{"version":3,"file":"GradientText_2_5.PyRXcPvW.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/LGc0tj28BBsDsUxYTd9Z/xeq2IQir4PLH1a20gvEX/GradientText_2_5.js"],"sourcesContent":["// Gradient text animation component with cycling colors and customizable properties\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useAnimation}from\"framer-motion\";/**\n * Gradient Text Animation\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function GradientText(props){const{text=\"Gradient Text\",font,animationType=\"infinite\",speed=4,direction=\"rightToLeft\",gradientDirection=45,color1=\"#FF6B6B\",color2=\"#4ECDC4\",color3=\"#45B7D1\",useThreeColors=false,overflowVisible=true}=props;const[currentGradient,setCurrentGradient]=useState(0);const[isHovered,setIsHovered]=useState(false);const isStatic=useIsStaticRenderer();const controls=useAnimation();// Create gradient combinations\nconst gradients=useThreeColors?[`linear-gradient(${gradientDirection}deg, ${color1}, ${color2})`,`linear-gradient(${gradientDirection}deg, ${color2}, ${color3})`,`linear-gradient(${gradientDirection}deg, ${color3}, ${color1})`]:[`linear-gradient(${gradientDirection}deg, ${color1}, ${color2})`,`linear-gradient(${gradientDirection}deg, ${color2}, ${color1})`];// Handle infinite animation\nuseEffect(()=>{if(isStatic)return;// For infinite type, always animate\nif(animationType!==\"infinite\")return;const interval=setInterval(()=>{startTransition(()=>{setCurrentGradient(prev=>(prev+1)%gradients.length);});},speed*1e3);return()=>clearInterval(interval);},[animationType,speed,gradients.length,isStatic]);// Determine which gradient to show\nconst getActiveGradient=()=>{if(animationType===\"static\"){return gradients[0];}if(animationType===\"hover\"){return gradients[0];}return gradients[currentGradient];};const isFixedWidth=props?.style&&props.style.width===\"100%\";// For animated gradients, create a larger gradient that moves\nconst getAnimatedGradient=()=>{if((animationType===\"infinite\"||animationType===\"hover\")&&!isStatic){const colors=useThreeColors?[color1,color2,color3]:[color1,color2];// Create a gradient that extends beyond the visible area for smooth looping\nreturn`linear-gradient(${gradientDirection}deg, transparent, ${colors.join(\", \")}, transparent)`;}return getActiveGradient();};// Get animation positions based on direction\nconst getAnimationPositions=()=>{if(direction===\"leftToRight\"){return[\"-300% 50%\",\"100% 50%\"];}else{return[\"100% 50%\",\"-300% 50%\"];}};// Handle hover animation control\nuseEffect(()=>{if(isStatic||animationType!==\"hover\")return;const positions=getAnimationPositions();if(isHovered){// Start the animation loop when hovered\ncontrols.start({backgroundPosition:positions,transition:{duration:speed,repeat:Infinity,ease:\"linear\",repeatType:\"loop\"}});}else{// Stop and reset when not hovered\ncontrols.stop();controls.set({backgroundPosition:positions[0]});}},[isHovered,animationType,speed,direction,isStatic]);// Determine which animation to use\nconst getAnimationProps=()=>{if(isStatic)return{};if(animationType===\"infinite\"){return{animate:{backgroundPosition:getAnimationPositions()},transition:{duration:speed,repeat:Infinity,ease:\"linear\",repeatType:\"loop\"}};}if(animationType===\"hover\"){return{animate:controls,onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),initial:{backgroundPosition:getAnimationPositions()[0]}};}return{};};const shouldAnimate=animationType===\"infinite\"||animationType===\"hover\";return /*#__PURE__*/_jsx(motion.div,{style:{...props.style,...isFixedWidth?{...props?.style}:{width:\"max-content\"},background:getAnimatedGradient(),WebkitBackgroundClip:\"text\",backgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundSize:shouldAnimate&&!isStatic?\"400% 100%\":\"100% 100%\",display:\"inline-block\",cursor:animationType===\"hover\"?\"pointer\":\"default\",overflow:overflowVisible?\"visible\":\"hidden\",height:\"auto\",minHeight:\"max-content\",lineHeight:font?.lineHeight||\"1.2em\",position:\"relative\",padding:overflowVisible?\"0.1em 0\":\"0\",...font},...getAnimationProps(),children:/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",overflow:overflowVisible?\"visible\":\"hidden\",lineHeight:\"inherit\"},children:text})});}addPropertyControls(GradientText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Gradient Text\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"32px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\",displayFontSize:true,displayTextAlignment:true},animationType:{type:ControlType.Enum,title:\"Animation\",options:[\"static\",\"hover\",\"infinite\"],optionTitles:[\"Static\",\"On Hover\",\"Infinite Loop\"],defaultValue:\"infinite\",displaySegmentedControl:true},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"leftToRight\",\"rightToLeft\"],optionTitles:[\"LEFT\",\"RIGHT\"],defaultValue:\"rightToLeft\",displaySegmentedControl:true,hidden:({animationType})=>animationType===\"static\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:8,min:2,max:30,step:1,unit:\"s\",hidden:({animationType})=>animationType===\"static\"},gradientDirection:{type:ControlType.Number,title:\"Direction\",defaultValue:45,min:0,max:360,step:15,unit:\"\\xb0\"},useThreeColors:{type:ControlType.Boolean,title:\"Colors\",defaultValue:false,enabledTitle:\"Three\",disabledTitle:\"Two\"},color1:{type:ControlType.Color,title:\"Color 1\",defaultValue:\"#FF6B6B\"},color2:{type:ControlType.Color,title:\"Color 2\",defaultValue:\"#4ECDC4\"},color3:{type:ControlType.Color,title:\"Color 3\",defaultValue:\"#45B7D1\",hidden:({useThreeColors})=>!useThreeColors},overflowVisible:{type:ControlType.Boolean,title:\"Overflow Visible\",defaultValue:true,enabledTitle:\"Visible\",disabledTitle:\"Hidden\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradientText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradientText_2_5.map"],"mappings":"wPAMG,SAAwB,EAAa,EAAM,CA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