{"version":3,"file":"EasySpotlight.DFhtVFbh.mjs","names":["React.useState","useId"],"sources":["https:/framerusercontent.com/modules/qWhjrSF5nM2w8FfnAoea/4CPXF3W8HK6ToCqowwUW/EasySpotlight.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{useId}from\"react\";import{motion,useMotionValue,animate,motionValue,useTransform,useMotionTemplate}from\"framer-motion\";// --- 🎛️ CONTROL PANEL ---\nconst CONFIG={cornerRadius:14,borderWidth:1.5,// 1. BACKGROUND SETTINGS\nspotlight:{defaultSize:400,hoverSize:1e3,blur:80,opacityDefault:.1,opacityActive:.15,colorDefault:\"#8A46FF\",colorActive:\"#8A46FF\"},// 2. BORDER SETTINGS\nborder:{defaultSize:600,hoverSize:1200,opacityDefault:.3,opacityActive:.6,colorDefault:\"#8A46FF\",colorActive:\"#8A46FF\"},// 3. LOGO SETTINGS\ncontent:{glowBlur:5,opacityDefault:.5,opacityActive:1},transition:{duration:.5,ease:\"easeOut\"}};// --- 🔌 GLOBAL WIRES ---\nconst sharedSpotlightColor=motionValue(CONFIG.spotlight.colorDefault);const sharedBorderColor=motionValue(CONFIG.border.colorDefault);const sharedSize=motionValue(CONFIG.spotlight.defaultSize);const sharedBorderSize=motionValue(CONFIG.border.defaultSize);const sharedSpotlightOpacity=motionValue(CONFIG.spotlight.opacityDefault);const sharedBorderOpacity=motionValue(CONFIG.border.opacityDefault);const sharedActiveState=motionValue(0);// --- HELPER: TRIGGER FUNCTION ---\nfunction triggerActiveState(isActive){const target=isActive?1:0;animate(sharedActiveState,target,CONFIG.transition);// Colors\nanimate(sharedSpotlightColor,isActive?CONFIG.spotlight.colorActive:CONFIG.spotlight.colorDefault,CONFIG.transition);animate(sharedBorderColor,isActive?CONFIG.border.colorActive:CONFIG.border.colorDefault,CONFIG.transition);// Sizes\nanimate(sharedSize,isActive?CONFIG.spotlight.hoverSize:CONFIG.spotlight.defaultSize,CONFIG.transition);animate(sharedBorderSize,isActive?CONFIG.border.hoverSize:CONFIG.border.defaultSize,CONFIG.transition);// Opacities\nanimate(sharedSpotlightOpacity,isActive?CONFIG.spotlight.opacityActive:CONFIG.spotlight.opacityDefault,CONFIG.transition);animate(sharedBorderOpacity,isActive?CONFIG.border.opacityActive:CONFIG.border.opacityDefault,CONFIG.transition);}// --- OVERRIDE 1: GLASS FRAME ---\nexport function withSpotlight(Component){return /*#__PURE__*/React.forwardRef((props,ref)=>{const rawMouseX=useMotionValue(0);const rawMouseY=useMotionValue(0);const blobX=useTransform(rawMouseX,x=>x);const blobY=useTransform(rawMouseY,y=>y);const[isHovered,setHovered]=React.useState(false);const gradId=useId();function handleMouseMove(event){const bounds=event.currentTarget.getBoundingClientRect();rawMouseX.set(event.clientX-bounds.left);rawMouseY.set(event.clientY-bounds.top);if(!isHovered)setHovered(true);}return /*#__PURE__*/_jsxs(Component,{...props,ref:ref,onMouseMove:e=>{props.onMouseMove?.(e);handleMouseMove(e);},onMouseLeave:e=>{props.onMouseLeave?.(e);setHovered(false);},style:{...props.style,position:props.style?.position||\"relative\",isolation:\"isolate\"},children:[/*#__PURE__*/_jsx(motion.div,{animate:{opacity:isHovered?1:0},transition:CONFIG.transition,style:{position:\"absolute\",inset:0,borderRadius:CONFIG.cornerRadius,overflow:\"hidden\",pointerEvents:\"none\",zIndex:0},children:/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:0,left:0,width:sharedSize,height:sharedSize,backgroundColor:sharedSpotlightColor,opacity:sharedSpotlightOpacity,filter:`blur(${CONFIG.spotlight.blur}px)`,mixBlendMode:\"overlay\",x:blobX,y:blobY,translateX:\"-50%\",translateY:\"-50%\"}})}),/*#__PURE__*/_jsx(motion.div,{animate:{opacity:isHovered?1:0},transition:CONFIG.transition,style:{position:\"absolute\",inset:0,pointerEvents:\"none\",zIndex:10,overflow:\"visible\"},children:/*#__PURE__*/_jsxs(\"svg\",{style:{width:\"100%\",height:\"100%\",overflow:\"visible\"},children:[/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(motion.radialGradient,{id:gradId,gradientUnits:\"userSpaceOnUse\",cx:rawMouseX,cy:rawMouseY,r:sharedBorderSize,children:[/*#__PURE__*/_jsx(motion.stop,{offset:\"0%\",stopColor:sharedBorderColor,stopOpacity:1}),/*#__PURE__*/_jsx(motion.stop,{offset:\"100%\",stopColor:sharedBorderColor,stopOpacity:0})]})}),/*#__PURE__*/_jsx(motion.rect,{width:\"100%\",height:\"100%\",x:\"0\",y:\"0\",rx:CONFIG.cornerRadius,fill:\"none\",stroke:`url(#${gradId})`,strokeWidth:CONFIG.borderWidth,style:{opacity:sharedBorderOpacity}})]})}),props.children]});});}// --- OVERRIDE 2: MAIN BUTTON TRIGGER ---\nexport function withButtonTrigger(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,onPointerEnter:e=>{triggerActiveState(true);props.onPointerEnter?.(e);},onPointerLeave:e=>{triggerActiveState(false);props.onPointerLeave?.(e);}});};}// --- OVERRIDE 3: LOGO EFFECT ---\n// FIXED: No wrapper div (Fixes alignment)\n// FIXED: Independent local opacity\nexport function withContentEffect(Component){return props=>{// LOCAL STATE: These only change when THIS specific logo is hovered\nconst localOpacity=useMotionValue(CONFIG.content.opacityDefault);const localGlowOpacity=useMotionValue(0);// Glow Filter: Linked to the global color, but visibility is controlled locally\nconst glowFilter=useMotionTemplate`drop-shadow(0px 0px ${localGlowOpacity}px ${sharedSpotlightColor})`;return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,opacity:localOpacity,filter:glowFilter,cursor:\"pointer\",zIndex:20},onPointerEnter:e=>{// 1. Trigger the Global Background Light\ntriggerActiveState(true);// 2. Trigger LOCAL Logo Brightness\nanimate(localOpacity,CONFIG.content.opacityActive,CONFIG.transition);animate(localGlowOpacity,CONFIG.content.glowBlur,CONFIG.transition);props.onPointerEnter?.(e);},onPointerLeave:e=>{// 1. Turn off Global Light\ntriggerActiveState(false);// 2. Dim LOCAL Logo\nanimate(localOpacity,CONFIG.content.opacityDefault,CONFIG.transition);animate(localGlowOpacity,0,CONFIG.transition);props.onPointerLeave?.(e);}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withButtonTrigger\":{\"type\":\"reactHoc\",\"name\":\"withButtonTrigger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSpotlight\":{\"type\":\"reactHoc\",\"name\":\"withSpotlight\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withContentEffect\":{\"type\":\"reactHoc\",\"name\":\"withContentEffect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EasySpotlight.map"],"mappings":"2NAMA,SAAS,EAAmB,EAAS,CAA2B,EAAQ,EAArB,KAA8C,EAAO,UAAU,EAClH,EAAQ,EAAqB,EAAS,EAAO,UAAU,YAAY,EAAO,UAAU,aAAa,EAAO,UAAU,EAAE,EAAQ,EAAkB,EAAS,EAAO,OAAO,YAAY,EAAO,OAAO,aAAa,EAAO,UAAU,EAC7N,EAAQ,EAAW,EAAS,EAAO,UAAU,UAAU,EAAO,UAAU,YAAY,EAAO,UAAU,EAAE,EAAQ,EAAiB,EAAS,EAAO,OAAO,UAAU,EAAO,OAAO,YAAY,EAAO,UAAU,EAC5M,EAAQ,EAAuB,EAAS,EAAO,UAAU,cAAc,EAAO,UAAU,eAAe,EAAO,UAAU,EAAE,EAAQ,EAAoB,EAAS,EAAO,OAAO,cAAc,EAAO,OAAO,eAAe,EAAO,UAAU,CAAE,CAC3O,SAAgB,EAAc,EAAU,CAAC,OAAoB,GAAkB,EAAM,IAAM,CAAC,IAAM,EAAU,EAAe,CAAC,EAAQ,EAAU,EAAe,CAAC,EAAQ,EAAM,EAAa,EAAU,GAAG,CAAC,EAAQ,EAAM,EAAa,EAAU,GAAG,CAAC,EAAO,CAAC,EAAU,GAAYA,EAAe,EAAK,EAAQ,EAAOC,EAAM,EAAE,SAAS,EAAgB,EAAM,CAAC,IAAM,EAA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