{"version":3,"file":"GlowTextSingle.DwlyFASf.mjs","names":["p","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,IAAI,CAAC,IAAI,CAAE,SAAS,EAAW,EAAM,CACjF,IAAM,GAAK,GAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAI,OAAO,KAAK,IAAM,EAAI,EAAI,QAAQ,KAAK,GAAG,CAAC,GAAG,mBAAmB,KAAK,EAAI,CAA2G,MAAM,CAAC,EAAxG,SAAS,EAAI,GAAG,EAAI,GAAG,GAAG,CAAgF,EAAvE,SAAS,EAAI,GAAG,EAAI,GAAG,GAAG,CAA+C,EAAtC,SAAS,EAAI,GAAG,EAAI,GAAG,GAAG,CAAc,EAAE,EAAE,CAAE,GAAG,mBAAmB,KAAK,EAAI,EAAE,mBAAmB,KAAK,EAAI,CAAuK,MAAM,CAAC,EAApK,SAAS,EAAI,MAAM,EAAE,EAAE,CAAC,GAAG,CAA2I,EAAlI,SAAS,EAAI,MAAM,EAAE,EAAE,CAAC,GAAG,CAAyG,EAAhG,SAAS,EAAI,MAAM,EAAE,EAAE,CAAC,GAAG,CAAuE,EAA9D,EAAI,SAAS,EAAE,SAAS,EAAI,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAiB,CAAE,IAAM,EAAE,EAAI,MAAM,sBAAsB,CAAC,GAAG,EAAE,CAAC,IAAM,EAAM,EAAE,GAAG,MAAM,IAAI,CAAC,IAA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