{"version":3,"file":"NovaGlowButton.BF2fviDR.mjs","names":["useState","useRef","_Fragment","__esmMin","_e","de","init_npm_react_18_3_1","ce","c","init_jsx_runtime","p","l","useIsStaticRenderer","init_framer_CKT6jEEQ","addPropertyControls","ControlType","NovaGlowButton","props","isHovered","setIsHovered","rootRef","audioRef","hasPlayedRef","isStaticRenderer","element","frame","rotation","lastTime","animate","delta","time","speed","audioSrc","audio","audioVolume","handleMouseEnter","audioPlayOnce","err","handleMouseLeave","content","borderSize","accentThree","accentOne","accentTwo","glowOpacity","glowBlur","borderRadius","shine","text","sharedStyle","style","borderColor","backgroundColor","textColor","font","hoverScale","hoverTransition","link","openInNewTab","init_NovaGlowButton"],"sources":["https:/framerusercontent.com/modules/ohesDjfIVFlk4WHs3glH/Jw0OoqJZri93HZBKFIaL/NovaGlowButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useRef,useState}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 220\n * @framerIntrinsicHeight 56\n */export default function NovaGlowButton(props){const{text=\"Explore now\",link,openInNewTab=false,backgroundColor=\"#070711\",textColor=\"#FFFFFF\",borderColor=\"rgba(255,255,255,0.14)\",accentOne=\"#9C43FE\",accentTwo=\"#4CC2E9\",accentThree=\"#111499\",glowOpacity=.9,glowBlur=18,borderSize=2,borderRadius=\"999px\",font,padding=\"0px 28px\",speed=5,hoverScale=1.02,hoverTransition,shine=true,audioSrc,audioVolume=.6,audioPlayOnce=false,style}=props;const[isHovered,setIsHovered]=useState(false);const rootRef=useRef(null);const audioRef=useRef(null);const hasPlayedRef=useRef(false);const isStaticRenderer=useIsStaticRenderer();useEffect(()=>{const element=rootRef.current;if(!element)return;if(isStaticRenderer){element.style.setProperty(\"--nova-glow-rotation\",\"42deg\");return;}let frame=0;let rotation=0;let lastTime=performance.now();const animate=time=>{const delta=(time-lastTime)/1e3;lastTime=time;rotation=(rotation+delta*speed*24)%360;element.style.setProperty(\"--nova-glow-rotation\",`${rotation}deg`);frame=requestAnimationFrame(animate);};frame=requestAnimationFrame(animate);return()=>cancelAnimationFrame(frame);},[speed,isStaticRenderer]);// Set up / update the audio element whenever the source changes.\nuseEffect(()=>{if(isStaticRenderer||!audioSrc){audioRef.current=null;return;}const audio=new Audio(audioSrc);audio.preload=\"auto\";audio.volume=Math.min(1,Math.max(0,audioVolume));audioRef.current=audio;hasPlayedRef.current=false;return()=>{audio.pause();audioRef.current=null;};// eslint-disable-next-line react-hooks/exhaustive-deps\n},[audioSrc,isStaticRenderer]);// Keep volume in sync without re-creating the audio element.\nuseEffect(()=>{if(audioRef.current){audioRef.current.volume=Math.min(1,Math.max(0,audioVolume));}},[audioVolume]);const handleMouseEnter=()=>{setIsHovered(true);const audio=audioRef.current;if(!audio)return;if(audioPlayOnce&&hasPlayedRef.current)return;audio.currentTime=0;audio.play().catch(err=>{// Most browsers require a real click/keypress (\"user activation\")\n// before they'll allow audio with sound to play None a hover alone\n// may not qualify, especially before any click has happened on\n// the page. If you see a NotAllowedError here, that's why.\nconsole.warn(\"NovaGlowButton: hover sound blocked:\",err);});hasPlayedRef.current=true;};const handleMouseLeave=()=>{setIsHovered(false);};const content=/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,borderRadius,padding:borderSize,background:`conic-gradient(from var(--nova-glow-rotation, 0deg), ${accentThree} 0deg, ${accentOne} 70deg, ${accentTwo} 135deg, transparent 190deg, ${accentThree} 260deg, ${accentOne} 360deg)`,opacity:isHovered?1:glowOpacity,WebkitMask:\"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)\",WebkitMaskComposite:\"xor\",maskComposite:\"exclude\",pointerEvents:\"none\",transition:\"opacity 220ms ease\",zIndex:1}}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:-glowBlur,borderRadius:`calc(${borderRadius} + ${glowBlur}px)`,background:`conic-gradient(from var(--nova-glow-rotation, 0deg), transparent 0deg, ${accentOne} 72deg, ${accentTwo} 135deg, transparent 210deg, ${accentThree} 290deg, transparent 360deg)`,opacity:isHovered?glowOpacity:glowOpacity*.55,filter:`blur(${glowBlur}px)`,pointerEvents:\"none\",transition:\"opacity 220ms ease, filter 220ms ease\",zIndex:0}}),shine&&/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:borderSize,borderRadius:`calc(${borderRadius} - ${borderSize}px)`,background:\"linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.03) 35%, rgba(255,255,255,0.13) 50%, rgba(255,255,255,0.03) 65%, transparent 100%)\",transform:isHovered?\"translateX(38%)\":\"translateX(-38%)\",opacity:isHovered?1:.45,pointerEvents:\"none\",transition:\"transform 650ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease\",zIndex:2}}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",zIndex:3,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",whiteSpace:\"nowrap\"},children:text})]});const sharedStyle={...style,width:\"100%\",height:\"100%\",minWidth:120,minHeight:36,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",isolation:\"isolate\",cursor:\"pointer\",border:`1px solid ${borderColor}`,borderRadius,background:backgroundColor,color:textColor,...font,lineHeight:1,padding,textDecoration:\"none\",userSelect:\"none\",WebkitTapHighlightColor:\"transparent\",WebkitAppearance:\"none\",appearance:\"none\",outline:\"none\",// Safari fix: clip filtered glow layers to rounded shape (prevents a visible square around the button)\nWebkitClipPath:`inset(0 round ${borderRadius})`,clipPath:`inset(0 round ${borderRadius})`,boxShadow:isHovered?`0 0 ${Math.round(glowBlur*1.25)}px rgba(124, 92, 255, 0.32), inset 0 1px 0 rgba(255,255,255,0.12)`:`0 0 ${Math.round(glowBlur*.55)}px rgba(124, 92, 255, 0.16), inset 0 1px 0 rgba(255,255,255,0.08)`,transform:isHovered?`translateY(-1px) scale(${hoverScale})`:\"none\",transition:`transform ${hoverTransition?.duration||.22}s ${hoverTransition?.ease||\"ease\"}, box-shadow 220ms ease, border-color 220ms ease`};if(link){return /*#__PURE__*/_jsx(\"a\",{ref:rootRef,href:link,target:openInNewTab?\"_blank\":undefined,rel:openInNewTab?\"noopener noreferrer\":undefined,style:sharedStyle,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:content});}return /*#__PURE__*/_jsx(\"button\",{ref:rootRef,type:\"button\",style:sharedStyle,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:content});}addPropertyControls(NovaGlowButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Explore now\"},link:{type:ControlType.Link,title:\"Link\"},openInNewTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#070711\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#FFFFFF\"},borderColor:{type:ControlType.Color,title:\"Base Border\",defaultValue:\"rgba(255,255,255,0.14)\"},accentOne:{type:ControlType.Color,title:\"Accent 1\",defaultValue:\"#9C43FE\"},accentTwo:{type:ControlType.Color,title:\"Accent 2\",defaultValue:\"#4CC2E9\"},accentThree:{type:ControlType.Color,title:\"Accent 3\",defaultValue:\"#111499\"},glowOpacity:{type:ControlType.Number,title:\"Glow Opacity\",defaultValue:.9,min:0,max:1,step:.05},glowBlur:{type:ControlType.Number,title:\"Glow Blur\",defaultValue:18,min:0,max:60,step:1,unit:\"px\"},borderSize:{type:ControlType.Number,title:\"Glow Edge\",defaultValue:2,min:1,max:8,step:1,unit:\"px\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"999px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Semibold\"}},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"0px 28px\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:5,min:0,max:16,step:.5},hoverScale:{type:ControlType.Number,title:\"Hover Scale\",defaultValue:1.02,min:1,max:1.08,step:.01},shine:{type:ControlType.Boolean,title:\"Shine\",description:\"Built by Matthias \\xd6lschlegel 💪\\n[Explore more components](https://framer.link/fsd2pgh)\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},audioSrc:{type:ControlType.File,title:\"Hover Sound\",allowedFileTypes:[\"mp3\",\"wav\",\"ogg\"]},audioVolume:{type:ControlType.Number,title:\"Volume\",defaultValue:.6,min:0,max:1,step:.05,hidden:props=>!props.audioSrc},audioPlayOnce:{type:ControlType.Boolean,title:\"Play Once\",description:\"Only play the first time it's hovered per page load\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\",hidden:props=>!props.audioSrc}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NovaGlowButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"220\",\"framerIntrinsicHeight\":\"56\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NovaGlowButton.map"],"mappings":"A,8MAKG,SAAwBgB,EAAe,EAAM,CAAC,GAAK,CAAC,OAAK,cAAc,OAAK,eAAa,GAAM,kBAAgB,UAAU,YAAU,UAAU,cAAY,yBAAyB,YAAU,UAAU,YAAU,UAAU,cAAY,UAAU,cAAY,GAAG,WAAS,GAAG,aAAW,EAAE,eAAa,QAAQ,OAAK,UAAQ,WAAW,QAAM,EAAE,aAAW,KAAK,kBAAgB,QAAM,GAAK,WAAS,cAAY,GAAG,gBAAc,GA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