{"version":3,"file":"GlassyButton.BOyuUSGL.mjs","names":["useState","useCallback","x","y","useMemo","startTransition"],"sources":["https:/framerusercontent.com/modules/P8le6NN5SmbMNhVMirGY/ZHS5PoLNnXedYPOXajme/GlassyButton.js"],"sourcesContent":["// GlassyButton: A glassmorphic button with animated highlight/reflection, hover effect, and configurable light direction\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useMemo,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * GlassyButton\n *\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 48\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function GlassyButton(props){const{label,background,textColor,borderRadius,blur,lightDirection,font,style,link,shadowHoverColor=\"#0000002D\",shadowHoverIntensity=1}=props;const isStatic=useIsStaticRenderer();const[hovered,setHovered]=useState(false);const[mouse,setMouse]=useState({x:.5,y:.5});// Light direction mapping to gradient angles and highlight positions\nconst lightMap={\"top-left\":{angle:135,x:\"10%\",y:\"10%\"},\"top\":{angle:180,x:\"50%\",y:\"8%\"},\"top-right\":{angle:225,x:\"90%\",y:\"10%\"},\"right\":{angle:270,x:\"92%\",y:\"50%\"},\"bottom-right\":{angle:315,x:\"90%\",y:\"90%\"},\"bottom\":{angle:0,x:\"50%\",y:\"92%\"},\"bottom-left\":{angle:45,x:\"10%\",y:\"90%\"},\"left\":{angle:90,x:\"8%\",y:\"50%\"}};const{angle,x,y}=lightMap[lightDirection];// Mouse move handler for light following\nconst handleMouseMove=useCallback(e=>{const rect=e.currentTarget.getBoundingClientRect();// Use pageX/pageY for better accuracy in Framer canvas\nlet clientX,clientY;if(e.touches&&e.touches.length>0){clientX=e.touches[0].clientX;clientY=e.touches[0].clientY;}else{clientX=e.clientX;clientY=e.clientY;}// Calculate mouse position relative to center for light direction\nconst x=(clientX-rect.left)/rect.width;const y=(clientY-rect.top)/rect.height;startTransition(()=>setMouse({x:Math.max(0,Math.min(1,x)),y:Math.max(0,Math.min(1,y))}));},[]);// Highlight and reflection styles\nconst highlightStyle=useMemo(()=>{// Parallax offset for highlight\n// Light follows mouse: direction is from center to mouse\nconst dx=mouse.x-.5;const dy=mouse.y-.5;const offsetX=dx*(hovered?28:16);const offsetY=dy*(hovered?28:16);return{position:\"absolute\",left:`calc(${x} + ${offsetX}px)`,top:`calc(${y} + ${offsetY+(hovered?-4:0)}px)`,width:hovered?\"74%\":\"60%\",height:hovered?\"42%\":\"30%\",background:hovered?\"linear-gradient(120deg, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.02) 100%)\":\"linear-gradient(120deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.01) 100%)\",borderRadius:\"50%\",filter:`blur(${hovered?22:14}px)`,opacity:hovered?.82:.5,pointerEvents:\"none\",transform:`translate(-50%, -50%) scale(${hovered?1.13:1})`+(hovered?\" translateY(-2.5px)\":\"\"),transition:\"all 0.32s cubic-bezier(.4,0,.2,1)\",zIndex:2};},[x,y,hovered,mouse]);const reflectionStyle=useMemo(()=>{// Parallax offset for reflection\n// Reflection follows mouse, but with smaller offset\nconst dx=mouse.x-.5;const dy=mouse.y-.5;const offsetX=dx*(hovered?16:8);const offsetY=dy*(hovered?16:8);return{position:\"absolute\",left:`calc(${x} + ${offsetX}px)`,top:`calc(${y} + ${offsetY}px)`,width:hovered?\"38%\":\"30%\",height:hovered?\"18%\":\"14%\",background:\"linear-gradient(120deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.01) 100%)\",borderRadius:\"50%\",filter:`blur(${hovered?10:7}px)`,opacity:hovered?.45:.28,pointerEvents:\"none\",transform:`translate(-50%, -50%) scale(${hovered?1.12:1})`+(hovered?\" translateY(-1px)\":\"\"),transition:\"all 0.32s cubic-bezier(.4,0,.2,1)\",zIndex:1};},[x,y,hovered,mouse]);// Glassy background style\nconst glassStyle=useMemo(()=>({position:\"relative\",width:\"100%\",height:\"100%\",borderRadius,background:`linear-gradient(${angle}deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.01) 100%), ${hovered?props.hoverBackground:background}`,boxShadow:hovered?`0 18px ${48*shadowHoverIntensity}px 0 ${shadowHoverColor}, 0 6px 24px 0 rgba(0,0,0,0.12)`:\"0 6px 18px 0 rgba(0,0,0,0.10)\",backdropFilter:`blur(${blur}px) saturate(1.2)`,WebkitBackdropFilter:`blur(${blur}px) saturate(1.2)`,border:\"1px solid rgba(0,0,0,0.12)\",boxSizing:\"border-box\",overflow:\"hidden\",cursor:\"pointer\",transition:\"box-shadow 0.32s cubic-bezier(.4,0,.2,1), background 0.32s cubic-bezier(.4,0,.2,1), transform 0.32s cubic-bezier(.4,0,.2,1)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transform:hovered?\"translateY(-11px) scale(1.08)\":\"none\",...style}),[angle,background,borderRadius,blur,hovered,style,props.hoverBackground,shadowHoverColor,shadowHoverIntensity]);// Text style\nconst textStyle=useMemo(()=>({color:textColor,zIndex:3,userSelect:\"none\",...font,fontWeight:font?.variant===\"Bold\"?700:undefined,fontSize:font?.fontSize,letterSpacing:font?.letterSpacing,lineHeight:font?.lineHeight,textAlign:font?.textAlign,fontStyle:font?.fontStyle,fontFamily:font?.fontFamily,minWidth:\"max-content\",width:\"max-content\",pointerEvents:\"none\",transition:\"color 0.22s cubic-bezier(.4,0,.2,1)\"}),[textColor,font]);// Accessibility: role=button, tabIndex=0\nconst content=/*#__PURE__*/_jsxs(\"div\",{style:glassStyle,role:\"button\",tabIndex:0,\"aria-label\":label,onMouseEnter:isStatic?undefined:()=>startTransition(()=>setHovered(true)),onMouseLeave:isStatic?undefined:e=>{startTransition(()=>setMouse({x:.5,y:.5}));startTransition(()=>setHovered(false));},onFocus:isStatic?undefined:()=>startTransition(()=>setHovered(true)),onBlur:isStatic?undefined:()=>startTransition(()=>setHovered(false)),onMouseMove:isStatic?undefined:handleMouseMove,onTouchMove:isStatic?undefined:handleMouseMove,children:[/*#__PURE__*/_jsx(\"div\",{style:highlightStyle}),/*#__PURE__*/_jsx(\"div\",{style:reflectionStyle}),/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:label}),/*#__PURE__*/_jsx(\"div\",{style:{pointerEvents:\"none\",position:\"absolute\",inset:0,borderRadius,border:\"1px solid rgba(0,0,0,0.08)\",boxShadow:\"inset 0 1px 8px 0 rgba(0,0,0,0.04), 0 1px 8px 0 rgba(0,0,0,0.06)\",zIndex:4}})]});return link?/*#__PURE__*/_jsx(\"a\",{href:link,style:{display:\"block\",width:\"100%\",height:\"100%\",textDecoration:\"none\"},tabIndex:-1,\"aria-label\":label,children:content}):content;}addPropertyControls(GlassyButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Glassy Button\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#F5F5F5CC\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:16,min:0,max:48},blur:{type:ControlType.Number,title:\"Blur\",defaultValue:18,min:4,max:32,step:1},lightDirection:{type:ControlType.Enum,title:\"Light Dir\",options:[\"top-left\",\"top\",\"top-right\",\"right\",\"bottom-right\",\"bottom\",\"bottom-left\",\"left\"],optionTitles:[\"Top Left\",\"Top\",\"Top Right\",\"Right\",\"Bottom Right\",\"Bottom\",\"Bottom Left\",\"Left\"],defaultValue:\"top-left\",displaySegmentedControl:false},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Bold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\",textAlign:\"center\"}},link:{type:ControlType.Link,title:\"Button Link\",defaultValue:\"\"},// --- Hover group ---\nhoverBackground:{type:ControlType.Color,title:\"Hover BG\",defaultValue:\"#E8E8E8DD\"},shadowHoverColor:{type:ControlType.Color,title:\"Hover Shadow\",defaultValue:\"#0000002D\"},shadowHoverIntensity:{type:ControlType.Number,title:\"Shadow Intensity\",defaultValue:1,min:.5,max:2.5,step:.05}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GlassyButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"48\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"160\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GlassyButton.map"],"mappings":"8MASG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,aAAW,YAAU,eAAa,OAAK,iBAAe,OAAK,QAAM,OAAK,mBAAiB,YAAY,uBAAqB,GAAG,EAAY,EAAS,GAAqB,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAAM,CAAC,EAAM,GAAUA,EAAS,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CACY,CAAC,QAAM,IAAE,KAA5T,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,IAAM,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAQ,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,OAAS,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,KAAO,CAAC,MAAM,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAA2B,GACjV,EAAgBC,EAAY,GAAG,CAAC,IAAM,EAAK,EAAE,cAAc,uBAAuB,CACpF,EAAQ,EAAW,EAAE,SAAS,EAAE,QAAQ,OAAO,GAAG,EAAQ,EAAE,QAAQ,GAAG,QAAQ,EAAQ,EAAE,QA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