{"version":3,"file":"GradientText_2.BiWvq1rf.mjs","names":["useState","startTransition","__esmMin","init_npm_react_18_3_1","te","_e","c","init_jsx_runtime","ce","useAnimation","init_framer_motion_DhsWWWsN","motion","init_framer_B6PCHH0A","useIsStaticRenderer","addPropertyControls","ControlType","GradientText","props","currentGradient","setCurrentGradient","isHovered","setIsHovered","isStatic","controls","linearEase","t","gradients","useThreeColors","gradientDirection","color1","color2","color3","animationType","interval","prev","speed","getActiveGradient","getAnimatedGradient","getAnimationPositions","direction","positions","getAnimationProps","shouldAnimate","overflowVisible","font","text","init_GradientText_2"],"sources":["https:/framerusercontent.com/modules/6IyXNrkBm6ZirTlxLD0V/zCSAEuy5CmGog184Ygte/GradientText_2.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 * @framerIntrinsicWidth 1050\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function GradientText(props){const{text=\"Coming Soon\",font,animationType=\"infinite\",speed=5,direction=\"rightToLeft\",gradientDirection=45,color1=\"#081F5C\",color2=\"#B1BED7\",color3=\"#ffffff\",useThreeColors=false,overflowVisible=true}=props;const[currentGradient,setCurrentGradient]=useState(0);const[isHovered,setIsHovered]=useState(false);const isStatic=useIsStaticRenderer();const controls=useAnimation();// Framer Motion's types don't always accept string easings; use a functional linear easing.\nconst linearEase=t=>t;// 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:linearEase,repeatType:\"loop\"}});}else{// Stop and reset when not hovered\ncontrols.stop();controls.set({backgroundPosition:positions[0]});}},[isHovered,animationType,speed,direction,isStatic,controls]);// Determine which animation to use\nconst getAnimationProps=()=>{if(isStatic)return{};if(animationType===\"infinite\"){return{animate:{backgroundPosition:getAnimationPositions()},transition:{duration:speed,repeat:Infinity,ease:linearEase,repeatType:\"loop\"}};}if(animationType===\"hover\"){return{animate:controls,onMouseEnter:()=>startTransition(()=>setIsHovered(true)),onMouseLeave:()=>startTransition(()=>setIsHovered(false)),initial:{backgroundPosition:getAnimationPositions()[0]}};}return{};};const shouldAnimate=animationType===\"infinite\"||animationType===\"hover\";return /*#__PURE__*/_jsx(motion.div,{style:{...props.style,width:\"100%\",background:getAnimatedGradient(),WebkitBackgroundClip:\"text\",backgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundSize:shouldAnimate&&!isStatic?\"400% 100%\":\"100% 100%\",display:\"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,textAlign:\"center\"},...getAnimationProps(),children:/*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",width:\"max-content\",maxWidth:\"100%\",overflow:overflowVisible?\"visible\":\"hidden\",lineHeight:\"inherit\",whiteSpace:\"pre-wrap\"},children:text})});}addPropertyControls(GradientText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Gradient Text\",displayTextArea:true,placeholder:\"Use a line break (\\\\n) for a new line\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"64px\",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\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"1050\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradientText_2.map"],"mappings":"A,wPAQG,SAAwBgB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,cAAc,OAAK,gBAAc,WAAW,QAAM,EAAE,YAAU,cAAc,oBAAkB,GAAG,SAAO,UAAU,SAAO,UAAU,SAAO,UAAU,iBAAe,GAAM,kBAAgB,IAAMC,EAAW,CAACC,EAAgBC,GAAoBnB,EAAS,CAAC,EAAO,CAACoB,EAAUC,GAAcrB,EAAS,EAAK,EAAQsB,EAAST,EAAoB,EAAQU,EAASd,EAAa,EAC9Ze,EAAW,GAAGC,EACdC,EAAUC,EAAe,CAAC,mBAAmBC,EAAkB,OAAOC,EAAO,IAAIC,EAAO,GAAG,mBAAmBF,EAAkB,OAAOE,EAAO,IAAIC,EAAO,GAAG,mBAAmBH,EAAkB,OAAOG,EAAO,IAAIF,EAAO,EAAE,EAAE,CAAC,mBAAmBD,EAAkB,OAAOC,EAAO,IAAIC,EAAO,GAAG,mBAAmBF,EAAkB,OAAOE,EAAO,IAAID,EAAO,EAAE,EACtWrB,MAAc,CACd,GADkBc,GACfU,IAAgB,WAAW,OAAO,IAAMC,EAAS,gBAAgB,CAAC7B,MAAoB,CAACe,EAAmB,IAAOe,EAAK,GAAGR,EA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