{"version":3,"file":"Gradient_Highlight.BV02kITr.mjs","names":[],"sources":["https:/framerusercontent.com/modules/WYBajOQIRLPxegSrYz2O/FFlaDWLq1md9PEKEi12F/Gradient_Highlight.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";export default function HighlightText({text=\"Normal text highlight this more text\",highlightWords=\"\",gradientColor1=\"#FF6B6B\",gradientColor2=\"#4ECDC4\",gradientAngle=45,normalColor=\"#000000\",fontSize=16,fontWeight=400,fontFamily=\"Inter, sans-serif\",lineHeight=1.5,letterSpacing=0,textAlign=\"left\",animationEnabled=true,animationType=\"smooth\",animationSpeed=3}){// Convert comma-separated string to array and trim whitespace\nconst wordsToHighlight=highlightWords.split(\",\").map(word=>word.trim()).filter(word=>word.length>0);// Parse text and create elements with highlights\nconst processedContent=parseAndHighlightWords(text,wordsToHighlight,gradientColor1,gradientColor2,gradientAngle,animationEnabled,animationType,animationSpeed);// Create a unique key based on colors to force remount when colors change\nconst componentKey=`${gradientColor1}-${gradientColor2}-${normalColor}-${gradientAngle}`;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",background:\"none\",backgroundColor:\"transparent\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                    @keyframes gradientSmooth {\n                        0% {\n                            background-position: 0% 50%;\n                        }\n                        100% {\n                            background-position: 200% 50%;\n                        }\n                    }\n\n                    @keyframes gradientBounce {\n                        0% {\n                            background-position: 0% 50%;\n                        }\n                        25% {\n                            background-position: 100% 50%;\n                        }\n                        50% {\n                            background-position: 0% 50%;\n                        }\n                        75% {\n                            background-position: 100% 50%;\n                        }\n                        100% {\n                            background-position: 0% 50%;\n                        }\n                    }\n\n                    @keyframes gradientPulse {\n                        0%, 100% {\n                            background-position: 0% 50%;\n                            filter: brightness(1);\n                        }\n                        50% {\n                            background-position: 100% 50%;\n                            filter: brightness(1.4);\n                        }\n                    }\n\n                    @keyframes gradientWave {\n                        0% {\n                            background-position: 0% 0%;\n                            background-size: 200% 200%;\n                        }\n                        25% {\n                            background-position: 100% 100%;\n                            background-size: 250% 250%;\n                        }\n                        50% {\n                            background-position: 100% 0%;\n                            background-size: 200% 200%;\n                        }\n                        75% {\n                            background-position: 0% 100%;\n                            background-size: 250% 250%;\n                        }\n                        100% {\n                            background-position: 0% 0%;\n                            background-size: 200% 200%;\n                        }\n                    }\n\n                    /* Force transparent background on all elements */\n                    .highlight-text-wrapper,\n                    .highlight-text-wrapper * {\n                        background-color: transparent !important;\n                    }\n\n                    /* Allow gradient backgrounds only on highlighted spans */\n                    .highlight-text-wrapper .gradient-text {\n                        background-color: unset !important;\n                    }\n                `}),/*#__PURE__*/_jsx(\"div\",{className:\"highlight-text-wrapper\",style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",background:\"transparent\",backgroundColor:\"transparent\"},children:/*#__PURE__*/_jsx(\"p\",{style:{margin:0,width:\"100%\",color:normalColor,fontSize:`${fontSize}px`,fontWeight,fontFamily,lineHeight,letterSpacing:`${letterSpacing}px`,textAlign,backgroundColor:\"transparent\"},children:processedContent})})]},componentKey);}/**\n * Parse text and highlight specific words from array\n */function parseAndHighlightWords(text,words,color1,color2,angle,animationEnabled,animationType,animationSpeed){if(typeof text!==\"string\"||words.length===0)return text;// Create regex pattern from words array (escape special regex characters)\nconst escapedWords=words.map(word=>word.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\"));const pattern=new RegExp(`(${escapedWords.join(\"|\")})`,\"gi\");const parts=text.split(pattern);return parts.map((part,index)=>{// Check if this part matches any highlight word (case insensitive)\nconst isHighlighted=words.some(word=>word.toLowerCase()===part.toLowerCase());if(isHighlighted){return /*#__PURE__*/_jsx(\"span\",{className:\"gradient-text\",style:{background:`linear-gradient(${angle}deg, ${color1}, ${color2}, ${color1})`,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\",display:\"inline-block\",backgroundSize:animationEnabled?\"200% 200%\":\"100% 100%\",animation:animationEnabled?`gradient${animationType.charAt(0).toUpperCase()+animationType.slice(1)} ${animationSpeed}s ease infinite`:\"none\"},children:part},index);}// Return normal text\nreturn /*#__PURE__*/_jsx(\"span\",{children:part},index);});}// Property controls for Framer\naddPropertyControls(HighlightText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Normal text highlight this more text\",displayTextArea:true},highlightWords:{type:ControlType.String,title:\"Highlight Words\",defaultValue:\"highlight, this\",description:\"Comma-separated words to highlight\",displayTextArea:true},gradientColor1:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#FF6B6B\"},gradientColor2:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#4ECDC4\"},gradientAngle:{type:ControlType.Number,title:\"Gradient Angle\",defaultValue:45,min:-360,max:360,step:1,unit:\"\\xb0\"},normalColor:{type:ControlType.Color,title:\"Normal Color\",defaultValue:\"#000000\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:8,max:200,step:1,unit:\"px\"},fontWeight:{type:ControlType.Number,title:\"Font Weight\",defaultValue:400,min:100,max:900,step:100},fontFamily:{type:ControlType.Font,title:\"Font Family\",defaultValue:\"Inter\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:1.5,min:.5,max:3,step:.1},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",defaultValue:0,min:-5,max:20,step:.5,unit:\"px\"},textAlign:{type:ControlType.Enum,title:\"Text Align\",options:[\"left\",\"center\",\"right\"],defaultValue:\"left\"},animationEnabled:{type:ControlType.Boolean,title:\"Animation\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},animationType:{type:ControlType.Enum,title:\"Animation Type\",options:[\"smooth\",\"bounce\",\"pulse\",\"wave\"],defaultValue:\"smooth\",hidden:props=>!props.animationEnabled},animationSpeed:{type:ControlType.Number,title:\"Animation Speed\",defaultValue:3,min:.5,max:10,step:.5,unit:\"s\",hidden:props=>!props.animationEnabled}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlightText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Gradient_Highlight.map"],"mappings":"mKAA6G,SAAwB,EAAc,CAAC,OAAK,uCAAuC,iBAAe,GAAG,iBAAe,UAAU,iBAAe,UAAU,gBAAc,GAAG,cAAY,UAAU,WAAS,GAAG,aAAW,IAAI,aAAW,oBAAoB,aAAW,IAAI,gBAAc,EAAE,YAAU,OAAO,mBAAiB,GAAK,gBAAc,SAAS,iBAAe,GAAG,CAEpd,IAAM,EAAiB,EAAuB,EADvB,EAAe,MAAM,IAAI,CAAC,IAAI,GAAM,EAAK,MAAM,CAAC,CAAC,OAAO,GAAM,EAAK,OAAO,EAAE,CAC/B,EAAe,EAAe,EAAc,EAAiB,EAAc,EAAe,CACxJ,EAAa,GAAG,EAAe,GAAG,EAAe,GAAG,EAAY,GAAG,IAAgB,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,WAAW,OAAO,gBAAgB,cAAc,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwEzO,CAAC,CAAc,EAAK,MAAM,CAAC,UAAU,yBAAyB,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,OAAO,WAAW,SAAS,WAAW,cAAc,gBAAgB,cAAc,CAAC,SAAsB,EAAK,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,OAAO,MAAM,EAAY,SAAS,GAAG,EAAS,IAAI,aAAW,aAAW,aAAW,cAAc,GAAG,EAAc,IAAI,YAAU,gBAAgB,cAAc,CAAC,SAAS,EAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAa,CAE5c,SAAS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