{"version":3,"file":"Text_Reveal.CMmbs8rA.mjs","names":["React.useRef","gsap","__legacyOverrideHOC_DataObserverContext","_jsx","ScrollTrigger"],"sources":["https:/framerusercontent.com/modules/yxnmTewZ5gGV9PkM3fIL/rGUmefv0pM1Qxkj9omwK/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\";gsap.registerPlugin(ScrollTrigger);let splitTypeLoaded=false;export function TextReveal(){const textRef=React.useRef(null);React.useEffect(()=>{const loadSplitType=async()=>{if(!splitTypeLoaded){await new Promise(resolve=>{const script=document.createElement(\"script\");script.src=\"https://cdn.jsdelivr.net/npm/split-type\";script.onload=()=>{splitTypeLoaded=true;resolve(true);};document.head.appendChild(script);});}const textElement=textRef.current;if(!textElement||!window.SplitType)return;const sentences=textElement.querySelectorAll(\"h1, h2, h3, h4, h5, h6, p\");const characters=[];sentences.forEach(sentence=>{const splitText=new window.SplitType(sentence,{types:\"words,chars\"});splitText.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}});characters.forEach(char=>{tl.to(char,{opacity:1,duration:2,ease:\"ease-in-out\"});});return()=>{tl.kill();};};loadSplitType();},[]);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\",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