{"version":3,"file":"Text_Reveal.BPMyonso.mjs","names":["React.useRef","SplitType","gsap","__legacyOverrideHOC_DataObserverContext","_jsx","ScrollTrigger"],"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":"uPAAiN,SAAgB,GAAY,CAAC,IAAM,EAAQA,EAAa,KAAK,CAE9J,OAF+J,MAAoB,CAAC,IAAM,EAAY,EAAQ,QAAQ,GAAG,CAAC,EAAY,OAAO,IAAM,EAAU,EAAY,iBAAiB,4BAA4B,CAAO,EAAW,EAAE,CAAC,EAAU,QAAQ,GAAU,CAAC,IAAM,EAAU,IAAIC,EAAU,EAAS,CAAC,MAAM,cAAc,CAAC,CACrhB,EAAU,MAAM,QAAQ,GAAQ,CAAC,EAAO,MAAM,WAAW,UAAW,CAAC,EAAW,KAAK,GAAG,MAAM,KAAK,EAAU,MAAM,CAAC,EAAG,CAAC,EAAK,IAAI,EAAW,CAAC,QAAQ,GAAG,CAAC,CAAC,IAAM,EAAGC,EAAK,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAY,MAAM,UAAU,IAAI,aAAa,MAAM,GAAK,CAAC,CAAC,CAChL,OAAnF,EAAW,QAAQ,GAAM,CAAC,EAAG,GAAG,EAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,cAAc,CAAC,EAAG,KAAW,CAAC,EAAG,MAAM,GAAK,EAAE,CAAC,CAAO,CAAC,IAAI,EAAQ,CAAqJ,SAAgB,EAAe,EAAE,CAAC,MAAO,KAAQ,EAA+BC,EAAwC,CAAQC,EAAK,EAAE,CAAC,GAAG,EAAM,GAAG,EAAW,EAAM,CAAC,CAAC,mBAFpZ,IAA4B,IAAuB,IAA8C,IAAkC,IAE0G,CAF1G,EAAK,eAAeC,EAAc,CAEmP,EAAe,YAAY"}