<header class="supt-hero-innovation">
    <div class="supt-hero-innovation__wrapper">
        <div class="container">
            <div class="row">
                <div class="col-12 col-md-5">
                    <div class="supt-hero-innovation__content">
                        <h1>Innovation at Verisure</h1>
                        <p>Our industry-leading technology and innovation is designed to protect what matters most to our customers.</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="supt-hero-innovation__background">
            <div class="supt-hero-innovation__background__inner">
                <img src="/sites/gv/files/flmngr/superhuit/innovation/overview/innovation-hero.webp" alt="Innovation" />

                <svg width="2000" height="850" viewbox="0 0 2000 850" fill="none" xmlns="http://www.w3.org/2000/svg" preserveaspectratio="xMidYMid slice" class="supt-hero-innovation__background__glow">
                    <g filter="url(#supt-innovation-shared-glow-effect)" class="supt-hero-innovation__background__glow__center">
                        <path d="M1408.98 322.943C1397.53 316.723 1382.43 313.906 1367.41 315.143C1352.15 316.402 1338.32 321.532 1328.35 329.704C1310.01 344.737 1310.22 366.497 1329.91 380.227C1341.15 388.067 1356.58 392.03 1373.21 391.295C1389.58 390.568 1405.05 385.144 1415.52 376.533C1436.02 359.676 1432.5 335.718 1408.98 322.946L1408.98 322.943Z" stroke="white" stroke-width="2" stroke-linecap="round" shape-rendering="crispEdges" />
                    </g>
                    <g filter="url(#supt-innovation-shared-glow-effect)" class="supt-hero-innovation__background__glow__star">
                        <path d="M1463.99 353.197C1451.44 344.307 1446.44 332.203 1450.36 321.036C1456.74 302.973 1429.79 289.495 1404.91 296.689C1389.25 301.891 1369.91 300.853 1356.02 294.636C1333.5 285.297 1302.55 297.053 1303.25 315.117C1303.71 328.697 1291.41 339.655 1280.15 345.513C1253.14 358.126 1258.48 383.978 1289.42 388.221C1306.47 390.708 1321.28 399.237 1327.4 412.446C1336.96 434.765 1378.07 437.064 1395.09 415.7C1402.6 406.504 1416.6 395.951 1440.85 394.939C1471.98 393.638 1485.2 368.219 1463.99 353.203L1463.99 353.197Z" stroke="white" stroke-width="2" stroke-linecap="round" shape-rendering="crispEdges" />
                    </g>
                    <g filter="url(#supt-innovation-shared-glow-effect)" class="supt-hero-innovation__background__glow__line">
                        <path d="M1287.5 528V543.984C1287.5 544.622 1287.2 545.222 1286.68 545.599L1212.32 599.9C1211.8 600.277 1211.5 600.877 1211.5 601.516V850" stroke="white" stroke-width="2" />
                    </g>
                </svg>
            </div>
        </div>

        <div class="supt-scroll-item">
            <p class="supt-scroll-item__text">Scroll down</p>
            <span class="supt-scroll-item__inner">
                <span class="supt-scroll-item__icon"></span>
            </span>
            <svg xmlns="http://www.w3.org/2000/svg" width="2" height="63" viewbox="0 0 2 63" fill="none" class="supt-scroll-item__line">
                <path d="M1 1L1 63" stroke="url(#paint0_linear_10281_8341)" stroke-linecap="round" stroke-dasharray="1 4" />
                <defs>
                    <linearGradient id="paint0_linear_10281_8341" x1="1.5" y1="1" x2="1.5" y2="63" gradientunits="userSpaceOnUse">
                        <stop offset="0.4" stop-color="#ED002F" />
                        <stop offset="1" stop-color="#ED002F" stop-opacity="0" />
                    </linearGradient>
                </defs>
            </svg>
        </div>
    </div>
</header>

No notes defined.

