import React from "react"; export interface Scene { id: string; name: string; } export const SCENES: Scene[] = [ { id: "default", name: "Default" }, { id: "office", name: "Office" }, { id: "lab", name: "Lab" }, { id: "hospital", name: "Hospital" }, { id: "night", name: "Night city" }, ]; export const DEFAULT_SCENE = "default"; // Full-bleed backdrop behind the desks. pointerEvents:none so desks stay clickable; // zIndex 0 keeps it under the desk strip, clock, bed and bell. Desaturated + faded // so the scene recedes and the foreground desks/agents stay the focus. const LAYER: React.CSSProperties = { position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden", zIndex: 0, opacity: 0.7, filter: "saturate(0.55)", }; const pc = (v: number | string) => (typeof v === "number" ? `${v}%` : v); const at = (top: number | string, left: number | string, extra?: React.CSSProperties): React.CSSProperties => ({ position: "absolute", top: pc(top), left: pc(left), transform: "translate(-50%,-50%)", ...extra }); function tileBg(base: string, line: string, size: number): React.CSSProperties { return { backgroundColor: base, backgroundImage: `repeating-linear-gradient(0deg, ${line} 0 1px, transparent 1px ${size}px),` + `repeating-linear-gradient(90deg, ${line} 0 1px, transparent 1px ${size}px)`, }; } // ── Props (clean flat SVG / divs) ──────────────────────────────────────────── function SnakePlant({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function Monstera({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function Cactus({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function WaterCooler({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function Coffee({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function FloorLamp({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function TPlant({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function Bench({ top, left, w = 200 }: { top: number; left: number; w?: number }) { return
; } function Cabinet({ top, left }: { top: number; left: number }) { const cols = ["#5fd0e6", "#5fe6a3", "#e66fb0", "#e6c25f", "#6fb0e6"]; return (
{cols.map((c, i) =>
)}
); } function HospitalBed({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return (
); } function IVStand({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function VitalsMonitor({ top, left, s = 1 }: { top: number; left: number; s?: number }) { return ( ); } function Building({ left, w, h, lit }: { left: string; w: number; h: number; lit: number }) { const rows = Math.floor((h - 10) / 14), cols = Math.max(1, Math.floor(w / 14)); return (
{Array.from({ length: rows }).map((_, r) => (
{Array.from({ length: cols }).map((_, c) =>
)}
))}
); } // ── Scenes ─────────────────────────────────────────────────────────────────── // The original minimal backdrop: dark floor + subtle grid + top rule. Rendered at // full strength (no muting) since there's nothing to compete with the foreground. function DefaultScene() { return (
); } // Sparse accents placed in the gaps around the desks, leaving the centre open. const OFFICE_PROPS: { Comp: React.FC<{ top: number; left: number; s?: number }>; top: number; left: number; s: number }[] = [ { Comp: WaterCooler, top: 84, left: 12, s: 1.1 }, { Comp: SnakePlant, top: 86, left: 30, s: 1.1 }, { Comp: Monstera, top: 84, left: 50, s: 1.0 }, { Comp: TPlant, top: 87, left: 70, s: 1.2 }, { Comp: Cactus, top: 86, left: 88, s: 1.0 }, { Comp: FloorLamp, top: 52, left: 6, s: 1.2 }, { Comp: Coffee, top: 54, left: 94, s: 1.1 }, { Comp: TPlant, top: 22, left: 33, s: 0.8 }, { Comp: SnakePlant, top: 22, left: 67, s: 0.75 }, ]; function OfficeScene() { return (
{/* hanging pendant lamps */} {[18, 40, 62, 84].map((l, i) => (
))} {OFFICE_PROPS.map(({ Comp, top, left, s }, i) => )}
); } function LabScene() { return (
{/* periodic-table poster on the wall */}
{Array.from({ length: 24 }).map((_, i) =>
)}
{/* bench rows with equipment */} {[40, 64, 88].map((t, ri) => ( {[18, 38, 58, 78].map((l, ci) => { const kind = (ri + ci) % 4; const col = ["#5fd0e6", "#5fe6a3", "#e66fb0", "#6fb0e6"][kind]; return ( {kind === 0 && } {kind === 1 && <>} {kind === 2 && } {kind === 3 && } ); })} ))} {[[16, 8], [16, 92], [92, 10], [92, 90]].map(([t, l], i) => )}
); } function HospitalScene() { return (
{/* red cross signs on the wall (clear of bed & clock) */} {[30, 70].map((l, i) => ( ))} {/* aisle guide line down the centre */}
{/* beds along both walls, aisle open in the middle */} {/* vitals monitors by the left beds, IV stands by the right beds */} {/* plants in the corners */} {[[24, 7], [24, 93], [96, 50]].map(([t, l], i) => )}
); } const STARS = Array.from({ length: 60 }, (_, i) => ({ top: `${(i * 53) % 48}%`, left: `${(i * 71) % 100}%`, size: (i % 3) + 1 })); function NightScene() { const buildings: [string, number, number][] = [ ["0%", 56, 100], ["6%", 44, 150], ["13%", 72, 76], ["21%", 50, 184], ["29%", 64, 120], ["37%", 40, 160], ["44%", 84, 70], ["54%", 52, 140], ["62%", 60, 104], ["70%", 46, 190], ["78%", 70, 86], ["86%", 54, 134], ["93%", 64, 110], ]; return (
{STARS.map((s, i) =>
)}
{buildings.map(([l, w, h], i) => )}
{["14%", "46%", "78%"].map((l, i) => (
))}
); } export function SceneBackground({ scene }: { scene: string }) { switch (scene) { case "office": return ; case "lab": return ; case "hospital": return ; case "night": return ; case "default": default: return ; } }