{"version":3,"file":"RollingText.CYVIP3o_.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/aKk72ikAdVYBO5Ecwo9P/ZTci1biWGGhhWI0QvxYI/RollingText.js"],"sourcesContent":["// Rolling text component with staggered letter animations on hover\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,startTransition}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function RollingLetters(props){const{text=\"Rolling Letters\",font,color,transition={type:\"tween\",ease:[.8,0,.4,1],duration:.4,delay:0},stagger=.05,reverse=false,transform=\"none\",tag=\"span\"}=props;const[animationKey,setAnimationKey]=useState(0);const[isAnimating,setIsAnimating]=useState(false);const containerRef=useRef(null);const handleMouseEnter=()=>{if(!isAnimating){startTransition(()=>{setAnimationKey(prev=>prev+1);setIsAnimating(true);});}};const handleAnimationComplete=()=>{startTransition(()=>setIsAnimating(false));};const letters=text.split(\"\");const Tag=tag;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...props.style,position:\"relative\",display:\"inline-block\",userSelect:\"none\",cursor:\"pointer\",overflow:\"hidden\"},onMouseEnter:handleMouseEnter,children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",...font,color:color,textTransform:transform,margin:0,padding:0},children:letters.map((letter,index)=>/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"inline-block\",overflow:\"hidden\",height:font?.lineHeight||\"1em\"},children:[/*#__PURE__*/_jsx(motion.div,{style:{position:\"relative\",display:\"inline-block\"},initial:{y:\"0%\"},animate:{y:animationKey>0?reverse?\"100%\":\"-100%\":\"0%\"},transition:{...transition,delay:index*stagger},onAnimationComplete:index===letters.length-1?handleAnimationComplete:undefined,children:letter===\" \"?\"\\xa0\":letter},`original-${animationKey}`),/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:reverse?\"-100%\":\"100%\",left:0,display:\"inline-block\"},initial:{y:\"0%\"},animate:{y:animationKey>0?reverse?\"100%\":\"-100%\":\"0%\"},transition:{...transition,delay:index*stagger},children:letter===\" \"?\"\\xa0\":letter},`rolling-${animationKey}`)]},index))})});}addPropertyControls(RollingLetters,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Rolling Letters\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},transition:{type:ControlType.Transition,title:\"Transition\"},stagger:{type:ControlType.Number,title:\"Stagger\",defaultValue:.05,min:0,max:1,step:.01,unit:\"s\"},reverse:{type:ControlType.Boolean,title:\"Reverse\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},transform:{type:ControlType.Enum,title:\"Transform\",options:[\"none\",\"uppercase\",\"lowercase\",\"capitalize\"],optionTitles:[\"None\",\"Uppercase\",\"Lowercase\",\"Capitalize\"],defaultValue:\"none\"},tag:{type:ControlType.Enum,title:\"Tag\",options:[\"p\",\"span\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],optionTitles:[\"P\",\"Span\",\"H1\",\"H2\",\"H3\",\"H4\",\"H5\",\"H6\"],defaultValue:\"span\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RollingLetters\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RollingText.map"],"mappings":"gPAIG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,OAAK,kBAAkB,OAAK,QAAM,aAAW,CAAC,KAAK,QAAQ,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,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