if(!customElements.get("image-with-text-overlay")){class ImageTextOverlay extends HTMLElement{constructor(){super(),this.tl=!1,this.splittext=!1}connectedCallback(){document.body.classList.contains("animations-true")&&typeof gsap<"u"&&this.prepareAnimations()}disconnectedCallback(){document.body.classList.contains("animations-true")&&typeof gsap<"u"&&(this.tl.kill(),this.splittext.revert())}prepareAnimations(){let section=this,button_offset=0,property=gsap.getProperty("html","--header-height")+gsap.getProperty("html","--header-offset")+"px";section.tl=gsap.timeline({scrollTrigger:{trigger:section,start:"top center"}}),document.fonts.ready.then(function(){if(section.splittext=new SplitText(section.querySelectorAll(".image-with-text-overlay--heading, p:not(.subheading)"),{type:"lines, words",linesClass:"line-child"}),section.querySelector(".subheading")&&(section.tl.fromTo(section.querySelector(".subheading"),{opacity:0},{duration:.75,opacity:.6},0),button_offset+=.5),section.querySelector(".image-with-text-overlay--heading")){let h3_duration=.8+(section.querySelectorAll(".image-with-text-overlay--heading .line-child div").length-1)*.08;section.tl.set(section.querySelector(".image-with-text-overlay--heading"),{visibility:"visible"},0).from(section.querySelectorAll(".image-with-text-overlay--heading .line-child div"),{duration:h3_duration,yPercent:"100",stagger:.08},0),button_offset+=h3_duration}if(section.querySelector(".rte p")){let p_duration=.8+(section.querySelectorAll(".rte p .line-child div").length-1)*.02;section.tl.set(section.querySelectorAll(".rte p"),{visibility:"visible"},0).from(section.querySelectorAll(".rte p .line-child div"),{duration:p_duration,yPercent:"100",stagger:.02},0),button_offset+=p_duration}if(section.querySelectorAll(".button")){let i=1;section.querySelectorAll(".button").forEach(item=>{section.tl.fromTo(item,{autoAlpha:0},{duration:.5,autoAlpha:1},button_offset*.4+(i-1)*.1),i++})}}),section.querySelector(".thb-parallax-image")&&gsap.fromTo(section.querySelectorAll(".thb-parallax-image"),{y:"-8%"},{y:"8%",ease:"none",scrollTrigger:{trigger:section,scrub:1,start:()=>"top bottom",end:()=>`bottom top+=${property}`,onUpdate:()=>{property=gsap.getProperty("html","--header-height")+gsap.getProperty("html","--header-offset")+"px"}}})}}customElements.define("image-with-text-overlay",ImageTextOverlay)} //# sourceMappingURL=/cdn/shop/t/41/assets/image-with-text-overlay.js.map?v=37516454739780590641739221808