Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

feat(office): change floors with the elevator doors and a real button panel

rubenluetke10-beep1f0cdecb2b7f
diff --git a/jarvis/ui/web/frontend/src/components/society/office/ElevatorCar.tsx b/jarvis/ui/web/frontend/src/components/society/office/ElevatorCar.tsx
deleted file mode 100644
index 333e3042d4..0000000000
--- a/jarvis/ui/web/frontend/src/components/society/office/ElevatorCar.tsx
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * Riding the elevator, from inside the car. Pressing the call button puts the
- * person in the car: its steel side walls, lit ceiling and stone floor frame
- * the stage, and through the open doors they still see the floor they are on.
- * On the wall beside the doors hangs the car's operating panel (a directory
- * plate and one round push button per floor, plus "doors open" to step out
- * again); above the doors the floor indicator. Pressing a floor lights its
- * button, the doors close, the car pulls away with a slight jolt while the
- * indicator counts the floors, it settles, and the doors open on the new
- * floor — then the person steps out.
- *
- * OfficeStage owns the phases and their timing (the floor switches while the
- * doors are shut); this component draws the phase it is given. It is a modal
- * dialog the whole time, so the character stands still (`ownsKeyboard`).
- * Part of the diorama: one palette in light and dark mode. Reduced motion:
- * no stepping in or out, no jolt or counting.
- */
-import { useEffect, useRef, useState } from "react";
-import { useT } from "@/i18n";
-import { floorLevel, OFFICE_FLOORS, type OfficeFloor } from "./officeStore";
-
-export type CarPhase = "boarding" | "closing" | "riding" | "opening" | "leaving";
-
-/** The car's floor buttons, top floor first, like the panel in a real car. */
-export const CAR_BUTTONS: readonly OfficeFloor[] = [...OFFICE_FLOORS].reverse();
-
-/** How long the indicator shows each floor while the car moves. */
-export const RIDE_STEP_MS = 650;
-
-/** The floor a number key picks ("0" = ground floor), or null. */
-export function floorForKey(key: string): OfficeFloor | null {
- const level = /^[0-9]$/.test(key) ? Number(key) : -1;
- return OFFICE_FLOORS[level] ?? null;
-}
-
-/** The floor levels a ride passes, from where it starts to where it stops (both included). */
-export function rideLevels(from: OfficeFloor, to: OfficeFloor): number[] {
- const a = floorLevel(from), b = floorLevel(to);
- const step = b >= a ? 1 : -1;
- const out: number[] = [];
- for (let level = a; level !== b + step; level += step) out.push(level);
- return out;
-}
-
-/** How long the car should at least be under way so the indicator can show every floor it passes. */
-export function minRideMs(from: OfficeFloor, to: OfficeFloor): number {
- return Math.max(1, rideLevels(from, to).length - 1) * RIDE_STEP_MS;
-}
-
-function Arrow({ down }: { down: boolean }) {
- return (
- <svg viewBox="0 0 24 24" className="office-car-arrow" data-down={down || undefined} aria-hidden>
- <path d="M12 4 L21 15 H3 Z" fill="currentColor" />
- </svg>
- );
-}
-
-/** The "doors open" symbol: two arrows pointing away from a centre line. */
-function DoorsOpenGlyph() {
- return (
- <svg viewBox="0 0 24 24" aria-hidden>
- <path d="M11 12 L5 7 V17 Z M13 12 L19 7 V17 Z" fill="currentColor" />
- <rect x="11.4" y="5" width="1.2" height="14" fill="currentColor" />
- </svg>
- );
-}
-
-export function ElevatorCar({ phase, from, to, reduced, onPick, onLeave }: {
- phase: CarPhase;
- /** The floor the car is boarded on. */
- from: OfficeFloor;
- /** The floor pressed, once a button is pressed. */
- to: OfficeFloor | null;
- reduced: boolean;
- onPick: (floor: OfficeFloor) => void;
- onLeave: () => void;
-}) {
- const t = useT();
- const panel = useRef<HTMLDivElement>(null);
- const boarding = phase === "boarding";
- const target = to ?? from;
- const levels = rideLevels(from, target);
- const up = floorLevel(target) > floorLevel(from);
-
- // The indicator: the boarded floor until the car moves, one floor per RIDE_STEP_MS under way, the stop on arrival.
- const [step, setStep] = useState(0);
- useEffect(() => {
- if (reduced || phase !== "riding") return;
- const timer = window.setInterval(() => setStep((s) => Math.min(levels.length - 1, s + 1)), RIDE_STEP_MS);
- return () => window.clearInterval(timer);
- }, [phase, reduced, levels.length]);
- const index = phase === "opening" || phase === "leaving" || (reduced && phase === "riding") ? levels.length - 1
- : phase === "riding" ? step : 0;
- const level = levels[index] ?? floorLevel(from);
-
- // Step in with the focus on the first floor button you can press; hand focus back when stepping out.
- useEffect(() => {
- const before = document.activeElement instanceof HTMLElement ? document.activeElement : null;
- panel.current?.querySelector<HTMLButtonElement>("button[data-floor]:not(:disabled)")?.focus({ preventScroll: true });
- return () => { before?.focus({ preventScroll: true }); };
- }, []);
-
- // Keys belong to the car while it is on screen (capture phase): a floor's number presses it, Escape or E steps out.
- const latest = useRef({ boarding, from, onPick, onLeave });
- latest.current = { boarding, from, onPick, onLeave };
- useEffect(() => {
- const onKey = (event: KeyboardEvent) => {
- const now = latest.current;
- if (event.key === "Escape" || event.code === "KeyE") {
- event.preventDefault(); event.stopPropagation();
- if (!event.repeat && now.boarding) now.onLeave();
- return;
- }
- const picked = event.ctrlKey || event.metaKey || event.altKey ? null : floorForKey(event.key);
- if (picked) {
- event.preventDefault(); event.stopPropagation();
- if (!event.repeat && now.boarding && picked !== now.from) now.onPick(picked);
- return;
- }
- if (event.key === "ArrowUp" || event.key === "ArrowDown") {
- event.preventDefault(); event.stopPropagation();
- const buttons = [...(panel.current?.querySelectorAll<HTMLButtonElement>("button:not(:disabled)") ?? [])];
- if (buttons.length === 0) return;
- const at = buttons.indexOf(document.activeElement as HTMLButtonElement);
- buttons[at < 0 ? 0 : (at + (event.key === "ArrowDown" ? 1 : -1) + buttons.length) % buttons.length].focus();
- }
- };
- document.addEventListener("keydown", onKey, true);
- return () => document.removeEventListener("keydown", onKey, true);
- }, []);
-
- const caption = to
- ? t(up ? "society.office.riding_up_to" : "society.office.riding_down_to").replace("{0}", t(`society.office.floor_name_${to}`))
- : t("society.office.elevator_choose");
- const moving = phase === "closing" || phase === "riding";
- return (
- <div className="office-car" data-phase={phase} data-direction={up ? "up" : "down"} data-reduced={reduced || undefined} data-office-ui
- role="dialog" data-state="open" aria-modal="true" aria-label={caption}>
- <div className="office-car-body">
- <i className="office-car-ceiling" aria-hidden><i className="office-car-light" /></i>
- <i className="office-car-floor" aria-hidden />
- <i className="office-car-wall" data-side="left" aria-hidden><i className="office-car-rail" /></i>
- <i className="office-car-wall" data-side="right" aria-hidden><i className="office-car-rail" /></i>
- <div className="office-car-front">
- <i className="office-car-lintel" aria-hidden />
- <i className="office-car-pier" data-side="left" aria-hidden />
- <i className="office-car-pier" data-side="right" aria-hidden />
- <div className="office-car-opening" aria-hidden>
- <i className="office-car-leaf" data-side="left" />
- <i className="office-car-leaf" data-side="right" />
- </div>
- <i className="office-car-frame" aria-hidden />
- <div className="office-car-display" aria-live="polite" aria-label={t(`society.office.floor_name_${OFFICE_FLOORS[level] ?? from}`)}>
- <span className="office-car-display-arrow" data-on={moving || undefined}><Arrow down={!up} /></span>
- <b key={level}>{level}</b>
- </div>
- <div ref={panel} className="office-car-panel" role="group" aria-label={t("society.office.elevator_choose")}>
- <ol className="office-car-directory">
- {CAR_BUTTONS.map((option) => (
- <li key={option}><b>{floorLevel(option)}</b><span>{t(`society.office.floor_name_${option}`)}</span></li>
- ))}
- </ol>
- {CAR_BUTTONS.map((option) => (
- <button key={option} type="button" className="office-car-button" data-floor={option}
- data-lit={to === option || undefined} aria-pressed={to === option}
- disabled={!boarding || option === from} aria-current={option === from ? "location" : undefined}
- aria-keyshortcuts={String(floorLevel(option))} aria-label={t(`society.office.floor_name_${option}`)}
- onClick={() => onPick(option)}>
- <span>{floorLevel(option)}</span>
- </button>
- ))}
- <i className="office-car-panel-gap" aria-hidden />
- <button type="button" className="office-car-button" data-kind="open" disabled={!boarding}
- aria-label={t("society.office.elevator_leave")} onClick={onLeave}>
- <span><DoorsOpenGlyph /></span>
- </button>
- </div>
- </div>
- </div>
- {boarding && <p className="office-car-hint">{t("society.office.elevator_keys")}</p>}
- </div>
- );
-}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/ElevatorDoors.tsx b/jarvis/ui/web/frontend/src/components/society/office/ElevatorDoors.tsx
new file mode 100644
index 0000000000..9d5b3572e9
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/office/ElevatorDoors.tsx
@@ -0,0 +1,23 @@
+/**
+ * The floor change: the elevator's two brushed-steel doors slide shut over
+ * the stage, the floor switches behind them, and they slide open on the new
+ * floor. OfficeStage owns the timing; this only draws the phase it is given.
+ * Part of the diorama: one palette in light and dark mode. Reduced motion:
+ * the doors appear and disappear without sliding.
+ */
+import { useT } from "@/i18n";
+import { floorLevel, type OfficeFloor } from "./officeStore";
+
+export type DoorsPhase = "closing" | "closed" | "opening";
+
+export function ElevatorDoors({ from, to, phase }: { from: OfficeFloor; to: OfficeFloor; phase: DoorsPhase }) {
+ const t = useT();
+ const up = floorLevel(to) > floorLevel(from);
+ return (
+ <div className="office-doors" data-phase={phase} role="status" aria-live="polite"
+ aria-label={t(up ? "society.office.riding_up_to" : "society.office.riding_down_to").replace("{0}", t(`society.office.floor_name_${to}`))}>
+ <i className="office-doors-leaf" data-side="left" aria-hidden />
+ <i className="office-doors-leaf" data-side="right" aria-hidden />
+ </div>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/ElevatorPanel.tsx b/jarvis/ui/web/frontend/src/components/society/office/ElevatorPanel.tsx
new file mode 100644
index 0000000000..869705d710
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/office/ElevatorPanel.tsx
@@ -0,0 +1,116 @@
+/**
+ * The elevator's floor picker: pressing the call button (click, or E at the
+ * doors) opens the elevator's button panel. A steel plate with the floor
+ * indicator on top and one round push button per floor, top floor first,
+ * each with the floor's name engraved beside it. The floor you are on shows
+ * in the indicator and cannot be pressed. A pressed button lights its rim
+ * for a moment, then the panel closes and the doors start to move.
+ *
+ * Keys: the floor's number (0, 1, 2) presses it, arrows move between the
+ * buttons, Escape (or E) closes. It is a dialog, so the character stands
+ * still while it is open (`ownsKeyboard`). Part of the diorama: one steel
+ * palette in light and dark mode.
+ */
+import { useEffect, useRef, useState } from "react";
+import { useReducedMotion } from "framer-motion";
+import { useT } from "@/i18n";
+import { floorLevel, OFFICE_FLOORS, type OfficeFloor } from "./officeStore";
+
+/** The floors as the panel lists them: top floor first, like a real elevator panel. */
+export const PANEL_FLOORS: readonly OfficeFloor[] = [...OFFICE_FLOORS].reverse();
+
+/** How long a pressed button stays lit before the panel hands the floor on. */
+export const BUTTON_PRESS_MS = 280;
+
+/** The floor a number key picks ("0" = ground floor), or null. */
+export function floorForKey(key: string): OfficeFloor | null {
+ const level = /^[0-9]$/.test(key) ? Number(key) : -1;
+ return OFFICE_FLOORS[level] ?? null;
+}
+
+export function ElevatorPanel({ floor, onPick, onClose }: {
+ floor: OfficeFloor;
+ onPick: (floor: OfficeFloor) => void;
+ onClose: () => void;
+}) {
+ const t = useT();
+ const reduced = useReducedMotion() ?? false;
+ const list = useRef<HTMLDivElement>(null);
+ const [pressed, setPressed] = useState<OfficeFloor | null>(null);
+ const pressTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
+ useEffect(() => () => clearTimeout(pressTimer.current), []);
+
+ // A ref, so the capture-phase key listener always calls the current press without re-subscribing.
+ const press = useRef<(target: OfficeFloor) => void>(() => undefined);
+ press.current = (target: OfficeFloor) => {
+ if (pressed || target === floor) return;
+ setPressed(target);
+ if (reduced) { onPick(target); return; }
+ pressTimer.current = setTimeout(() => onPick(target), BUTTON_PRESS_MS);
+ };
+
+ // Focus the first floor you can go to, and give focus back to the office when the panel closes.
+ useEffect(() => {
+ const before = document.activeElement instanceof HTMLElement ? document.activeElement : null;
+ list.current?.querySelector<HTMLButtonElement>("button:not(:disabled)")?.focus({ preventScroll: true });
+ return () => { before?.focus({ preventScroll: true }); };
+ }, []);
+
+ // Capture phase: the office's own E, Escape and movement keys never see these.
+ useEffect(() => {
+ const onKey = (event: KeyboardEvent) => {
+ if (event.key === "Escape" || event.code === "KeyE") {
+ event.preventDefault(); event.stopPropagation();
+ if (!event.repeat) onClose();
+ return;
+ }
+ // Ctrl/Alt/Cmd + a digit belongs to the browser or the app, never to the panel.
+ const picked = event.ctrlKey || event.metaKey || event.altKey ? null : floorForKey(event.key);
+ if (picked) {
+ event.preventDefault(); event.stopPropagation();
+ if (!event.repeat) press.current(picked);
+ return;
+ }
+ if (event.key === "ArrowUp" || event.key === "ArrowDown") {
+ event.preventDefault(); event.stopPropagation();
+ const buttons = [...(list.current?.querySelectorAll<HTMLButtonElement>("button:not(:disabled)") ?? [])];
+ if (buttons.length === 0) return;
+ const at = buttons.indexOf(document.activeElement as HTMLButtonElement);
+ buttons[at < 0 ? 0 : (at + (event.key === "ArrowDown" ? 1 : -1) + buttons.length) % buttons.length].focus();
+ }
+ };
+ document.addEventListener("keydown", onKey, true);
+ return () => document.removeEventListener("keydown", onKey, true);
+ }, [onClose]);
+
+ const up = pressed ? floorLevel(pressed) > floorLevel(floor) : null;
+ return (
+ <div className="office-lift-backdrop" data-office-ui onPointerDown={(event) => { if (event.target === event.currentTarget) onClose(); }}>
+ <div className="office-lift" role="dialog" data-state="open" aria-modal="true" aria-label={t("society.office.elevator_choose")}
+ data-reduced={reduced || undefined}>
+ <button type="button" className="office-lift-close" onClick={onClose} aria-label={t("society.office.close")}>×</button>
+ <div className="office-lift-display" aria-hidden>
+ <svg viewBox="0 0 24 24" className="office-lift-arrow" data-dir={up === null ? undefined : up ? "up" : "down"}>
+ <path d="M12 4 L21 15 H3 Z" fill="currentColor" />
+ </svg>
+ <b>{floorLevel(floor)}</b>
+ </div>
+ <div ref={list} className="office-lift-rows">
+ {PANEL_FLOORS.map((option) => {
+ const here = option === floor;
+ return (
+ <button key={option} type="button" className="office-lift-row" disabled={here || (pressed !== null && pressed !== option)}
+ aria-current={here ? "location" : undefined} aria-pressed={pressed === option}
+ aria-keyshortcuts={String(floorLevel(option))} data-here={here || undefined} data-lit={pressed === option || undefined}
+ onClick={() => press.current(option)}>
+ <span className="office-lift-button" aria-hidden><span>{floorLevel(option)}</span></span>
+ <span className="office-lift-label">{t(`society.office.floor_name_${option}`)}</span>
+ </button>
+ );
+ })}
+ </div>
+ <p className="office-lift-keys">{t("society.office.elevator_keys")}</p>
+ </div>
+ </div>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx b/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx
index a16c452a73..9a991037c2 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/office/OfficeStage.tsx
@@ -39,7 +39,8 @@ import { PaneCommandPanel } from "./PaneCommandPanel";
import type { WalkerContext } from "./OfficeAgents";
import { ownsKeyboard } from "./OfficePlayer";
import { ArcadeCabinet } from "./ArcadeCabinet";
-import { ElevatorCar, minRideMs, type CarPhase } from "./ElevatorCar";
+import { ElevatorPanel } from "./ElevatorPanel";
+import { ElevatorDoors, type DoorsPhase } from "./ElevatorDoors";
import { buildArcadeLayout } from "../arcade/arcadeFloorLayout";
import { ARCADE_GAMES, gameForCabinet, type RetroGameId } from "../arcade/arcadeGames";
import { useOfficeSettings, useReceptionTab } from "./officeSettings";
@@ -68,12 +69,10 @@ const REFRESH_JITTER_MS = 1500;
const EMPTY_OCCUPANTS: ReadonlyMap<string, PaneOccupant> = new Map();
-/** The elevator car: its doors slide in CAR_DOORS_MS, stepping in or out takes CAR_STEP_MS, a ride is capped at RIDE_MAX_MS. */
-const CAR_DOORS_MS = 760;
-const CAR_STEP_MS = 420;
-const RIDE_MAX_MS = 2800;
-/** The call button glows this long before the person is in the car. */
-const CALL_GLOW_MS = 280;
+/** The elevator doors: they slide in DOORS_MS and stay shut between DOORS_HOLD_MIN_MS and DOORS_HOLD_MAX_MS while the floor changes. */
+const DOORS_MS = 640;
+const DOORS_HOLD_MIN_MS = 450;
+const DOORS_HOLD_MAX_MS = 1600;
class RenderBoundary extends Component<{ children: ReactNode; fallbackText: string }, { failed: boolean }> {
state = { failed: false };
@@ -234,49 +233,40 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
openTimer.current = setTimeout(() => { go(); setDiving(false); }, ZOOM_SECONDS * 1000 + 260);
}, [sectionDive, compact, onOpenLedger, reduced]);
- // The elevator, ridden from inside the car (ElevatorCar): pressing the call
- // button at the doors puts the person in the car; pressing a floor there
- // closes the doors, the floor switches behind them, and the doors open once
- // the new floor has loaded and the indicator has counted the floors (capped);
- // then the person steps out. A press from afar (a click on the button, the
- // floor token or E anywhere) walks the character over instead; it never
- // rides from a distance. Reduced motion switches floors at once.
- const [car, setCar] = useState<{ phase: CarPhase; from: OfficeFloor; to: OfficeFloor | null; startedMs: number } | null>(null);
- const carTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
- useEffect(() => () => clearTimeout(carTimer.current), []);
- const [callLit, setCallLit] = useState(false);
+ // The elevator: pressing its call button, standing at the doors, opens the
+ // button panel; pressing a floor there closes the elevator doors over the
+ // stage, the floor switches behind them, and they open once the new floor
+ // has loaded (capped). A press from afar (a click on the button, the floor
+ // token or E anywhere) walks the character over instead; it never rides
+ // from a distance. Reduced motion switches floors at once.
+ const [picking, setPicking] = useState(false);
+ const [ride, setRide] = useState<{ from: OfficeFloor; to: OfficeFloor; phase: DoorsPhase; closedMs: number } | null>(null);
+ const rideTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
+ useEffect(() => () => clearTimeout(rideTimer.current), []);
const pressCall = useCallback(() => {
- if (car || callLit) return;
+ if (ride || picking) return;
const lift = layout.checkpoints.find((cp) => cp.id === "elevator");
if (!atElevator(player, lift)) {
if (lift) useOfficeStore.getState().requestWalk({ x: lift.x, z: lift.z });
return;
}
- // The button lights, then the doors are open and the person steps in.
- setCallLit(true);
- clearTimeout(carTimer.current);
- carTimer.current = setTimeout(() => {
- setCallLit(false);
- useOfficeStore.getState().select(null);
- setCar({ phase: "boarding", from: useOfficeStore.getState().floor, to: null, startedMs: 0 });
- }, CALL_GLOW_MS);
- }, [car, callLit, layout]);
+ useOfficeStore.getState().select(null);
+ setPicking(true);
+ }, [ride, picking, layout]);
+ const closePicker = useCallback(() => setPicking(false), []);
const pickFloor = useCallback((to: OfficeFloor) => {
- if (car?.phase !== "boarding" || to === car.from) return;
- if (reduced) { setCar(null); switchFloor(to, true); return; }
- setCar({ ...car, to, phase: "closing" });
- clearTimeout(carTimer.current);
- carTimer.current = setTimeout(() => {
+ setPicking(false);
+ const from = useOfficeStore.getState().floor;
+ if (ride || to === from) return;
+ if (reduced) { switchFloor(to, true); return; }
+ setRide({ from, to, phase: "closing", closedMs: 0 });
+ clearTimeout(rideTimer.current);
+ rideTimer.current = setTimeout(() => {
switchFloor(to, true);
- setCar((c) => (c ? { ...c, phase: "riding", startedMs: performance.now() } : c));
- carTimer.current = setTimeout(() => setCar((c) => (c?.phase === "riding" ? { ...c, phase: "opening" } : c)), RIDE_MAX_MS);
- }, CAR_DOORS_MS);
- }, [car, reduced]);
- const leaveCar = useCallback(() => {
- if (car?.phase !== "boarding") return;
- if (reduced) { setCar(null); return; }
- setCar({ ...car, phase: "leaving" });
- }, [car, reduced]);
+ setRide((r) => (r ? { ...r, phase: "closed", closedMs: performance.now() } : r));
+ rideTimer.current = setTimeout(() => setRide((r) => (r?.phase === "closed" ? { ...r, phase: "opening" } : r)), DOORS_HOLD_MAX_MS);
+ }, DOORS_MS);
+ }, [ride, reduced]);
// E at the elevator, or a click on its floor token, presses the call button instead of opening a panel.
useEffect(() => {
if (selection?.kind !== "checkpoint" || selection.id !== "elevator") return;
@@ -284,22 +274,17 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
pressCall();
}, [selection, select, pressCall]);
useEffect(() => {
- if (car?.phase === "riding" && floor === car.to && ready && car.to) {
- // The car settles once the floor has loaded and the indicator has counted every floor passed.
- const left = minRideMs(car.from, car.to) - (performance.now() - car.startedMs);
- clearTimeout(carTimer.current);
- carTimer.current = setTimeout(() => setCar((c) => (c ? { ...c, phase: "opening" } : c)), Math.max(220, left));
+ if (ride?.phase === "closed" && floor === ride.to && ready) {
+ // The doors stay shut a short beat at least, so the change reads as a ride and not a cut.
+ const left = DOORS_HOLD_MIN_MS - (performance.now() - ride.closedMs);
+ clearTimeout(rideTimer.current);
+ rideTimer.current = setTimeout(() => setRide((r) => (r ? { ...r, phase: "opening" } : r)), Math.max(0, left));
}
- if (car?.phase === "opening") {
- // The doors open, a short beat to look out, then the person steps out.
- clearTimeout(carTimer.current);
- carTimer.current = setTimeout(() => setCar((c) => (c ? { ...c, phase: "leaving" } : c)), CAR_DOORS_MS + 260);
+ if (ride?.phase === "opening") {
+ clearTimeout(rideTimer.current);
+ rideTimer.current = setTimeout(() => setRide(null), DOORS_MS);
}
- if (car?.phase === "leaving") {
- clearTimeout(carTimer.current);
- carTimer.current = setTimeout(() => setCar(null), CAR_STEP_MS);
- }
- }, [car, floor, ready]);
+ }, [ride, floor, ready]);
const counts = countStates(active);
const updateProfile = useCallback((next: PlayerProfile) => { setProfile(next); saveProfile(next); }, []);
@@ -407,7 +392,7 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
<OfficeScene floor={floor} occupants={occupants} ready={ready} layout={layout} grid={grid} walkers={walkers} agents={agents} newcomers={newcomers}
awake={awake} reduced={reduced} overview={overview} player={{ look: playerLook(profile), name: playerName }}
selection={selection} nearby={nearby} chats={chats} onOpenScreen={openScreen}
- elevatorCall={{ lit: callLit || !!car, picking: !!car, onPress: pressCall }} />
+ elevatorCall={{ lit: picking || !!ride, picking, onPress: pressCall }} />
</Canvas>
</Suspense>
</RenderBoundary>
@@ -469,14 +454,15 @@ export function OfficeStage({ onOpenLedger, onSelectAgent, onCreateAgent, onOpen
</div>
)}
- {nearbyLabel && !selection && !car && (
+ {nearbyLabel && !selection && !picking && !ride && (
<button type="button" className="office-hud office-prompt" data-office-ui onClick={() => nearby && select(nearby)}>
<kbd>E</kbd>{nearbyLabel}
</button>
)}
{!compact && <OfficeCompass layout={layout} agents={agents} selectedId={selection?.kind === "agent" ? selection.id : null} />}
{diving && <div className="office-dive-fade" aria-hidden />}
- {car && <ElevatorCar phase={car.phase} from={car.from} to={car.to} reduced={reduced} onPick={pickFloor} onLeave={leaveCar} />}
+ {picking && !ride && <ElevatorPanel floor={floor} onPick={pickFloor} onClose={closePicker} />}
+ {ride && <ElevatorDoors from={ride.from} to={ride.to} phase={ride.phase} />}
{!compact && <OfficeMinimap layout={layout} agents={agents} selectedId={selection?.kind === "agent" ? selection.id : null}
onOpenMap={() => setMapOpen(true)} />}
<OfficeFullMap open={mapOpen} onOpen={() => setMapOpen(true)} onClose={() => setMapOpen(false)}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeFloors.css b/jarvis/ui/web/frontend/src/components/society/office/officeFloors.css
index 37ec05b648..b6fcd91f8a 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/officeFloors.css
+++ b/jarvis/ui/web/frontend/src/components/society/office/officeFloors.css
@@ -1,146 +1,26 @@
/* Floors, the elevator ride and the compact (IDE side panel) HUD. Theme tokens only: light and dark mode both work. */
/*
- * Inside the elevator car (ElevatorCar). The car frames the stage like standing in it: steel side walls
- * and a lit ceiling drawn in perspective, a stone floor, and the front wall with the door opening, the
- * floor indicator above it and the operating panel beside it. Through the opening the stage stays visible
- * until the doors close. Sizes follow the stage (container units), so the car fits the side panel too.
- * Part of the diorama: one palette in light and dark mode.
+ * The floor change (ElevatorDoors): the elevator's two brushed-steel doors slide shut over the stage, the
+ * floor switches behind them, they slide open. Part of the diorama: one palette in light and dark mode.
*/
-.office-car {
- --front-w:min(64cqw, 112cqh); --side:calc((100cqw - var(--front-w)) / 2); --ceil:10cqh; --floor:11cqh;
- --door-w:50%; --door-h:84%; --pier:calc((100% - var(--door-w)) / 2);
- --steel:repeating-linear-gradient(90deg, rgb(255 255 255 / .045) 0 1px, transparent 1px 3px), linear-gradient(180deg, #c6cbd1, #a9afb6 55%, #949aa2);
- position:absolute; inset:0; z-index:62; overflow:hidden; container-type:size;
-}
-.office-car-body { position:absolute; inset:0; animation:office-car-in 420ms cubic-bezier(.2,.75,.25,1); transform-origin:50% 55%; }
-@keyframes office-car-in { from { opacity:0; transform:scale(1.14); } }
-.office-car[data-phase="leaving"] .office-car-body { opacity:0; transform:scale(1.14); transition:opacity 420ms ease-in, transform 420ms cubic-bezier(.5,0,.75,.3); }
-/* Under way: a jolt as the car pulls away, a faint hum, and it settles when it stops. */
-.office-car[data-phase="riding"] .office-car-body { animation:office-car-pull 420ms cubic-bezier(.3,0,.3,1), office-car-hum 180ms linear 420ms infinite; }
-.office-car[data-phase="opening"] .office-car-body { animation:office-car-settle 360ms cubic-bezier(.2,.8,.2,1); }
-@keyframes office-car-pull { 30% { transform:translateY(calc(var(--pull, 1) * 0.5cqh)); } }
-@keyframes office-car-hum { 50% { transform:translateY(0.08cqh); } }
-@keyframes office-car-settle { 40% { transform:translateY(calc(var(--pull, 1) * -0.35cqh)); } }
-.office-car[data-direction="down"] { --pull:-1; }
-
-/* Ceiling with its light panel, floor, side walls: trapezoids meeting the front wall's edges. */
-.office-car-ceiling {
- position:absolute; left:0; right:0; top:0; height:var(--ceil);
- clip-path:polygon(0 0, 100% 0, calc(100% - var(--side)) 100%, var(--side) 100%);
- background:linear-gradient(180deg, #24272c, #3a3e45);
-}
-.office-car-light {
- position:absolute; left:50%; bottom:22%; width:calc(var(--front-w) * .62); height:38%; transform:translateX(-50%); border-radius:3px;
- background:linear-gradient(180deg, #ffffff, #eef4ff); box-shadow:0 0 2.4cqh rgb(255 255 255 / .75), 0 0 6cqh rgb(220 235 255 / .35);
-}
-.office-car-floor {
- position:absolute; left:0; right:0; bottom:0; height:var(--floor);
- clip-path:polygon(var(--side) 0, calc(100% - var(--side)) 0, 100% 100%, 0 100%);
- background:
- radial-gradient(circle at 20% 40%, rgb(255 255 255 / .06) 0 1px, transparent 1.5px) 0 0 / 7px 7px,
- radial-gradient(circle at 70% 60%, rgb(0 0 0 / .25) 0 1px, transparent 1.5px) 0 0 / 9px 9px,
- linear-gradient(180deg, #4a4a50, #26262a 70%, #1a1a1d);
-}
-.office-car-wall {
- position:absolute; top:0; bottom:0; width:var(--side);
- /* Steel panels whose seams crowd together towards the front wall, as they would in perspective. */
- background:
- linear-gradient(90deg, transparent 0 34%, rgb(0 0 0 / .22) 34% 34.4%, rgb(255 255 255 / .18) 34.4% 34.7%, transparent 34.7% 62%,
- rgb(0 0 0 / .22) 62% 62.4%, rgb(255 255 255 / .18) 62.4% 62.7%, transparent 62.7% 82%,
- rgb(0 0 0 / .22) 82% 82.4%, rgb(255 255 255 / .18) 82.4% 82.7%, transparent 82.7%),
- repeating-linear-gradient(180deg, rgb(255 255 255 / .025) 0 1px, transparent 1px 3px),
- linear-gradient(90deg, #4b5057 0%, #7b8189 55%, #a1a7ae 100%);
-}
-.office-car-wall[data-side="left"] { left:0; clip-path:polygon(0 0, 100% var(--ceil), 100% calc(100% - var(--floor)), 0 100%); }
-/* The right wall is the left one mirrored: same shape, rail and light falling off towards the viewer. */
-.office-car-wall[data-side="right"] { right:0; clip-path:polygon(0 0, 100% var(--ceil), 100% calc(100% - var(--floor)), 0 100%); transform:scaleX(-1); }
-/* A brushed handrail at hip height, running towards the front wall. */
-.office-car-rail { position:absolute; inset:0; background:linear-gradient(180deg, #f6f8fa 58%, #6c727a 62%); clip-path:polygon(0 61.2%, 100% 57.5%, 100% 58.5%, 0 62.8%); }
-
-/* The front wall: lintel, two piers and the door frame round the opening. */
-.office-car-front { position:absolute; left:50%; top:var(--ceil); bottom:var(--floor); width:var(--front-w); transform:translateX(-50%); }
-.office-car-lintel, .office-car-pier { position:absolute; background:var(--steel); }
-.office-car-lintel { left:0; right:0; top:0; height:calc(100% - var(--door-h)); }
-.office-car-pier { bottom:0; height:var(--door-h); width:var(--pier); }
-.office-car-pier[data-side="left"] { left:0; box-shadow:inset -1px 0 0 rgb(0 0 0 / .12); }
-.office-car-pier[data-side="right"] { right:0; box-shadow:inset 1px 0 0 rgb(0 0 0 / .12); }
-.office-car-opening { position:absolute; bottom:0; left:var(--pier); width:var(--door-w); height:var(--door-h); overflow:hidden; }
-.office-car-frame {
- position:absolute; bottom:0; left:var(--pier); width:var(--door-w); height:var(--door-h); pointer-events:none;
- box-shadow:0 0 0 0.9cqh #6d737b, 0 0 0 calc(0.9cqh + 1px) rgb(0 0 0 / .35), inset 0 0 0 1px rgb(0 0 0 / .4);
-}
-/* The doors: two brushed leaves that slide behind the piers. */
-.office-car-leaf {
+.office-doors { position:absolute; inset:0; z-index:62; pointer-events:none; overflow:hidden; }
+.office-doors-leaf {
position:absolute; top:0; bottom:0; width:50%;
- background:repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 1px, transparent 1px 3px), linear-gradient(90deg, #a2a8af, #c9cdd2 50%, #a7adb4);
- transition:transform 760ms cubic-bezier(.45,0,.2,1);
-}
-.office-car-leaf[data-side="left"] { left:0; transform:translateX(-100%); box-shadow:inset -2px 0 0 #3b3f45, inset -10px 0 14px -10px rgb(0 0 0 / .45); }
-.office-car-leaf[data-side="right"] { right:0; transform:translateX(100%); box-shadow:inset 2px 0 0 #3b3f45, inset 10px 0 14px -10px rgb(0 0 0 / .45); }
-.office-car[data-phase="closing"] .office-car-leaf,
-.office-car[data-phase="riding"] .office-car-leaf { transform:translateX(0); }
-
-/* The floor indicator above the doors: black glass, an orange dot-matrix number and the direction arrow. */
-.office-car-display {
- position:absolute; left:50%; top:calc((100% - var(--door-h)) / 2); transform:translate(-50%, -50%);
- display:flex; align-items:center; justify-content:center; gap:0.8cqh; height:62%; max-height:9cqh; aspect-ratio:2.2;
- border-radius:0.6cqh; background:linear-gradient(180deg, #121316, #050506); box-shadow:inset 0 0 0 1px rgb(255 255 255 / .07), 0 1px 0 rgb(255 255 255 / .35);
- color:#ff8a1f; font-family:'Pixelify Sans', ui-monospace, monospace; font-weight:600; line-height:1;
-}
-.office-car-display b { font-size:min(6.2cqh, 9cqw); text-shadow:0 0 0.8cqh rgb(255 138 31 / .7); animation:office-car-digit 260ms ease-out; }
-@keyframes office-car-digit { from { opacity:.15; } }
-.office-car-display-arrow { width:min(2.8cqh, 4cqw); opacity:.18; transition:opacity 200ms ease; }
-.office-car-display-arrow[data-on] { opacity:1; filter:drop-shadow(0 0 0.5cqh rgb(255 138 31 / .7)); }
-.office-car-arrow { display:block; width:100%; height:auto; }
-.office-car-arrow[data-down] { transform:rotate(180deg); }
-.office-car[data-phase="opening"] .office-car-display { animation:office-car-chime 520ms ease-out; }
-@keyframes office-car-chime { 35% { box-shadow:inset 0 0 0 1px rgb(255 255 255 / .07), 0 0 2.4cqh rgb(255 138 31 / .55); } }
-
-/* The operating panel on the right pier: a steel plate with a directory, one push button per floor and "doors open". */
-.office-car-panel {
- position:absolute; right:calc(var(--pier) * .22); top:14%; width:calc(var(--pier) * .5); min-width:58px; max-width:120px;
- display:flex; flex-direction:column; align-items:center; gap:1.1cqh; padding:1.4cqh 0.9cqh 1.6cqh; border-radius:0.8cqh;
- background:
- radial-gradient(circle, #6a7078 0 1.6px, transparent 2.2px) left 2px top 2px / 14px 14px no-repeat,
- radial-gradient(circle, #6a7078 0 1.6px, transparent 2.2px) right 2px top 2px / 14px 14px no-repeat,
- radial-gradient(circle, #6a7078 0 1.6px, transparent 2.2px) left 2px bottom 2px / 14px 14px no-repeat,
- radial-gradient(circle, #6a7078 0 1.6px, transparent 2.2px) right 2px bottom 2px / 14px 14px no-repeat,
- repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 1px, transparent 1px 3px), linear-gradient(180deg, #d3d7dc, #aeb4bb);
- box-shadow:0 0.4cqh 1cqh rgb(0 0 0 / .3), inset 0 1px 0 rgb(255 255 255 / .6), inset 0 0 0 1px rgb(0 0 0 / .14);
-}
-.office-car-directory { list-style:none; margin:0 0 0.3cqh; padding:0.6cqh 0.7cqh; width:100%; border-radius:0.4cqh; background:rgb(0 0 0 / .06); box-shadow:inset 0 1px 1px rgb(0 0 0 / .18); }
-.office-car-directory li { display:flex; gap:0.6em; align-items:baseline; font-size:clamp(8px, 1.15cqh, 11px); line-height:1.35; color:#353a41; text-shadow:0 1px 0 rgb(255 255 255 / .55); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
-.office-car-directory b { flex:none; font-weight:700; }
-.office-car-directory span { overflow:hidden; text-overflow:ellipsis; }
-.office-car-panel-gap { width:70%; height:1px; margin:0.2cqh 0; background:rgb(0 0 0 / .18); box-shadow:0 1px 0 rgb(255 255 255 / .45); }
-/* A push button: a polished ring round a satin face with the engraved number; its rim lights up when pressed. */
-.office-car-button {
- position:relative; width:62%; aspect-ratio:1; padding:0; border:0; border-radius:50%; cursor:pointer;
- background:radial-gradient(circle at 35% 30%, #fdfdfd, #b6bcc3 55%, #737980);
- box-shadow:0 0.25cqh 0.45cqh rgb(0 0 0 / .4), inset 0 -1px 2px rgb(0 0 0 / .25);
- transition:box-shadow 160ms ease, transform 90ms ease;
+ background:repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 1px, transparent 1px 3px), linear-gradient(90deg, #969ca4, #c4c8ce 50%, #9ca2a9);
+ transition:transform 640ms cubic-bezier(.45,0,.2,1);
}
-.office-car-button span {
- position:absolute; inset:13%; display:grid; place-items:center; border-radius:50%;
- background:radial-gradient(circle at 50% 38%, #e2e5e9, #b3b9c0); color:#40454c;
- font-family:'Inter Variable', Inter, system-ui, sans-serif; font-weight:650; font-size:min(2.1cqh, 15px);
- text-shadow:0 1px 0 rgb(255 255 255 / .65); box-shadow:inset 0 1px 2px rgb(0 0 0 / .25), 0 0 0 2px transparent;
- transition:box-shadow 180ms ease, color 180ms ease;
-}
-.office-car-button span svg { width:58%; height:58%; }
-.office-car-button:enabled:hover span { background:radial-gradient(circle at 50% 38%, #edf0f3, #bfc5cb); }
-.office-car-button:enabled:active { transform:scale(.96); }
-.office-car-button:focus-visible { outline:2px solid #8fd8ff; outline-offset:3px; }
-.office-car-button:disabled { cursor:default; }
-.office-car-button[data-lit] span { color:#1f6f96; box-shadow:inset 0 1px 2px rgb(0 0 0 / .2), 0 0 0 2px #8fd8ff, 0 0 1.4cqh rgb(143 216 255 / .9); }
-.office-car-hint {
- position:absolute; left:50%; bottom:2.2cqh; transform:translateX(-50%); margin:0; padding:0.5cqh 1.4cqh; border-radius:999px;
- background:rgb(10 11 14 / .55); color:rgb(240 242 245 / .85); font-size:11px; white-space:nowrap;
-}
-.office-car[data-reduced] *, .office-car[data-reduced] *::before, .office-car[data-reduced] *::after { animation:none !important; transition:none !important; }
+.office-doors-leaf[data-side="left"] { left:0; transform:translateX(-101%); box-shadow:inset -3px 0 0 #2f3338, inset -18px 0 26px -16px rgb(0 0 0 / .5); }
+.office-doors-leaf[data-side="right"] { right:0; transform:translateX(101%); box-shadow:inset 3px 0 0 #2f3338, inset 18px 0 26px -16px rgb(0 0 0 / .5); }
+.office-doors[data-phase="closing"] .office-doors-leaf,
+.office-doors[data-phase="closed"] .office-doors-leaf { transform:translateX(0); }
+/* A fresh mount starts open, so closing slides in from the sides; opening slides back out. */
+.office-doors[data-phase="closing"] .office-doors-leaf { animation:office-doors-close 640ms cubic-bezier(.45,0,.2,1); }
+@keyframes office-doors-close { from { transform:translateX(var(--office-door-from, 0)); } }
+.office-doors[data-phase="closing"] .office-doors-leaf[data-side="left"] { --office-door-from:-101%; }
+.office-doors[data-phase="closing"] .office-doors-leaf[data-side="right"] { --office-door-from:101%; }
@media (prefers-reduced-motion: reduce) {
- .office-car *, .office-car *::before, .office-car *::after { animation:none !important; transition:none !important; }
+ .office-doors-leaf { transition:none; animation:none !important; }
}
/* The pill over the elevator's call button. Like the name pills it is part of the diorama, which keeps one palette in both modes. */
@@ -164,3 +44,73 @@
.office-stage-compact .office-panel-slot { top:auto; bottom:48px; right:8px; width:calc(100% - 16px); max-height:62%; }
.office-stage-compact .office-prompt { bottom:48px; max-width:calc(100% - 16px); font-size:12px; }
.office-stage-compact .office-note { font-size:11px; }
+
+/*
+ * The elevator's button panel (ElevatorPanel): a steel plate with the floor indicator on top and one round
+ * push button per floor, its name engraved beside it. A pressed button lights its rim. Part of the diorama:
+ * one palette in light and dark mode.
+ */
+.office-lift-backdrop { position:absolute; inset:0; z-index:64; display:flex; align-items:center; justify-content:center; padding:16px; background:rgb(8 9 12 / .32); }
+.office-lift {
+ position:relative; width:min(230px, 100%); padding:18px 18px 14px; border-radius:10px;
+ background:
+ radial-gradient(circle, #6a7078 0 1.7px, transparent 2.3px) left 4px top 4px / 14px 14px no-repeat,
+ radial-gradient(circle, #6a7078 0 1.7px, transparent 2.3px) right 4px top 4px / 14px 14px no-repeat,
+ radial-gradient(circle, #6a7078 0 1.7px, transparent 2.3px) left 4px bottom 4px / 14px 14px no-repeat,
+ radial-gradient(circle, #6a7078 0 1.7px, transparent 2.3px) right 4px bottom 4px / 14px 14px no-repeat,
+ repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 1px, transparent 1px 3px),
+ linear-gradient(180deg, #d5d9de, #aeb4bb);
+ box-shadow:0 18px 48px rgb(0 0 0 / .45), inset 0 1px 0 rgb(255 255 255 / .7), inset 0 0 0 1px rgb(0 0 0 / .16);
+ animation:office-lift-in 200ms cubic-bezier(.2,.8,.2,1);
+}
+@keyframes office-lift-in { from { opacity:0; transform:translateY(8px); } }
+.office-lift-close {
+ position:absolute; top:8px; right:8px; width:24px; height:24px; border:0; border-radius:6px; background:transparent;
+ color:#4a4f56; font-size:17px; line-height:1; cursor:pointer;
+}
+.office-lift-close:hover { background:rgb(0 0 0 / .08); }
+.office-lift-close:focus-visible { outline:2px solid #2f7fb0; outline-offset:1px; }
+/* The indicator: black glass with an orange dot-matrix number and the direction arrow once a floor is pressed. */
+.office-lift-display {
+ display:flex; align-items:center; justify-content:center; gap:8px; width:96px; height:46px; margin:0 auto 16px; border-radius:5px;
+ background:linear-gradient(180deg, #121316, #050506); box-shadow:inset 0 0 0 1px rgb(255 255 255 / .07), 0 1px 0 rgb(255 255 255 / .6);
+ color:#ff8a1f; font-family:'Pixelify Sans', ui-monospace, monospace; font-weight:600; line-height:1;
+}
+.office-lift-display b { font-size:30px; text-shadow:0 0 8px rgb(255 138 31 / .7); }
+.office-lift-arrow { width:16px; height:16px; opacity:.16; transition:opacity 160ms ease; }
+.office-lift-arrow[data-dir] { opacity:1; filter:drop-shadow(0 0 4px rgb(255 138 31 / .7)); }
+.office-lift-arrow[data-dir="down"] { transform:rotate(180deg); }
+.office-lift-rows { display:flex; flex-direction:column; gap:10px; }
+/* A row: the push button and its engraved name; the whole row is the click target. */
+.office-lift-row {
+ display:flex; align-items:center; gap:14px; width:100%; padding:2px 4px; border:0; border-radius:28px; background:transparent;
+ color:inherit; text-align:left; cursor:pointer;
+}
+/* Keyboard focus rings the button itself, like a lit rim, instead of boxing the whole row. */
+.office-lift-row:focus-visible { outline:none; }
+.office-lift-row:focus-visible .office-lift-button { box-shadow:0 2px 4px rgb(0 0 0 / .38), inset 0 -1px 2px rgb(0 0 0 / .25), 0 0 0 3px #2f7fb0; }
+.office-lift-row:disabled { cursor:default; }
+.office-lift-button {
+ position:relative; flex:none; width:46px; height:46px; border-radius:50%;
+ background:radial-gradient(circle at 35% 30%, #fdfdfd, #b6bcc3 55%, #737980);
+ box-shadow:0 2px 4px rgb(0 0 0 / .38), inset 0 -1px 2px rgb(0 0 0 / .25);
+ transition:transform 90ms ease;
+}
+.office-lift-button span {
+ position:absolute; inset:6px; display:grid; place-items:center; border-radius:50%;
+ background:radial-gradient(circle at 50% 38%, #e3e6ea, #b3b9c0); color:#40454c;
+ font-family:'Inter Variable', Inter, system-ui, sans-serif; font-size:16px; font-weight:650;
+ text-shadow:0 1px 0 rgb(255 255 255 / .65); box-shadow:inset 0 1px 2px rgb(0 0 0 / .25), 0 0 0 2px transparent;
+ transition:box-shadow 180ms ease, color 180ms ease, background 140ms ease;
+}
+.office-lift-row:enabled:hover .office-lift-button span { background:radial-gradient(circle at 50% 38%, #eef0f3, #c0c6cc); }
+.office-lift-row:enabled:active .office-lift-button { transform:scale(.95); }
+.office-lift-row[data-lit] .office-lift-button span { color:#1f6f96; box-shadow:inset 0 1px 2px rgb(0 0 0 / .2), 0 0 0 2px #8fd8ff, 0 0 12px rgb(143 216 255 / .95); }
+.office-lift-label { font-size:13px; font-weight:600; color:#30353b; text-shadow:0 1px 0 rgb(255 255 255 / .55); }
+.office-lift-row[data-here] .office-lift-label { color:#6b7179; }
+.office-lift-row:disabled:not([data-here]):not([data-lit]) { opacity:.55; }
+.office-lift-keys { margin:14px 0 0; text-align:center; font-size:10px; color:#5c626a; text-shadow:0 1px 0 rgb(255 255 255 / .45); }
+.office-lift[data-reduced], .office-lift[data-reduced] * { animation:none !important; transition:none !important; }
+@media (prefers-reduced-motion: reduce) {
+ .office-lift, .office-lift * { animation:none !important; transition:none !important; }
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/office/officeFloors.test.ts b/jarvis/ui/web/frontend/src/components/society/office/officeFloors.test.ts
index 33dd2382cf..07b16d6c02 100644
--- a/jarvis/ui/web/frontend/src/components/society/office/officeFloors.test.ts
+++ b/jarvis/ui/web/frontend/src/components/society/office/officeFloors.test.ts
@@ -4,7 +4,7 @@ import { buildNavGrid, isWalkable } from "./officeNav";
import { arrivalPose, knownOnFloor, noteArrivals } from "./officeFloors";
import { floorLevel, OFFICE_FLOORS, officeSession, player, switchFloor, useOfficeStore } from "./officeStore";
import { callDirection } from "./ElevatorCallButton";
-import { CAR_BUTTONS, floorForKey, minRideMs, RIDE_STEP_MS, rideLevels } from "./ElevatorCar";
+import { floorForKey, PANEL_FLOORS } from "./ElevatorPanel";
import { buildArcadeLayout } from "../arcade/arcadeFloorLayout";
const AGENTS: OfficeAgentInput[] = [
@@ -23,25 +23,15 @@ function resetBuilding() {
afterEach(resetBuilding);
describe("floors", () => {
- it("stacks the floors bottom to top, and the car's panel lists them top first", () => {
+ it("stacks the floors bottom to top, and the elevator panel lists them top first", () => {
expect(OFFICE_FLOORS).toEqual(["agents", "coding", "arcade"]);
expect(OFFICE_FLOORS.map(floorLevel)).toEqual([0, 1, 2]);
- expect(CAR_BUTTONS).toEqual(["arcade", "coding", "agents"]);
+ expect(PANEL_FLOORS).toEqual(["arcade", "coding", "agents"]);
expect(callDirection("agents")).toBe("up");
expect(callDirection("coding")).toBe("both");
expect(callDirection("arcade")).toBe("down");
});
- it("counts every floor a ride passes, in the direction of travel", () => {
- expect(rideLevels("agents", "arcade")).toEqual([0, 1, 2]);
- expect(rideLevels("arcade", "agents")).toEqual([2, 1, 0]);
- expect(rideLevels("coding", "arcade")).toEqual([1, 2]);
- expect(rideLevels("coding", "coding")).toEqual([1]);
- // The car stays under way long enough to show each passed floor once.
- expect(minRideMs("agents", "arcade")).toBe(2 * RIDE_STEP_MS);
- expect(minRideMs("coding", "agents")).toBe(RIDE_STEP_MS);
- });
-
it("picks a floor by its number key", () => {
expect(floorForKey("0")).toBe("agents");
expect(floorForKey("1")).toBe("coding");
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
index 3091e9cea1..b673ce580a 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/de.json
@@ -819,8 +819,7 @@
"cp_elevator": "Aufzug",
"cp_elevator_hint": "Den Ruf-Knopf neben den Türen drücken",
"elevator_choose": "Etage wählen",
- "elevator_leave": "Aussteigen",
- "elevator_keys": "0–2 wählt die Etage · Esc zum Aussteigen",
+ "elevator_keys": "0–2 wählt die Etage · Esc schließt",
"floor_name_agents": "Agenten-Etage",
"floor_name_coding": "Coding-Etage",
"floor_name_arcade": "Arcade-Etage",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
index 221f2a4036..22a58e4f44 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/en.json
@@ -819,8 +819,7 @@
"cp_elevator": "Elevator",
"cp_elevator_hint": "Press the call button beside the doors",
"elevator_choose": "Choose a floor",
- "elevator_leave": "Step out",
- "elevator_keys": "0–2 picks a floor · Esc steps out",
+ "elevator_keys": "0–2 picks a floor · Esc closes",
"floor_name_agents": "Agents floor",
"floor_name_coding": "Coding floor",
"floor_name_arcade": "Arcade floor",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
index daaa46f579..f9ebb3c945 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/society/es.json
@@ -819,8 +819,7 @@
"cp_elevator": "Ascensor",
"cp_elevator_hint": "Pulsa el botón de llamada junto a las puertas",
"elevator_choose": "Elige una planta",
- "elevator_leave": "Salir",
- "elevator_keys": "0–2 elige planta · Esc para salir",
+ "elevator_keys": "0–2 elige planta · Esc cierra",
"floor_name_agents": "Planta de agentes",
"floor_name_coding": "Planta de código",
"floor_name_arcade": "Planta arcade",