{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "meteors",
  "type": "registry:component",
  "title": "Meteors",
  "description": "A shower of shooting stars with fading tails over a faint, twinkling star field. Pure CSS, fills its positioned parent.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "overlay",
    "meteors",
    "stars",
    "night",
    "background",
    "shooting star",
    "space"
  ],
  "docs": "https://hyperblur.dev/effects/meteors",
  "files": [
    {
      "path": "registry/hyperblur/meteors.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/meteors.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface MeteorsProps extends React.HTMLAttributes<HTMLDivElement> {\n  count?: number;\n  angle?: number;\n  speed?: number;\n  color?: string;\n  stars?: number;\n  seed?: number;\n}\n\nconst css = `\n@keyframes hb-met-fly {\n  0% { transform: translate3d(0, 0, 0); opacity: 0; }\n  3% { opacity: 1; }\n  30% { opacity: 1; }\n  38%, 100% { transform: translate3d(var(--hb-met-run), 0, 0); opacity: 0; }\n}\n@keyframes hb-met-twinkle {\n  0%, 100% { opacity: var(--hb-met-lo); }\n  50% { opacity: var(--hb-met-hi); }\n}\n.hb-met {\n  position: absolute;\n  inset: 0;\n  overflow: hidden;\n  pointer-events: none;\n  container-type: size;\n  --hb-met-run: 160cqmax;\n}\n.hb-met-star {\n  position: absolute;\n  border-radius: 50%;\n  background: var(--hb-met-c);\n  animation: hb-met-twinkle var(--hb-met-td) ease-in-out infinite;\n  animation-delay: var(--hb-met-tl);\n}\n.hb-met-path {\n  position: absolute;\n  width: 0;\n  height: 0;\n  transform: rotate(var(--hb-met-a));\n}\n.hb-met-m {\n  position: absolute;\n  right: 0;\n  top: calc(var(--hb-met-w) / -2);\n  width: var(--hb-met-len);\n  height: var(--hb-met-w);\n  border-radius: 999px;\n  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--hb-met-c) 30%, transparent) 55%, var(--hb-met-c));\n  opacity: 0;\n  will-change: transform, opacity;\n  animation: hb-met-fly var(--hb-met-d) linear infinite;\n  animation-delay: var(--hb-met-dl);\n}\n.hb-met-m::after {\n  content: \"\";\n  position: absolute;\n  right: -1px;\n  top: 50%;\n  width: calc(var(--hb-met-w) * 2.4);\n  height: calc(var(--hb-met-w) * 2.4);\n  border-radius: 50%;\n  transform: translateY(-50%);\n  background: var(--hb-met-c);\n  box-shadow: 0 0 6px 1px var(--hb-met-c), 0 0 16px 3px color-mix(in srgb, var(--hb-met-c) 45%, transparent);\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-met-star { animation: none; opacity: var(--hb-met-hi); }\n  .hb-met-m { animation: none; will-change: auto; opacity: 0; }\n  .hb-met-path:nth-child(3n + 1) .hb-met-m { opacity: 0.8; transform: translate3d(calc(var(--hb-met-run) * 0.28), 0, 0); }\n}\n`;\n\nfunction rnd(i: number, salt: number, seed: number) {\n  let x = (Math.imul(i + 1, 2654435761) + Math.imul(salt + 1, 40503) + Math.imul(seed | 0, 2246822519)) >>> 0;\n  x = Math.imul((x >>> 16) ^ x, 0x45d9f3b);\n  x = Math.imul((x >>> 16) ^ x, 0x45d9f3b);\n  x = ((x >>> 16) ^ x) >>> 0;\n  return x / 4294967296;\n}\n\nexport function Meteors({\n  count = 20,\n  angle = 145,\n  speed = 1,\n  color = \"#ffffff\",\n  stars = 60,\n  seed = 7,\n  className = \"\",\n  style,\n  ...rest\n}: MeteorsProps) {\n  const total = Math.max(0, Math.round(count));\n  const starTotal = Math.max(0, Math.round(stars));\n  const sp = Math.max(0.05, speed);\n  const rad = (angle * Math.PI) / 180;\n  const dx = Math.cos(rad);\n  const dy = Math.sin(rad);\n\n  const meteors = Array.from({ length: total }, (_, i) => {\n    const spread = (rnd(i, 1, seed) * 2 - 1) * 0.95;\n    const back = 0.55 + rnd(i, 2, seed) * 0.35;\n    const x = 0.5 - dx * back - dy * spread;\n    const y = 0.5 - dy * back + dx * spread;\n    const d = (3.2 + rnd(i, 3, seed) * 5.2) / sp;\n    return {\n      x: (x * 100).toFixed(2),\n      y: (y * 100).toFixed(2),\n      d: d.toFixed(3),\n      dl: (-rnd(i, 4, seed) * d).toFixed(3),\n      len: (50 + rnd(i, 5, seed) * 90).toFixed(1),\n      w: (1 + rnd(i, 6, seed) * 0.8).toFixed(2),\n    };\n  });\n\n  const field = Array.from({ length: starTotal }, (_, i) => {\n    const hi = 0.35 + rnd(i, 11, seed) * 0.55;\n    return {\n      x: (rnd(i, 12, seed) * 100).toFixed(2),\n      y: (rnd(i, 13, seed) * 100).toFixed(2),\n      s: (0.6 + rnd(i, 14, seed) * 1.3).toFixed(2),\n      hi: hi.toFixed(2),\n      lo: (hi * 0.25).toFixed(2),\n      td: (2.4 + rnd(i, 15, seed) * 4).toFixed(2),\n      tl: (-rnd(i, 16, seed) * 6).toFixed(2),\n    };\n  });\n\n  const vars = {\n    \"--hb-met-c\": color,\n    \"--hb-met-a\": `${angle.toFixed(2)}deg`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <div className={`hb-met ${className}`} style={vars} aria-hidden=\"true\" {...rest}>\n      <style href=\"hb-meteors\" precedence=\"default\">{css}</style>\n      {field.map((s, i) => (\n        <span\n          key={`s${i}`}\n          className=\"hb-met-star\"\n          style={\n            {\n              left: `${s.x}%`,\n              top: `${s.y}%`,\n              width: `${s.s}px`,\n              height: `${s.s}px`,\n              \"--hb-met-hi\": s.hi,\n              \"--hb-met-lo\": s.lo,\n              \"--hb-met-td\": `${s.td}s`,\n              \"--hb-met-tl\": `${s.tl}s`,\n            } as React.CSSProperties\n          }\n        />\n      ))}\n      {meteors.map((m, i) => (\n        <span key={`m${i}`} className=\"hb-met-path\" style={{ left: `${m.x}%`, top: `${m.y}%` }}>\n          <span\n            className=\"hb-met-m\"\n            style={\n              {\n                \"--hb-met-d\": `${m.d}s`,\n                \"--hb-met-dl\": `${m.dl}s`,\n                \"--hb-met-len\": `${m.len}px`,\n                \"--hb-met-w\": `${m.w}px`,\n              } as React.CSSProperties\n            }\n          />\n        </span>\n      ))}\n    </div>\n  );\n}\n"
    }
  ]
}