PageSourceSearch

https://www.labello.com/dist/NiveaX/modules/SliderScrollBar.84a71109.js

js labello.com collected 2026-10-02 12:42:45 UTC 9,480 bytes, 2 lines download raw bytes

1"use strict";(self.NiveaXwebpackJsonp=self.NiveaXwebpackJsonp||[]).push([[260,7006,8091],{15288:(t,e,i)=>{i.r(e),i.d(e,{default:()=>l});var s=i(99567),r=i(53784),n=i(21464);const a='[data-module="SliderScrollBar"]';class l{static setup(t=a){Array.from(document.querySelectorAll(t)).filter(t=>!t.dataset.moduleInitialized).forEach(t=>{new l(t),t.dataset.moduleInitialized="true"})}constructor(t,e={}){this.element=t,this.options=e,this.options=(0,n.$E)(this.element,Object.assign(this.getDefaultOptions(),this.options)),this.scrollBarNode=this.element.querySelector(`.${this.options.scrollBarSelector}`),this.sliderNode=this.element.querySelector(`.${this.options.sliderNodeSelector}`),this.init()}init(){window.NiveaX.deviceType.isMobile?this.initSlider():this.initScrollBar(),this.currentState=this.slider||this.scrollBar,this.onResize()}initScrollBar(){this.scrollBar=new s.default(this.scrollBarNode,this.options.scrollBarOptions)}initSlider(){this.slider=new r.default(this.sliderNode,this.options.sliderOptions)}reinit(){return window.NiveaX.deviceType.isMobile&&this.currentState===this.scrollBar?(this.scrollBar.destroy(),this.slider?this.slider.rebuild():this.initSlider(),void(this.currentState=this.slider)):window.NiveaX.deviceType.isMobile||this.currentState!==this.slider?void 0:(this.slider.destroy(),this.scrollBar?this.scrollBar.rebuild():this.initScrollBar(),void(this.currentState=this.scrollBar))}onResize(){NiveaX.addToEventStore("resize",this.reinit.bind(this),window)}getDefaultOptions(){return{scrollBarSelector:"nx-category-content-teasers__scrollbar",sliderNodeSelector:"nx-category-content-teasers__list",scrollBarOptions:{fadeSide:!1,sbListSelector:"nx-category-content-teasers__list"}}}}l.setup(a)},53784:(t,e,i)=>{i.r(e),i.d(e,{default:()=>g});var s=i(84817),r=i(19446),n=i(42194),a=i(88692),l=i(8481),o=i(60778),d=i(45204),h=i(61269),c=i(24329),u=i(71678),p=i(50436),m=i(98684);const f='[data-module="SliderPagination"]',v=document.dir;class g extends p.default{static setup(t=f){Array.from(document.querySelectorAll(t)).filter(t=>!t.dataset.moduleInitialized).forEach(t=>{window.requestAnimationFrame(()=>{setTimeout(function(){t.dataset.moduleInitialized||(new g(t),t.dataset.moduleInitialized="true")})})})}constructor(t,e){super(t,e),this.hasChildren()&&(this.initSliderPagination(),this.convertAnchorToSpan())}hasChildren(){return this.element.children.length>0}convertAnchorToSpan(){return this.element.querySelectorAll(".nx-how-to__description a").forEach(t=>{const e=(0,m.m6)("");e.innerHTML=t.innerHTML,e.className=t.className,e.setAttribute("data-url",t.getAttribute("href")),e.classList.add("nx-how-to__description-link"),t.parentNode.replaceChild(e,t),e.addEventListener("click",()=>window.location.replace(e.getAttribute("data-url")))}),this}initSliderPagination(){return this.initLiquid(20).initInfitity(this.sliderInfo,5),this}resetPaginatorItem(t){return(0,s.H)(this.sliderInfo.navItems).pipe((0,o.T)(t=>t.querySelector(".tns-nav__liquid")),(0,d.p)(t=>null!=t)).subscribe(e=>{requestAnimationFrame(()=>{e.style.transition="all 0.5s",e.style.opacity="0",e.style.width=t+"px",setTimeout(()=>{e.remove()},500)})}),this}drawPaginationItem(t,e,i){0==(null==t?void 0:t.children.length)&&(0,m.L8)(t,(0,m.Sw)("tns-nav__liquid"));let s=null==t?void 0:t.firstElementChild;return s&&requestAnimationFrame(()=>{"rtl"===v?(s.style.left=e?"auto":"0",s.style.right=e?"0":"auto"):(s.style.left=e?"0":"auto",s.style.right=e?"auto":"0"),s.style.width=i+"px"}),this}initLiquid(t){return this.onDrag(t),this.slider.events.on("indexChanged",this.onIndexChanged(t)),this}onDrag(t){const e=(0,r.R)(this.slider.events,"dragMove",{passive:!0}).pipe((0,h.E)("0","event","clientX")),i=(0,r.R)(this.slider.events,"dragEnd",{passive:!0}),s=(0,r.R)(document,"mousemove").pipe((0,o.T)(({clientX:t})=>t)),d=(0,r.R)(document,"touchmove",{passive:!0}).pipe((0,o.T)(({changedTouches:{0:{clientX:t}}})=>t)),p=(0,n.h)(s,d).pipe((0,c.Q)(i));return e.pipe((0,u.n)(t=>(0,a.zV)((0,l.of)(t),p))).subscribe(([e,i])=>{const s=document.body.offsetWidth-e,r=i>e,n=r?i-e:e-i;if(r&&s<60||!r&&e<60)return;const a=Math.max((r?s:e)/2,60),l=Math.min(n/a,1);this.drawPaginationItem(this.activeNav,!r,t*l)}),i.subscribe(()=>this.resetPaginatorItem(t)),this}get activeNav(){return Array.from(this.sliderInfo.navItems).filter(t=>(0,m.nB)(t,"tns-nav-active"))[0]}onIndexChanged(t){let e;return()=>{let{index:i,indexCached:s,navItems:r,slideBy:n,slideCount:a}=this.sliderInfo,l=Math.ceil(a/n),o=Math.ceil(i/n),d=Math.ceil(s/n),h=o>=l?o-l:o,c=d>=l?0:d,u=Array.from(r).filter(t=>!t.style.display)[c],p=h>c;Math.abs(h-c)>1||e===h||h<0||(this.drawPaginationItem(u,p,0).resetPaginatorItem(t),e=h)}}initInfitity(t,e){const i=t.navContainer,s=null==i?void 0:i.parentElement,r=(0,m.Sw)("tns-nav__wrapper");return(0,m.L8)(s,(0,m.L8)(r,i)),this.slider.events.on("indexChanged",t=>
1{this.adjustInfinytePagination(t,e),this.element.closest(".nx-stage")||this.options.autoplay||this.setFocusActiveTeaser(this.activeSlides,t.index)}),this.adjustInfinytePagination(t,e),this}setFocusActiveTeaser(t,e){const i=t[0];i&&i.querySelector("a")&&(i.setAttribute("tabindex",0),i.querySelector("a").focus())}adjustInfinytePagination({navContainer:t,navItems:e,index:i,slideBy:s,cloneCount:r=0},n){const a=Array.from(e).filter(t=>"none"!==t.style.display),l=Array.from(a),o=a.length,d=Math.ceil((i-r)/s),h=Math.ceil(n/2),c=o-h,u=d>=h&&d<c,p=d>=c;let f="-";o<=n||("rtl"==v&&(f=""),d<h&&((0,m.vg)(l,"tns-nav-small"),(0,m.BK)([l[n-1]],"tns-nav-small"),t.style.transform=`translateX(${f}0px)`),u&&((0,m.vg)(l,"tns-nav-small"),(0,m.BK)([l[d-h+1],l[d+h-1]],"tns-nav-small"),t.style.transform=`translateX(${f}${15*(d-(h-1))}px)`),p&&((0,m.vg)(l,"tns-nav-small"),(0,m.BK)([l[o-n]],"tns-nav-small"),t.style.transform=`translateX(${f}${15*(c-(h-1))}px)`))}}g.setup(f)},61269:(t,e,i)=>{i.d(e,{E:()=>r});var s=i(60778);function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.length;if(0===i)throw new Error("list of properties cannot be empty.");return function(e){return(0,s.T)(function(t,e){var i=function(i){for(var s=i,r=0;r<e;r++){var n=s[t[r]];if(void 0===n)return;s=n}return s};return i}(t,i))(e)}}},99567:(t,e,i)=>{i.r(e),i.d(e,{default:()=>a});var s=i(53983),r=i(21464);const n='[data-module="ScrollBar"]';class a{static setup(t=n){Array.from(document.querySelectorAll(t)).filter(t=>!t.dataset.moduleInitialized).forEach(t=>{new a(t),t.dataset.moduleInitialized="true"})}constructor(t,e={}){this.element=t,this.options=e,this.options=(0,r.$E)(this.element,Object.assign(this.getDefaultOptions(),this.options)),this.list=this.element.querySelector(`.${this.options.sbListSelector}`),this.init()}init(){return this.psb=new s.A(this.element,this.options),this.onPageLoaded().onResize(),this}initFadeSide(){return this.fadeSide=new l(this.element,this.options.fadeWidth),this}
1updateScrollBar(){return this.element.closest(".nx-advantages")&&this.adjustScrollBarListWidth(),this.psb&&this.psb.update(),this}getScrollBarListWidth(){const t=this.list.querySelector(`.${this.options.sbListItem}`),e=this.list.querySelectorAll(`.${this.options.sbListItem}`).length;return Math.ceil(e*t.offsetWidth+1)}adjustScrollBarListWidth(){return this.clearScrollBarListWidth(),this.list.style.width=this.getScrollBarListWidth()+"px",this}clearScrollBarListWidth(){return this.list.style.width="",this}initScrollBarAfterPageLoaded(){return this.updateScrollBar(),this.options.fadeSide&&this.initFadeSide(),this}onResize(){return NiveaX.addToEventStore("resize",this.updateScrollBar.bind(this),window),this}onPageLoaded(){return"complete"===document.readyState?this.initScrollBarAfterPageLoaded():NiveaX.addToEventStore("load",this.initScrollBarAfterPageLoaded.bind(this),window),this}getDefaultOptions(){return{fadeSide:!0,suppressScrollY:!0,sbListSelector:"nx-benefits__list",fadeWidth:null,sbListItem:"nx-benefit",useBothWheelAxes:!0,swipeEasing:!0}}destroy(){var t;return null===(t=this.psb)||void 0===t||t.destroy(),this.psb=null,this}rebuild(){return this.psb=new s.A(this.element,this.options),this.updateScrollBar(),this}}class l{constructor(t,e){this.element=t,this.leftMaskWidth=0,this.rightMaskWidth=0,this.fadeWidth=e||this.getFadeWidth(),this.leftMaskWidth=this.fadeWidth,this.rightMaskWidth=this.fadeWidth,this.init()}init(){this.adjustFadeElements(),this.element.addEventListener("ps-scroll-x",()=>{this.adjustFadeElements()})}adjustFadeElements(){let t,e,i=this.element.scrollWidth,s=Math.abs(this.element.scrollLeft),r=Math.abs(i-(s+this.element.clientWidth));s<=this.fadeWidth&&(t=s/this.fadeWidth*this.fadeWidth),r<=this.fadeWidth&&(e=r/this.fadeWidth*this.fadeWidth),null==t&&null==e&&(t=this.fadeWidth,e=this.fadeWidth);let n="ltr"==document.dir?t:e,a="ltr"==document.dir?e:t;this.leftMaskWidth=null!=n?n:this.leftMaskWidth,this.rightMaskWidth=null!=a?a:this.rightMaskWidth,this.element.setAttribute("style",`-webkit-mask-image: linear-gradient(to right, transparent 0px, black ${this.leftMaskWidth}px), linear-gradient(to left, transparent 0px, black ${this.rightMaskWidth}px);\n        mask-image: linear-gradient(to right, transparent 0px, black ${this.leftMaskWidth}px), linear-gradient(to left, transparent 0px, black ${this.rightMaskWidth}px);`)}setFadeWith(t){this.fadeWidth=t}getFadeWidth(){var t;return null===(t=this.element.querySelector(".nx-benefit"))||void 0===t?void 0:t.clientWidth}}a.setup(n)}}]);
2//# sourceMappingURL=/dist/NiveaX/./modules/SliderScrollBar.84a71109.js.9aba1c30.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.