{"version":3,"file":"TextReveal.CUO2yp3q.mjs","names":["useRef","text"],"sources":["https:/framerusercontent.com/modules/Vt34uFjm28bb7h1aXCFT/hQr0teC9Mw0XqhmdtxI8/TextReveal.js"],"sourcesContent":["// Text animation component that animates from bottom to top when in view using GSAP\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView,motion}from\"framer-motion\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TextReveal(props){const{text=\"Animate this text from bottom to top\",font,textSize=32,textColor=\"#000000\",duration=.8,delay=0,distance=50,stagger=.1,animateBy=\"words\"}=props;const containerRef=useRef(null);const isInView=useInView(containerRef,{once:true,margin:\"-10%\"});const isStatic=useIsStaticRenderer();const hasAnimated=useRef(false);// No useEffect needed - framer-motion handles the animation\nconst splitText=(text,type)=>{if(type===\"characters\"){return text.split(\"\").map((char,index)=>/*#__PURE__*/_jsx(motion.span,{initial:{y:distance,opacity:1},animate:isInView?{y:0,opacity:1}:{y:distance,opacity:1},transition:{duration:duration,delay:delay+index*stagger,ease:\"easeOut\"},style:{display:\"inline-block\"},children:char===\" \"?\"\\xa0\":char},index));}else if(type===\"words\"){return text.split(\" \").map((word,index)=>/*#__PURE__*/_jsx(motion.span,{initial:{y:distance,opacity:1},animate:isInView?{y:0,opacity:1}:{y:distance,opacity:1},transition:{duration:duration,delay:delay+index*stagger,ease:\"easeOut\"},style:{display:\"inline-block\",marginRight:\"0.25em\"},children:word},index));}else{return text.split(\"\\n\").map((line,index)=>/*#__PURE__*/_jsx(motion.div,{initial:{y:distance,opacity:1},animate:isInView?{y:0,opacity:1}:{y:distance,opacity:1},transition:{duration:duration,delay:delay+index*stagger,ease:\"easeOut\"},style:{display:\"block\"},children:line},index));}};const isFixedWidth=props?.style&&props.style.width===\"100%\";return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...props.style,position:\"relative\",overflow:\"hidden\",...isFixedWidth?{...props?.style}:{width:\"max-content\"},color:textColor,fontSize:`${textSize}px`,...font},children:isStatic?/*#__PURE__*/_jsx(\"span\",{children:text}):splitText(text,animateBy)});}addPropertyControls(TextReveal,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Animate this text from bottom to top\",displayTextArea:true},font:{type:ControlType.Font,title:\"Font\",defaultValue:{variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\",displayFontSize:false},textSize:{type:ControlType.Number,title:\"Text Size\",defaultValue:32,min:8,max:120,step:1,unit:\"px\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},animateBy:{type:ControlType.Enum,title:\"Animate By\",options:[\"words\",\"lines\",\"characters\"],optionTitles:[\"Words\",\"Lines\",\"Characters\"],defaultValue:\"words\",displaySegmentedControl:true},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:.8,min:.1,max:3,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:2,step:.1,unit:\"s\"},distance:{type:ControlType.Number,title:\"Distance\",defaultValue:50,min:10,max:200,step:5,unit:\"px\"},stagger:{type:ControlType.Number,title:\"Stagger\",defaultValue:.1,min:0,max:.5,step:.05,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextReveal\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextReveal.map"],"mappings":"0OAMG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,OAAK,uCAAuC,OAAK,WAAS,GAAG,YAAU,UAAU,WAAS,GAAG,QAAM,EAAE,WAAS,GAAG,U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