1gsap.registerPlugin(CustomEase);let columnsVisible=!1;ScrollTrigger.create({trigger:".ingredient-scroll",start:"top+=300 bottom",toggleActions:"restart pause reverse pause",scrub:3,onUpdate:self=>runStarAnimation(self.progress.toFixed(2)),onEnter:()=>clearAnimationClassesOnRestart(),onLeave:()=>(ingredientColumns.forEach(column=>{column.classList.add("hidden")}),clearAnimationClassesOnLeave()),onEnterBack:()=>{ingredientColumns.forEach(column=>{column.classList.remove("hidden")})},animation:gsap.timeline().to(".i-0",{yPercent:25,ease:"none"},"start").to(".i-1",{yPercent:-40,ease:"none"},"start").to(".i-2",{yPercent:15,ease:"none"},"start").to(".i-3",{yPercent:-30,ease:"none"},"start").to(".i-4",{yPercent:10,ease:"none"},"start").to(".i-5",{yPercent:-20,ease:"none"},"start")});const productBottleContainer=document.querySelector(".product__wrapper"),starsContainer=document.querySelector(".ingredient-scroll__star-wrapper");ScrollTrigger.create({trigger:".ingredient-scroll",start:"top center-=100",scrub:1,toggleActions:"restart pause reverse pause",onEnter:()=>{productBottleContainer.classList.remove("hidden"),starsContainer.classList.remove("hidden")},onLeave:()=>{productBottleContainer.classList.add("hidden"),starsContainer.classList.add("hidden")},onEnterBack:()=>{productBottleContainer.classList.remove("hidden"),starsContainer.classList.remove("hidden")},onLeaveBack:()=>{productBottleContainer.classList.add("hidden"),starsContainer.classList.add("hidden")},animation:gsap.timeline().fromTo(productBottleContainer,{y:"10%"},{y:"-10%",ease:CustomEase.create("custom","M0,0,C0.104,0.204,0.172,0.3,1,0.3")},"start")});const stars=document.querySelectorAll(".ingredient-scroll__star"),getListSegments=()=>{const length=stars.length,segment=+parseFloat(1/length).toFixed(2),rangeMap=new Map;let tempValue=segment,index=0;for(;tempValue<=1.1;)rangeMap.set(+index,+parseFloat(tempValue).toFixed(2)),tempValue+=segment,++index;return rangeMap},ranges=getListSegments(),getActiveStarKey=progress=>{for(let[key,value]of ranges)if(progress<=value)return key},clearAnimationClassesOnRestart=()=>{stars.forEach((star,i)=>{i!==0&&star.classList.remove("pulse")})},clearAnimationClassesOnLeave=()=>{stars.forEach((star,i)=>{i!==12&&star.classList.remove("pulse")})};let active={former:null,current:0};const runStarAnimation=async progress=>{const key=await getActiveStarKey(progress);if(key!==active.current&&key!==void 0){active.current=key;const activeStar=document.querySelector(`[data-active-star-${active.current}]`),formerKey=active.former||0,formerStar=document.querySelector(`[data-active-star-${formerKey}]`);activeStar.classList.add("pulse"),active.former=active.current}}; 2//# sourceMappingURL=/cdn/shop/t/102/assets/ingredient-scroll.js.map?v=135723055696133484171718384347
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.