feat: make Big Screen a holographic visor
The map fills the viewport and every control is light: thin mint lines and glowing text over a vignette, a faint scan, corner brackets and a glass edge. Brand and mode sit top left, telemetry top right, the legend bottom left, the systems as text tabs bottom centre, and view, motion, search and sign out as outlined keys bottom right with the hub's state above them. Each piece springs between the workspace and the big screen with useScreenTransition. Every orbit is labelled on the big screen, and the picked orbit's label stands off its star on an elbowed leader line with its status. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,9 @@ const HALF_WIDTH = SCENE_WIDTH / 2;
|
||||
const HALF_HEIGHT = SCENE_HEIGHT / 2;
|
||||
const labelFont = "500 11px ui-monospace, monospace";
|
||||
const MAX_LABELS = 12;
|
||||
const MAX_BIG_LABELS = 60;
|
||||
/** On the big screen the picked orbit's label stands off its star, on the end of an elbowed leader line. */
|
||||
const BIG_LABEL_GAP = 64;
|
||||
const clamp = (value: number) => Math.max(0, Math.min(1, value));
|
||||
const ACCRETION_SECONDS = 6.4;
|
||||
/** Glow falloff, close to a gaussian so there is no visible edge. */
|
||||
@@ -359,7 +362,8 @@ export function BlackholeGalaxy({
|
||||
orbit.id === selectedOrbitId ? 0 : shownStatus(orbit) === "failed" ? 1 : orbitStatus(shownStatus(orbit)).busy ? 2 : 3;
|
||||
const labelCandidates = [...visible].sort((a, b) => byPriority(a) - byPriority(b))
|
||||
.filter((orbit) => width >= 530 || orbit.id === selectedOrbitId)
|
||||
.slice(0, MAX_LABELS);
|
||||
// The big screen has room for every orbit; placement still drops a label that would land on another.
|
||||
.slice(0, bigScreen ? MAX_BIG_LABELS : MAX_LABELS);
|
||||
const box = (point: Vec2, r: number): Rect => {
|
||||
const { x, y } = screen(point);
|
||||
return { x: x - r, y: y - r, width: r * 2, height: r * 2 };
|
||||
@@ -374,7 +378,7 @@ export function BlackholeGalaxy({
|
||||
labels = placeLabels(labelCandidates.map(({ id, name }) => {
|
||||
const point = screen(orbitPose(slots.get(id)!, lockedPhase));
|
||||
return { id, ...point, width: Math.min(146, Math.ceil(measure?.measureText(name).width ?? name.length * 7) + 16) };
|
||||
}), width, height, [core, ...markers, ...moons.map((moon) => box(moon, 12))], selectedOrbitId);
|
||||
}), width, height, [core, ...markers, ...moons.map((moon) => box(moon, 12))], selectedOrbitId, bigScreen ? BIG_LABEL_GAP : 0);
|
||||
}
|
||||
const focusLabel = labels.find(({ id }) => id === selectedOrbitId);
|
||||
|
||||
@@ -505,7 +509,22 @@ export function BlackholeGalaxy({
|
||||
</g>
|
||||
);
|
||||
})}
|
||||
{selectedPosition && focusLabel && (
|
||||
{selectedPosition && focusLabel && bigScreen && (() => {
|
||||
// Diagonal out of the star, a dot at the bend, then level into the near edge of the label.
|
||||
const star = screen(selectedPosition);
|
||||
const toRight = focusLabel.x + focusLabel.width / 2 >= star.x;
|
||||
const endX = toRight ? focusLabel.x - 6 : focusLabel.x + focusLabel.width + 6;
|
||||
const endY = focusLabel.y + LABEL_HEIGHT / 2;
|
||||
const bendX = endX - (toRight ? 1 : -1) * Math.min(Math.abs(endX - star.x) * 0.6, 120);
|
||||
const point = (x: number, y: number) => `${x / scale - HALF_WIDTH} ${y / scale - HALF_HEIGHT}`;
|
||||
return (
|
||||
<g className="focus-leader-big">
|
||||
<path className="focus-leader" d={`M${point(star.x, star.y)} L${point(bendX, endY)} L${point(endX, endY)}`} fill="none" />
|
||||
<circle className="focus-leader-dot" r="2" cx={bendX / scale - HALF_WIDTH} cy={endY / scale - HALF_HEIGHT} />
|
||||
</g>
|
||||
);
|
||||
})()}
|
||||
{selectedPosition && focusLabel && !bigScreen && (
|
||||
<motion.line className="focus-leader"
|
||||
x1={selectionX} y1={selectionY} initial={false}
|
||||
animate={{
|
||||
@@ -523,6 +542,11 @@ export function BlackholeGalaxy({
|
||||
{labelCandidates.find((orbit) => orbit.id === id)?.name}
|
||||
</span>
|
||||
))}
|
||||
{bigScreen && focusLabel && (
|
||||
<span className="scene-label-note" style={{ left: `${100 * focusLabel.x / width}%`, top: `${100 * (focusLabel.y + LABEL_HEIGHT - 4) / height}%`, opacity: reducedMotion ? 1 : "var(--lock-reveal)" }}>
|
||||
{orbitStatus(shownStatus(visible.find(({ id }) => id === selectedOrbitId)!)).label}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{orbits.length >= orbitCapacity && <p className="scene-density">Select an orbit in the list to inspect it</p>}
|
||||
</motion.div>
|
||||
|
||||
Reference in New Issue
Block a user