{"version":3,"file":"RollingText.Bpl43ZA4.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/wi48ZDcRGNgJW2QcSv2b/afJZ5SRPcMd4DENVn7ri/RollingText.js"],"sourcesContent":["// Text rolling animation that transitions between words\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Rolling Text Animation\n * \n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function RollingText(props){const{words=[\"UX/UI\",\"Product\"],duration=2e3,textColor=\"#000000\",font,direction=\"up\"}=props;const[currentIndex,setCurrentIndex]=useState(0);useEffect(()=>{if(typeof window===\"undefined\")return;const interval=setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%words.length);});},duration);return()=>clearInterval(interval);},[words.length,duration]);const variants={enter:{y:direction===\"up\"?100:-100,opacity:0},center:{y:0,opacity:1},exit:{y:direction===\"up\"?-100:100,opacity:0}};return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",display:\"inline-block\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.div,{variants:variants,initial:\"enter\",animate:\"center\",exit:\"exit\",transition:{y:{type:\"spring\",stiffness:300,damping:30},opacity:{duration:.2}},style:{color:textColor,whiteSpace:\"nowrap\",...font},children:words[currentIndex]},currentIndex)})});}addPropertyControls(RollingText,{words:{type:ControlType.Array,title:\"Words\",control:{type:ControlType.String},defaultValue:[\"UX/UI\",\"Product\"]},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2e3,min:500,max:1e4,step:100,unit:\"ms\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"up\",\"down\"],optionTitles:[\"Up\",\"Down\"],defaultValue:\"up\",displaySegmentedControl:true},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"80px\",variant:\"Extra Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RollingText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RollingText.map"],"mappings":"yPAMG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,QAAQ,SAAS,EAAE,WAAS,IAAI,YAAU,UAAU,OAAK,YAAU,MAAM,EAAW,CAAC,EAAa,GAAiBA,EAAS,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAS,gBAAgB,CAAC,MAAoB,CAAC,EAAgB,IAAO,EAAK,GAAG,EAAM,MAAM,CAAE,CAAC,CAAE,EAAE,CAAQ,EAAE,UAAU,cAAc,CAAQ,CAAE,EAAE,CAAC,EAAM,OAAO,CAAQ,CAAC,EAAE,IAAM,EAAS,CAAC,MAAM,CAAC,EAAE,IAAY,KAAK,IAAI,KAAK,QAAQ,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,EAAE,IAAY,KAAK,KAAK,IAAI,QAAQ,CAAC,CAAC,EAAE,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,QAAQ,eAAe,SAAS,QAAQ,EAAE,SAAsB,EAAK,EAAgB,CAAC,KAAK,OAAO,SAAsB,EAAK,EAAO,IAAI,CAAU,WAAS,QAAQ,QAAQ,QAAQ,SAAS,KAAK,OAAO,WAAW,CAAC,EAAE,CAAC,KAAK,SAAS,UAAU,IAAI,QAAQ,EAAE,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,CA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