feat: rebuild the orbital vault as an operational map

This commit is contained in:
2026-11-09 22:01:14 +07:00
parent 2129e80c38
commit fba4a1e628
25 changed files with 1342 additions and 1333 deletions

View File

@@ -1,60 +1,31 @@
import { motion } from "motion/react";
export type HUDMode = "scene" | "orbits" | "wormhole" | "decay" | "reconstitute" | "snapshot";
export type HUDMode = "scene" | "orbits" | "wormhole" | "decay" | "reconstitute";
const items: { id: HUDMode; label: string; glyph: string; hint: string }[] = [
{ id: "scene", label: "Viewport", glyph: "◎", hint: "Vault ring" },
{ id: "orbits", label: "Orbits", glyph: "⟳", hint: "Flight paths" },
{ id: "wormhole", label: "Wormhole", glyph: "◉", hint: "Outpost link" },
{ id: "decay", label: "Decay", glyph: "◇", hint: "Fade policy" },
{ id: "reconstitute", label: "Restore", glyph: "↩", hint: "Reconstitute" },
];
const items = [
{ id: "scene", label: "Vault" },
{ id: "orbits", label: "Orbits" },
{ id: "wormhole", label: "Outposts" },
{ id: "decay", label: "Retention" },
{ id: "reconstitute", label: "Restore" },
] as const;
export function HUDRail({
active,
onSelect,
capturing,
active, onSelect,
}: {
active: HUDMode;
onSelect: (m: HUDMode) => void;
capturing?: boolean;
onSelect: (mode: HUDMode) => void;
}) {
return (
<nav
className="pointer-events-auto absolute bottom-6 left-1/2 -translate-x-1/2 z-30 flex gap-1 px-2 py-1.5 rounded-full border border-wormhole-violet/25 bg-space-950/75 backdrop-blur-xl shadow-[0_0_40px_rgba(5,6,15,0.8)]"
aria-label="Ship systems"
>
{items.map((item) => {
const on = active === item.id;
return (
<motion.button
key={item.id}
type="button"
title={item.hint}
onClick={() => onSelect(item.id)}
className={`relative px-3 py-2 rounded-full text-xs font-mono transition-colors ${
on
? "text-wormhole-violet bg-wormhole-violet/15"
: "text-star-400 hover:text-star-200"
}`}
whileTap={{ scale: 0.94 }}
>
<span className="sr-only">{item.label}</span>
<span aria-hidden className="text-sm">
{item.glyph}
</span>
{on && (
<motion.span
layoutId="hud-pip"
className="absolute -bottom-1 left-1/2 w-1 h-1 -translate-x-1/2 rounded-full bg-orbit-green"
/>
)}
{item.id === "orbits" && capturing && (
<span className="absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-orbit-amber animate-pulse" />
)}
</motion.button>
);
})}
<nav className="vault-nav" aria-label="Vault systems">
{items.map(({ id, label }) => (
<button
key={id}
type="button"
onClick={() => onSelect(id)}
aria-current={active === id ? "page" : undefined}
>
{label}
</button>
))}
</nav>
);
}