{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"flashy-card","type":"registry:ui","title":"Flashy Card","description":"A card with a comet of gradient light sweeping its border that brightens, blooms into a glow and flashes across the surface on hover.","dependencies":[],"registryDependencies":[],"files":[{"path":"registry/ui/flashy-card.tsx","type":"registry:ui","content":"\"use client\";\n\nimport { useRef, type CSSProperties, type PointerEvent, type ReactNode } from \"react\";\n\nexport interface FlashyCardProps {\n  children?: ReactNode;\n  /** Gradient stops of the sweeping light, in order. */\n  colors?: string[];\n  /** Seconds per full sweep around the border. */\n  speed?: number;\n  /** Border thickness in px. */\n  borderWidth?: number;\n  /** Corner radius in px. */\n  radius?: number;\n  /** Strength of the outer glow on hover, 0 to 1. */\n  glow?: number;\n  /** \"hover\": the sweep brightens and glows while hovered/focused. \"always\": always lit. */\n  trigger?: \"hover\" | \"always\";\n  className?: string;\n}\n\nconst css = `\n@property --fc-a { syntax: \"<angle>\"; inherits: false; initial-value: 0deg; }\n@keyframes fc-spin { to { --fc-a: 360deg; } }\n@keyframes fc-flash { from { transform: translateX(-100%); opacity: 1; } to { transform: translateX(100%); opacity: 1; } }\n.fc-root { --fc-on: 0; }\n.fc-root[data-trigger=\"always\"], .fc-root:hover, .fc-root:focus-within { --fc-on: 1; }\n.fc-sweep { animation: fc-spin var(--fc-speed) linear infinite; }\n.fc-root:hover .fc-flash, .fc-root:focus-within .fc-flash { animation: fc-flash .9s cubic-bezier(.4,0,.2,1); }\n@media (prefers-reduced-motion: reduce) { .fc-sweep, .fc-flash { animation: none !important; } }\n`;\n\n/**\n * A card whose border carries a comet of light that sweeps around it. On hover the comet\n * brightens, the card blooms with a soft glow and a quick flash crosses the surface.\n */\nexport function FlashyCard({\n  children,\n  colors = [\"#22d3ee\", \"#a78bfa\", \"#f472b6\", \"#fbbf24\"],\n  speed = 3,\n  borderWidth = 1.5,\n  radius = 20,\n  glow = 0.6,\n  trigger = \"hover\",\n  className,\n}: FlashyCardProps) {\n  const ref = useRef<HTMLDivElement>(null);\n  // Comet: transparent most of the way round, then the colors, fading back out at the head.\n  const comet = `conic-gradient(from var(--fc-a), transparent 0% 55%, ${colors.join(\", \")}, transparent 99%)`;\n\n  // Pointer position for the inner sheen, written straight to CSS variables.\n  const onMove = (e: PointerEvent<HTMLDivElement>) => {\n    const el = ref.current;\n    if (!el) return;\n    const r = el.getBoundingClientRect();\n    el.style.setProperty(\"--fc-x\", `${e.clientX - r.left}px`);\n    el.style.setProperty(\"--fc-y\", `${e.clientY - r.top}px`);\n  };\n\n  return (\n    <div\n      ref={ref}\n      data-trigger={trigger}\n      onPointerMove={onMove}\n      className={`fc-root group relative isolate ${className ?? \"\"}`}\n      style={{ borderRadius: radius, \"--fc-speed\": `${speed}s` } as CSSProperties}\n    >\n      <style href=\"flashy-card\" precedence=\"default\">\n        {css}\n      </style>\n\n      {/* Outer bloom: the same comet, blurred behind the card. */}\n      <div\n        aria-hidden\n        className=\"fc-sweep pointer-events-none absolute -inset-px -z-10 rounded-[inherit] transition-opacity duration-500\"\n        style={{ background: comet, filter: \"blur(18px)\", opacity: `calc(var(--fc-on) * ${glow})` }}\n      />\n      {/* Border: static dim ring plus the moving comet. */}\n      <div aria-hidden className=\"pointer-events-none absolute inset-0 rounded-[inherit] bg-border\" />\n      <div\n        aria-hidden\n        className=\"fc-sweep pointer-events-none absolute inset-0 rounded-[inherit] transition-opacity duration-500\"\n        style={{ background: comet, opacity: \"calc(.35 + var(--fc-on) * .65)\" }}\n      />\n\n      <div\n        className=\"relative h-full overflow-hidden bg-card text-foreground\"\n        style={{ margin: borderWidth, borderRadius: Math.max(0, radius - borderWidth) }}\n      >\n        {/* Pointer-follow sheen. */}\n        <div\n          aria-hidden\n          className=\"pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 group-hover:opacity-100\"\n          style={{\n            background: `radial-gradient(260px circle at var(--fc-x, 50%) var(--fc-y, 0%), ${colors[0] ?? \"#fff\"}22, transparent 70%)`,\n          }}\n        />\n        {/* One-shot flash that crosses the surface when hover starts. */}\n        <div\n          aria-hidden\n          className=\"fc-flash pointer-events-none absolute inset-0 opacity-0\"\n          style={{ background: \"linear-gradient(115deg, transparent 30%, rgba(255,255,255,.14) 45%, rgba(255,255,255,.04) 55%, transparent 70%)\" }}\n        />\n        <div className=\"relative\">{children}</div>\n      </div>\n    </div>\n  );\n}\n"}]}