{"version":3,"file":"GlowTextSingle.doRF-bZz.mjs","names":["React.useMemo"],"sources":["https:/framerusercontent.com/modules/u3aengBiKSwDnOrbvbeH/AxLHzo7OW4gTSTtDSFmG/GlowTextSingle.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import*as React from\"react\";// Instructions: Create a text component where the text glows like in this image. The glow should originate from the text, not from the frame\nfunction fmt2(n){return String(Math.round(n*100)/100);}function parseColor(input){// Supports #RGB, #RRGGBB, #RRGGBBAA, rgb(), rgba(). Falls back to null.\nconst str=(input||\"\").trim();if(!str)return null;const hex=str.replace(/^#/,\"\");if(/^[0-9a-fA-F]{3}$/.test(hex)){const r=parseInt(hex[0]+hex[0],16);const g=parseInt(hex[1]+hex[1],16);const b=parseInt(hex[2]+hex[2],16);return{r,g,b,a:1};}if(/^[0-9a-fA-F]{6}$/.test(hex)||/^[0-9a-fA-F]{8}$/.test(hex)){const r=parseInt(hex.slice(0,2),16);const g=parseInt(hex.slice(2,4),16);const b=parseInt(hex.slice(4,6),16);const a=hex.length===8?parseInt(hex.slice(6,8),16)/255:1;return{r,g,b,a};}const m=str.match(/^rgba?\\(([^)]+)\\)$/i);if(m){const parts=m[1].split(\",\").map(p=>p.trim());if(parts.length>=3){const r=Number(parts[0]);const g=Number(parts[1]);const b=Number(parts[2]);const a=parts.length>=4?Math.max(0,Math.min(1,Number(parts[3]))):1;if([r,g,b,a].every(n=>Number.isFinite(n)))return{r,g,b,a};}}return null;}function buildGlowTextSingleShadow(params){const{disableGlow,color,opacity,blur,layers}=params;if(disableGlow)return\"none\";const layerCount=Math.max(1,Math.min(2,Math.round(layers)));const blurBase=Math.max(0,blur);const parsed=parseColor(color);const parts=[];for(let i=1;i<=layerCount;i++){const t=i/layerCount;// Softer, more airbrushed look: keep offsets subtle and push blur\nconst layerBlur=blurBase*(.8+1.65*t);const a=Math.max(0,Math.min(1,opacity*(.55-.45*t)));const directionCount=layerCount<=4||i%2===0?9:5;const effectiveA=1-Math.pow(1-a,directionCount);const rgba=parsed?`rgba(${parsed.r}, ${parsed.g}, ${parsed.b}, ${effectiveA.toFixed(3)})`:color;parts.push(`${fmt2(0)}px ${fmt2(0)}px ${fmt2(layerBlur)}px ${rgba}`);}return parts.join(\", \");}/**\n * @framerIntrinsicWidth 560\n * @framerIntrinsicHeight 120\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function GlowTextSingle(props){const{text,textColor,glowColor,glowOpacity,glowBlur,glowLayers,glowScale,textFont,align,disableGlow,style}=props;const isFixedWidth=!!style&&style.width===\"100%\";const isFixedHeight=!!style&&style.height===\"100%\";const justify=React.useMemo(()=>{return align===\"left\"?\"flex-start\":align===\"right\"?\"flex-end\":\"center\";},[align]);const containerStyle=React.useMemo(()=>{const base={...style||{},position:\"relative\",width:isFixedWidth?\"100%\":\"max-content\",height:isFixedHeight?\"100%\":\"max-content\",display:\"flex\",alignItems:\"center\",justifyContent:justify,overflow:\"visible\",background:\"transparent\"};return base;},[style,justify,isFixedWidth,isFixedHeight]);const GlowTextSingleShadow=React.useMemo(()=>{return buildGlowTextSingleShadow({disableGlow,color:glowColor,opacity:glowOpacity,blur:glowBlur,layers:glowLayers});},[disableGlow,glowColor,glowOpacity,glowBlur,glowLayers]);const sharedTextStyle=React.useMemo(()=>({...textFont,margin:0,padding:0,whiteSpace:\"pre-wrap\",textAlign:align,lineHeight:textFont?.lineHeight??\"1em\",letterSpacing:textFont?.letterSpacing??\"-0.03em\"}),[textFont,align]);const topTextStyle=React.useMemo(()=>({...sharedTextStyle,position:\"relative\",zIndex:2,color:textColor}),[sharedTextStyle,textColor]);const glowLayerStyle=React.useMemo(()=>({...sharedTextStyle,position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:justify,zIndex:1,color:glowColor,opacity:disableGlow?0:Math.max(0,Math.min(1,glowOpacity)),textShadow:GlowTextSingleShadow,filter:`blur(${Math.max(0,glowBlur*.18).toFixed(2)}px)`,mixBlendMode:\"screen\",transform:`scale(${Math.max(.5,Math.min(1.4,glowScale))})`,transformOrigin:\"center\",pointerEvents:\"none\",userSelect:\"none\"}),[sharedTextStyle,justify,glowColor,glowOpacity,GlowTextSingleShadow,glowScale,disableGlow,glowBlur]);return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,\"aria-label\":text,role:\"text\",children:[/*#__PURE__*/_jsx(\"div\",{style:glowLayerStyle,children:/*#__PURE__*/_jsx(\"span\",{style:{width:isFixedWidth?\"100%\":\"max-content\"},children:text})}),/*#__PURE__*/_jsx(\"span\",{style:{...topTextStyle,width:isFixedWidth?\"100%\":\"max-content\"},children:text})]});}addPropertyControls(GlowTextSingle,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"농축하게 다루다\",displayTextArea:true},textFont:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"72px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"},glowColor:{type:ControlType.Color,title:\"Glow\",defaultValue:\"#FFB38A\"},disableGlow:{type:ControlType.Boolean,title:\"Glow\",defaultValue:false,enabledTitle:\"Off\",disabledTitle:\"On\"},glowOpacity:{type:ControlType.Number,title:\"Glow Opacity\",defaultValue:.55,min:0,max:1,step:.01,hidden:({disableGlow})=>disableGlow},glowBlur:{type:ControlType.Number,title:\"Glow Blur\",defaultValue:44,min:0,max:200,step:1,unit:\"px\",hidden:({disableGlow})=>disableGlow},glowLayers:{type:ControlType.Number,title:\"Glow Layers\",defaultValue:2,min:1,max:2,step:1,hidden:({disableGlow})=>disableGlow},glowScale:{type:ControlType.Number,title:\"Glow Scale\",defaultValue:1.02,min:.5,max:1.4,step:.01,hidden:({disableGlow})=>disableGlow}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GlowTextSingle\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"560\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"120\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GlowTextSingle.map"],"mappings":"iLACA,SAAS,EAAK,EAAE,CAAC,OAAO,OAAO,KAAK,MAAM,EAAE,GAAG,EAAE,GAAG,CAAE,CAAC,SAAS,EAAW,EAAM,CACjF,IAAM,GAAK,GAAO,GAAA,CAAI,KAAK,EAAE,GAAG,CAAC,EAAI,OAAO,KAAK,IAAM,EAAI,EAAI,QAAQ,KAAK,EAAE,EAAE,GAAG,mBAAmB,KAAK,CAAG,EAA4G,MAAM,CAAC,EAAxG,SAAS,EAAI,GAAG,EAAI,GAAG,EAAiF,EAAE,EAAvE,SAAS,EAAI,GAAG,EAAI,GAAG,EAAgD,EAAE,EAAtC,SAAS,EAAI,GAAG,EAAI,GAAG,EAAe,EAAE,EAAE,CAAC,EAAG,GAAG,mBAAmB,KAAK,CAAG,GAAG,mBAAmB,KAAK,CAAG,EAAwK,MAAM,CAAC,EAApK,SAAS,EAAI,MAAM,EAAE,CAAC,EAAE,EAA4I,EAAE,EAAlI,SAAS,EAAI,MAAM,EAAE,CAAC,EAAE,EAA0G,EAAE,EAAhG,SAAS,EAAI,MAAM,EAAE,CAAC,EAAE,EAAwE,EAAE,EAA9D,EAAI,SAAS,EAAE,SAAS,EAAI,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,CAAgB,EAAG,IAAM,EAAE,EAAI,MAAM,qBAAqB,EAAE,GAAG,EAAE,CAAC,IAAM,EAAM,EAAE,EAAE,CAAC,MAAM,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