{"version":3,"file":"Text_Reveal.CEnhWLTH.mjs","names":["React.useRef","SplitType","gsap","__legacyOverrideHOC_DataObserverContext","_jsx","ScrollTrigger","__esmMin","oe","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","init_framer_DKgW_P28","tr","j","i","init_ScrollTrigger","init_npm_gsap_3_12_5","init_dist","TextReveal","textRef","textElement","sentences","characters","splitText","sentence","tl","char","withTextReveal","DataObserverContext","C","props","init_Text_Reveal"],"sources":["https:/framerusercontent.com/modules/kJ0w4CXPaSVTWvU6FjLE/KgcQSLd0DlcTj0ouQhJX/Text_Reveal.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 TextReveal(){const textRef=React.useRef(null);React.useEffect(()=>{const textElement=textRef.current;if(!textElement)return;const sentences=textElement.querySelectorAll(\"h1, h2, h3, h4, h5, h6, p\");const characters=[];sentences.forEach(sentence=>{const splitText=new SplitType(sentence,{types:\"words,chars\"});// Prevent word break by adding white-space: nowrap to each word\nsplitText.words.forEach(wordEl=>{wordEl.style.whiteSpace=\"nowrap\";});characters.push(...Array.from(splitText.chars));});gsap.set(characters,{opacity:.1});const tl=gsap.timeline({scrollTrigger:{trigger:textElement,start:\"top 90%\",end:\"bottom 50%\",scrub:true}});// Add animation to reveal each character sequentially\ncharacters.forEach(char=>{tl.to(char,{opacity:1,duration:2,ease:\"ease-in-out\"});});return()=>{tl.kill();};},[]);return{ref:textRef};}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withTextReveal(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...TextReveal(props)});};}withTextReveal.displayName=\"TextReveal\";\nexport const __FramerMetadata__ = {\"exports\":{\"TextReveal\":{\"type\":\"override\",\"name\":\"TextReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTextReveal\":{\"type\":\"reactHoc\",\"name\":\"withTextReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Reveal.map"],"mappings":"A,uPAAiN,SAAgBoB,GAAY,CAAC,IAAMC,EAAQrB,EAAa,IAAI,EAE7J,OAF+JU,MAAoB,CAAC,IAAMY,EAAYD,EAAQ,QAAQ,GAAG,CAACC,EAAY,OAAO,IAAMC,EAAUD,EAAY,iBAAiB,2BAA2B,EAAQE,EAAW,CAAC,EAAED,EAAU,QAAQ,GAAU,CAAC,IAAME,EAAU,IAAIxB,EAAUyB,EAAS,CAAC,MAAM,aAAa,CAAC,EACphBD,EAAU,MAAM,QAAQ,GAAQ,CAAC,EAAO,MAAM,WAAW,QAAS,CAAC,EAAED,EAAW,KAAK,GAAG,MAAM,KAAKC,EAAU,KAAK,CAAC,CAAE,CAAC,EAAET,EAAK,IAAIQ,EAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAMG,EAAGzB,EAAK,SAAS,CAAC,cAAc,CAAC,QAAQoB,EAAY,MAAM,UAAU,IAAI,aAAa,MAAM,EAAI,CAAC,CAAC,EAC/K,OAAnFE,EAAW,QAAQ,GAAM,CAACG,EAAG,GAAGC,EAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,aAAa,CAAC,CAAE,CAAC,MAAY,CAACD,EAAG,KAAK,CAAE,CAAE,EAAE,CAAC,CAAC,EAAQ,CAAC,IAAIN,CAAO,CAAE,CAAoJ,SAAgBQ,EAAe,EAAE,CAAC,MAAO,KAAQtB,EAA+BJ,CAAuC,EAASC,EAAK2B,EAAE,CAAC,GAAGC,EAAM,GAAGZ,EAAWY,CAAK,CAAC,CAAC,EAAI,C,sDAFpRhB,EAAK,eAAeX,CAAa,EAEoP,EAAe,YAAY,Y"}