diff --git a/docs/UI.md b/docs/UI.md index adc72bf..3de20fa 100644 --- a/docs/UI.md +++ b/docs/UI.md @@ -4,7 +4,7 @@ The persistent viewport maps backup jobs and recovery points. The black hole rep ## Viewport and consoles -- **Flowing** animates the projected orbit paths. **Locked** keeps bodies in place and prioritizes labels for the selected, failed, and running orbits. Pause or resume from the map toolbar. Selecting an orbit locks the map. Reduced motion starts in Locked mode. +- **Flowing** animates the projected orbits and the black hole's accretion disk. **Locked** freezes their motion and prioritizes labels for the selected, failed, and running orbits. Pause or resume from the map toolbar. Selecting an orbit locks the map. Reduced motion starts in Locked mode. - Select a star or use the orbit register. The register prioritizes failed and active jobs and supports the up/down arrow keys. The inspector includes the capture action and full snapshot history. - The first three recovery points of the selected orbit appear as moons when the map has room. Select a moon or history entry to review the snapshot and start a restore. Escape closes the console. Restore countdown and polling continue if the console closes. - Hub connectivity is separate from backup health. Capture targets the named orbit. An incoming meteor represents a confirmed new snapshot. Failures and rehearsals show text feedback. diff --git a/web/src/components/scene/BlackholeGalaxy.tsx b/web/src/components/scene/BlackholeGalaxy.tsx index 2d7b920..82433bb 100644 --- a/web/src/components/scene/BlackholeGalaxy.tsx +++ b/web/src/components/scene/BlackholeGalaxy.tsx @@ -26,6 +26,7 @@ const HALF_HEIGHT = SCENE_HEIGHT / 2; const labelFont = "500 11px ui-monospace, monospace"; const MAX_LABELS = 12; const METEOR_SECONDS = 1.4; +const ACCRETION_SECONDS = 6.4; export function BlackholeGalaxy({ orbits, selectedOrbitId, recentSnapshots, flowing, arrival, onSelectOrbit, onSelectSnapshot, @@ -34,6 +35,7 @@ export function BlackholeGalaxy({ const bodyNodes = useRef(new Map()); const slotsBefore = useRef>(undefined); const elapsed = useRef(0); + const core = useRef(null); const meteor = useRef<{ id: string; time: number; source: Vec2 }>(undefined); const trail = useRef(null); const head = useRef(null); @@ -56,8 +58,11 @@ export function BlackholeGalaxy({ }, []); const draw = useCallback((delta: number) => { - const moving = flowing && slots.size > 0; - if (moving) elapsed.current += delta; + if (flowing && delta > 0) { + elapsed.current += delta; + const phase = (elapsed.current % ACCRETION_SECONDS) / ACCRETION_SECONDS; + core.current?.style.setProperty("--accretion-offset", String(-100 * phase)); + } for (const [node, { id, far }] of bodyNodes.current) { const slot = slots.get(id); if (!slot) continue; @@ -71,7 +76,7 @@ export function BlackholeGalaxy({ if (!arrival) { effect.current?.setAttribute("opacity", "0"); - return moving; + return flowing; } const slot = slots.get(arrival.orbitId); if (meteor.current?.id !== arrival.snapshotId && slot) { @@ -81,7 +86,7 @@ export function BlackholeGalaxy({ trail.current?.setAttribute("d", points.map(({ x, y }, i) => `${i ? "L" : "M"} ${x} ${y}`).join(" ")); } const current = meteor.current; - if (!current || current.id !== arrival.snapshotId) return moving; + if (!current || current.id !== arrival.snapshotId) return flowing; current.time += delta; const progress = Math.min(1, current.time / METEOR_SECONDS); const { x, y } = spiralPoint(current.source, progress); @@ -89,10 +94,10 @@ export function BlackholeGalaxy({ head.current?.setAttribute("cy", String(y)); trail.current?.setAttribute("stroke-dashoffset", String(0.2 - progress)); effect.current?.setAttribute("opacity", String(progress >= 1 ? 0 : Math.min(1, (1 - progress) * 6))); - return moving || progress < 1; + return flowing || progress < 1; }, [arrival, flowing, slots]); - useGalaxyMotion((flowing && slots.size > 0) || !!arrival, draw); + useGalaxyMotion(flowing || !!arrival, draw); const scale = width / SCENE_WIDTH; const height = SCENE_HEIGHT * scale; @@ -166,7 +171,7 @@ export function BlackholeGalaxy({ ))} {renderOrbits(true)} - + {renderOrbits(false)} {selectedPosition && moons.map(({ x, y }, index) => { const snapshot = recentSnapshots[index]; diff --git a/web/src/components/scene/VaultCore.tsx b/web/src/components/scene/VaultCore.tsx index 5eb6d91..acfb197 100644 --- a/web/src/components/scene/VaultCore.tsx +++ b/web/src/components/scene/VaultCore.tsx @@ -1,4 +1,6 @@ -import { memo, useId } from "react"; +import { memo, useId, type Ref } from "react"; + +const LENS_ARC = "M-115 12 C-68 9 -67 -66 -9 -68 C52 -71 61 -10 111 6"; const streams = [ { rx: 122, ry: 19, y: 10, width: 0.7, opacity: 0.30 }, @@ -9,11 +11,11 @@ const streams = [ { rx: 66, ry: 12, y: 15, width: 0.9, opacity: 0.75 }, ]; -export const VaultCore = memo(function VaultCore() { +export const VaultCore = memo(function VaultCore({ ref }: { ref: Ref }) { const id = useId(); const paint = (name: string) => `url(#${id}-${name})`; return ( - + @@ -44,17 +46,21 @@ export const VaultCore = memo(function VaultCore() { + @@ -66,6 +72,14 @@ export const VaultCore = memo(function VaultCore() { fill="none" stroke={paint("disk")} strokeWidth={width} opacity={opacity} /> ))} + + diff --git a/web/src/index.css b/web/src/index.css index 5878645..b132443 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -220,6 +220,8 @@ button:disabled { cursor: default; } .snapshot-light { fill: #dce5f7; stroke: #272c35; stroke-width: 1.1; pointer-events: none; } .snapshot-marker:hover .snapshot-light { fill: #fff; } .focus-leader { stroke: var(--accent); opacity: .65; pointer-events: none; } +.accretion-flow { stroke-dashoffset: var(--accretion-offset, 0); } +.accretion-flow--inner { stroke-dashoffset: calc(32 + 2 * var(--accretion-offset, 0)); } .capture-arrival path { stroke: #ffce9b; stroke-width: 2.3; stroke-linecap: round; } .capture-arrival circle { fill: #fff0d9; } .scene-labels { position: absolute; inset: 0; pointer-events: none; }