1"use strict";(self.NiveaXwebpackJsonp=self.NiveaXwebpackJsonp||[]).push([[1486],{66654:(e,t,n)=>{n.r(t),n.d(t,{default:()=>r});var i=n(98684);const a='[data-module="Parallax"]';class r{static setup(e=a){Array.from(document.querySelectorAll(e)).filter(e=>!e.dataset.moduleInitialized).forEach(e=>{new r(e),e.dataset.moduleInitialized="true"})}constructor(e){this.element=e;const t=Array.from(this.element.querySelectorAll(".nx-content-zone-container"));this.getHeaderElements(),this.initParallax(t[0],t[1])}getHeaderElements(){this.desktopNavElement=document.querySelector(".nx-nav-desktop__wrapper"),this.mobileBurgerNavElement=document.querySelector(".nx-mob-burger-nav__wrapper"),this.breadcrumbElement=document.querySelector(".nx-breadcrumb")}initParallax(e,t){this.stage=this.element.querySelector(".nx-stage"),this.addParallaxEffectToStage(),this.addParallaxEffectToContentZones(e,t),window.addEventListener("scroll",n=>this.onScroll(n,e,t))}onScroll(e,t,n){const i=this.getHeaderHeight();if(this.stage&&(this.stage.style.top=`${i}px`),!t)return;t.style.top=`${i}px`;const a=null==t?void 0:t.getBoundingClientRect().height,r=window.innerHeight<a;(null==t?void 0:t.getBoundingClientRect().top)<=i&&r&&(t.style.top=-(a-window.innerHeight)+"px");const o=this.getZone1Offset(t,i),l=null==n?void 0:n.offsetTop;this.updateContentZones(o,l,t,n)}addParallaxEffectToContentZones(e,t){e&&(0,i.iQ)(e,"nx-parallax-container--first"),t&&(0,i.iQ)(t,"nx-parallax-container--second")}addParallaxEffectToStage(){this.stage&&(0,i.iQ)(this.stage,"nx-parallax-container--stage")}getZone1Offset(e,t){return e.offsetTop-t}getHeaderHeight(){let e=0;return e+=this.getCurrentNavigationHeight(),e+=this.getCurrentBreadcrumbHeight(),e}getCurrentBreadcrumbHeight(){let e=0;const t=getComputedStyle(this.breadcrumbElement);return this.breadcrumbElement&&t.maxHeight&&(e=parseInt(t.height)),e}getCurrentNavigationHeight(){let e=0;return!window.NiveaX.deviceType.isDesktop&&this.mobileBurgerNavElement?e+=this.mobileBurgerNavElement.clientHeight:this.desktopNavElement&&this.isDesktopNaviVisibleInViewport()&&(e+=this.desktopNavElement.clientHeight),e}updateContentZones(e,t,n,i){const a=window.scrollY;a>=e&&a<t?this.addParallaxEffectToContentZones(n,i):a>=t&&this.removeParallaxEffectFromContentZones(n,i)}removeParallaxEffectFromContentZones(e,t){(0,i.vy)(e,"parallax-container--first"),(0,i.vy)(t,"parallax-container--second")}isDesktopNaviVisibleInViewport(){if(!this.desktopNavElement)return!1;const e=this.desktopNavElement.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}}r.setup(a)}}]); 2//# sourceMappingURL=/dist/NiveaX/./modules/Parallax-Parallax.c9435943.js.13825b05.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.