From: stephen@cubedesigners.com Date: Thu, 11 Feb 2021 16:46:09 +0000 (+0000) Subject: WIP #4147 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c5ace50d0faafd1f2d0b9c449b33697b5fc725e3;p=physioassist-wordpress.git WIP #4147 @1.5 --- diff --git a/.htaccess b/.htaccess index 12e90e69..2a4bb8cb 100644 --- a/.htaccess +++ b/.htaccess @@ -1,8 +1,25 @@ Options -Indexes +# Ensure HTTPS + WWW subdomains + +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] + + # 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. RewriteEngine On +RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f diff --git a/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/HeroBlock.php b/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/HeroBlock.php index 51f6f803..707fda5f 100644 --- a/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/HeroBlock.php +++ b/wp-content/mu-plugins/physioassist/src/Elementor/Widgets/HeroBlock.php @@ -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 "get_render_attribute_string('image')}>"; + echo wp_get_attachment_image($image['id'], 'full', false, ['class' => 'hero-block-image']); echo '
'; echo '
'; if (!empty($subtitle)) echo "

get_render_attribute_string('subtitle')}>$subtitle

"; - if (!empty($title)) echo "

get_render_attribute_string('title')}>$title

"; + if (!empty($title)) echo "

get_render_attribute_string('title')}>$title

"; if (!empty($body)) echo "
get_render_attribute_string('body')}>$body
"; if (!empty($cta_text)) { echo "get_render_attribute_string('cta_text')}>". \BladeSvgSage\svg_image('arrow')->toHtml() ."$cta_text"; diff --git a/wp-content/themes/physioassist/app/setup.php b/wp-content/themes/physioassist/app/setup.php index 6af0bea3..e3f21926 100644 --- a/wp-content/themes/physioassist/app/setup.php +++ b/wp-content/themes/physioassist/app/setup.php @@ -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' ); +}); + //======================================================================== /** diff --git a/wp-content/themes/physioassist/resources/assets/scripts/hero-block.js b/wp-content/themes/physioassist/resources/assets/scripts/hero-block.js index ff3de33f..f6346320 100644 --- a/wp-content/themes/physioassist/resources/assets/scripts/hero-block.js +++ b/wp-content/themes/physioassist/resources/assets/scripts/hero-block.js @@ -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}%); } `); diff --git a/wp-content/themes/physioassist/resources/assets/styles/common/global.styl b/wp-content/themes/physioassist/resources/assets/styles/common/global.styl index d9f94b04..10a58418 100644 --- a/wp-content/themes/physioassist/resources/assets/styles/common/global.styl +++ b/wp-content/themes/physioassist/resources/assets/styles/common/global.styl @@ -1,5 +1,3 @@ -@import url('https://fonts.googleapis.com/css?family=Montserrat:400,500,600,700') - html box-sizing: border-box height: 100% diff --git a/wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl b/wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl index 9c4eb23e..6fefc02d 100644 --- a/wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl +++ b/wp-content/themes/physioassist/resources/assets/styles/widgets/hero-block.styl @@ -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 diff --git a/wp-content/themes/physioassist/resources/views/index.blade.php b/wp-content/themes/physioassist/resources/views/index.blade.php index 1516f466..5e319fb9 100644 --- a/wp-content/themes/physioassist/resources/views/index.blade.php +++ b/wp-content/themes/physioassist/resources/views/index.blade.php @@ -4,7 +4,7 @@
-

+

@include('partials.page-header') diff --git a/wp-content/themes/physioassist/resources/views/layouts/app.blade.php b/wp-content/themes/physioassist/resources/views/layouts/app.blade.php index 992cb030..cd4f48f2 100644 --- a/wp-content/themes/physioassist/resources/views/layouts/app.blade.php +++ b/wp-content/themes/physioassist/resources/views/layouts/app.blade.php @@ -1,5 +1,5 @@ - + @include('partials.head') {{-- When not using the hero image header template the compact header is set --}} diff --git a/wp-content/themes/physioassist/resources/views/partials/head.blade.php b/wp-content/themes/physioassist/resources/views/partials/head.blade.php index 44787e51..8e4e4a12 100644 --- a/wp-content/themes/physioassist/resources/views/partials/head.blade.php +++ b/wp-content/themes/physioassist/resources/views/partials/head.blade.php @@ -1,8 +1,14 @@ + {{-- Allow styling based on whether or not JS is enabled (see app.blade.php where .no-js class is defined on HTML element --}} + + + + +