{"version":3,"file":"Text_animation_01.BhYO2qes.mjs","names":["React.useRef","SplitType","gsap","__legacyOverrideHOC_DataObserverContext","_jsx","ScrollTrigger"],"sources":["https:/framerusercontent.com/modules/GOyZ9nbHPmM5O3wUuYrU/coLaYVotrMtKIPGN4BmG/Text_animation_01.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;// Tipografía\ntextElement.style.fontFamily=\"PP Telegraph, sans-serif\";const paragraphs=textElement.querySelectorAll(\"h1, h2, h3, h4, h5, h6, p\");const allChars=[];paragraphs.forEach((paragraph,index)=>{const splitText=new SplitType(paragraph,{types:\"words,chars\"});splitText.words.forEach(wordEl=>{wordEl.style.whiteSpace=\"nowrap\";});splitText.chars.forEach(char=>{allChars.push({el:char,paragraphIndex:index});});});// Color inicial beige\ngsap.set(allChars.map(item=>item.el),{color:\"#D8D6B5\"});const tl=gsap.timeline({scrollTrigger:{trigger:textElement,start:\"top 85%\",end:\"top 50%\",scrub:true}});// Todo se colorea a rosa\nallChars.forEach(item=>{tl.to(item.el,{color:\"#f489b2\",duration:.15,ease:\"power1.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_animation_01.map"],"mappings":"uPAAiN,SAAgB,GAAY,CAAC,IAAM,EAAQA,EAAa,KAAK,CAGtJ,OAHuJ,MAAoB,CAAC,IAAM,EAAY,EAAQ,QAAQ,GAAG,CAAC,EAAY,OACtV,EAAY,MAAM,WAAW,2BAA2B,IAAM,EAAW,EAAY,iBAAiB,4BAA4B,CAAO,EAAS,EAAE,CAAC,EAAW,SAAS,EAAU,IAAQ,CAAC,IAAM,EAAU,IAAIC,EAAU,EAAU,CAAC,MAAM,cAAc,CAAC,CAAC,EAAU,MAAM,QAAQ,GAAQ,CAAC,EAAO,MAAM,WAAW,UAAW,CAAC,EAAU,MAAM,QAAQ,GAAM,CAAC,EAAS,KAAK,CAAC,GAAG,EAAK,eAAe,EAAM,CAAC,EAAG,EAAG,CAClZ,EAAK,IAAI,EAAS,IAAI,GAAM,EAAK,GAAG,CAAC,CAAC,MAAM,UAAU,CAAC,CAAC,IAAM,EAAGC,EAAK,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAY,MAAM,UAAU,IAAI,UAAU,MAAM,GAAK,CAAC,CAAC,CACnE,OAA3F,EAAS,QAAQ,GAAM,CAAC,EAAG,GAAG,EAAK,GAAG,CAAC,MAAM,UAAU,SAAS,IAAI,KAAK,aAAa,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,mBAH5Z,IAA4B,IAAuB,IAA8C,IAAkC,IAGkH,CAHlH,EAAK,eAAeC,EAAc,CAG2P,EAAe,YAAY"}