PageSourceSearch

https://crenshawjuice.com/cdn/shop/t/2/assets/shapes-animations.js?v=111376164229927584001777605197

js crenshawjuice.com collected 2026-10-10 02:38:19 UTC 3,682 bytes, 2 lines download raw bytes

1if(!window.theme.shapesAnimationsInitialized){const map=function(number,inMin,inMax,outMin,outMax){return(number-inMin)*(outMax-outMin)/(inMax-inMin)+outMin};class ShapesAnimations{setPosition(){let oldPosition=this.position;return this.position=(document.documentElement||document.body.parentNode||document.body).scrollTop||window.pageYOffset,oldPosition!=this.position}updatePosition(percentage,speed){let value=speed*(100*(1-percentage));return Math.round(value)}cacheParallaxContainers(){for(var i=0;i<this.parallaxContainers.length;i++){var item=this.createParallaxItem(this.parallaxContainers[i]);this.parallaxItems.push(item)}}inViewport(element){if(!element||element.nodeType!==1)return!1;var html=document.documentElement,rect=element.getBoundingClientRect();return!!rect&&rect.width>0&&rect.height>0&&rect.bottom>=0&&rect.right>=0&&rect.left<=html.clientWidth&&rect.top<=html.clientHeight}createParallaxItem(el){const id=el.getAttribute("data-parallax-id"),container=el,item=el.querySelector("[data-parallax-element]");let speed=parseInt(el.getAttribute("data-parallax-speed"));speed=speed*-1;const blockHeight=item.clientHeight||item.offsetHeight||item.scrollHeight,isInViewPort=this.inViewport(el);return{id,container,item,height:blockHeight,speed,visible:isInViewPort,item}}observeItems(){this.parallaxObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{const parallaxItemIndex=this.parallaxItems.findIndex(item=>item.id===entry.target.getAttribute("data-parallax-id"));parallaxItemIndex>-1&&(this.parallaxItems[parallaxItemIndex].visible=entry.isIntersecting)})},{rootMargin:"0px 0px 20% 0px",threshold:0});for(var i=0;i<this.items.length;i++)this.parallaxObserver.observe(this.items[i])}animate(){for(var i=0;i<this.parallaxContainers.length;i++){if(this.parallaxItems[i].visible){const scrollPercentage=(this.screenHeight-this.parallaxItems[i].container.getBoundingClientRect().top)/(this.screenHeight+this.parallaxItems[i].height)-.5,baseValue=this.intensity*(this.parallaxItems[i].speed*(scrollPercentage*100)),valueY=Math.round(baseValue*100+Number.EPSILON)/100;this.parallaxItems[i].item.style.transform=`translateY(${valueY}px)`}this.parallaxContainers[i].classList.add("animated")}for(var i=0;i<this.rotateItems.length;i++)this.rotateItems[i].style.transform="rotate("+window.pageYOffset/3+"deg)";this.firstAnimate=!0}initParallax(){this.screenHeight=window.innerHeight,this.parallaxItems=[],this.parallaxContainers=document.querySelectorAll("[data-parallax-container]"),this.setPosition(),this.cacheParallaxContainers(),this.intensity=map(window.theme.settings.parallaxIntensity,0,100,1,110)/100,this.animate(),document.addEventListener("scroll",()=>{this.setPosition()&&requestAnimationFrame(this.animate.bind(this))},{passive:!0})}init(){this.items=document.querySelectorAll("[data-parallax-container]"),this.rotateItems=document.querySelectorAll(".sticker-rotate-when-scrolling"),this.observeItems(),this.initParallax(),window.addEventListener("resize",()=>{this.enable_parallax&&this.initParallax()}),window.addEventListener("shapes:section:hasmutated",debounce(()=>{this.init()},300))}}const shapesAnimations=new ShapesAnimations;if(window.matchMedia("(prefers-reduced-motion: no-preference)").matches){document.addEventListener("DOMContentLoaded",()=>{shapesAnimations.init()}),document.addEventListener("shopify:section:load",()=>{shapesAnimations.init()});const mutationHandler=debounce(()=>{shapesAnimations.init()},500);document.addEventListener("dev:hotreloadmutation",mutationHandler)}}window.theme.shapesAnimationsInitialized=!0;
2//# sourceMappingURL=/cdn/shop/t/2/assets/shapes-animations.js.map?v=111376164229927584001777605197

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.