{"version":3,"file":"AnimatedGradientText.BpFS72YP.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/KvGeRPu83GUZHJpv5miX/kgwCy7gVHilqFmQYHtrx/AnimatedGradientText.js"],"sourcesContent":["// Text element with selectable words that have animated moving gradient backgrounds\n// User can select font and customize gradient colors\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useMemo}from\"react\";/**\n * Animated Gradient Text\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function AnimatedGradientText(props){const{text=\"Humans are the most advanced lifeforms on earth. It's not easy to do what we do. Flexion is making it less difficult.\",highlightWord1=\"advanced\",highlightWord2=\"Flexion\",highlightWord3=\"\",highlightWord4=\"\",highlightWord5=\"\",highlightWord6=\"\",font,highlightFont,textColor=\"#000000\",gradientColor1=\"#FFA500\",gradientColor2=\"#FF69B4\",gradientColor3=\"#00CED1\",gradientColor4=\"#9370DB\",gradientColor5=\"#32CD32\",gradientColor6=\"#FFD700\",animationSpeed=3,blurIntensity=20,gradientOpacity=.8,showGradient=true,enableIndent=false,indentWidth=40,gradientTopOffset=24,gradientPaddingTop=8,gradientPaddingRight=8,gradientPaddingBottom=16,gradientPaddingLeft=8,style}=props;const highlightedWords=useMemo(()=>{return[highlightWord1,highlightWord2,highlightWord3,highlightWord4,highlightWord5,highlightWord6].filter(word=>word.trim()!==\"\");},[highlightWord1,highlightWord2,highlightWord3,highlightWord4,highlightWord5,highlightWord6]);const words=useMemo(()=>text.split(\" \"),[text]);const isHighlighted=word=>{const cleanWord=word.replace(/[.,!?;:]/g,\"\").toLowerCase();return highlightedWords.some(hw=>hw.toLowerCase()===cleanWord);};const isFillWidth=style?.width===\"100%\";const isFillHeight=style?.height===\"100%\";return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",display:isFillWidth?\"flex\":\"inline-block\",width:isFillWidth?\"100%\":\"max-content\",height:isFillHeight?\"100%\":\"auto\",alignItems:isFillHeight?\"center\":undefined},children:/*#__PURE__*/_jsxs(\"p\",{style:{...font,color:textColor,margin:0,display:\"inline\",whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",width:isFillWidth?\"100%\":undefined},children:[enableIndent&&/*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",width:`${indentWidth}px`}}),words.map((word,index)=>{const highlighted=isHighlighted(word);if(highlighted){// Calculate which highlighted word this is (0-based index)\nconst highlightIndex=highlightedWords.findIndex(hw=>hw.toLowerCase()===word.replace(/[.,!?;:]/g,\"\").toLowerCase());return /*#__PURE__*/_jsxs(\"span\",{style:{position:\"relative\",display:\"inline\",marginRight:index<words.length-1?\"0.25em\":0,borderRadius:\"0.2em\",overflow:\"visible\",isolation:\"isolate\"},children:[showGradient&&/*#__PURE__*/_jsx(motion.span,{style:{position:\"absolute\",top:`calc(${gradientTopOffset}% + ${gradientPaddingTop}px)`,left:`${gradientPaddingLeft}px`,right:`${gradientPaddingRight}px`,bottom:`${gradientPaddingBottom}px`,background:`linear-gradient(90deg, ${gradientColor1}, ${gradientColor2}, ${gradientColor3}, ${gradientColor4}, ${gradientColor5}, ${gradientColor6})`,backgroundSize:\"300% 300%\",borderRadius:\"0.2em\",filter:`blur(${blurIntensity}px)`,opacity:gradientOpacity,willChange:\"transform\",transform:\"translateZ(0)\",backfaceVisibility:\"hidden\"},animate:{backgroundPosition:[\"0% 50%\",\"50% 100%\",\"100% 50%\",\"50% 0%\",\"0% 50%\"]},transition:{duration:animationSpeed,repeat:Infinity,ease:\"linear\",delay:-(highlightIndex*animationSpeed/highlightedWords.length)}}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",...highlightFont,color:textColor},children:word})]},index);}return /*#__PURE__*/_jsxs(\"span\",{children:[word,index<words.length-1?\" \":\"\"]},index);})]})});}addPropertyControls(AnimatedGradientText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Humans are the most advanced lifeforms on earth. It's not easy to do what we do. Flexion is making it less difficult.\",displayTextArea:true},enableIndent:{type:ControlType.Boolean,title:\"Enable Indent\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},indentWidth:{type:ControlType.Number,title:\"Indent Width\",defaultValue:40,min:0,max:200,step:5,unit:\"px\",hidden:({enableIndent})=>!enableIndent},showGradient:{type:ControlType.Boolean,title:\"Show Gradient\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},highlightWord1:{type:ControlType.String,title:\"Highlight Word 1\",defaultValue:\"advanced\"},highlightWord2:{type:ControlType.String,title:\"Highlight Word 2\",defaultValue:\"Flexion\"},highlightWord3:{type:ControlType.String,title:\"Highlight Word 3\",defaultValue:\"\"},highlightWord4:{type:ControlType.String,title:\"Highlight Word 4\",defaultValue:\"\"},highlightWord5:{type:ControlType.String,title:\"Highlight Word 5\",defaultValue:\"\"},highlightWord6:{type:ControlType.String,title:\"Highlight Word 6\",defaultValue:\"\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"40px\",variant:\"Regular\",letterSpacing:\"-0.02em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},highlightFont:{type:ControlType.Font,title:\"Highlight Font\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},gradientColor1:{type:ControlType.Color,title:\"Gradient Color 1\",defaultValue:\"#FFA500\",hidden:({showGradient})=>!showGradient},gradientColor2:{type:ControlType.Color,title:\"Gradient Color 2\",defaultValue:\"#FF69B4\",hidden:({showGradient})=>!showGradient},gradientColor3:{type:ControlType.Color,title:\"Gradient Color 3\",defaultValue:\"#00CED1\",hidden:({showGradient})=>!showGradient},gradientColor4:{type:ControlType.Color,title:\"Gradient Color 4\",defaultValue:\"#9370DB\",hidden:({showGradient})=>!showGradient},gradientColor5:{type:ControlType.Color,title:\"Gradient Color 5\",defaultValue:\"#32CD32\",hidden:({showGradient})=>!showGradient},gradientColor6:{type:ControlType.Color,title:\"Gradient Color 6\",defaultValue:\"#FFD700\",hidden:({showGradient})=>!showGradient},animationSpeed:{type:ControlType.Number,title:\"Animation Speed\",defaultValue:8,min:1,max:20,step:.5,unit:\"s\",hidden:({showGradient})=>!showGradient},blurIntensity:{type:ControlType.Number,title:\"Blur Intensity\",defaultValue:20,min:0,max:50,step:1,unit:\"px\",hidden:({showGradient})=>!showGradient},gradientOpacity:{type:ControlType.Number,title:\"Gradient Opacity\",defaultValue:.8,min:0,max:1,step:.05,hidden:({showGradient})=>!showGradient},gradientTopOffset:{type:ControlType.Number,title:\"Gradient Top Offset\",defaultValue:24,min:0,max:100,step:1,unit:\"%\",hidden:({showGradient})=>!showGradient},gradientPaddingTop:{type:ControlType.Number,title:\"Gradient Padding Top\",defaultValue:8,min:-20,max:50,step:1,unit:\"px\",hidden:({showGradient})=>!showGradient},gradientPaddingRight:{type:ControlType.Number,title:\"Gradient Padding Right\",defaultValue:8,min:-20,max:50,step:1,unit:\"px\",hidden:({showGradient})=>!showGradient},gradientPaddingBottom:{type:ControlType.Number,title:\"Gradient Padding Bottom\",defaultValue:16,min:-20,max:50,step:1,unit:\"px\",hidden:({showGradient})=>!showGradient},gradientPaddingLeft:{type:ControlType.Number,title:\"Gradient Padding Left\",defaultValue:8,min:-20,max:50,step:1,unit:\"px\",hidden:({showGradient})=>!showGradient}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedGradientText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatedGradientText.map"],"mappings":"kOAOG,SAAwB,EAAqB,EAAM,CAAC,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