{"version":3,"file":"withAnimatedText.BLADRaZ4.mjs","names":[],"sources":["https:/framerusercontent.com/modules/zYqyDG2n4FqVWMqmOE8P/sxwfOtHYIoWkc3BHL5Fw/withAnimatedText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{stagger,useAnimate,useInView}from\"framer-motion\";const MIN_FONT_SIZE=\"2rem\"// smallest on mobile\n;const MAX_FONT_SIZE=\"50rem\"// bigger max for desktop\n;const PREFERRED_FONT_SIZE=\"clamp(3rem, 12vw, 50rem)\";export function withAnimateChar(Component){return props=>{const[scopeRef,animate]=useAnimate();const isInView=useInView(scopeRef,{amount:.5});const easeOutCirc=[.075,.82,.165,1];const easeInCirc=[.6,.04,.98,.335];const settings={delay:stagger(.1)};useEffect(()=>{if(isInView){animate(\"span\",{y:[\"100%\",\"0%\"]},{...settings,duration:2,ease:easeOutCirc,onPlay:()=>scopeRef.current.style.opacity=1});}else{animate(\"span\",{y:[\"0%\",\"-100%\"]},{...settings,duration:1,ease:easeInCirc});}},[isInView]);useEffect(()=>{const text=scopeRef.current.querySelector(\".framer-text\");if(!text)return;// Keep layout styles\ntext.style.display=\"flex\";text.style.justifyContent=\"center\";// Set responsive font size\nconst MIN_FONT_SIZE=\"3rem\"// mobile\n;const PREFERRED_FONT_SIZE=\"12vw\"// scales\n;const MAX_FONT_SIZE=\"50rem\"// big desktop\n;text.style.fontSize=`clamp(${MIN_FONT_SIZE}, ${PREFERRED_FONT_SIZE}, ${MAX_FONT_SIZE})`;// Preserve animation: split into spans\ntext.innerHTML=text.textContent.split(\"\").map(character=>`<span style=\"display: inline-block\">${character}</span>`).join(\"\");},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:scopeRef,style:{...props.style,opacity:0,lineHeight:1,width:\"fit-content\"}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAnimateChar\":{\"type\":\"reactHoc\",\"name\":\"withAnimateChar\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./withAnimatedText.map"],"mappings":"iLAEsD,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAS,GAAS,EAAW,EAAQ,EAAS,EAAU,EAAS,CAAC,OAAO,EAAE,CAAC,EAAQ,EAAY,CAAC,KAAK,IAAI,KAAK,CAAC,EAAQ,EAAW,CAAC,GAAG,IAAI,IAAI,IAAI,EAAQ,EAAS,CAAC,MAAM,EAAQ,EAAE,CAAC,EAMzK,OAN2K,MAAc,CAAI,EAAU,EAAQ,OAAO,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,GAAG,EAAS,SAAS,EAAE,KAAK,EAAY,WAAW,EAAS,QAAQ,MAAM,QAAQ,CAAC,CAAC,EAAQ,EAAQ,OAAO,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,EAAE,CAAC,GAAG,EAAS,SAAS,EAAE,KAAK,CAAU,CAAC,CAAG,EAAE,CAAC,CAAQ,CAAC,EAAE,MAAc,CAAC,IAAM,EAAK,EAAS,QAAQ,cAAc,cAAc,EAAM,IAChnB,EAAK,MAAM,QAAQ,OAAO,EAAK,MAAM,eAAe,SAInD,EAAK,MAAM,SAAS,2BACrB,EAAK,UAAU,EAAK,YAAY,MAAM,EAAE,CAAC,CAAC,IAAI,GAAW,uCAAuC,EAAU,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,IAAI,EAAS,MAAM,CAAC,GAAG,EAAM,MAAM,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC,CAAC,CAAE,CAAE,iBARzN,IAA6B,IAAwD"}