{"version":3,"file":"MeshGradientText.nGebD2vs.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/7Wh32UenZT2ZfaN0uspi/Ix7IHNiqQIo11YwykXgB/MeshGradientText.js"],"sourcesContent":["// Text with customizable mesh gradient fill (4-corner gradient) and font controls\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function MeshGradientText(props){const{text,mode,topLeft,topRight,bottomLeft,bottomRight,shimmerSpeed,font,tag=\"span\"}=props;const gradientId=useMemo(()=>`mesh-gradient-${Math.random().toString(36).substr(2,9)}`,[]);const isFixedWidth=props.style?.width===\"100%\";const Component=tag;const shimmerGradient=`\n        radial-gradient(circle at 0% 0%, ${topLeft} 0%, transparent 50%),\n        radial-gradient(circle at 100% 0%, ${topRight} 0%, transparent 50%),\n        radial-gradient(circle at 0% 100%, ${bottomLeft} 0%, transparent 50%),\n        radial-gradient(circle at 100% 100%, ${bottomRight} 0%, transparent 50%),\n        linear-gradient(135deg, ${topLeft}, ${topRight}, ${bottomRight}, ${bottomLeft})\n    `;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"inline-block\",width:isFixedWidth?\"100%\":\"max-content\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                    @keyframes shimmer-${gradientId} {\n                        0%, 100% {\n                            opacity: 0;\n                        }\n                        50% {\n                            opacity: 1;\n                        }\n                    }\n                `}),mode===\"gradient\"&&/*#__PURE__*/_jsx(\"svg\",{width:\"0\",height:\"0\",style:{position:\"absolute\"},children:/*#__PURE__*/_jsxs(\"defs\",{children:[/*#__PURE__*/_jsxs(\"linearGradient\",{id:`${gradientId}-horizontal-top`,x1:\"0%\",y1:\"0%\",x2:\"100%\",y2:\"0%\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:topLeft}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:topRight})]}),/*#__PURE__*/_jsxs(\"linearGradient\",{id:`${gradientId}-horizontal-bottom`,x1:\"0%\",y1:\"0%\",x2:\"100%\",y2:\"0%\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:bottomLeft}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:bottomRight})]}),/*#__PURE__*/_jsxs(\"linearGradient\",{id:`${gradientId}-mesh`,x1:\"0%\",y1:\"0%\",x2:\"0%\",y2:\"100%\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:\"url(#mesh-gradient-horizontal-top)\"}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:\"url(#mesh-gradient-horizontal-bottom)\"})]}),/*#__PURE__*/_jsxs(\"radialGradient\",{id:gradientId,children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",style:{stopColor:topLeft}}),/*#__PURE__*/_jsx(\"stop\",{offset:\"33%\",style:{stopColor:topRight}}),/*#__PURE__*/_jsx(\"stop\",{offset:\"66%\",style:{stopColor:bottomLeft}}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",style:{stopColor:bottomRight}})]})]})}),/*#__PURE__*/_jsxs(Component,{style:{...font,margin:0,...mode===\"gradient\"?{background:shimmerGradient,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\"}:{color:\"#000000\",position:\"relative\"},display:\"inline-block\",width:isFixedWidth?\"100%\":\"max-content\",whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",overflowWrap:\"break-word\"},children:[text,mode===\"shimmer\"&&/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,background:shimmerGradient,WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\",animation:`shimmer-${gradientId} ${shimmerSpeed}s ease-in-out infinite`,pointerEvents:\"none\"},children:text})]})]});}addPropertyControls(MeshGradientText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Mesh Gradient\",displayTextArea:true},mode:{type:ControlType.Enum,title:\"Mode\",options:[\"gradient\",\"shimmer\"],optionTitles:[\"Gradient\",\"Shimmer\"],defaultValue:\"gradient\",displaySegmentedControl:true},tag:{type:ControlType.Enum,title:\"HTML Tag\",options:[\"span\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\"],optionTitles:[\"Span\",\"H1\",\"H2\",\"H3\",\"H4\",\"H5\",\"H6\",\"P\"],defaultValue:\"span\",displaySegmentedControl:false},topLeft:{type:ControlType.Color,title:\"Top Left\",defaultValue:\"#FF5588\"},topRight:{type:ControlType.Color,title:\"Top Right\",defaultValue:\"#8855FF\"},bottomLeft:{type:ControlType.Color,title:\"Bottom Left\",defaultValue:\"#FFBB00\"},bottomRight:{type:ControlType.Color,title:\"Bottom Right\",defaultValue:\"#0099FF\"},shimmerSpeed:{type:ControlType.Number,title:\"Shimmer Speed\",defaultValue:3,min:1,max:10,step:.5,unit:\"s\",hidden:props=>props.mode!==\"shimmer\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MeshGradientText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MeshGradientText.map"],"mappings":"iLAIG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,UAAQ,WAAS,aAAW,cAAY,eAAa,OAAK,MAAI,QAAQ,EAAY,EAAWA,MAAY,iBAAiB,KAAK,QAAQ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