"use client"; import type { PointerEvent, ReactNode } from "react"; import "./atmosphere-card.css"; /** * Atmosphere Card * Smoked-glass link cards. Colour lives in the corners, contour currents drift * slowly underneath, and the whole field leans toward the pointer while a soft * spotlight follows it. Copy sits in a deliberately quieter pool of shade. */ export type Atmosphere = "violet" | "cyan" | "teal"; export type AtmosphereItem = { label: string; description: string; href: string; icon: ReactNode; atmosphere: Atmosphere; }; const WAVES: Record = { violet: [ "M-60 168 C 20 12, 110 236, 198 64 S 318 228, 428 48 C 488 8, 540 120, 580 86", "M-48 42 C 70 188, 168 -28, 268 132 S 412 8, 540 154", "M-36 214 C 88 96, 176 248, 274 78 S 404 236, 560 118", "M 40 -20 C 120 80, 90 160, 210 190 S 360 40, 480 210", ], cyan: [ "M-70 36 C 40 58, 150 22, 250 48 S 430 18, 560 52", "M-70 88 C 55 118, 165 72, 270 102 S 445 70, 570 108", "M-70 142 C 48 168, 160 128, 268 154 S 438 126, 565 160", "M-70 196 C 62 214, 172 178, 282 204 S 458 176, 575 212", ], teal: [ "M-50 190 C 90 10, 210 230, 360 46 S 520 200, 610 90", "M 560 206 C 390 -10, 210 240, -40 72", "M-40 118 C 130 176, 250 28, 520 148", "M 80 240 C 160 40, 300 220, 470 -10", ], }; function setPoint(e: PointerEvent) { const node = e.currentTarget; const r = node.getBoundingClientRect(); node.style.setProperty("--atm-nx", ((e.clientX - r.left) / r.width).toFixed(3)); node.style.setProperty("--atm-ny", ((e.clientY - r.top) / r.height).toFixed(3)); } function clearPoint(e: PointerEvent) { e.currentTarget.style.removeProperty("--atm-nx"); e.currentTarget.style.removeProperty("--atm-ny"); } export function AtmosphereCard({ item }: { item: AtmosphereItem }) { return ( ); } /** The hairline-gap grid the cards were designed for. */ export function AtmosphereGrid({ items }: { items: AtmosphereItem[] }) { return (
    {items.map((item) => (
  • ))}
); }