From: Stephen Cameron Date: Thu, 3 Oct 2019 15:36:47 +0000 (+0200) Subject: WIP #3053 @6.75 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=14592ca5871295729b7f3f32985cf998a6e44bbb;p=ccv-wordpress.git WIP #3053 @6.75 --- diff --git a/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeaderSlideshow.php b/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeaderSlideshow.php index 99a810f..0d07a2a 100644 --- a/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeaderSlideshow.php +++ b/wp-content/mu-plugins/cube/src/Elementor/Widgets/HeaderSlideshow.php @@ -107,6 +107,12 @@ class HeaderSlideshow extends Widget_Base { $subtitle = $this->get_settings('subtitle'); $images = $this->get_settings('images'); + if (!$images || count($images) < 1) return false; // Must have images to display + + // Use first image in gallery to set size of slideshow + $image_meta = wp_get_attachment_metadata($images[0]['id']); + $image_ratio = round($image_meta['height'] / $image_meta['width'] * 100, 2) . '%'; + // When this element is present, add a class to the body so the header can be styled differently (transparent background) add_filter('body_class', function($classes) { $classes[] = 'header-slideshow-present'; @@ -126,22 +132,19 @@ class HeaderSlideshow extends Widget_Base { After recent updates, the parent must also have the class "elementor" for animations to work. */ ?> -
-
-

-

-
+ - - -
+
+
+

+ + +

+
-
-
-
__('Primary Navigation', 'sage') + 'primary_navigation' => __('Primary Navigation', 'sage'), + 'cta_navigation' => __('Header Buttons (2 items max)', 'cube') ]); /** diff --git a/wp-content/themes/CCV/resources/assets/images/rendezvous.svg b/wp-content/themes/CCV/resources/assets/images/rendezvous.svg new file mode 100644 index 0000000..f2c1bff --- /dev/null +++ b/wp-content/themes/CCV/resources/assets/images/rendezvous.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/wp-content/themes/CCV/resources/assets/images/teleconsultation.svg b/wp-content/themes/CCV/resources/assets/images/teleconsultation.svg new file mode 100644 index 0000000..a5682b5 --- /dev/null +++ b/wp-content/themes/CCV/resources/assets/images/teleconsultation.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/wp-content/themes/CCV/resources/assets/styles/components/header.styl b/wp-content/themes/CCV/resources/assets/styles/components/header.styl new file mode 100644 index 0000000..7716d06 --- /dev/null +++ b/wp-content/themes/CCV/resources/assets/styles/components/header.styl @@ -0,0 +1,8 @@ +header.site + .header-slideshow-present & + position: absolute + top: 0 + left: 0 + width: 100% + background-color: transparent + z-index: 20 diff --git a/wp-content/themes/CCV/resources/assets/styles/widgets/header-slideshow.styl b/wp-content/themes/CCV/resources/assets/styles/widgets/header-slideshow.styl new file mode 100644 index 0000000..75139e0 --- /dev/null +++ b/wp-content/themes/CCV/resources/assets/styles/widgets/header-slideshow.styl @@ -0,0 +1,59 @@ +$title_bg = rgba(#fff, 0.88) + +.header-slideshow + position: relative + + &-sizer + @apply bg-cover bg-center + + &:before + content: '' + position: absolute + top: 0 + left: 0 + width: 100% + height: 100% + background-image: linear-gradient(to bottom, #fff 10%, transparent 50%) + + &-content + position: absolute + constrain(left, 5vw) + constrain(bottom, 10vw) + + // Note: for the title to have a semi-transparent background, + // we're limited by the font properties because the inline + // backgrounds can't overlap so we need to get the line-height + // and padding just right. Maybe it would be better if it was + // solid white... More details: + // https://iamvdo.me/en/blog/css-font-metrics-line-height-and-vertical-align + &-title + position: relative + line-height: 1.27 + padding-right: 1rem // To match inline text below + + &:before + top: 0.6em + left: -0.5em + width: 0.7em + + // For multi-line padded text effect + // Ref: https://css-tricks.com/multi-line-padded-text/ + &-text + @apply text-3xl + box-decoration-break: clone + display: inline + padding: 0 1rem + background-color: $title_bg + + + // Need to position this absolutely so it sits properly + // right at the bottom but without overlapping... + // (due to also having a semi-transparent background) + &-subtitle + background-color: $title_bg + position: absolute + top: 100% + left: 0 + width: 100% + font-size: 23px + padding: 0 1rem 0.5em diff --git a/wp-content/themes/CCV/resources/views/layouts/app.blade.php b/wp-content/themes/CCV/resources/views/layouts/app.blade.php index e5e1307..a853f96 100644 --- a/wp-content/themes/CCV/resources/views/layouts/app.blade.php +++ b/wp-content/themes/CCV/resources/views/layouts/app.blade.php @@ -2,9 +2,9 @@ @include('partials.head') - + -
+
@php(wp_body_open()) @php(do_action('get_header')) @include('partials.header') diff --git a/wp-content/themes/CCV/resources/views/partials/header.blade.php b/wp-content/themes/CCV/resources/views/partials/header.blade.php index 6be3a97..0634289 100644 --- a/wp-content/themes/CCV/resources/views/partials/header.blade.php +++ b/wp-content/themes/CCV/resources/views/partials/header.blade.php @@ -1,13 +1,38 @@ -
-
+
+
"> @if (has_nav_menu('primary_navigation')) -
diff --git a/wp-content/themes/CCV/tailwind.config.js b/wp-content/themes/CCV/tailwind.config.js index 0925334..1bbc389 100644 --- a/wp-content/themes/CCV/tailwind.config.js +++ b/wp-content/themes/CCV/tailwind.config.js @@ -21,6 +21,7 @@ module.exports = { 'light': '#F6F5F5', // Light grey backgrounds 'purple-dark': '#2E2C40', // Footer and other dark sections 'pink': '#FF078B', // Accent colour + 'teal': '#2CC4CF', // Accent colour }, fontFamily: { 'display': ['Dosis', 'sans-serif'], // Headings, labels, menus etc