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:
@@ -14,17 +14,25 @@ export function placeLabels(
|
||||
height: number,
|
||||
obstacles: Rect[],
|
||||
selectedId?: string,
|
||||
/** The picked orbit's label keeps at least this far from its star, so a leader line has room to run. */
|
||||
selectedMinGap = 0,
|
||||
): Label[] {
|
||||
const occupied = [...obstacles];
|
||||
const placed: Label[] = [];
|
||||
for (const label of candidates) {
|
||||
const { x, y, width: w } = label;
|
||||
const gaps = label.id === selectedId ? [12, 28, 44, 64, 88, 112, 144, 180] : [12, 28, 44];
|
||||
const gaps = label.id === selectedId
|
||||
? [12, 28, 44, 64, 88, 112, 144, 180].filter((gap) => gap >= selectedMinGap)
|
||||
: [12, 28, 44];
|
||||
const offsets = gaps.flatMap((gap) => [
|
||||
[gap, -LABEL_HEIGHT / 2], [-w - gap, -LABEL_HEIGHT / 2],
|
||||
[-w / 2, -LABEL_HEIGHT - gap], [-w / 2, gap],
|
||||
[gap, -LABEL_HEIGHT - gap / 2], [-w - gap, gap / 2],
|
||||
]);
|
||||
// A label held off its star reads best up and to the side, where a leader line can bend into it.
|
||||
if (label.id === selectedId && selectedMinGap > 0) {
|
||||
offsets.sort((a, b) => Number(b[1] < -LABEL_HEIGHT / 2) - Number(a[1] < -LABEL_HEIGHT / 2));
|
||||
}
|
||||
for (const [dx, dy] of offsets) {
|
||||
const rect = { x: x + dx, y: y + dy, width: w, height: LABEL_HEIGHT };
|
||||
if (rect.x < GAP || rect.y < GAP || rect.x + w > width - GAP ||
|
||||
|
||||
Reference in New Issue
Block a user