{"version":3,"file":"AvoidLayoutJumping_Prod.CGOmQ2Rf.mjs","names":["useMemo","useRef","React","EachCharacter","useRef"],"sources":["https:/framerusercontent.com/modules/uRiLukd4hmGkFbVjI31G/JFtOs7F9vI31L8BoQ6oL/RevealText.js","https:/framerusercontent.com/modules/h8ioHyt4BUxuvVCE1Q10/aTM6mEMGlM19JjX8exDe/AvoidLayoutJumping_Prod.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useScroll,useTransform,useReducedMotion}from\"framer-motion\";import React,{useMemo,useRef,useEffect}from\"react\";function useGoogleFont(fontFamily){useEffect(()=>{if(!fontFamily)return;const id=`font-${fontFamily.replace(/\\s+/g,\"-\")}`;if(document.getElementById(id))return;const link=document.createElement(\"link\");link.id=id;link.rel=\"stylesheet\";const familyParam=fontFamily.trim().replace(/\\s+/g,\"+\");link.href=`https://fonts.googleapis.com/css2?family=${familyParam}:wght@400;500;700&display=swap`;document.head.appendChild(link);},[fontFamily]);}const srOnlyStyle={position:\"absolute\",width:\"1px\",height:\"1px\",padding:0,margin:\"-1px\",overflow:\"hidden\",clip:\"rect(0, 0, 0, 0)\",whiteSpace:\"nowrap\",border:0};const EachCharacter=/*#__PURE__*/React.memo(function EachCharacter({char,start,end,progress,transition,fromColor,toColor}){const color=useTransform(progress,[start,end],[fromColor,toColor]);return /*#__PURE__*/_jsx(motion.span,{style:{color,willChange:\"color\"},transition:transition,\"aria-hidden\":true,children:char});});export default function RevealText(props){const{text=\"Hello Text\",uppercase=false,fontFamily=\"Urbanist\",fontSize=48,fontWeight=\"400\",lineHeight=120,letterSpacing=-3,paragraphAlign=\"center\",fromColor=\"#666666\",toColor=\"#FFFFFF\",easing=\"easeInOut\",offsetStart=\"start 0.75\",offsetEnd=\"start 0.15\"}=props;useGoogleFont(fontFamily);const resolvedText=text||\"\";const words=useMemo(()=>resolvedText.split(/\\s+/).filter(Boolean),[resolvedText]);const totalWords=words.length||1;const reduceMotion=useReducedMotion();const ref=useRef(null);const{scrollYProgress}=useScroll({target:ref,offset:[offsetStart,offsetEnd]});const transition=useMemo(()=>({duration:reduceMotion?0:.3,ease:easing}),[easing,reduceMotion]);const unitlessLineHeight=Math.max(.5,Number(lineHeight)/100||1.2);const textAlign=paragraphAlign===\"flex-start\"?\"left\":paragraphAlign===\"flex-end\"?\"right\":paragraphAlign;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\"},children:[/*#__PURE__*/_jsx(\"p\",{ref:ref,style:{fontFamily:`${fontFamily}, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif`,fontSize,fontWeight,color:fromColor,display:\"block\",lineHeight:unitlessLineHeight,letterSpacing:`${letterSpacing}px`,textAlign,margin:0,textTransform:uppercase?\"uppercase\":\"none\",WebkitFontSmoothing:\"antialiased\",MozOsxFontSmoothing:\"grayscale\"},children:words.map((word,wIdx)=>{const starting=wIdx/totalWords;const ending=(wIdx+1)/totalWords;const characters=[...word];const length=characters.length||1;const amount=Math.max(ending-starting,1e-4);const step=amount/length;return /*#__PURE__*/_jsxs(React.Fragment,{children:[characters.map((ch,i)=>/*#__PURE__*/_jsx(EachCharacter,{char:ch,start:starting+step*i,end:starting+step*(i+1),progress:scrollYProgress,transition:transition,fromColor:fromColor,toColor:toColor},i)),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":true,children:\" \"})]},`${word}-${wIdx}`);})}),/*#__PURE__*/_jsx(\"span\",{style:srOnlyStyle,\"aria-hidden\":false,children:resolvedText})]});}addPropertyControls(RevealText,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Hello Text\"},uppercase:{title:\"Uppercase\",type:ControlType.Boolean,defaultValue:false,enabledTitle:\"ON\",disabledTitle:\"OFF\"},fontFamily:{title:\"Font Family\",type:ControlType.String,defaultValue:\"Urbanist\"},fontSize:{title:\"Font Size\",type:ControlType.Number,defaultValue:48,min:10,max:200},fontWeight:{title:\"Font Weight\",type:ControlType.Enum,options:[\"400\",\"500\",\"700\"],optionTitles:[\"Regular\",\"Medium\",\"Bold\"],defaultValue:\"400\"},lineHeight:{title:\"Line Height (%)\",type:ControlType.Number,defaultValue:120,min:80,max:200},letterSpacing:{title:\"Letter Spacing (px)\",type:ControlType.Number,defaultValue:-3,min:-10,max:10,step:.5},paragraphAlign:{title:\"Align\",type:ControlType.Enum,options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"},fromColor:{title:\"From Color\",type:ControlType.Color,defaultValue:\"#666666\"},toColor:{title:\"To Color\",type:ControlType.Color,defaultValue:\"#FFFFFF\"},easing:{title:\"Easing\",type:ControlType.Enum,options:[\"easeInOut\",\"easeIn\",\"easeOut\",\"linear\"],optionTitles:[\"Ease In Out\",\"Ease In\",\"Ease Out\",\"Linear\"],defaultValue:\"easeInOut\"},offsetStart:{title:\"Offset Start\",type:ControlType.String,defaultValue:\"start 0.75\"},offsetEnd:{title:\"Offset End\",type:ControlType.String,defaultValue:\"start 0.15\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RevealText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RevealText.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n *\n * @framerDisableUnlink\n */export default function AvoidLayoutJumping({direction,style}){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const ref=useRef(null);const rafId=useRef();const vertical=direction===\"vertical\"||direction===\"both\";const horizontal=direction===\"horizontal\"||direction===\"both\";useEffect(()=>{if(isCanvas)return;const parent=ref.current?.parentElement?.parentElement;if(!parent)return;const container=parent.parentElement;if(!container)return;const updateSize=()=>{const rect=parent.getBoundingClientRect();if(horizontal){container.style.width=`${rect.width}px`;}if(vertical){container.style.height=`${rect.height}px`;}rafId.current=requestAnimationFrame(updateSize);};// Start the RAF loop\nrafId.current=requestAnimationFrame(updateSize);return()=>{if(rafId.current){cancelAnimationFrame(rafId.current);}if(container){if(horizontal){container.style.width=\"\";}if(vertical){container.style.height=\"\";}}};},[direction]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...style}});}AvoidLayoutJumping.displayName=\"Layout Jump Preventer\";addPropertyControls(AvoidLayoutJumping,{direction:{type:ControlType.Enum,defaultValue:\"vertical\",options:[\"vertical\",\"horizontal\",\"both\"],optionTitles:[\"Vertical\",\"Horizontal\",\"Both\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",// @ts-ignore\noptionIcons:[\"direction-vertical\",\"direction-horizontal\",\"direction-all\"],description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AvoidLayoutJumping\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AvoidLayoutJumping_Prod.map"],"mappings":"ybAA0O,SAAS,EAAc,EAAW,CAAC,MAAc,CAAC,GAAG,CAAC,EAAW,OAAO,IAAM,EAAG,QAAQ,EAAW,QAAQ,OAAO,IAAI,GAAG,GAAG,SAAS,eAAe,EAAG,CAAC,OAAO,IAAM,EAAK,SAAS,cAAc,OAAO,CAAC,EAAK,GAAG,EAAG,EAAK,IAAI,aAAqE,EAAK,KAAK,4CAAhD,EAAW,MAAM,CAAC,QAAQ,OAAO,IAAI,CAAmE,gCAAgC,SAAS,KAAK,YAAY,EAAK,EAAG,CAAC,EAAW,CAAC,CAAme,SAAwB,EAAW,EAAM,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