{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hud-boot-screen",
  "type": "registry:component",
  "title": "HUD Boot Screen",
  "description": "A boot sequence with a logo, a segmented progress bar and status rows that resolve one by one from WAIT to READY. Click to replay.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "hud",
    "boot",
    "loader",
    "progress",
    "hud",
    "splash",
    "status"
  ],
  "docs": "https://hyperblur.dev/effects/hud-boot-screen",
  "files": [
    {
      "path": "registry/hyperblur/hud-boot-screen.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/hud-boot-screen.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface HudBootRow {\n  label: string;\n  value?: string;\n}\n\nexport interface HudBootScreenProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n  title?: string;\n  subtitle?: string;\n  logo?: React.ReactNode;\n  rows?: HudBootRow[];\n  duration?: number;\n  autoStart?: boolean;\n  waitLabel?: string;\n  readyLabel?: string;\n  accent?: string;\n  onComplete?: () => void;\n}\n\nconst defaultRows: HudBootRow[] = [\n  { label: \"Core\" },\n  { label: \"Shaders\", value: \"42 / 42\" },\n  { label: \"Audio\", value: \"48 kHz\" },\n  { label: \"Input\" },\n];\n\nconst css = `\n.hb-ua3 {\n  --hb-ua3-accent: #ff4d4d;\n  position: relative;\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  width: 100%;\n  padding: 14px 16px;\n  border: 1px solid rgba(255,255,255,.12);\n  background:\n    radial-gradient(120% 70% at 0% 0%, color-mix(in srgb, var(--hb-ua3-accent) 8%, transparent), transparent 60%),\n    #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  cursor: default;\n}\n.hb-ua3[data-done=\"true\"] { cursor: pointer; }\n.hb-ua3 *, .hb-ua3 *::before, .hb-ua3 *::after { box-sizing: border-box; }\n.hb-ua3-k { position: absolute; width: 9px; height: 9px; border: 0 solid rgba(255,255,255,.6); pointer-events: none; }\n.hb-ua3-k-tl { left: -1px; top: -1px; border-left-width: 1px; border-top-width: 1px; }\n.hb-ua3-k-tr { right: -1px; top: -1px; border-right-width: 1px; border-top-width: 1px; }\n.hb-ua3-k-bl { left: -1px; bottom: -1px; border-left-width: 1px; border-bottom-width: 1px; }\n.hb-ua3-k-br { right: -1px; bottom: -1px; border-right-width: 1px; border-bottom-width: 1px; }\n.hb-ua3-mono {\n  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n  font-size: 10px;\n  letter-spacing: .14em;\n  text-transform: uppercase;\n}\n.hb-ua3-head { display: flex; align-items: center; gap: 12px; min-width: 0; }\n.hb-ua3-logo {\n  display: grid;\n  place-items: center;\n  flex: 0 0 auto;\n  width: 30px;\n  height: 30px;\n  color: var(--hb-ua3-accent);\n}\n.hb-ua3-logo svg { width: 100%; height: 100%; }\n.hb-ua3-titles { display: flex; flex-direction: column; gap: 3px; min-width: 0; }\n.hb-ua3-title {\n  margin: 0;\n  font-size: 15px;\n  font-weight: 600;\n  letter-spacing: .06em;\n  line-height: 1.1;\n  text-transform: uppercase;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n.hb-ua3-sub { color: #8f8f8f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-ua3-prog { display: flex; flex-direction: column; gap: 6px; }\n.hb-ua3-plabel { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #a1a1a1; min-height: 14px; }\n.hb-ua3-pct { color: #ededed; font-variant-numeric: tabular-nums; }\n.hb-ua3-replay {\n  margin: 0;\n  padding: 0;\n  border: 0;\n  background: none;\n  color: var(--hb-ua3-accent);\n  font: inherit;\n  letter-spacing: inherit;\n  text-transform: inherit;\n  cursor: pointer;\n}\n.hb-ua3-replay:focus-visible { outline: 1px solid var(--hb-ua3-accent); outline-offset: 3px; }\n.hb-ua3-track {\n  position: relative;\n  height: 4px;\n  overflow: hidden;\n  background: rgba(255,255,255,.08);\n}\n.hb-ua3-fill {\n  position: absolute;\n  inset: 0;\n  background: var(--hb-ua3-accent);\n  box-shadow: 0 0 12px var(--hb-ua3-accent);\n  transform-origin: left center;\n  transform: scaleX(var(--hb-ua3-p, 0));\n}\n.hb-ua3-track::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background: repeating-linear-gradient(90deg, transparent 0 7px, #0a0a0a 7px 9px);\n}\n.hb-ua3-rows { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }\n.hb-ua3-row { display: flex; align-items: center; gap: 8px; min-width: 0; color: #a1a1a1; }\n.hb-ua3-lead { flex: 1 1 auto; min-width: 12px; height: 1px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.2) 0 1px, transparent 1px 4px); }\n.hb-ua3-rl { white-space: nowrap; }\n.hb-ua3-val { white-space: nowrap; color: #5f5f5f; animation: hb-ua3-wait 1s steps(2, jump-none) infinite; }\n.hb-ua3-row[data-ready=\"true\"] .hb-ua3-rl { color: #ededed; }\n.hb-ua3-row[data-ready=\"true\"] .hb-ua3-val { color: #ededed; animation: hb-ua3-in .35s ease-out both; }\n.hb-ua3-row[data-ready=\"true\"] .hb-ua3-val::before {\n  content: \"\";\n  display: inline-block;\n  width: 5px;\n  height: 5px;\n  margin-right: 6px;\n  vertical-align: 1px;\n  background: var(--hb-ua3-accent);\n}\n@keyframes hb-ua3-wait { 50% { opacity: .35; } }\n@keyframes hb-ua3-in { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-ua3-val, .hb-ua3-row[data-ready=\"true\"] .hb-ua3-val { animation: none; }\n}\n`;\n\nfunction Mark() {\n  return (\n    <svg viewBox=\"0 0 30 30\" fill=\"none\" aria-hidden=\"true\">\n      <path d=\"M3 8V3h5M22 3h5v5M27 22v5h-5M8 27H3v-5\" stroke=\"rgba(255,255,255,.55)\" strokeWidth=\"1\" />\n      <path d=\"M8 9l7 13 7-13\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinejoin=\"miter\" />\n      <path d=\"M11.5 9h7\" stroke=\"currentColor\" strokeWidth=\"1\" />\n    </svg>\n  );\n}\n\nexport function HudBootScreen({\n  title = \"Vector Lab\",\n  subtitle = \"Boot sequence 2.4\",\n  logo,\n  rows = defaultRows,\n  duration = 3200,\n  autoStart = true,\n  waitLabel = \"Wait\",\n  readyLabel = \"Ready\",\n  accent = \"#ff4d4d\",\n  onComplete,\n  className,\n  style,\n  onClick,\n  ...rest\n}: HudBootScreenProps) {\n  const [run, setRun] = React.useState(autoStart ? 1 : 0);\n  const [progress, setProgress] = React.useState(0);\n  const completeRef = React.useRef(onComplete);\n\n  React.useEffect(() => {\n    completeRef.current = onComplete;\n  });\n\n  React.useEffect(() => {\n    if (!run) return;\n    const reduced = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const total = Math.max(300, duration);\n    let raf = 0;\n    let t0 = 0;\n    const step = (t: number) => {\n      if (!t0) t0 = t;\n      const raw = reduced ? 1 : Math.min(1, (t - t0) / total);\n      const eased = raw < 1 ? raw - Math.sin(raw * Math.PI * 6) * 0.018 * (1 - raw) : 1;\n      setProgress(Math.max(0, Math.min(1, eased)));\n      if (raw < 1) raf = requestAnimationFrame(step);\n      else completeRef.current?.();\n    };\n    raf = requestAnimationFrame(step);\n    return () => cancelAnimationFrame(raf);\n  }, [run, duration]);\n\n  const done = run > 0 && progress >= 1;\n  const replay = () => {\n    setProgress(0);\n    setRun((r) => r + 1);\n  };\n  const n = rows.length;\n\n  return (\n    <div\n      className={[\"hb-ua3\", className].filter(Boolean).join(\" \")}\n      data-done={done ? \"true\" : \"false\"}\n      style={{ [\"--hb-ua3-accent\" as string]: accent, ...style }}\n      onClick={(e) => {\n        onClick?.(e);\n        if (!e.defaultPrevented && (done || !run)) replay();\n      }}\n      {...rest}\n    >\n      <style href=\"hb-hud-boot-screen\" precedence=\"default\">{css}</style>\n      <span className=\"hb-ua3-k hb-ua3-k-tl\" aria-hidden=\"true\" />\n      <span className=\"hb-ua3-k hb-ua3-k-tr\" aria-hidden=\"true\" />\n      <span className=\"hb-ua3-k hb-ua3-k-bl\" aria-hidden=\"true\" />\n      <span className=\"hb-ua3-k hb-ua3-k-br\" aria-hidden=\"true\" />\n      <div className=\"hb-ua3-head\">\n        <span className=\"hb-ua3-logo\">{logo ?? <Mark />}</span>\n        <span className=\"hb-ua3-titles\">\n          <span className=\"hb-ua3-title\">{title}</span>\n          {subtitle ? <span className=\"hb-ua3-mono hb-ua3-sub\">{subtitle}</span> : null}\n        </span>\n      </div>\n      <div className=\"hb-ua3-prog\">\n        <div className=\"hb-ua3-mono hb-ua3-plabel\">\n          <span>{done ? \"System ready\" : run ? \"Loading\" : \"Standby\"}</span>\n          {done || !run ? (\n            <button type=\"button\" className=\"hb-ua3-replay\" onClick={(e) => { e.stopPropagation(); replay(); }}>\n              {run ? \"Replay\" : \"Start\"}\n            </button>\n          ) : (\n            <span className=\"hb-ua3-pct\">{String(Math.round(progress * 100)).padStart(3, \"0\")}%</span>\n          )}\n        </div>\n        <div\n          className=\"hb-ua3-track\"\n          role=\"progressbar\"\n          aria-label={`${title} boot progress`}\n          aria-valuemin={0}\n          aria-valuemax={100}\n          aria-valuenow={Math.round(progress * 100)}\n        >\n          <span className=\"hb-ua3-fill\" style={{ [\"--hb-ua3-p\" as string]: progress.toFixed(4) }} />\n        </div>\n      </div>\n      <ul className=\"hb-ua3-rows\">\n        {rows.map((row, i) => {\n          const ready = run > 0 && progress >= ((i + 1) / n) * 0.96;\n          return (\n            <li key={row.label} className=\"hb-ua3-mono hb-ua3-row\" data-ready={ready ? \"true\" : \"false\"}>\n              <span className=\"hb-ua3-rl\">{row.label}</span>\n              <span className=\"hb-ua3-lead\" aria-hidden=\"true\" />\n              <span className=\"hb-ua3-val\">{ready ? row.value ?? readyLabel : waitLabel}</span>\n            </li>\n          );\n        })}\n      </ul>\n    </div>\n  );\n}\n\nexport default HudBootScreen;\n"
    }
  ]
}