{"version":3,"file":"Textcycle.CkxLUJdF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/yaTkNyVsL6UQBuHvWvPi/BIFyLd7aVMd13eHDAzcg/Textcycle.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function TextCycle(props){const{prefix,words,cycleInterval,fontSize,fontWeight,fontFamily,prefixColor,suffixColor,suffixGradientStart,suffixGradientEnd,useGradient,containerWidth}=props;const[currentIndex,setCurrentIndex]=useState(0);const wordArray=words.split(\",\").map(w=>w.trim());useEffect(()=>{const interval=setInterval(()=>{setCurrentIndex(prev=>(prev+1)%wordArray.length);},cycleInterval);return()=>clearInterval(interval);},[wordArray.length,cycleInterval]);const suffixStyle=useGradient?{background:`linear-gradient(to right, ${suffixGradientStart}, ${suffixGradientEnd})`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\"}:{color:suffixColor};return /*#__PURE__*/_jsxs(\"div\",{style:{fontSize:fontSize,fontWeight:fontWeight,fontFamily:fontFamily,lineHeight:1.2},children:[/*#__PURE__*/_jsxs(\"span\",{style:{color:prefixColor},children:[prefix,\" \"]}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",display:\"inline-block\",width:containerWidth,verticalAlign:\"baseline\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.span,{initial:{y:20,opacity:0},animate:{y:0,opacity:1},exit:{y:-20,opacity:0},transition:{duration:.3},style:{display:\"inline-block\",whiteSpace:\"nowrap\",...suffixStyle},children:wordArray[currentIndex]},currentIndex)})})]});}TextCycle.defaultProps={prefix:\"We build\",words:\"amazing, beautiful, powerful, innovative, stunning\",cycleInterval:2e3,fontSize:48,fontWeight:700,fontFamily:\"Inter, sans-serif\",prefixColor:\"#FFFFFF\",suffixColor:\"#60A5FA\",suffixGradientStart:\"#60A5FA\",suffixGradientEnd:\"#A855F7\",useGradient:true,containerWidth:\"400px\"};addPropertyControls(TextCycle,{prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"We build\"},words:{type:ControlType.String,title:\"Words\",displayTextArea:true,defaultValue:\"amazing, beautiful, powerful, innovative, stunning\",description:\"Comma-separated list of words\"},cycleInterval:{type:ControlType.Number,title:\"Cycle Speed\",defaultValue:2e3,min:500,max:5e3,step:100,unit:\"ms\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:48,min:12,max:200,step:1,unit:\"px\"},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[100,200,300,400,500,600,700,800,900],optionTitles:[\"Thin\",\"Extra Light\",\"Light\",\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\",\"Black\"],defaultValue:700},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Inter, sans-serif\"},prefixColor:{type:ControlType.Color,title:\"Prefix Color\",defaultValue:\"#FFFFFF\"},useGradient:{type:ControlType.Boolean,title:\"Use Gradient\",defaultValue:true,enabledTitle:\"Gradient\",disabledTitle:\"Solid\"},suffixColor:{type:ControlType.Color,title:\"Suffix Color\",defaultValue:\"#60A5FA\",hidden:props=>props.useGradient===true},suffixGradientStart:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#60A5FA\",hidden:props=>props.useGradient===false},suffixGradientEnd:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#A855F7\",hidden:props=>props.useGradient===false},containerWidth:{type:ControlType.String,title:\"Container Width\",defaultValue:\"400px\",description:\"Width for cycling words container\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextCycle\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Textcycle.map"],"mappings":"2OAAqM,SAAwB,EAAU,EAAM,CAAC,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