{"version":3,"file":"MagneticGlowButton.DkEXJSX9.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/GU0ZzbLdpwkCcjviVCOQ/kCqNQ0QQkPILvOFMUkFb/MagneticGlowButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useState}from\"react\";import{motion,useMotionValue,useMotionTemplate}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function MagneticGlowButton(props){const buttonRef=useRef(null);const[isHovered,setIsHovered]=useState(false);const mouseX=useMotionValue(0);const mouseY=useMotionValue(0);function handlePointerMove(e){if(!buttonRef.current)return;const rect=buttonRef.current.getBoundingClientRect();mouseX.set(e.clientX-rect.left);mouseY.set(e.clientY-rect.top);}const buttonContent=/*#__PURE__*/_jsxs(motion.div,{ref:buttonRef,whileHover:{scale:1.02},whileTap:{scale:.98},onPointerMove:handlePointerMove,onPointerEnter:()=>setIsHovered(true),onPointerLeave:()=>setIsHovered(false),style:{position:\"relative\",padding:props.borderWidth,borderRadius:props.radius,overflow:\"hidden\",cursor:\"pointer\",width:\"max-content\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",boxShadow:props.showOuterGlow?`${props.glowOffsetX}px ${props.glowOffsetY}px ${props.glowBlur}px ${props.glowSpread}px ${props.outerGlowColor}`:\"none\"},transition:{type:\"spring\",stiffness:400,damping:25},children:[props.animationStyle===\"spin\"&&/*#__PURE__*/_jsx(motion.div,{animate:{rotate:360},transition:{repeat:Infinity,duration:props.spinSpeed,ease:\"linear\"},style:{position:\"absolute\",left:\"50%\",top:\"50%\",x:\"-50%\",y:\"-50%\",width:2e3,height:2e3,background:`conic-gradient(from 0deg, transparent 0%, ${props.glowColor} 20%, transparent 50%)`,zIndex:0}}),props.animationStyle===\"spotlight\"&&/*#__PURE__*/_jsx(motion.div,{animate:{opacity:isHovered?1:0},transition:{duration:.3},style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,background:useMotionTemplate`radial-gradient(${props.spotlightSize}px circle at ${mouseX}px ${mouseY}px, ${props.glowColor}, transparent 100%)`,zIndex:0}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",zIndex:1,background:props.enableGlass?props.glassColor:props.innerColor,backdropFilter:props.enableGlass?`blur(${props.blurAmount}px)`:\"none\",WebkitBackdropFilter:props.enableGlass?`blur(${props.blurAmount}px)`:\"none\",borderRadius:props.radius-props.borderWidth,padding:`${props.paddingY}px ${props.paddingX}px`,display:\"flex\",alignItems:\"center\"},children:/*#__PURE__*/_jsx(\"span\",{style:{...props.font,color:props.textColor,whiteSpace:\"nowrap\"},children:props.text})})]});// If a link is provided, wrap in an anchor tag\nif(props.link){return /*#__PURE__*/_jsx(\"a\",{href:props.link,target:props.openInNewTab?\"_blank\":\"_self\",rel:props.openInNewTab?\"noopener noreferrer\":undefined,style:{textDecoration:\"none\",display:\"inline-block\"},children:buttonContent});}// No link — render as-is\nreturn buttonContent;}MagneticGlowButton.defaultProps={text:\"Interactive Glow\",glowColor:\"#00F0FF\",link:\"\",openInNewTab:false,animationStyle:\"spotlight\",spinSpeed:3,spotlightSize:150,innerColor:\"#0D0D0D\",enableGlass:false,glassColor:\"rgba(13, 13, 13, 0.4)\",blurAmount:24,showOuterGlow:true,outerGlowColor:\"rgba(0, 240, 255, 0.25)\",glowOffsetX:0,glowOffsetY:15,glowBlur:35,glowSpread:0,textColor:\"#FFFFFF\",borderWidth:1.5,radius:100,paddingX:32,paddingY:16,font:{fontFamily:\"Inter, sans-serif\",fontSize:16,fontWeight:500,letterSpacing:0,lineHeight:\"1.5em\",textAlign:\"center\"}};addPropertyControls(MagneticGlowButton,{text:{type:ControlType.String,title:\"Text\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Typography\"},textColor:{type:ControlType.Color,title:\"Text Color\"},// ── LINK (new) ──\nlink:{type:ControlType.Link,title:\"Link\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false},// Inner Button Styling\nenableGlass:{type:ControlType.Boolean,title:\"Use Glass\"},innerColor:{type:ControlType.Color,title:\"Solid Fill\",hidden(props){return props.enableGlass===true;}},glassColor:{type:ControlType.Color,title:\"Glass Fill\",hidden(props){return props.enableGlass===false;}},blurAmount:{type:ControlType.Number,title:\"Glass Blur\",min:0,max:100,hidden(props){return props.enableGlass===false;}},animationStyle:{type:ControlType.Enum,title:\"Anim Style\",options:[\"spin\",\"spotlight\"],optionTitles:[\"Auto Spin\",\"Follow Cursor\"]},glowColor:{type:ControlType.Color,title:\"Border Glow\"},spinSpeed:{type:ControlType.Number,title:\"Spin Speed\",min:.5,max:10,step:.1,hidden(props){return props.animationStyle===\"spotlight\";}},spotlightSize:{type:ControlType.Number,title:\"Light Size\",min:50,max:500,step:10,hidden(props){return props.animationStyle===\"spin\";}},borderWidth:{type:ControlType.Number,title:\"Border Width\",min:1,max:10,step:.5},showOuterGlow:{type:ControlType.Boolean,title:\"Outer Glow\"},outerGlowColor:{type:ControlType.Color,title:\"Shadow Color\",hidden(props){return props.showOuterGlow===false;}},glowOffsetX:{type:ControlType.Number,title:\"Offset X\",min:-50,max:50,hidden(props){return props.showOuterGlow===false;}},glowOffsetY:{type:ControlType.Number,title:\"Offset Y\",min:-50,max:50,hidden(props){return props.showOuterGlow===false;}},glowBlur:{type:ControlType.Number,title:\"Blur\",min:0,max:100,hidden(props){return props.showOuterGlow===false;}},glowSpread:{type:ControlType.Number,title:\"Spread\",min:-50,max:50,hidden(props){return props.showOuterGlow===false;}},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:100},paddingX:{type:ControlType.Number,title:\"Pad X\",min:0,max:100},paddingY:{type:ControlType.Number,title:\"Pad Y\",min:0,max:100}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MagneticGlowButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MagneticGlowButton.map"],"mappings":"uPAAm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