<header class="supt-hero-innovation">
	<div class="supt-hero-innovation__wrapper">
		<div class="container">
			<div class="row">
				<div class="col-12 col-md-5">
					<div class="supt-hero-innovation__content">
						<h1>Innovation at Verisure</h1>
						<p>Our industry-leading technology and innovation is designed to protect what matters most to our customers.</p>
					</div>
				</div>
			</div>
		</div>
		<div class="supt-hero-innovation__background">
			<div class="supt-hero-innovation__background__inner">
				<img src="/sites/gv/files/flmngr/superhuit/innovation/overview/innovation-hero.webp" alt="Innovation"/>

				<svg width="2000" height="850" viewbox="0 0 2000 850" fill="none" xmlns="http://www.w3.org/2000/svg" preserveaspectratio="xMidYMid slice" class="supt-hero-innovation__background__glow">
					<g filter="url(#supt-innovation-shared-glow-effect)" class="supt-hero-innovation__background__glow__center">
						<path d="M1408.98 322.943C1397.53 316.723 1382.43 313.906 1367.41 315.143C1352.15 316.402 1338.32 321.532 1328.35 329.704C1310.01 344.737 1310.22 366.497 1329.91 380.227C1341.15 388.067 1356.58 392.03 1373.21 391.295C1389.58 390.568 1405.05 385.144 1415.52 376.533C1436.02 359.676 1432.5 335.718 1408.98 322.946L1408.98 322.943Z" stroke="white" stroke-width="2" stroke-linecap="round" shape-rendering="crispEdges"/>
					</g>
					<g filter="url(#supt-innovation-shared-glow-effect)" class="supt-hero-innovation__background__glow__star">
						<path d="M1463.99 353.197C1451.44 344.307 1446.44 332.203 1450.36 321.036C1456.74 302.973 1429.79 289.495 1404.91 296.689C1389.25 301.891 1369.91 300.853 1356.02 294.636C1333.5 285.297 1302.55 297.053 1303.25 315.117C1303.71 328.697 1291.41 339.655 1280.15 345.513C1253.14 358.126 1258.48 383.978 1289.42 388.221C1306.47 390.708 1321.28 399.237 1327.4 412.446C1336.96 434.765 1378.07 437.064 1395.09 415.7C1402.6 406.504 1416.6 395.951 1440.85 394.939C1471.98 393.638 1485.2 368.219 1463.99 353.203L1463.99 353.197Z" stroke="white" stroke-width="2" stroke-linecap="round" shape-rendering="crispEdges"/>
					</g>
					<g filter="url(#supt-innovation-shared-glow-effect)" class="supt-hero-innovation__background__glow__line">
						<path d="M1287.5 528V543.984C1287.5 544.622 1287.2 545.222 1286.68 545.599L1212.32 599.9C1211.8 600.277 1211.5 600.877 1211.5 601.516V850" stroke="white" stroke-width="2"/>
					</g>
				</svg>
			</div>
		</div>

		{% include "atoms/scroll-item/scroll-item.twig" %}
	</div>
