<h1 class="header-slideshow-content elementor-element elementor-invisible <?= $index === 0 ? ' showing' : '' ?>"
data-settings='{"animation":"fadeInRight","animation_delay":0}'
data-element_type="section">
- <div class="header-slideshow-title"><?= $items[$index]['title'] ?></div>
- <div class="header-slideshow-body"><?= $items[$index]['body'] ?></div>
+ <div class="header-slideshow-content-wrapper">
+ <div class="header-slideshow-title"><?= $items[$index]['title'] ?></div>
+ <div class="header-slideshow-body"><?= $items[$index]['body'] ?></div>
+ </div>
<?php if (!empty($cta_text) || !empty($cta_text_2)) { ?>
<div class="header-slideshow-buttons flex items-center">
margin-top: 1.5em;
}
-.wrapper {
+body:not(.home) .wrapper {
margin-left: auto;
margin-right: auto;
max-width: 1920px;
flex-direction: row-reverse;
}
+body .elementor-section:not(#slideshow-section) {
+ margin-left: auto;
+ margin-right: auto;
+ max-width: 1920px;
+}
+
.elementor-swiper-button,
.elementor-lightbox .elementor-swiper-button {
--bg-opacity: 1;
}
@media only screen and (min-width: 1000px) {
+ .header-slideshow-sizer {
+ padding-bottom: 0 !important;
+ }
+
.header-slideshow-sizer:before {
content: '';
position: absolute;
top: 0;
left: 0;
- width: 100%;
+ width: 102%;
height: 100%;
z-index: 5;
}
}
}
+@media only screen and (max-width: 999px) {
+ .header-slideshow-sizer {
+ height: 0 !important;
+ }
+}
+
+@media only screen and (min-width: 1000px) and (min-width: 1920px) {
+ .header-slideshow-sizer:before {
+ background-color: #031236;
+ transform: translateX(calc( ((100% - 1920px ) / 2 - 100%)) );
+ border-right: 5px solid #031236;
+ }
+}
+
.header-slideshow-image {
position: absolute;
top: 0;
}
.header-slideshow .header-slideshow-content {
+ display: flex;
+ justify-content: center;
+ flex-direction: column;
+ align-items: flex-end;
+ padding: 0 2em 0 2.5em;
--text-opacity: 1;
color: #FFF;
color: rgba(255, 255, 255, var(--text-opacity));
-moz-osx-font-smoothing: grayscale;
background: #031236;
text-transform: none;
- padding: 3.75em 2em 0.75em 2.5em;
margin: 0 !important;
position: absolute;
bottom: 9.2vw;
.header-slideshow .header-slideshow-content {
font-size: 42px;
font-size: 42px;
+ max-width: calc(1920px / 2);
+ left: calc((100% - 1920px ) / 2);
}
}
padding: 1.75em 1em 3.75em 5em;
width: 100%;
height: auto;
+ display: block;
}
}
}
}
+.header-slideshow .header-slideshow-content.small-height {
+ font-size: 31px;
+ font-size: 31px;
+}
+
.header-slideshow-content:before {
content: none;
}
// Inspired by: https://www.sitepoint.com/make-a-simple-javascript-slideshow-without-jquery/
const slides = $scope.find('.header-slideshow-image');
const slidesText = $scope.find('.header-slideshow-content');
- const slideInterval = setInterval(nextSlide, 10000);
+ //const slideInterval = setInterval(nextSlide, 14000);
let currentSlide = 0;
+ let headerHeight = $("header.site").get(0).getBoundingClientRect().height
initSlideshow();
+ setHeight(headerHeight);
+ detectRatio();
function initSlideshow() {
let slideshowDots = document.createElement('ul');
setTimeout(function() {
revealText(slidesText)
}, 1000)
+
revealLastText(slidesText);
}
+ $(window).on('resize', function() {
+ headerHeight = $("header.site").get(0).getBoundingClientRect().height
+ setHeight(headerHeight);
+ detectRatio();
+ })
+
function showSlide(index) {
removeBySlide(slides)
removeBySlide(slidesText)
}
function revealText(slides) {
- let delay = 200
+ let delay = 2000
$(slides[currentSlide]).find(".header-slideshow-title").addClass('showing')
$(slides[currentSlide]).find(".header-slideshow-body p,.header-slideshow-body li").each(function(i, el) {
$(el).addClass("showing")
}, delay)
- delay += 200
+ delay += 2000
})
}
$(slides).last().find(".header-slideshow-title,.header-slideshow-body p,.header-slideshow-body li").addClass('showing')
}
+ function setHeight(h) {
+ let vh = $(window).outerHeight() - h
+ $(".header-slideshow-sizer").css("height", vh + "px")
+ }
+
+ function detectRatio() {
+ let ratio_window = $(window).width() / $(window).height()
+ const ratio_1 = 32 / 9;
+ const ratio_2 = 21 / 9;
+
+ if (ratio_window >= ratio_1 || (ratio_window >= ratio_2 && $(window).width() <= 1920)) {
+ $(".header-slideshow-content").addClass("small-height")
+ } else {
+ $(".header-slideshow-content").removeClass("small-height")
+ }
+ }
});
});
})(jQuery);
* + p
margin-top: 1.5em
-.wrapper
+body:not(.home) .wrapper
@apply mx-auto
max-width: $content-max-width
.layout-reversed
.elementor-row
flex-direction: row-reverse
+
+body
+ .elementor-section:not(#slideshow-section)
+ @apply mx-auto
+ max-width: $content-max-width
\ No newline at end of file
&-sizer
// White fade for better readability of menu when slideshow is under it
+above($breakpoint-slideshow)
+ padding-bottom: 0 !important
&:before
content: ''
position: absolute
top: 0
left: 0
- width: 100%
+ width: 102%
height: 100%
//background-image: linear-gradient(to bottom, #fff 10%, transparent 50%)
//background-image: linear-gradient(180deg, rgba(255,255,255,1) -5%,rgba(255,255,255,0.9) 17%, transparent 55%)
z-index: 5
+ +above($content-max-width)
+ background-color: $title_bg
+ transform: 'translateX(calc( ((100% - %s ) / 2 - 100%)) )' % ($content-max-width)
+ border-right: 5px solid $title_bg
+
// Change to portrait oriented images for small screens
+below($breakpoint-slideshow-images)
padding-bottom: 140% !important // Based off mockup: 525px / 375px
+ +below($breakpoint-slideshow)
+ height: 0 !important
+
&-image
position: absolute
top: 0
&-content
.header-slideshow & // Need some extra specificity to override H1 CSS
+ display: flex
+ justify-content: center
+ flex-direction: column
+ align-items: flex-end
+ padding: 0 2em 0 2.5em
@apply text-white
font-smoothing()
background: $title_bg
text-transform: none
- padding: 3.75em 2em .75em 2.5em
margin: 0 !important
position: absolute
constrain(bottom, 9.2vw)
+above($content-max-width)
font-size: 42px // Base font size
+ max-width: 'calc(%s / 2)' % ($content-max-width)
+ left: 'calc((100% - %s ) / 2)' % ($content-max-width)
+below($breakpoint-slideshow)
top: initial
padding: 1.75em 1em 3.75em 5em
width: 100%
height: auto
+ display: block
+below($breakpoint-slideshow-images)
font-size: 3.75vw
padding-right: 1em
+ &.small-height
+ font-size: 31px
+
&:before
content: none