1class ParallaxImage extends HTMLElement{connectedCallback(){this.abortController=new AbortController,this.parallaxImage=this.querySelector("[data-parallax-image]"),this.windowInnerHeight=window.innerHeight,this.isActive=!1,this.timeout=null,this.directionMap={right:0,top:90,left:180,bottom:270},this.directionMultipliers={0:[1,0],90:[0,-1],180:[-1,0],270:[0,1]},window.addEventListener("scroll",this.scrollHandler.bind(this),{signal:this.abortController.signal}),this.init()}disconnectedCallback(){this.abortController.abort()}getParallaxInfo(){const{width,height,top}=this.parallaxImage.getBoundingClientRect();let element=this.parallaxImage,multipliers,{angle,movement}=element.dataset,movementPixels=Math.ceil(angle==="top"?height*(parseFloat(movement)/100):width*(parseFloat(movement)/100));angle=this.directionMap[angle]??parseFloat(angle),angle!==angle&&(angle=270),movementPixels!==movementPixels&&(movementPixels=100),angle%=360,angle<0&&(angle+=360);const toLeft=angle>90&&angle<270,toTop=angle<180;if(element.style[toLeft?"left":"right"]=0,element.style[toTop?"top":"bottom"]=0,angle%90){const radians=angle*Math.PI/180;multipliers=[Math.cos(radians),Math.sin(radians)*-1]}else multipliers=this.directionMultipliers[angle];return multipliers[0]&&(element.style.width=`calc(100% + ${movementPixels*Math.abs(multipliers[0])}px)`),multipliers[1]&&(element.style.height=`calc(100% + ${movementPixels*Math.abs(multipliers[1])}px)`),{element,movementPixels,multipliers,top,height}}init(){const{element,movementPixels,multipliers,top,height}=this.getParallaxInfo(),scrolledInContainer=this.windowInnerHeight-top,scrollArea=this.windowInnerHeight+height,progress=scrolledInContainer/scrollArea;if(progress>-.1&&progress<1.1){const position=Math.min(Math.max(progress,0),1)*movementPixels;element.style.transform=`translate3d(${position*multipliers[0]}px, ${position*multipliers[1]}px, 0)`}this.isActive&&requestAnimationFrame(this.init.bind(this))}scrollHandler(){this.isActive?clearTimeout(this.timeout):(this.isActive=!0,requestAnimationFrame(this.init.bind(this))),this.timeout=setTimeout(()=>this.isActive=!1,20)}}customElements.define("parallax-image",ParallaxImage); 2//# sourceMappingURL=/cdn/shop/t/159/assets/element.image.parallax.js.map?v=59188309605188605141775544472
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.