PageSourceSearch

https://www.toscablu.com/cdn/shop/t/22/assets/jarallax.js?v=93128699462010326281788279028

js toscablu.com collected 2026-10-03 21:35:25 UTC 13,659 bytes, 6 lines download raw bytes

1/*!
2 * Jarallax v2.0.4 (https://github.com/nk-o/jarallax)
3 * Copyright 2022 nK <https://nkdev.info>
4 * Licensed under MIT (https://github.com/nk-o/jarallax/blob/master/LICENSE)
5 */(function(global2,factory){typeof exports=="object"&&typeof module<"u"?module.exports=factory():typeof define=="function"&&define.amd?define(factory):(global2=typeof globalThis<"u"?globalThis:global2||self,global2.jarallax=factory())})(this,(function(){"use strict";function ready(callback){document.readyState==="complete"||document.readyState==="interactive"?callback():document.addEventListener("DOMContentLoaded",callback,{capture:!0,once:!0,passive:!0})}let win;typeof window<"u"?win=window:typeof global<"u"?win=global:typeof self<"u"?win=self:win={};var global$1=win;const{navigator}=global$1,isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);let $deviceHelper;function getDeviceHeight(){return!$deviceHelper&&document.body&&($deviceHelper=document.createElement("div"),$deviceHelper.style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild($deviceHelper)),($deviceHelper?$deviceHelper.clientHeight:0)||global$1.innerHeight||document.documentElement.clientHeight}let wndH;function updateWndVars(){isMobile?wndH=getDeviceHeight():wndH=global$1.innerHeight||document.documentElement.clientHeight}updateWndVars(),global$1.addEventListener("resize",updateWndVars),global$1.addEventListener("orientationchange",updateWndVars),global$1.addEventListener("load",updateWndVars),ready(()=>{updateWndVars()});const jarallaxList=[];function getParents(elem){const parents=[];for(;elem.parentElement!==null;)elem=elem.parentElement,elem.nodeType===1&&parents.push(elem);return parents}function updateParallax(){jarallaxList.length&&(jarallaxList.forEach((data,k)=>{const{instance,oldData}=data,clientRect=instance.$item.getBoundingClientRect(),newData={width:clientRect.width,height:clientRect.height,top:clientRect.top,bottom:clientRect.bottom,wndW:global$1.innerWidth,wndH},isResized=!oldData||oldData.wndW!==newData.wndW||oldData.wndH!==newData.wndH||oldData.width!==newData.width||oldData.height!==newData.height,isScrolled=isResized||!oldData||oldData.top!==newData.top||oldData.bottom!==newData.bottom;jarallaxList[k].oldData=newData,isResized&&instance.onResize(),isScrolled&&instance.onScroll()}),global$1.requestAnimationFrame(updateParallax))}let instanceID=0;class Jarallax{constructor(item,userOptions){const self2=this;self2.instanceID=instanceID,instanceID+=1,self2.$item=item,self2.defaults={type:"scroll",speed:.5,imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,disableVideo:!1,videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null};const dataOptions=self2.$item.dataset||{},pureDataOptions={};if(Object.keys(dataOptions).forEach(key=>{const loweCaseOption=key.substr(0,1).toLowerCase()+key.substr(1);loweCaseOption&&typeof self2.defaults[loweCaseOption]<"u"&&(pureDataOptions[loweCaseOption]=dataOptions[key])}),self2.options=self2.extend({},self2.defaults,pureDataOptions,userOptions),self2.pureOptions=self2.extend({},self2.options),Object.keys(self2.options).forEach(key=>{self2.options[key]==="true"?self2.options[key]=!0:self2.options[key]==="false"&&(self2.options[key]=!1)}),self2.options.speed=Math.min(2,Math.max(-1,parseFloat(self2.options.speed))),typeof self2.options.disableParallax=="string"&&(self2.options.disableParallax=new RegExp(self2.options.disableParallax)),self2.options.disableParallax instanceof RegExp){const disableParallaxRegexp=self2.options.disableParallax;self2.options.disableParallax=()=>disableParallaxRegexp.test(navigator.userAgent)}if(typeof self2.options.disableParallax!="function"&&(self2.options.disableParallax=()=>!1),typeof self2.options.disableVideo=="string"&&(self2.options.disableVideo=new RegExp(self2.options.disableVideo)),self2.options.disableVideo instanceof RegExp){const disableVideoRegexp=self2.options.disableVideo;self2.options.disableVideo=()=>disableVideoRegexp.test(navigator.userAgent)}typeof self2.options.disableVideo!="function"&&(self2.options.disableVideo=()=>!1);let elementInVP=self2.options.elementInViewport;elementInVP&&typeof elementInVP=="object"&&typeof elementInVP.length<"u"&&([elementInVP]=elementInVP),elementInVP instanceof Element||(elementInVP=null),self2.options.elementInViewport=elementInVP,self2.image={src:self2.options.imgSrc||null,$container:null,useImgTag:!1,position:"fixed"},self2.initImg()&&self2.canInitParallax()&&self2.init()}css(el,styles){return typeof styles=="string"?global$1.getComputedStyle(el).getPropertyValue(styles):(Object.keys(styles).forEac
5h(key=>{el.style[key]=styles[key]}),el)}extend(out,...args){return out=out||{},Object.keys(args).forEach(i=>{args[i]&&Object.keys(args[i]).forEach(key=>{out[key]=args[i][key]})}),out}getWindowData(){return{width:global$1.innerWidth||document.documentElement.clientWidth,height:wndH,y:document.documentElement.scrollTop}}initImg(){const self2=this;let $imgElement=self2.options.imgElement;return $imgElement&&typeof $imgElement=="string"&&($imgElement=self2.$item.querySelector($imgElement)),$imgElement instanceof Element||(self2.options.imgSrc?($imgElement=new Image,$imgElement.src=self2.options.imgSrc):$imgElement=null),$imgElement&&(self2.options.keepImg?self2.image.$item=$imgElement.cloneNode(!0):(self2.image.$item=$imgElement,self2.image.$itemParent=$imgElement.parentNode),self2.image.useImgTag=!0),self2.image.$item?!0:(self2.image.src===null&&(self2.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",self2.image.bgImage=self2.css(self2.$item,"background-image")),!(!self2.image.bgImage||self2.image.bgImage==="none"))}canInitParallax(){return!this.options.disableParallax()}init(){const self2=this,containerStyles={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden"};let imageStyles={pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden"};if(!self2.options.keepImg){const curStyle=self2.$item.getAttribute("style");if(curStyle&&self2.$item.setAttribute("data-jarallax-original-styles",curStyle),self2.image.useImgTag){const curImgStyle=self2.image.$item.getAttribute("style");curImgStyle&&self2.image.$item.setAttribute("data-jarallax-original-styles",curImgStyle)}}if(self2.css(self2.$item,"position")==="static"&&self2.css(self2.$item,{position:"relative"}),self2.css(self2.$item,"z-index")==="auto"&&self2.css(self2.$item,{zIndex:0}),self2.image.$container=document.createElement("div"),self2.css(self2.image.$container,containerStyles),self2.css(self2.image.$container,{"z-index":self2.options.zIndex}),this.image.position==="fixed"&&self2.css(self2.image.$container,{"-webkit-clip-path":"polygon(0 0, 100% 0, 100% 100%, 0 100%)","clip-path":"polygon(0 0, 100% 0, 100% 100%, 0 100%)"}),self2.image.$container.setAttribute("id",`jarallax-container-${self2.instanceID}`),self2.$item.appendChild(self2.image.$container),self2.image.useImgTag?imageStyles=self2.extend({"object-fit":self2.options.imgSize,"object-position":self2.options.imgPosition,"max-width":"none"},containerStyles,imageStyles):(self2.image.$item=document.createElement("div"),self2.image.src&&(imageStyles=self2.extend({"background-position":self2.options.imgPosition,"background-size":self2.options.imgSize,"background-repeat":self2.options.imgRepeat,"background-image":self2.image.bgImage||`url("${self2.image.src}")`},containerStyles,imageStyles))),(self2.options.type==="opacity"||self2.options.type==="scale"||self2.options.type==="scale-opacity"||self2.options.speed===1)&&(self2.image.position="absolute"),self2.image.position==="fixed"){const $parents=getParents(self2.$item).filter(el=>{const styles=global$1.getComputedStyle(el),parentTransform=styles["-webkit-transform"]||styles["-moz-transform"]||styles.transform;return parentTransform&&parentTransform!=="none"||/(auto|scroll)/.test(styles.overflow+styles["overflow-y"]+styles["overflow-x"])});self2.image.position=$parents.length?"absolute":"fixed"}imageStyles.position=self2.image.position,self2.css(self2.image.$item,imageStyles),self2.image.$container.appendChild(self2.image.$item),self2.onResize(),self2.onScroll(!0),self2.options.onInit&&self2.options.onInit.call(self2),self2.css(self2.$item,"background-image")!=="none"&&self2.css(self2.$item,{"background-image":"none"}),self2.addToParallaxList()}addToParallaxList(){jarallaxList.push({instance:this}),jarallaxList.length===1&&global$1.requestAnimationFrame(updateParallax)}removeFromParallaxList(){const self2=this;jarallaxList.forEach((data,key)=>{data.instance.instanceID===self2.instanceID&&jarallaxList.splice(key,1)})}destroy(){const self2=this;self2.removeFromParallaxList();const originalStylesTag=self2.$item.getAttribute("data-jarallax-original-styles");if(self2.$item.removeAttribute("data-jarallax-original-styles"),originalStylesTag?self2.$item.setAttribute("style",originalStylesTag):self2.$item.removeAttribute("style"),self2.image.useImgTag){const originalStylesImgTag=self2.image.$item.getAttribute("data-jarallax-original-styles");self2.image.$item.removeAttribute("data-jarallax-original-styles"),originalStylesImgTag?self2.image.$item.setAttribute("style",originalStylesTag):self2.image.$item.removeAttribute("style"),self2.image.$itemParent&&self2.image.$itemParent.appendChild(self2.image.$item)}self2.image.$container&&self2.image.$container.parentNode.removeChild(self2.image.$container),self2.options.onDestroy&&self2.options.onDestroy.call(self2),delete self2.$item.jarallax}clipContainer(){}
5coverImage(){const self2=this,rect=self2.image.$container.getBoundingClientRect(),contH=rect.height,{speed}=self2.options,isScroll=self2.options.type==="scroll"||self2.options.type==="scroll-opacity";let scrollDist=0,resultH=contH,resultMT=0;return isScroll&&(0>speed?(scrollDist=speed*Math.max(contH,wndH),wndH<contH&&(scrollDist-=speed*(contH-wndH))):scrollDist=speed*(contH+wndH),1<speed?resultH=Math.abs(scrollDist-wndH):0>speed?resultH=scrollDist/speed+Math.abs(scrollDist):resultH+=(wndH-contH)*(1-speed),scrollDist/=2),self2.parallaxScrollDistance=scrollDist,isScroll?resultMT=(wndH-resultH)/2:resultMT=(contH-resultH)/2,self2.css(self2.image.$item,{height:`${resultH}px`,marginTop:`${resultMT}px`,left:self2.image.position==="fixed"?`${rect.left}px`:"0",width:`${rect.width}px`}),self2.options.onCoverImage&&self2.options.onCoverImage.call(self2),{image:{height:resultH,marginTop:resultMT},container:rect}}isVisible(){return this.isElementInViewport||!1}onScroll(force){const self2=this,rect=self2.$item.getBoundingClientRect(),contT=rect.top,contH=rect.height,styles={};let viewportRect=rect;if(self2.options.elementInViewport&&(viewportRect=self2.options.elementInViewport.getBoundingClientRect()),self2.isElementInViewport=0<=viewportRect.bottom&&0<=viewportRect.right&&viewportRect.top<=wndH&&viewportRect.left<=global$1.innerWidth,!force&&!self2.isElementInViewport)return;const beforeTop=Math.max(0,contT),beforeTopEnd=Math.max(0,contH+contT),afterTop=Math.max(0,-contT),beforeBottom=Math.max(0,contT+contH-wndH),beforeBottomEnd=Math.max(0,contH-(contT+contH-wndH)),afterBottom=Math.max(0,-contT+wndH-contH),fromViewportCenter=1-2*((wndH-contT)/(wndH+contH));let visiblePercent=1;if(contH<wndH?visiblePercent=1-(afterTop||beforeBottom)/contH:beforeTopEnd<=wndH?visiblePercent=beforeTopEnd/wndH:beforeBottomEnd<=wndH&&(visiblePercent=beforeBottomEnd/wndH),(self2.options.type==="opacity"||self2.options.type==="scale-opacity"||self2.options.type==="scroll-opacity")&&(styles.transform="translate3d(0,0,0)",styles.opacity=visiblePercent),self2.options.type==="scale"||self2.options.type==="scale-opacity"){let scale=1;0>self2.options.speed?scale-=self2.options.speed*visiblePercent:scale+=self2.options.speed*(1-visiblePercent),styles.transform=`scale(${scale}) translate3d(0,0,0)`}if(self2.options.type==="scroll"||self2.options.type==="scroll-opacity"){let positionY=self2.parallaxScrollDistance*fromViewportCenter;self2.image.position==="absolute"&&(positionY-=contT),styles.transform=`translate3d(0,${positionY}px,0)`}self2.css(self2.image.$item,styles),self2.options.onScroll&&self2.options.onScroll.call(self2,{section:rect,beforeTop,beforeTopEnd,afterTop,beforeBottom,beforeBottomEnd,afterBottom,visiblePercent,fromViewportCenter})}onResize(){this.coverImage()}}const jarallax=function(items,options,...args){(typeof HTMLElement=="object"?items instanceof HTMLElement:items&&typeof items=="object"&&items!==null&&items.nodeType===1&&typeof items.nodeName=="string")&&(items=[items]);const len=items.length;let k=0,ret;for(k;k<len;k+=1)if(typeof options=="object"||typeof options>"u"?items[k].jarallax||(items[k].jarallax=new Jarallax(items[k],options)):items[k].jarallax&&(ret=items[k].jarallax[options].apply(items[k].jarallax,args)),typeof ret<"u")return ret;return items};jarallax.constructor=Jarallax;const $=global$1.jQuery;if(typeof $<"u"){const $Plugin=function(...args){Array.prototype.unshift.call(args,this);const res=jarallax.apply(global$1,args);return typeof res!="object"?res:this};$Plugin.constructor=jarallax.constructor;const old$Plugin=$.fn.jarallax;$.fn.jarallax=$Plugin,$.fn.jarallax.noConflict=function(){return $.fn.jarallax=old$Plugin,this}}return ready(()=>{jarallax(document.querySelectorAll("[data-jarallax]"))}),jarallax}));
6//# sourceMappingURL=/cdn/shop/t/22/assets/jarallax.js.map?v=93128699462010326281788279028

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.