]> _ Git - physioassist-wordpress.git/commitdiff
WIP #4147 @1.5
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 11 Feb 2021 16:46:09 +0000 (16:46 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 11 Feb 2021 16:46:09 +0000 (16:46 +0000)
.htaccess
wp-content/mu-plugins/physioassist/src/Elementor/Widgets/HeroBlock.php
wp-content/themes/physioassist/app/setup.php
wp-content/themes/physioassist/resources/assets/scripts/hero-block.js
wp-content/themes/physioassist/resources/assets/styles/common/global.styl
wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl
wp-content/themes/physioassist/resources/views/index.blade.php
wp-content/themes/physioassist/resources/views/layouts/app.blade.php
wp-content/themes/physioassist/resources/views/partials/head.blade.php

index 12e90e698c36ee2523618208ffcc119bfe486e0a..2a4bb8cb90ebbcb5062ce77b586ac76ea541ea4d 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -1,8 +1,25 @@
 Options -Indexes
 
+# Ensure HTTPS + WWW subdomains
+<IfModule mod_rewrite.c>
+RewriteCond %{HTTPS} off
+RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
+
+RewriteCond %{HTTP_HOST} ^physioassist.com [NC]
+RewriteRule (.*)$ https://www.physioassist.com/$1 [R=301,L]
+RewriteCond %{HTTP_HOST} ^physioassist.de [NC]
+RewriteRule (.*)$ https://www.physioassist.de/$1 [R=301,L]
+RewriteCond %{HTTP_HOST} ^physioassist.fr [NC]
+RewriteRule (.*)$ https://www.physioassist.fr/$1 [R=301,L]
+</IfModule>
+
 # BEGIN WordPress
+# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
+# dynamically generated, and should only be modified via WordPress filters.
+# Any changes to the directives between these markers will be overwritten.
 <IfModule mod_rewrite.c>
 RewriteEngine On
+RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
 RewriteBase /
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
index 51f6f80312ffa8075460d492a7585a271c2c33e5..707fda5f77d33f482274618978c5af412f2d9f02 100644 (file)
@@ -254,10 +254,6 @@ class HeroBlock extends Widget_Base {
         $this->add_render_attribute('title', 'class', ['hero-block-title']);
         $this->add_render_attribute('body', 'class', ['hero-block-body']);
         $this->add_render_attribute('cta_text', 'class', ['hero-block-cta arrow-link']);
-        $this->add_render_attribute('image', 'class', ['hero-block-image']);
-
-        // Add image src attribute
-        $this->add_render_attribute('image', 'src', [$image['url']]);
 
         // Handle CTA link
         if ( ! empty( $cta_link['url'] ) ) {
@@ -284,11 +280,11 @@ class HeroBlock extends Widget_Base {
 
         // TODO: instead of inserting image like this, maybe it should be a bg image with proportional padding set to allow it to take up space. Then set to cover / right. Maybe text could be non-absolute so it pushes when needed? Check CCV, Elens and other sites where I've used these kinds of techniques recently...
 
-        echo "<img {$this->get_render_attribute_string('image')}>";
+        echo wp_get_attachment_image($image['id'], 'full', false, ['class' => 'hero-block-image']);
         echo '<div class="hero-block-content">';
         echo '<div class="hero-block-content-inner">';
         if (!empty($subtitle)) echo "<h3 {$this->get_render_attribute_string('subtitle')}>$subtitle</h3>";
-        if (!empty($title)) echo "<h2 {$this->get_render_attribute_string('title')}>$title</h2>";
+        if (!empty($title)) echo "<h1 {$this->get_render_attribute_string('title')}>$title</h1>";
         if (!empty($body)) echo "<div {$this->get_render_attribute_string('body')}>$body</div>";
         if (!empty($cta_text)) {
             echo "<a {$this->get_render_attribute_string('cta_text')}>". \BladeSvgSage\svg_image('arrow')->toHtml() ."$cta_text</a>";
index 6af0bea392b79630e07adc093f47d1d8177cc777..e3f219260266cd168e78c2fa8b05ef65d838afb6 100644 (file)
@@ -74,6 +74,14 @@ add_action('wp_enqueue_scripts', function() {
     wp_dequeue_style( 'storefront-gutenberg-blocks' ); // Storefront theme
 }, 100);
 
+/**
+ * Disable WordPress emoji script and styles
+ */
+add_action('init', function() {
+    remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
+    remove_action( 'wp_print_styles', 'print_emoji_styles' );
+});
+
 //========================================================================
 
 /**
index ff3de33f3670d2a57faacb6d10598737288581f4..f63463204ac7b2b4e9748b6b8654042de1599a4c 100644 (file)
@@ -49,7 +49,8 @@ function resizeHeroBlock() {
   translateAmount = -50 / scale;
 
   styles.html(`
-    .hero-block-content-inner {
+    .js .hero-block-content-inner {
+      opacity: 1;
       transform: scale(${scale}) translateY(${translateAmount}%);
     }
   `);
index d9f94b044459c9e118617ebef898c189563b55ee..10a584182e26e39300244ed842e42112a9e27866 100644 (file)
@@ -1,5 +1,3 @@
-@import url('https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700')
-
 html
   box-sizing: border-box
   height: 100%
index 9c4eb23e3be93c6034e2754cafa164cc7b9abc71..6fefc02d8875457dabf3517cbcb1ee89adc37951 100644 (file)
@@ -38,12 +38,18 @@ $header-height = 84px // How much space to leave for transparent header
 
     &-inner
       position: absolute
-      top: 50% // translateY handled by hero-block.js
       constrain(left, 10vw)
+      top: 50%
       width: 672px // Max width a full size (should be kept in sync with JS!)
       transform-origin: left
       display: flex
       flex-direction: column
+      transition: opacity 0.3s
+
+      .js &
+        +above(1024px)
+          transform: translateY(-50%) // Just a default, will be updated by hero-block.js
+          opacity: 0 // Hide initially while we wait for the JS the scale and position this content
 
       .elementor-widget-cube-hero.content-reversed &
         flex-direction: column-reverse
index 1516f466c27ac97b80bca088090fc06e3af0919d..5e319fb9aa7da89d9253ac383481b0a0052246ba 100644 (file)
@@ -4,7 +4,7 @@
 
   <div class="content-inner vertical-spacing">
 
-    <h2 class="main-heading"><?php _ex('News', 'Blog index title text', 'sage') ?></h2>
+    <h1 class="main-heading"><?php _ex('News', 'Blog index title text', 'sage') ?></h1>
 
     @include('partials.page-header')
 
index 992cb03028c1a6b85ffdb83285e790f4ac0609cb..cd4f48f2206a95ef864a635317442321ba3374f4 100644 (file)
@@ -1,5 +1,5 @@
 <!doctype html>
-<html @php(language_attributes())>
+<html @php(language_attributes()) class="no-js">
   @include('partials.head')
   {{-- When not using the hero image header template the compact header is set --}}
   <body @php(body_class( is_page_template('views/template-transparent-header.blade.php') ? '' : 'header-compact' ))>
index 44787e516fa2a6f2211cf828fe3040a93ab4519b..8e4e4a12247fd8fec0255324e58cf111f91f9bf1 100644 (file)
@@ -1,8 +1,14 @@
 <head>
+  {{-- Allow styling based on whether or not JS is enabled (see app.blade.php where .no-js class is defined on HTML element --}}
+  <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
+
   <meta charset="utf-8">
   <meta http-equiv="x-ua-compatible" content="ie=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 
+  <link rel="preconnect" href="https://fonts.gstatic.com">
+  <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap" rel="stylesheet">
+
   <!-- Google Tag Manager -->
   <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
         new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],