</header>
/* No context defined. */
  • Content:
    .supt-hero-innovation {
    	height: 110vh;
    	position: relative;
    	background-color: black;
    
    	&__wrapper {
    		position: sticky;
    		top: 0;
    		height: 100svh;
    		overflow: hidden;
    	}
    
    	.container {
    		height: 100%;
    		display: flex;
    		align-items: flex-end;
    		padding-top: 69px;
    		padding-bottom: $spacing-40;
    		@media (min-width: $breakpoint-md) {
    			align-items: center;
    			padding-bottom: 0;
    		}
    		@media (min-width: $breakpoint-lg) {
    			padding-top: 81px;
    		}
    	}
    
    	&__content {
    		position: relative;
    		z-index: 2;
    
    		padding-top: 40px;
    		@media (min-width: $breakpoint-xs) {
    			padding-top: 60px;
    		}
    		@media (min-width: $breakpoint-md) {
    			padding-top: 0;
    		}
    
    		h1 {
    			@extend %t-h1;
    			color: $color-white;
    			@mixin clamp margin-bottom, $spacing-4, $spacing-6, $breakpoint-xs, $breakpoint-xl;
    		}
    		p {
    			@extend %t-body-m;
    			color: $color-white;
    		}
    	}
    
    	&__background {
    		position: absolute;
    		inset: 0 -500px; /* We need to add some extra space to the left and right to avoid the images to be cut off (bug in Firefox and Safari) */
    		transform-origin: bottom;
    		transform: scale(1.1) translateY(10%);
    		@media (min-width: $breakpoint-md) {
    			transform: scale(1.1) translateY(0%);
    			inset: 0 -300px; /* We need to add some extra space to the left and right to avoid the images to be cut off (bug in Firefox and Safari) */
    		}
    		@media (min-width: $breakpoint-lg) {
    			inset: 0 -200px; /* We need to add some extra space to the left and right to avoid the images to be cut off (bug in Firefox and Safari) */
    		}
    
    		&::after {
    			content: '';
    			position: absolute;
    			bottom: 0;
    			left: 0;
    			width: 100%;
    			height: 160px;
    			background: linear-gradient(180deg, rgba(1, 1, 1, 0) 0%, #000 100%);
    			z-index: 1;
    		}
    
    		&__inner {
    			position: absolute;
    			inset: 0;
    
    			@media (min-width: $breakpoint-md) {
    				transform: translate(-20%, 0%);
    			}
    			@media (min-width: $breakpoint-lg) {
    				transform: translate(-10%, 0%);
    			}
    			@media (min-width: $breakpoint-xl) {
    				transform: none;
    			}
    		}
    
    		img {
    			display: block;
    			width: 100%;
    			height: 100%;
    			object-fit: cover;
    			overflow: visible;
    		}
    
    		&__glow {
    			position: absolute;
    			top: 0;
    			left: 0;
    			width: 100%;
    			height: 100%;
    			aspect-ratio: 1440 / 850;
    
    			overflow: visible;
    
    			z-index: 2;
    
    			&__center {
    				stroke-dasharray: 310;
    				stroke-dashoffset: 310;
    			}
    			&__star {
    				stroke-dasharray: 570;
    				stroke-dashoffset: 570;
    			}
    			&__line {
    				stroke-dasharray: 370;
    				stroke-dashoffset: 370;
    			}
    		}
    	}
    }
    
  • URL: /components/raw/hero-innovation/hero-innovation.css
  • Filesystem Path: src/components/organisms/02-innovation/hero-innovation/hero-innovation.css
  • Size: 2.5 KB
  • Content:
    import { Sizes } from '@/js/Sizes';
    import { animate, createTimeline, onScroll, stagger } from 'animejs';
    
    const GLOW_CENTER_DASHARRAY = 310;
    const GLOW_STAR_DASHARRAY = 570;
    const GLOW_LINE_DASHARRAY = 370;
    
    const MOBILE_TRANSLATION_OFFSET = 100;
    
    export class HeroInnovation {
    	private $element: HTMLElement;
    	private $content: HTMLElement;
    	private $scrollItem: HTMLElement;
    	private $background: HTMLElement;
    	private $backgroundInner: HTMLElement;
    	private $backgroundImage: HTMLImageElement;
    	private $glowCenter: HTMLElement;
    	private $glowStar: HTMLElement;
    	private $glowLine: HTMLElement;
    	private translationSize: number = 0;
    	private sizes: Sizes;
    	private isFirstTime: boolean = true;
    
    	constructor($element: HTMLElement) {
    		this.$element = $element;
    		this.$content = $element.querySelector('.supt-hero-innovation__content') as HTMLElement;
    		this.$scrollItem = $element.querySelector('.supt-scroll-item') as HTMLElement;
    		this.$background = $element.querySelector('.supt-hero-innovation__background') as HTMLElement;
    		this.$backgroundInner = $element.querySelector(
    			'.supt-hero-innovation__background__inner'
    		) as HTMLElement;
    		this.$backgroundImage = this.$background.querySelector('img') as HTMLImageElement;
    		this.$glowCenter = this.$background.querySelector(
    			'.supt-hero-innovation__background__glow__center'
    		) as HTMLElement;
    		this.$glowStar = this.$background.querySelector(
    			'.supt-hero-innovation__background__glow__star'
    		) as HTMLElement;
    		this.$glowLine = this.$background.querySelector(
    			'.supt-hero-innovation__background__glow__line'
    		) as HTMLElement;
    
    		this.sizes = new Sizes(); // Singleton
    
    		this.display();
    		this.getTranslationSize();
    	}
    
    	private display() {
    		animate([this.$content, this.$scrollItem], {
    			opacity: [0, 1],
    			delay: stagger(100, { start: 500 }),
    		});
    	}
    
    	/**
    	 * Get the translation size of the background image so the glow line reaches the middle of the viewport
    	 */
    	private getTranslationSize() {
    		// Get glowLine left position
    		const glowLineLeft = this.$glowLine.getBoundingClientRect().left;
    		// Get viewport middle position
    		const viewportMiddle = (document.documentElement.clientWidth || window.innerWidth) / 2;
    		// Get the difference between the glowLine left position and the viewport middle
    		const difference = viewportMiddle - glowLineLeft;
    
    		// Adjust for scale factor (background is scaled at 1.1, but we want calculation for scale 1)
    		const adjustedDifference = difference / 1.1;
    
    		// Set the translation size to the adjusted difference
    		this.translationSize = this.translationSize - adjustedDifference;
    
    		// On mobile, we place the background image directly so the line reaches the middle of the viewport
    		if (this.sizes.isDesktop) {
    			this.$backgroundInner.style.transform = '';
    		} else {
    			this.$backgroundInner.style.transform = `translateX(${-1 * this.translationSize - MOBILE_TRANSLATION_OFFSET}px)`;
    		}
    
    		// Setup scroll animation once the translation size is set
    		if (this.isFirstTime) {
    			this.setupScrollAnimation();
    			this.isFirstTime = false;
    		}
    	}
    
    	private setupScrollAnimation() {
    		/**
    		 * Draw star with the glow line
    		 */
    		createTimeline({
    			autoplay: onScroll({
    				container: document.body,
    				target: this.$element,
    				enter: 'top top',
    				leave: 'bottom bottom',
    				sync: true,
    			}),
    		})
    			// glow star scale
    			.add(this.$glowCenter, {
    				strokeDashoffset: [GLOW_CENTER_DASHARRAY, 0],
    				ease: 'linear',
    			})
    			// lines scale down to let enough space for the title
    			.add(this.$glowStar, {
    				strokeDashoffset: [GLOW_STAR_DASHARRAY, 0],
    				ease: 'linear',
    			});
    
    		/**
    		 * Move background image + hide content
    		 */
    		createTimeline({
    			autoplay: onScroll({
    				container: document.body,
    				target: this.$element,
    				enter: 'bottom bottom',
    				leave: '80vh bottom',
    				sync: true,
    			}),
    		})
    			// Hide text + scroll item
    			.add([this.$content, this.$scrollItem], {
    				opacity: [1, 0],
    				ease: 'linear',
    			})
    			// Move image to the left at same time
    			.add(
    				this.$background,
    				{
    					scale: [1.1, 1],
    					x: [
    						'0px',
    						this.sizes.isDesktop
    							? `${-1 * this.translationSize}px`
    							: `${MOBILE_TRANSLATION_OFFSET}px`,
    					],
    					y: [this.sizes.isDesktop ? '0%' : '10%', '20%'],
    					ease: 'linear',
    				},
    				'<<'
    			)
    			// Fade out image
    			.add(
    				this.$backgroundImage,
    				{
    					opacity: [1, 0.5],
    					ease: 'linear',
    				},
    				'<<'
    			);
    
    		/**
    		 * Draw the vertical glow line
    		 */
    		// glow line display
    		animate(this.$glowLine, {
    			strokeDashoffset: [GLOW_LINE_DASHARRAY, 0],
    			ease: 'linear',
    			autoplay: onScroll({
    				container: document.body,
    				target: this.$element,
    				enter: 'bottom bottom',
    				leave: '80vh bottom+=20vh',
    				sync: true,
    			}),
    		});
    	}
    }
    
  • URL: /components/raw/hero-innovation/index.ts
  • Filesystem Path: src/components/organisms/02-innovation/hero-innovation/index.ts
  • Size: 4.8 KB
  • Handle: @hero-innovation
  • Preview:
  • Filesystem Path: src/components/organisms/02-innovation/hero-innovation/hero-innovation.twig