{"version":3,"file":"SplitTypeLines.DZCorqp9.mjs","names":["React.useRef","SplitType","gsap","__legacyOverrideHOC_DataObserverContext","_jsx","ScrollTrigger"],"sources":["https:/framerusercontent.com/modules/QNVhC4NY4W9gdFQM48iM/Ll8dCGQLHBI1MlvNKDm4/SplitTypeLines.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import gsap from\"gsap\";import{ScrollTrigger}from\"gsap/ScrollTrigger\";import SplitType from\"split-type\";gsap.registerPlugin(ScrollTrigger);export function TextSlideUpLines(){const textRef=React.useRef(null);React.useEffect(()=>{const textElement=textRef.current;if(!textElement)return;// Find the logo element (adjust selector based on your setup)\nconst logoElement=textElement.querySelector(\"img\")||textElement.querySelector('[data-framer-name*=\"logo\"]')||textElement.querySelector(\".logo\");// If logo exists, wrap it for animation without changing its position\nif(logoElement){const logoWrapper=document.createElement(\"span\");logoWrapper.style.display=\"inline-block\";logoWrapper.style.overflow=\"hidden\";logoWrapper.style.verticalAlign=\"baseline\";logoWrapper.style.lineHeight=\"0\";logoElement.parentNode.insertBefore(logoWrapper,logoElement);logoWrapper.appendChild(logoElement);logoElement.style.transform=\"translateY(100%)\";}// Select all text nodes for splitting, but preserve the logo in place\nconst textElements=Array.from(textElement.children).filter(child=>child.textContent.trim()!==\"\"&&child!==logoElement&&child!==logoElement?.parentElement);const splitText=new SplitType(textElements,{types:\"lines\"});const filledLines=Array.from(splitText.lines).filter(line=>line.textContent.trim()!==\"\");// Wrap each line in a container for overflow hidden effect\nfilledLines.forEach(line=>{const wrapper=document.createElement(\"span\");wrapper.style.display=\"block\"// Changed to block for full-width lines\n;wrapper.style.overflow=\"hidden\";line.parentNode.insertBefore(wrapper,line);wrapper.appendChild(line);line.style.display=\"block\";line.style.transform=\"translateY(100%)\";});// Now that everything is wrapped and hidden, make container visible\ngsap.set(textElement,{opacity:1});// Check if element is already in viewport on load\nconst rect=textElement.getBoundingClientRect();const isInView=rect.top<window.innerHeight*.8;// Create animation timeline\nconst timeline=gsap.timeline(isInView?{}:{scrollTrigger:{trigger:textElement,start:\"top 80%\",end:\"bottom 60%\",toggleActions:\"play none none none\",markers:false}});// Animate all lines\nfilledLines.forEach((line,index)=>{timeline.to(line,{y:0,duration:.8,ease:\"power3.out\"},index*.15// Increased stagger for lines\n);});// Animate logo at the appropriate time in sequence\nif(logoElement){const logoIndex=filledLines.length/2;timeline.to(logoElement,{y:0,duration:.8,ease:\"power3.out\"},logoIndex*.15);}},[]);return{ref:textRef,style:{opacity:0}};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withTextSlideUpLines(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...TextSlideUpLines(props)});};}withTextSlideUpLines.displayName=\"TextSlideUpLines\";\nexport const __FramerMetadata__ = {\"exports\":{\"withTextSlideUpLines\":{\"type\":\"reactHoc\",\"name\":\"withTextSlideUpLines\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TextSlideUpLines\":{\"type\":\"override\",\"name\":\"TextSlideUpLines\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SplitTypeLines.map"],"mappings":"yTAAiN,SAAgB,GAAkB,CAAC,IAAM,EAAQA,EAAa,KAAK,CAW7I,OAX8I,MAAoB,CAAC,IAAM,EAAY,EAAQ,QAAQ,GAAG,CAAC,EAAY,OAC5V,IAAM,EAAY,EAAY,cAAc,MAAM,EAAE,EAAY,cAAc,6BAA6B,EAAE,EAAY,cAAc,QAAQ,CAC/I,GAAG,EAAY,CAAC,IAAM,EAAY,SAAS,cAAc,OAAO,CAAC,EAAY,MAAM,QAAQ,eAAe,EAAY,MAAM,SAAS,SAAS,EAAY,MAAM,cAAc,WAAW,EAAY,MAAM,WAAW,IAAI,EAAY,WAAW,aAAa,EAAY,EAAY,CAAC,EAAY,YAAY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