{"version":3,"file":"Text_Reveal.CBfO8eqR.mjs","names":["React.useRef","SplitType","gsap","__legacyOverrideHOC_DataObserverContext","_jsx","ScrollTrigger"],"sources":["https:/framerusercontent.com/modules/3D06D8M17hjlUJ8kwfRm/QbWvZ3lXAi1RvLcrGUUf/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\":{\"withTextReveal\":{\"type\":\"reactHoc\",\"name\":\"withTextReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TextReveal\":{\"type\":\"override\",\"name\":\"TextReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Reveal.map"],"mappings":"uPAAiN,SAAgB,GAAY,CAAC,IAAM,EAAQA,EAAa,IAAI,EAE7J,OAF+J,MAAoB,CAAC,IAAM,EAAY,EAAQ,QAAQ,GAAG,CAAC,EAAY,OAAO,IAAM,EAAU,EAAY,iBAAiB,2BAA2B,EAAQ,EAAW,CAAC,EAAE,EAAU,QAAQ,GAAU,CAAC,IAAM,EAAU,IAAIC,EAAU,EAAS,CAAC,MAAM,aAAa,CAAC,EACphB,EAAU,MAAM,QAAQ,GAAQ,CAAC,EAAO,MAAM,WAAW,QAAS,CAAC,EAAE,EAAW,KAAK,GAAG,MAAM,KAAK,EAAU,KAAK,CAAC,CAAE,CAAC,EAAE,EAAK,IAAI,EAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAM,EAAGC,EAAK,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAY,MAAM,UAAU,IAAI,aAAa,MAAM,EAAI,CAAC,CAAC,EAC/K,OAAnF,EAAW,QAAQ,GAAM,CAAC,EAAG,GAAG,EAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,aAAa,CAAC,CAAE,CAAC,MAAY,CAAC,EAAG,KAAK,CAAE,CAAE,EAAE,CAAC,CAAC,EAAQ,CAAC,IAAI,CAAO,CAAE,CAAoJ,SAAgB,EAAe,EAAE,CAAC,MAAO,KAAQ,EAA+BC,CAAuC,EAASC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAW,CAAK,CAAC,CAAC,EAAI,iBAFxZ,IAA4B,IAAuB,IAA8C,IAAkC,IAE0G,EAFzG,EAAK,eAAeC,CAAa,EAEoP,EAAe,YAAY"}