"use client"; import { useRef, type CSSProperties, type ReactNode } from "react"; type SpotlightCardProps = { children: ReactNode; className?: string; /** Colour of the light. Any CSS colour. */ color?: string; /** Size of the light on the border, in pixels. */ size?: number; /** Card fill. */ background?: string; /** Border colour where the light is not. */ border?: string; }; /* SpotlightCard: a soft light follows the pointer across the card and its border. */ export function SpotlightCard({ children, className = "", color = "#34f5c5", size = 240, background = "#0a1714", border = "#1a2a27", }: SpotlightCardProps) { const ref = useRef(null); const onMove = (e: React.PointerEvent) => { const el = ref.current; if (!el) return; const r = el.getBoundingClientRect(); el.style.setProperty("--x", `${e.clientX - r.left}px`); el.style.setProperty("--y", `${e.clientY - r.top}px`); }; return (
{children}
); }