{"version":3,"file":"RollingText.CcfWBOWv.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/wi48ZDcRGNgJW2QcSv2b/8pXrcMv2jUkGTTbvqpn9/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\",customType=false,fontSize=80,fontWeight=800}=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}};// Applied after the Font control so these win when the toggle is on.\nconst typeOverride=customType?{fontSize,fontWeight}:null;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,...typeOverride},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\"},customType:{type:ControlType.Boolean,title:\"Size & Weight\",defaultValue:false,enabledTitle:\"Custom\",disabledTitle:\"From Font\"},fontSize:{type:ControlType.Number,title:\"Size\",defaultValue:80,min:8,max:400,step:1,unit:\"px\",displayStepper:true,hidden:props=>!props.customType},fontWeight:{type:ControlType.Enum,title:\"Weight\",defaultValue:800,options:[100,200,300,400,500,600,700,800,900],optionTitles:[\"100 Thin\",\"200 Extra Light\",\"300 Light\",\"400 Regular\",\"500 Medium\",\"600 Semi Bold\",\"700 Bold\",\"800 Extra Bold\",\"900 Black\"],hidden:props=>!props.customType}});\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":"8PAMG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,QAAQ,SAAS,EAAE,WAAS,IAAI,YAAU,UAAU,OAAK,YAAU,KAAK,aAAW,GAAM,WAAS,GAAG,aAAW,KAAK,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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