import React, { useRef, useState } from 'react'; export const SpotlightCard = ({ children, className = "", spotlightColor = "rgba(255, 255, 255, 0.25)", rounded = "rounded-3xl" }) => { const divRef = useRef(null); const [position, setPosition] = useState({ x: 0, y: 0 }); const [opacity, setOpacity] = useState(0); const handleMouseMove = (e) => { if (!divRef.current) return; const div = divRef.current; const rect = div.getBoundingClientRect(); setPosition({ x: e.clientX - rect.left, y: e.clientY - rect.top }); }; const handleFocus = () => { setOpacity(1); }; const handleBlur = () => { setOpacity(0); }; const handleMouseEnter = () => { setOpacity(1); }; const handleMouseLeave = () => { setOpacity(0); }; // Calculate inner rounding based on outer rounding // If rounded-3xl (24px), inner should be ~22px // If rounded-none (0px), inner should be 0px const innerRounded = rounded === "rounded-none" ? "rounded-none" : "rounded-[22px]"; return (
{/* Rainbow Glow Layer - Background: Full conic RGB rainbow (Works on both, provides the color) - Mask reveals transparency */}
{/* Inner Mask (Content Container) - Light Mode: bg-white/90 (Opaque white with slight blur) - Dark Mode: bg-zinc-950/90 */}
{/* Surface Shine (Subtle top sheen) */}
{/* Light Mode Border (to separate card when not glowing) */}
{/* Content */}
{children}
); };