Prompt specification
Build or customize the Three.js 3D scene "Community Repair Day" inside the active workspace.
Engineering Constraints:
1. Runtime & Orbit: Use Three.js r160 with OrbitControls (damping enabled) and ACESFilmicToneMapping.
2. Frame Timing: Drive all motion strictly with clock.getDelta() so animation speed is FPS-independent.
3. Viewport Hygiene: Handle window resize cleanly, cap DPR at Math.min(window.devicePixelRatio, 2), and dispose geometries/materials/renderer on unmount.
Scene Metadata:
Scene: Community Repair Day
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/community-repair-day-x3279
Scene Description Prompt:
Please create one self-contained HTML file with Three.js from cdnjs showing volunteer skills, assignments, and availability. Create a repair event with intake, diagnosis, skilled benches, and waiting items. Match each job to explicit capabilities and show why additional untrained helpers do not solve every queue. Voxel style.
Working Three.js Starter (community-repair-day-x3279):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fixer Commons — Volunteer Repair Operations</title>
<style>
:root {
--bg: #07100e;
--surface: #0d1815;
--surface-2: #12211d;
--surface-3: #182a25;
--line: #294038;
--line-soft: #1c3029;
--text: #f4f1df;
--muted: #94a69d;
--lime: #d7ff4f;
--cyan: #62d8e9;
--orange: #ff7d49;
--yellow: #f4c84b;
--red: #ff6262;
--green: #70e09b;
--shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}
* {
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
margin: 0;
min-width: 320px;
background:
linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
var(--bg);
background-size: 32px 32px;
color: var(--text);
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
font-size: 14px;
line-height: 1.45;
}
button,
input {
font: inherit;
}
button {
color: inherit;
}
button:focus-visible,
input:focus-visible {
outline: 2px solid var(--lime);
outline-offset: 2px;
}
.app-header {
position: sticky;
top: 0;
z-index: 50;
display: flex;
align-items: center;
justify-content: space-between;
min-height: 68px;
padding: 0 28px;
border-bottom: 1px solid var(--line-soft);
background: rgba(7, 16, 14, 0.94);
backdrop-filter: blur(16px);
}
.brand {
display: flex;
align-items: center;
gap: 13px;
min-width: 240px;
}
.brand-mark {
position: relative;
width: 31px;
height: 31px;
border: 2px solid var(--lime);
box-shadow:
5px 5px 0 rgba(215, 255, 79, 0.14),
inset 5px -5px 0 rgba(215, 255, 79, 0.12);
}
.brand-mark::before,
.brand-mark::after {
content: "";
position: absolute;
background: var(--lime);
}
.brand-mark::before {
width: 7px;
height: 7px;
left: 4px;
top: 4px;
}
.brand-mark::after {
width: 10px;
height: 4px;
left: 8px;
bottom: 5px;
}
.brand-name {
font-weight: 850;
letter-spacing: .08em;
font-size: 14px;
}
.brand-name span {
color: var(--lime);
}
.header-nav {
display: flex;
align-items: center;
gap: 4px;
}
.header-nav a {
padding: 9px 12px;
border: 1px solid transparent;
color: var(--muted);
text-decoration: none;
font-size: 12px;
font-weight: 750;
letter-spacing: .05em;
text-transform: uppercase;
}
.header-nav a:hover {
border-color: var(--line);
color: var(--text);
background: var(--surface);
}
.header-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 10px;
min-width: 240px;
}
.live-pill,
.status-pill,
.tiny-pill {
display: inline-flex;
align-items: center;
gap: 7px;
width: fit-content;
white-space: nowrap;
font-size: 10px;
font-weight: 850;
letter-spacing: .08em;
text-transform: uppercase;
}
.live-pill {
padding: 7px 10px;
border: 1px solid #315843;
background: #10271d;
color: var(--green);
}
.live-pill::before {
content: "";
width: 7px;
height: 7px;
background: var(--green);
box-shadow: 0 0 10px rgba(112, 224, 155, .75);
animation: blink 1.6s steps(2, end) infinite;
}
@keyframes blink {
50% { opacity: .35; }
}
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
min-height: 38px;
padding: 0 14px;
border: 1px solid var(--line);
border-radius: 2px;
background: var(--surface-2);
color: var(--text);
cursor: pointer;
font-size: 11px;
font-weight: 850;
letter-spacing: .05em;
text-transform: uppercase;
transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.btn:hover {
border-color: #4a665a;
background: var(--surface-3);
transform: translateY(-1px);
}
.btn.primary {
border-color: var(--lime);
background: var(--lime);
color: #142008;
}
.btn.primary:hover {
background: #e2ff7d;
}
.btn.small {
min-height: 30px;
padding: 0 10px;
font-size: 9px;
}
.icon-btn {
width: 36px;
height: 36px;
padding: 0;
font-size: 17px;
}
main {
width: min(1640px, 100%);
margin: 0 auto;
padding: 25px 28px 42px;
}
.event-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 24px;
margin-bottom: 22px;
}
.eyebrow {
margin: 0 0 8px;
color: var(--lime);
font-size: 10px;
font-weight: 850;
letter-spacing: .16em;
text-transform: uppercase;
}
h1 {
margin: 0;
max-width: 820px;
font-size: clamp(28px, 3vw, 44px);
line-height: 1.05;
letter-spacing: -.045em;
}
.event-subtitle {
margin: 11px 0 0;
color: var(--muted);
font-size: 13px;
}
.event-meta {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 8px;
}
.meta-chip {
display: flex;
align-items: center;
gap: 8px;
min-height: 36px;
padding: 0 11px;
border: 1px solid var(--line-soft);
background: var(--surface);
color: #b9c7c0;
font-size: 11px;
font-weight: 700;
}
.meta-chip b {
color: var(--text);
}
.metrics {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 12px;
margin-bottom: 14px;
}
.metric {
position: relative;
min-height: 103px;
padding: 15px 17px;
overflow: hidden;
border: 1px solid var(--line-soft);
background: var(--surface);
box-shadow: var(--shadow);
}
.metric::after {
content: "";
position: absolute;
width: 29px;
height: 29px;
right: 13px;
top: 13px;
border-top: 2px solid var(--accent, var(--lime));
border-right: 2px solid var(--accent, var(--lime));
opacity: .5;
}
.metric-label {
color: var(--muted);
font-size: 9px;
font-weight: 850;
letter-spacing: .12em;
text-transform: uppercase;
}
.metric-value {
display: flex;
align-items: baseline;
gap: 8px;
margin-top: 8px;
font-size: 29px;
font-weight: 850;
letter-spacing: -.04em;
}
.metric-value small {
color: var(--muted);
font-size: 11px;
font-weight: 650;
letter-spacing: 0;
}
.metric-foot {
margin-top: 5px;
color: #7f948a;
font-size: 10px;
}
.dashboard {
display: grid;
grid-template-columns: minmax(0, 1.65fr) minmax(360px, .82fr);
gap: 14px;
align-items: stretch;
}
.panel {
border: 1px solid var(--line-soft);
background: var(--surface);
box-shadow: var(--shadow);
}
.scene-panel {
position: relative;
min-height: 628px;
overflow: hidden;
}
.scene-toolbar {
position: absolute;
z-index: 10;
top: 16px;
left: 16px;
right: 16px;
display: flex;
align-items: flex-start;
justify-content: space-between;
pointer-events: none;
}
.scene-heading {
padding: 11px 13px;
border-left: 3px solid var(--lime);
background: rgba(7, 16, 14, .82);
backdrop-filter: blur(8px);
}
.scene-heading strong {
display: block;
font-size: 13px;
letter-spacing: .02em;
}
.scene-heading span {
display: block;
margin-top: 3px;
color: var(--muted);
font-size: 10px;
}
.scene-tools {
display: flex;
gap: 6px;
pointer-events: auto;
}
.scene-tools .btn {
min-width: 36px;
padding: 0 10px;
background: rgba(13, 24, 21, .9);
}
#scene-host {
position: absolute;
inset: 0;
background: #0a1512;
}
#scene-host canvas {
display: block;
width: 100%;
height: 100%;
cursor: grab;
touch-action: none;
}
#scene-host canvas:active {
cursor: grabbing;
}
.scene-footer {
position: absolute;
z-index: 9;
left: 16px;
right: 16px;
bottom: 14px;
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 12px;
pointer-events: none;
}
.scene-legend,
.camera-tip {
border: 1px solid rgba(71, 96, 84, .72);
background: rgba(7, 16, 14, .86);
backdrop-filter: blur(8px);
}
.scene-legend {
display: flex;
flex-wrap: wrap;
gap: 12px;
padding: 9px 11px;
}
.legend-item {
display: flex;
align-items: center;
gap: 6px;
color: #b4c3bc;
font-size: 9px;
font-weight: 750;
letter-spacing: .04em;
text-transform: uppercase;
}
.legend-dot {
width: 8px;
height: 8px;
background: var(--dot);
box-shadow: 2px 2px 0 rgba(255,255,255,.12);
}
.camera-tip {
padding: 8px 10px;
color: var(--muted);
font-size: 9px;
}
.world-label-layer {
position: absolute;
inset: 0;
z-index: 6;
overflow: hidden;
pointer-events: none;
}
.world-label {
position: absolute;
display: flex;
align-items: center;
gap: 6px;
min-width: max-content;
padding: 6px 8px;
border: 1px solid rgba(89, 116, 102, .85);
background: rgba(7, 16, 14, .88);
box-shadow: 4px 4px 0 rgba(0, 0, 0, .28);
color: #d9e4de;
font-size: 9px;
font-weight: 850;
letter-spacing: .07em;
text-transform: uppercase;
transform: translate(-50%, -100%);
transition: opacity .2s ease;
}
.world-label::after {
content: "";
position: absolute;
left: 50%;
top: 100%;
width: 1px;
height: 13px;
background: rgba(137, 163, 150, .65);
}
.world-label b {
color: var(--label-color, var(--lime));
font-size: 8px;
}
.world-label.hidden {
opacity: 0;
}
.side-panel {
display: flex;
min-height: 628px;
flex-direction: column;
overflow: hidden;
}
.side-head {
display: flex;
align-items: center;
justify-content: space-between;
min-height: 57px;
padding: 0 15px;
border-bottom: 1px solid var(--line-soft);
}
.side-title {
display: flex;
align-items: center;
gap: 9px;
font-size: 12px;
font-weight: 850;
letter-spacing: .06em;
text-transform: uppercase;
}
.side-title::before {
content: "";
width: 9px;
height: 9px;
background: var(--lime);
box-shadow: 3px 3px 0 rgba(215,255,79,.16);
}
.tabs {
display: flex;
height: 100%;
}
.tab {
position: relative;
padding: 0 12px;
border: 0;
background: transparent;
color: var(--muted);
cursor: pointer;
font-size: 10px;
font-weight: 850;
letter-spacing: .06em;
text-transform: uppercase;
}
.tab.active {
color: var(--text);
}
.tab.active::after {
content: "";
position: absolute;
right: 10px;
bottom: 0;
left: 10px;
height: 2px;
background: var(--lime);
}
.tab-count {
margin-left: 4px;
color: #62786e;
font-size: 9px;
}
.routing-tools {
display: flex;
gap: 8px;
padding: 11px 12px;
border-bottom: 1px solid var(--line-soft);
}
.search-wrap {
position: relative;
flex: 1;
}
.search-wrap::before {
content: "⌕";
position: absolute;
left: 10px;
top: 50%;
color: var(--muted);
transform: translateY(-54%);
font-size: 18px;
}
#job-search {
width: 100%;
height: 34px;
padding: 0 10px 0 29px;
border: 1px solid var(--line);
border-radius: 0;
background: #091411;
color: var(--text);
font-size: 11px;
}
#job-search::placeholder {
color: #60756c;
}
.filter-button {
width: 34px;
height: 34px;
border: 1px solid var(--line);
background: var(--surface-2);
cursor: pointer;
color: var(--muted);
}
.filter-button.active {
border-color: var(--lime);
color: var(--lime);
}
.filter-menu {
position: absolute;
z-index: 30;
right: 12px;
margin-top: 6px;
width: 184px;
padding: 7px;
border: 1px solid var(--line);
background: #0a1512;
box-shadow: var(--shadow);
}
.filter-menu[hidden] {
display: none;
}
.filter-option {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 9px;
border: 0;
background: transparent;
color: var(--muted);
cursor: pointer;
text-align: left;
font-size: 10px;
font-weight: 750;
}
.filter-option:hover,
.filter-option.active {
background: var(--surface-3);
color: var(--text);
}
.filter-option.active::after {
content: "✓";
color: var(--lime);
}
.job-list,
.roster-list {
flex: 1;
min-height: 0;
max-height: 505px;
overflow: auto;
scrollbar-width: thin;
scrollbar-color: #365045 transparent;
}
.job-card {
position: relative;
padding: 13px 14px 12px;
border: 0;
border-bottom: 1px solid var(--line-soft);
background: transparent;
color: inherit;
cursor: pointer;
transition: background .15s ease;
}
.job-card:hover {
background: rgba(255,255,255,.025);
}
.job-card.selected {
background: #13231e;
box-shadow: inset 3px 0 0 var(--lime);
}
.job-topline {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 7px;
}
.job-id {
color: #70867c;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 9px;
font-weight: 700;
}
.status-pill {
padding: 4px 6px;
border: 1px solid currentColor;
font-size: 8px;
}
.status-pill.done {
color: var(--green);
background: rgba(112, 224, 155, .07);
}
.status-pill.active {
color: var(--cyan);
background: rgba(98, 216, 233, .07);
}
.status-pill.ready {
color: var(--lime);
background: rgba(215, 255, 79, .07);
}
.status-pill.waiting {
color: var(--orange);
background: rgba(255, 125, 73, .08);
}
.job-title {
margin: 0 0 9px;
font-size: 13px;
font-weight: 800;
letter-spacing: -.01em;
}
.job-meta {
display: flex;
flex-wrap: wrap;
gap: 5px;
}
.cap-chip {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 4px 6px;
border: 1px solid #31473d;
background: #101d19;
color: #bdc9c3;
font-size: 8px;
font-weight: 750;
letter-spacing: .02em;
}
.cap-chip::before {
content: "";
width: 5px;
height: 5px;
background: var(--cap-color, var(--lime));
}
.assignment-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-top: 10px;
padding-top: 9px;
border-top: 1px dashed #273a32;
}
.assignee {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.avatar {
display: grid;
flex: 0 0 auto;
width: 25px;
height: 25px;
place-items: center;
border: 1px solid #486056;
background: var(--avatar, #23372f);
color: #f4f1df;
font-size: 8px;
font-weight: 900;
}
.assignee-text {
min-width: 0;
}
.assignee-text strong {
display: block;
overflow: hidden;
font-size: 10px;
text-overflow: ellipsis;
white-space: nowrap;
}
.assignee-text span {
display: block;
color: #758b80;
font-size: 8px;
}
.empty-state {
padding: 35px 24px;
color: var(--muted);
text-align: center;
font-size: 11px;
}
.empty-state strong {
display: block;
margin-bottom: 5px;
color: var(--text);
}
.roster-row {
display: grid;
grid-template-columns: 33px minmax(0, 1fr) auto;
gap: 10px;
align-items: center;
padding: 12px 14px;
border-bottom: 1px solid var(--line-soft);
}
.roster-row .avatar {
width: 32px;
height: 32px;
}
.roster-name {
display: flex;
align-items: center;
gap: 6px;
font-size: 11px;
font-weight: 800;
}
.roster-name i {
width: 6px;
height: 6px;
background: var(--green);
}
.roster-name i.future {
background: var(--yellow);
}
.roster-skills {
margin-top: 4px;
color: #85998f;
font-size: 8px;
}
.roster-time {
color: var(--lime);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 9px;
font-weight: 700;
text-align: right;
}
.roster-time small {
display: block;
margin-top: 3px;
color: #71867b;
font-family: inherit;
font-size: 7px;
text-transform: uppercase;
}
.side-note {
display: flex;
gap: 9px;
padding: 11px 13px;
border-top: 1px solid var(--line-soft);
background: #0a1412;
color: #879b91;
font-size: 9px;
}
.side-note strong {
color: var(--lime);
}
.lower-grid {
display: grid;
grid-template-columns: 1.2fr 1fr .9fr;
gap: 14px;
margin-top: 14px;
}
.lower-panel {
min-height: 290px;
padding: 17px;
}
.panel-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
margin-bottom: 16px;
}
.panel-head h2 {
margin: 0;
font-size: 13px;
letter-spacing: .01em;
}
.panel-head p {
margin: 4px 0 0;
color: var(--muted);
font-size: 9px;
}
.panel-index {
color: #5d7368;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 9px;
}
.coverage-list {
display: grid;
gap: 13px;
}
.coverage-row {
display: grid;
grid-template-columns: 104px minmax(0, 1fr) 43px;
gap: 10px;
align-items: center;
}
.coverage-name {
color: #c2cec8;
font-size: 9px;
font-weight: 750;
}
.coverage-track {
height: 8px;
overflow: hidden;
border: 1px solid #263b32;
background: #09120f;
}
.coverage-fill {
height: 100%;
background: var(--bar, var(--lime));
box-shadow: inset -5px 0 0 rgba(0,0,0,.13);
}
.coverage-value {
color: var(--muted);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 9px;
text-align: right;
}
.logic-list {
display: grid;
gap: 10px;
}
.logic-item {
display: grid;
grid-template-columns: 31px 1fr;
gap: 10px;
padding: 10px;
border: 1px solid var(--line-soft);
background: #0a1512;
}
.logic-icon {
display: grid;
width: 30px;
height: 30px;
place-items: center;
border: 1px solid #3e574a;
background: #15251f;
color: var(--lime);
font-size: 14px;
font-weight: 900;
}
.logic-item strong {
display: block;
margin-bottom: 3px;
font-size: 10px;
}
.logic-item p {
margin: 0;
color: var(--muted);
font-size: 9px;
}
.logic-item em {
color: var(--orange);
font-style: normal;
}
.flow-list {
display: grid;
gap: 10px;
}
.flow-row {
display: grid;
grid-template-columns: 68px 1fr 28px;
gap: 9px;
align-items: center;
}
.flow-name {
color: #9dafA6;
font-size: 9px;
font-weight: 750;
}
.flow-track {
height: 18px;
border: 1px solid #2b4137;
background:
repeating-linear-gradient(
90deg,
transparent 0,
transparent 15px,
rgba(255,255,255,.04) 15px,
rgba(255,255,255,.04) 16px
);
}
.flow-fill {
display: flex;
align-items: center;
height: 100%;
padding-left: 6px;
background: var(--flow, var(--cyan));
color: #07100e;
font-size: 8px;
font-weight: 900;
}
.flow-total {
color: var(--muted);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 9px;
text-align: right;
}
.footer-note {
display: flex;
justify-content: space-between;
gap: 16px;
margin-top: 14px;
padding: 12px 2px 0;
color: #60756b;
font-size: 9px;
}
.toast {
position: fixed;
z-index: 100;
right: 24px;
bottom: 24px;
width: min(390px, calc(100vw - 48px));
padding: 14px 16px;
border: 1px solid var(--lime);
background: #13211c;
box-shadow: 7px 7px 0 rgba(0,0,0,.35);
color: var(--text);
font-size: 11px;
transform: translateY(30px);
opacity: 0;
pointer-events: none;
transition: opacity .2s ease, transform .2s ease;
}
.toast.show {
transform: translateY(0);
opacity: 1;
}
.toast strong {
display: block;
margin-bottom: 3px;
color: var(--lime);
font-size: 10px;
letter-spacing: .08em;
text-transform: uppercase;
}
@media (max-width: 1150px) {
.dashboard {
grid-template-columns: 1fr;
}
.side-panel {
min-height: 560px;
}
.job-list,
.roster-list {
max-height: 440px;
}
.lower-grid {
grid-template-columns: 1fr 1fr;
}
.lower-grid > :last-child {
grid-column: 1 / -1;
}
}
@media (max-width: 780px) {
.app-header {
padding: 0 14px;
}
.header-nav {
display: none;
}
.header-actions {
min-width: 0;
}
.live-pill {
display: none;
}
main {
padding: 19px 14px 32px;
}
.event-head {
align-items: flex-start;
flex-direction: column;
}
.event-meta {
justify-content: flex-start;
}
.metrics {
grid-template-columns: 1fr 1fr;
}
.scene-panel {
min-height: 520px;
}
.scene-toolbar {
flex-direction: column;
gap: 8px;
}
.scene-tools {
align-self: flex-end;
margin-top: -42px;
}
.scene-footer {
align-items: flex-start;
flex-direction: column;
}
.lower-grid {
grid-template-columns: 1fr;
}
.lower-grid > :last-child {
grid-column: auto;
}
.footer-note {
flex-direction: column;
}
}
@media (max-width: 470px) {
.brand {
min-width: 0;
}
.brand-name {
font-size: 11px;
}
.header-actions .btn:not(.icon-btn) {
display: none;
}
.metrics {
grid-template-columns: 1fr;
}
.metric {
min-height: 88px;
}
.scene-panel {
min-height: 470px;
}
.camera-tip {
display: none;
}
.coverage-row {
grid-template-columns: 90px minmax(0, 1fr) 38px;
}
}
</style>
</head>
<body>
<header class="app-header">
<div class="brand">
<div class="brand-mark" aria-hidden="true"></div>
<div class="brand-name">FIXER<span>//</span>COMMONS</div>
</div>
<nav class="header-nav" aria-label="Primary navigation">
<a href="#event-overview">Event</a>
<a href="#repair-floor">Repair floor</a>
<a href="#coverage">Capability map</a>
</nav>
<div class="header-actions">
<span class="live-pill">Live plan</span>
<button class="btn" id="export-btn" type="button">Export roster</button>
<button class="btn primary" id="open-jobs-btn" type="button">Open queue</button>
</div>
</header>
<main id="event-overview">
<section class="event-head">
<div>
<p class="eyebrow">Community repair event / Floor plan 02</p>
<h1>Riverside Repair Day</h1>
<p class="event-subtitle">
Skill-aware volunteer routing for intake, diagnosis, skilled repair, and wait control.
</p>
</div>
<div class="event-meta" aria-label="Event details">
<div class="meta-chip"><b>Sat</b> 18 May 2026</div>
<div class="meta-chip"><b>09:00–17:00</b> · Old Riverside Hall</div>
<div class="meta-chip"><b>31</b> items received</div>
</div>
</section>
<section class="metrics" aria-label="Event metrics">
<article class="metric" style="--accent: var(--lime)">
<div class="metric-label">Active now</div>
<div class="metric-value">12 <small>people</small></div>
<div class="metric-foot">6 general helpers · 6 skilled volunteers</div>
</article>
<article class="metric" style="--accent: var(--cyan)">
<div class="metric-label">Capability matches</div>
<div class="metric-value">8 <small>of 9 jobs</small></div>
<div class="metric-foot">One match arrives at 13:30</div>
</article>
<article class="metric" style="--accent: var(--orange)">
<div class="metric-label">Waiting on skills</div>
<div class="metric-value">2 <small>items</small></div>
<div class="metric-foot">Joinery + certified electrical work</div>
</article>
<article class="metric" style="--accent: var(--green)">
<div class="metric-label">Completed</div>
<div class="metric-value">14 <small>repairs</small></div>
<div class="metric-foot">Median handoff: 11 minutes</div>
</article>
</section>
<section class="dashboard" id="repair-floor">
<article class="panel scene-panel">
<div id="scene-host" aria-label="Interactive voxel repair floor"></div>
<div class="world-label-layer" id="world-labels"></div>
<div class="scene-toolbar">
<div class="scene-heading">
<strong>Riverside Hall / Live floor</strong>
<span>Drag to orbit · Scroll to zoom · Select a zone</span>
</div>
<div class="scene-tools" aria-label="Camera controls">
<button class="btn small" id="home-camera" type="button" title="Reset camera">Home</button>
<button class="btn small" id="top-camera" type="button" title="Top-down camera">Top</button>
<button class="btn small" id="toggle-labels" type="button" aria-pressed="true">Labels</button>
</div>
</div>
<div class="scene-footer">
<div class="scene-legend" aria-label="Floor legend">
<span class="legend-item"><i class="legend-dot" style="--dot: var(--lime)"></i> Intake</span>
<span class="legend-item"><i class="legend-dot" style="--dot: var(--cyan)"></i> Diagnosis</span>
<span class="legend-item"><i classlegend-dot" style="--dot: var(--orange)"></i> Skill bench</span>
<span class="legend-item"><i class="legend-dot" style="--dot: var(--red)"></i> Waiting</span>
</div>
<div class="camera-tip">Voxel operations view · click benches to inspect queue</div>
</div>
</article>
<aside class="panel side-panel" id="routing-panel">
<div class="side-head">
<div class="side-title" id="side-title">Routing board</div>
<div class="tabs" role="tablist" aria-label="Routing board views">
<button class="tab active" data-tab="jobs" role="tab" aria-selected="true" type="button">
Jobs <span class="tab-count">9</span>
</button>
<button class="tab" data-tab="roster" role="tab" aria-selected="false" type="button">
Roster <span class="tab-count">9</span>
</button>
</div>
</div>
<div id="routing-content"></div>
<div class="side-note">
<span>↳</span>
<div><strong>Capability-gated routing:</strong> a volunteer appears only when every required capability is listed and they are available.</div>
</div>
</aside>
</section>
<section class="lower-grid" id="coverage">
<article class="panel lower-panel">
<div class="panel-head">
<div>
<h2>Capability coverage</h2>
<p>Open tasks vs. volunteers with the required skill</p>
</div>
<span class="panel-index">01 / COVERAGE</span>
</div>
<div class="coverage-list" id="coverage-list"></div>
</article>
<article class="panel lower-panel">
<div class="panel-head">
<div>
<h2>Why more hands is not the whole plan</h2>
<p>Capacity and qualification solve different queues</p>
</div>
<span class="panel-index">02 / LOGIC</span>
</div>
<div class="logic-list">
<div class="logic-item">
<div class="logic-icon">+</div>
<div>
<strong>Six general helpers</strong>
<p>They can clear bag check-in, carrying, setup, and cable organization immediately.</p>
</div>
</div>
<div class="logic-item">
<div class="logic-icon" style="color: var(--orange)">!</div>
<div>
<strong>They do not unlock skilled work</strong>
<p><em>Soldering, joinery, and mains testing remain unmatched</em> when required skills are absent.</p>
</div>
</div>
<div class="logic-item">
<div class="logic-icon" style="color: var(--cyan)">✓</div>
<div>
<strong>Assignments show the evidence</strong>
<p>Every route names its capability pair, volunteer, and available time window.</p>
</div>
</div>
</div>
</article>
<article class="panel lower-panel">
<div class="panel-head">
<div>
<h2>Current queue shape</h2>
<p>Items by operational stage</p>
</div>
<span class="panel-index">03 / FLOW</span>
</div>
<div class="flow-list">
<div class="flow-row">
<div class="flow-name">Intake</div>
<div class="flow-track"><div class="flow-fill" style="--flow: var(--lime); width: 78%">6</div></div>
<div class="flow-total">08</div>
</div>
<div class="flow-row">
<div class="flow-name">Diagnosis</div>
<div class="flow-track"><div class="flow-fill" style="--flow: var(--cyan); width: 50%">4</div></div>
<div class="flow-total">08</div>
</div>
<div class="flow-row">
<div class="flow-name">Skill bench</div>
<div class="flow-track"><div class="flow-fill" style="--flow: var(--orange); width: 63%">5</div></div>
<div class="flow-total">08</div>
</div>
<div class="flow-row">
<div class="flow-name">Waiting</div>
<div class="flow-track"><div class="flow-fill" style="--flow: var(--red); width: 25%">2</div></div>
<div class="flow-total">08</div>
</div>
</div>
<div class="side-note" style="margin: 18px -17px -17px; border-top: 1px solid var(--line-soft)">
<span>●</span>
<div>Waiting capacity is intentionally finite so urgent skilled work is not buried beneath intake volume.</div>
</div>
</article>
</section>
<footer class="footer-note">
<span>FIXER//COMMONS · Riverside Repair Day · Plan refreshed 10:42</span>
<span>Three.js voxel operations view · local browser data</span>
</footer>
</main>
<div class="toast" id="toast" role="status" aria-live="polite">
<strong id="toast-title">Routing update</strong>
<span id="toast-message"></span>
</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const volunteers = [
{
id: "maya",
initials: "MO",
name: "Maya Ortiz",
skills: ["Intake", "Customer intake", "Spanish"],
start: "08:30",
end: "12:00",
state: "At intake",
color: "#f0a64b"
},
{
id: "theo",
initials: "TB",
name: "Theo Brooks",
skills: ["Electronics", "Diagnostics", "Soldering"],
start: "09:00",
end: "14:30",
state: "Diagnosing",
color: "#54c5d8"
},
{
id: "priya",
initials: "PN",
name: "Priya Nair",
skills: ["Electronics", "Soldering", "Diagnostics"],
start: "09:30",
end: "16:00",
state: "At bench A",
color: "#d7ff4f"
},
{
id: "lina",
initials: "LK",
name: "Lina Kim",
skills: ["Bike mechanics", "Bearing service", "Safety check"],
start: "09:30",
end: "14:00",
state: "At bench B",
color: "#ff7d49"
},
{
id: "sam",
initials: "SC",
name: "Sam Chen",
skills: ["Textiles", "Industrial sewing", "Repair assessment"],
start: "10:00",
end: "17:00",
state: "At bench C",
color: "#c497ff"
},
{
id: "ava",
initials: "AR",
name: "Ava Reed",
skills: ["Woodworking", "Sanding", "Finishing"],
start: "09:00",
end: "13:30",
state: "At bench C",
color: "#ed8468"
},
{
id: "jonas",
initials: "JW",
name: "Jonas Ward",
skills: ["Woodworking", "Joinery", "Sanding"],
start: "13:30",
end: "17:00",
state: "Arrives 13:30",
color: "#ed8468"
},
{
id: "noor",
initials: "NA",
name: "Noor Ahmed",
skills: ["Electrical safety", "Appliance repair", "Diagnostics"],
start: "14:00",
end: "18:00",
bookedUntil: "15:10",
state: "Safety induction",
color: "#f4c84b"
},
{
id: "helpers",
initials: "6H",
name: "General helper pool",
skills: ["Handling", "Intake", "Setup", "Cleaning", "Assembly", "Cable management"],
start: "09:00",
end: "15:00",
state: "Available now",
color: "#70e09b"
}
];
const jobs = [
{
id: "RV-041",
title: "Intake & triage",
zone: "intake",
status: "done",
required: ["Intake", "Customer intake"],
assigned: "maya",
time: "09:00",
note: "Owner contact, device condition, safety flags, and queue priority are captured.",
explanation: "Maya holds both intake requirements. General helpers can record and carry items, but Maya confirms priority and safety flags."
},
{
id: "RV-043",
title: "Laptop power fault",
zone: "diagnosis",
status: "active",
required: ["Electronics", "Diagnostics"],
assigned: "theo",
time: "09:20",
note: "Power rail tested; suspected failed connector. Waiting for a soldering hand-off.",
explanation: "Theo can test and diagnose the fault. Priya can take the solder joint, but a helper without electronics training cannot assess the board."
},
{
id: "RV-046",
title: "Desk lamp flicker",
zone: "bench",
status: "active",
required: ["Electronics", "Soldering"],
assigned: "priya",
time: "09:45",
note: "Loose terminal identified. Priya is replacing the connector and retesting the circuit.",
explanation: "The explicit Electronics + Soldering pair routes this to Priya. Extra assembly helpers cannot safely inspect live wiring."
},
{
id: "RV-047",
title: "Bicycle brake service",
zone: "bench",
status: "active",
required: ["Bike mechanics", "Bearing service"],
assigned: "lina",
time: "10:00",
note: "Cable tension and rear bearing are being serviced before the safety check.",
explanation: "Lina has both bike-specific requirements. Moving parts and brake adjustment are not generic handling tasks."
},
{
id: "RV-048",
title: "Winter coat seam",
zone: "bench",
status: "active",
required: ["Textiles", "Industrial sewing"],
assigned: "sam",
time: "10:15",
note: "Fabric assessment complete. Sam is reinforcing the load-bearing seam.",
explanation: "Sam can assess and sew the textile. A helper can prepare thread or label the garment, but cannot replace the sewing capability."
},
{
id: "RV-052",
title: "Oak chair wobble",
zone: "waiting",
status: "waiting",
required: ["Woodworking", "Joinery"],
assigned: null,
time: "Next match 13:30",
note: "Ava can sand and finish. Jonas has the complete Woodworking + Joinery pair and arrives at 13:30.",
explanation: "Both requirements must be present. Ava has woodworking but not joinery; extra sanding helpers do not replace a joinery assessment.",
bottleneck: true
},
{
id: "RV-053",
title: "Toaster dead heat",
zone: "waiting",
status: "waiting",
required: ["Electrical safety", "Appliance repair"],
assigned: null,
time: "Next match 15:10",
note: "Noor holds both requirements but is in safety induction until 15:10.",
explanation: "Live mains testing and appliance repair are explicit requirements. An untrained helper cannot safely diagnose this toaster.",
bottleneck: true
},
{
id: "RV-055",
title: "Bag check-in & carrying",
zone: "intake",
status: "ready",
required: ["Handling", "Intake"],
assigned: "helpers",
time: "Now",
note: "Six general helpers are available and this queue is safe to parallelize.",
explanation: "This is a capacity-limited queue. Additional general helpers directly increase throughput without pretending to hold scarce repair skills."
},
{
id: "RV-056",
title: "Cable organizer",
zone: "bench",
status: "ready",
required: ["Assembly", "Cable management"],
assigned: "helpers",
time: "Now",
note: "Two helpers can complete this low-risk build in parallel.",
explanation: "The explicit Assembly + Cable management pair is present in the helper pool, so additional hands can safely shorten this queue."
}
];
const coverage = [
{ name: "Electronics", open: 2, covered: 2, color: "#62d8e9" },
{ name: "Textiles", open: 1, covered: 1, color: "#c497ff" },
{ name: "Bike service", open: 1, covered: 1, color: "#ff7d49" },
{ name: "Wood + joinery", open: 1, covered: 0, color: "#d7ff4f" },
{ name: "Mains-safe repair", open: 1, covered: 0, color: "#f4c84b" }
];
const statusLabels = {
done: "Complete",
active: "In progress",
ready: "Ready",
waiting: "Skill hold"
};
const zoneLabels = {
intake: "Intake",
diagnosis: "Diagnosis",
bench: "Skilled bench",
waiting: "Waiting"
};
let currentTab = "jobs";
let currentFilter = "all";
let searchTerm = "";
let selectedJobId = "RV-052";
let toastTimer;
const routingContent = document.getElementById("routing-content");
const sideTitle = document.getElementById("side-title");
function getVolunteer(id) {
return volunteers.find((volunteer) => volunteer.id === id);
}
function showToast(title, message) {
const toast = document.getElementById("toast");
document.getElementById("toast-title").textContent = title;
document.getElementById("toast-message").textContent = message;
toast.classList.add("show");
clearTimeout(toastTimer);
toastTimer = setTimeout(() => toast.classList.remove("show"), 3600);
}
function renderCoverage() {
document.getElementById("coverage-list").innerHTML = coverage.map((item) => {
const width = item.covered >= item.open ? 100 : item.covered === 0 ? 12 : 55;
return `
<div class="coverage-row">
<div class="coverage-name">${item.name}</div>
<div class="coverage-track">
<div class="coverage-fill" style="width:${width}%;--bar:${item.color}"></div>
</div>
<div class="coverage-value">${item.covered}/${item.open}</div>
</div>
`;
}).join("");
}
function renderJobs() {
const filters = ["all", "intake", "diagnosis", "bench", "waiting"];
const filtered = jobs.filter((job) => {
const matchesFilter = currentFilter === "all" || job.zone === currentFilter;
const haystack = `${job.id} ${job.title} ${job.required.join(" ")} ${job.note}`.toLowerCase();
return matchesFilter && haystack.includes(searchTerm.toLowerCase());
});
routingContent.innerHTML = `
<div class="routing-tools">
<div class="search-wrap">
<input id="job-search" type="search" placeholder="Search item or capability" aria-label="Search jobs" />
</div>
<button class="filter-button ${currentFilter !== "all" ? "active" : ""}" id="filter-toggle" type="button" aria-label="Filter queue">≡</button>
<div class="filter-menu" id="filter-menu" ${currentFilter === "all" ? "hidden" : ""}>
${filters.map((filter) => `
<button class="filter-option ${currentFilter === filter ? "active" : ""}" data-filter="${filter}" type="button">
${filter === "all" ? "All operational stages" : zoneLabels[filter]}
</button>
`).join("")}
</div>
</div>
<div class="job-list" id="job-list">
${filtered.length ? filtered.map(jobCard).join("") : `
<div class="empty-state">
<strong>No matching jobs</strong>
Try another item name or capability.
</div>
`}
</div>
`;
const search = document.getElementById("job-search");
search.value = searchTerm;
search.addEventListener("input", (event) => {
searchTerm = event.target.value;
renderJobs();
document.getElementById("job-search")?.focus();
});
document.getElementById("filter-toggle").addEventListener("click", () => {
const menu = document.getElementById("filter-menu");
menu.hidden = !menu.hidden;
});
document.querySelectorAll("[data-filter]").forEach((button) => {
button.addEventListener("click", () => {
currentFilter = button.dataset.filter;
renderJobs();
});
});
document.querySelectorAll(".job-card").forEach((card) => {
card.addEventListener("click", (event) => {
if (event.target.closest(".schedule-btn")) return;
selectedJobId = card.dataset.job;
renderJobs();
selectSceneJob(selectedJobId);
});
});
document.querySelectorAll(".schedule-btn").forEach((button) => {
button.addEventListener("click", () => scheduleMatch(button.dataset.job));
});
}
function jobCard(job) {
const volunteer = getVolunteer(job.assigned);
const selected = job.id === selectedJobId ? "selected" : "";
const assignment = volunteer ? `
<div class="assignee">
<div class="avatar" style="--avatar:${volunteer.color}22">${volunteer.initials}</div>
<div class="assignee-text">
<strong>${volunteer.name}</strong>
<span>${volunteer.state} · ${volunteer.start}–${volunteer.end}</span>
</div>
</div>
<span class="tiny-pill" style="color:var(--green)">✓ Matched</span>
` : `
<div class="assignee">
<div class="avatar" style="--avatar:#ff7d4922;border-color:#75412f">!</div>
<div class="assignee-text">
<strong>Capability hold</strong>
<span>${job.time}</span>
</div>
</div>
<button class="btn small schedule-btn" data-job="${job.id}" type="button">Find match</button>
`;
const explanation = job.bottleneck ? `
<div style="margin-top:9px;padding:8px;border-left:2px solid var(--orange);background:#1c1713;color:#d9aa96;font-size:9px">
${job.explanation}
</div>
` : "";
return `
<article class="job-card ${selected}" data-job="${job.id}" tabindex="0" role="button" aria-label="Inspect ${job.title}">
<div class="job-topline">
<span class="job-id">${job.id}</span>
<span class="status-pill ${job.status}">${statusLabels[job.status]}</span>
</div>
<h3 class="job-title">${job.title}</h3>
<div class="job-meta">
${job.required.map((skill, index) => `
<span class="cap-chip" style="--cap-color:${index === 0 ? "#d7ff4f" : "#62d8e9"}">${skill}</span>
`).join("")}
</div>
<div class="assignment-row">${assignment}</div>
${explanation}
</article>
`;
}
function renderRoster() {
routingContent.innerHTML = `
<div class="roster-list" id="roster-list">
${volunteers.map((volunteer) => {
const availableNow = volunteer.start <= "10:42" && volunteer.end >= "10:42";
return `
<div class="roster-row">
<div class="avatar" style="--avatar:${volunteer.color}22">${volunteer.initials}</div>
<div>
<div class="roster-name">
<i class="${availableNow ? "" : "future"}"></i>
${volunteer.name}
</div>
<div class="roster-skills">${volunteer.skills.join(" · ")}</div>
</div>
<div class="roster-time">
${volunteer.start}–${volunteer.end}
<small>${volunteer.state}</small>
</div>
</div>
`;
}).join("")}
</div>
`;
}
function scheduleMatch(jobId) {
const job = jobs.find((item) => item.id === jobId);
const matches = volunteers.filter((volunteer) =>
job.required.every((skill) => volunteer.skills.includes(skill))
);
const available = matches.find((volunteer) =>
volunteer.start <= "10:42" &&
volunteer.end >= "10:42" &&
(!volunteer.bookedUntil || volunteer.bookedUntil <= "10:42")
);
if (available) {
job.assigned = available.id;
job.status = "ready";
job.time = "Now";
job.bottleneck = false;
renderJobs();
showToast("Match assigned", `${available.name} meets every requirement for ${job.title}: ${job.required.join(" + ")}.`);
return;
}
const future = matches.sort((a, b) => {
const aTime = a.bookedUntil && a.bookedUntil > "10:42" ? a.bookedUntil : a.start;
const bTime = b.bookedUntil && b.bookedUntil > "10:42" ? b.bookedUntil : b.start;
return aTime.localeCompare(bTime);
})[0];
if (future) {
const nextTime = future.bookedUntil && future.bookedUntil > "10:42"
? future.bookedUntil
: future.start;
showToast(
"Qualified match identified",
`${future.name} has ${job.required.join(" + ")} and is available at ${nextTime}. Extra untrained helpers cannot move this job earlier.`
);
} else {
showToast(
"No qualified match",
`No volunteer has the complete requirement pair for ${job.title}. Additional general helpers cannot satisfy ${job.required.join(" + ")}.`
);
}
}
function renderRouting() {
sideTitle.textContent = currentTab === "jobs" ? "Routing board" : "Volunteer availability";
document.querySelectorAll(".tab").forEach((tab) => {
const active = tab.dataset.tab === currentTab;
tab.classList.toggle("active", active);
tab.setAttribute("aria-selected", String(active));
});
if (currentTab === "jobs") renderJobs();
else renderRoster();
}
document.querySelectorAll(".tab").forEach((tab) => {
tab.addEventListener("click", () => {
currentTab = tab.dataset.tab;
renderRouting();
});
});
document.getElementById("open-jobs-btn").addEventListener("click", () => {
currentTab = "jobs";
renderRouting();
document.getElementById("routing-panel").scrollIntoView({ behavior: "smooth", block: "center" });
});
document.getElementById("export-btn").addEventListener("click", () => {
const rows = [
["Job", "Title", "Stage", "Required capabilities", "Assigned", "Availability"],
...jobs.map((job) => {
const volunteer = getVolunteer(job.assigned);
return [
job.id,
job.title,
zoneLabels[job.zone],
job.required.join(" + "),
volunteer ? volunteer.name : "Unmatched",
volunteer ? `${volunteer.start}-${volunteer.end}` : job.time
];
})
];
const csv = rows.map((row) =>
row.map((cell) => `"${String(cell).replaceAll('"', '""')}"`).join(",")
).join("\n");
const blob = new Blob([csv], { type: "text/csv;charset=utf-8" });
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = "riverside-repair-day-roster.csv";
link.click();
URL.revokeObjectURL(url);
showToast("Roster exported", "The capability-matched roster was downloaded as CSV.");
});
renderCoverage();
renderRouting();
// ---------- Voxel scene ----------
const sceneHost = document.getElementById("scene-host");
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x0a1512);
scene.fog = new THREE.Fog(0x0a1512, 25, 48);
const camera = new THREE.PerspectiveCamera(42, 1, 0.1, 100);
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.1;
sceneHost.appendChild(renderer.domElement);
const hemisphere = new THREE.HemisphereLight(0xc8f4e2, 0x15251f, 2.2);
scene.add(hemisphere);
const keyLight = new THREE.DirectionalLight(0xfff4d8, 3.5);
keyLight.position.set(-8, 15, 10);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -18;
keyLight.shadow.camera.right = 18;
keyLight.shadow.camera.top = 18;
keyLight.shadow.camera.bottom = -18;
keyLight.shadow.camera.far = 50;
scene.add(keyLight);
const cyanLight = new THREE.PointLight(0x62d8e9, 17, 18, 2);
cyanLight.position.set(-2, 4, 2);
scene.add(cyanLight);
const orangeLight = new THREE.PointLight(0xff7d49, 11, 14, 2);
orangeLight.position.set(6, 3, -1);
scene.add(orangeLight);
const materials = {
floor: new THREE.MeshStandardMaterial({ color: 0x15231e, roughness: 0.96 }),
wall: new THREE.MeshStandardMaterial({ color: 0x1b2b25, roughness: 0.92 }),
dark: new THREE.MeshStandardMaterial({ color: 0x17231f, roughness: 0.9 }),
wood: new THREE.MeshStandardMaterial({ color: 0x8c633d, roughness: 0.88 }),
woodLight: new THREE.MeshStandardMaterial({ color: 0xb58a58, roughness: 0.82 }),
metal: new THREE.MeshStandardMaterial({ color: 0x7e9990, roughness: 0.56, metalness: 0.25 }),
lime: new THREE.MeshStandardMaterial({ color: 0xd7ff4f, roughness: 0.72 }),
cyan: new THREE.MeshStandardMaterial({ color: 0x62d8e9, roughness: 0.68 }),
orange: new THREE.MeshStandardMaterial({ color: 0xff7d49, roughness: 0.72 }),
red: new THREE.MeshStandardMaterial({ color: 0xff6262, roughness: 0.74 }),
green: new THREE.MeshStandardMaterial({ color: 0x70e09b, roughness: 0.72 }),
cream: new THREE.MeshStandardMaterial({ color: 0xeee7ce, roughness: 0.88 }),
blue: new THREE.MeshStandardMaterial({ color: 0x5c8bd7, roughness: 0.72 }),
purple: new THREE.MeshStandardMaterial({ color: 0xa77add, roughness: 0.72 })
};
function box(parent, size, position, material, rotation = null) {
const geometry = new THREE.BoxGeometry(size[0], size[1], size[2]);
const mesh = new THREE.Mesh(geometry, material);
mesh.position.set(position[0], position[1], position[2]);
if (rotation) mesh.rotation.set(rotation[0], rotation[1], rotation[2]);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
const floor = new THREE.Mesh(new THREE.BoxGeometry(23, 0.45, 15), materials.floor);
floor.position.y = -0.3;
floor.receiveShadow = true;
scene.add(floor);
const grid = new THREE.GridHelper(22, 22, 0x3c5549, 0x263b32);
grid.position.y = -0.055;
grid.material.transparent = true;
grid.material.opacity = 0.34;
scene.add(grid);
// Back wall and structural columns.
box(scene, [23, 4.6, 0.35], [0, 2, -7.3], materials.wall);
box(scene, [23, 0.28, 0.48], [0, 4.5, -7.2], materials.dark);
for (const x of [-10, -5, 0, 5, 10]) {
box(scene, [0.55, 5.2, 0.65], [x, 2.3, -6.8], materials.dark);
box(scene, [0.72, 0.28, 0.8], [x, 4.7, -6.8], materials.metal);
}
// Painted aisle blocks.
for (let x = -8; x <= 8; x += 2) {
box(scene, [1.1, 0.035, 0.18], [x, 0.015, 6.35], materials.woodLight);
}
const zones = {};
const pickables = [];
const beacons = [];
function createZone(id, x, z, width, depth, color, beaconColor) {
const group = new THREE.Group();
group.position.set(x, 0, z);
group.userData.zone = id;
const baseMaterial = new THREE.MeshStandardMaterial({
color,
emissive: color,
emissiveIntensity: 0.05,
roughness: 0.92,
transparent: true,
opacity: 0.17
});
const base = box(group, [width, 0.08, depth], [0, 0.035, 0], baseMaterial);
base.userData.zone = id;
pickables.push(base);
const beacon = box(
group,
[0.22, 0.22, 0.22],
[width / 2 - 0.35, 2.25, depth / 2 - 0.35],
new THREE.MeshStandardMaterial({
color: beaconColor,
emissive: beaconColor,
emissiveIntensity: 1.2,
roughness: 0.5
})
);
beacons.push(beacon);
scene.add(group);
zones[id] = { group, base, baseMaterial, beacon };
return group;
}
const intakeZone = createZone("intake", -6.1, 3.6, 4.5, 3.1, 0xd7ff4f, 0xd7ff4f);
const diagnosisZone = createZone("diagnosis", -2.4, 2.9, 3.6, 3.2, 0x62d8e9, 0x62d8e9);
const benchZone = createZone("bench", 2.4, 3.4, 5.2, 3.2, 0xff7d49, 0xff7d49);
const waitingZone = createZone("waiting", 7.6, 3.1, 3.6, 3.5, 0xff6262, 0xff6262);
function table(parent, x, z, width = 2.3, depth = 1.05, topMaterial = materials.woodLight) {
box(parent, [width, 0.18, depth], [x, 1.05, z], topMaterial);
for (const dx of [-width / 2 + 0.16, width / 2 - 0.16]) {
for (const dz of [-depth / 2 + 0.14, depth / 2 - 0.14]) {
box(parent, [0.12, 1, 0.12], [x + dx, 0.52, z + dz], materials.metal);
}
}
box(parent, [width - 0.25, 0.1, 0.12], [x, 0.42, z], materials.metal);
}
function chair(parent, x, z, color = materials.cyan) {
box(parent, [0.48, 0.12, 0.48], [x, 0.58, z], color);
box(parent, [0.48, 0.7, 0.1], [x, 0.92, z - 0.19], color);
for (const dx of [-0.16, 0.16]) {
for (const dz of [-0.16, 0.16]) {
box(parent, [0.08, 0.54, 0.08], [x + dx, 0.28, z + dz], materials.metal);
}
}
}
function crate(parent, x, y, z, width = 0.85, color = materials.wood) {
box(parent, [width, 0.58, 0.72], [x, y, z], color);
box(parent, [width + 0.04, 0.1, 0.76], [x, y + 0.15, z], materials.woodLight);
box(parent, [width + 0.04, 0.1, 0.76], [x, y - 0.15, z], materials.woodLight);
}
// Intake counter.
table(intakeZone, 0.15, -0.15, 2.65, 1.05, materials.lime);
box(intakeZone, [0.62, 0.45, 0.55], [-0.55, 1.36, -0.18], materials.dark);
box(intakeZone, [0.45, 0.08, 0.35], [-0.55, 1.62, -0.18], materials.cyan);
box(intakeZone, [0.72, 0.08, 0.42], [0.65, 1.18, -0.15], materials.cream);
crate(intakeZone, 1.65, 0.34, 0.75, 0.8, materials.wood);
crate(intakeZone, 1.65, 0.94, 0.75, 0.72, materials.woodLight);
box(intakeZone, [0.55, 0.2, 0.35], [-1.5, 0.18, 0.75], materials.blue);
// Diagnosis bench with test gear.
table(diagnosisZone, 0.05, -0.3, 2.25, 0.95, materials.cyan);
box(diagnosisZone, [0.82, 0.12, 0.55], [-0.45, 1.2, -0.32], materials.dark);
box(diagnosisZone, [0.55, 0.38, 0.07], [-0.45, 1.44, -0.06], materials.dark);
box(diagnosisZone, [0.4, 0.26, 0.04], [-0.45, 1.45, -0.01], materials.green);
box(diagnosisZone, [0.5, 0.32, 0.45], [0.65, 1.32, -0.35], materials.dark);
box(diagnosisZone, [0.36, 0.23, 0.04], [0.65, 1.35, -0.1], materials.orange);
box(diagnosisZone, [0.06, 0.06, 0.65], [-0.98, 1.2, -0.3], materials.red);
// Skilled bench: three stations.
table(benchZone, -1.55, -0.15, 1.75, 1, materials.orange);
table(benchZone, 0.15, -0.15, 1.75, 1, materials.purple);
table(benchZone, 1.85, -0.15, 1.75, 1, materials.blue);
// Lamp at bench A.
box(benchZone, [0.45, 0.12, 0.45], [-1.75, 1.2, -0.18], materials.dark);
box(benchZone, [0.09, 0.75, 0.09], [-1.75, 1.62, -0.18], materials.metal);
box(benchZone, [0.58, 0.25, 0.45], [-1.75, 2.04, -0.18], materials.orange);
// Sewing machine and coat.
box(benchZone, [0.72, 0.1, 0.42], [-0.02, 1.2, -0.18], materials.dark);
box(benchZone, [0.18, 0.62, 0.18], [0.18, 1.52, -0.18], materials.purple);
box(benchZone, [0.64, 0.12, 0.18], [0.15, 1.79, -0.18], materials.purple);
box(benchZone, [0.62, 0.9, 0.14], [0.28, 1.88, -0.42], materials.blue);
// Bike-like voxel prop.
const bike = new THREE.Group();
bike.position.set(1.45, 0.1, -0.1);
benchZone.add(bike);
for (const x of [-0.55, 0.55]) {
box(bike, [0.58, 0.12, 0.12], [x, 0.48, 0], materials.dark);
box(bike, [0.12, 0.58, 0.12], [x, 0.48, 0], materials.dark);
box(bike, [0.12, 0.12, 0.5], [x, 0.48, 0], materials.dark);
}
box(bike, [1.2, 0.11, 0.11], [0, 0.75, 0], materials.orange);
box(bike, [0.11, 0.75, 0.11], [0.15, 0.53, 0], materials.orange);
box(bike, [0.85, 0.11, 0.11], [-0.22, 0.45, 0], materials.orange);
box(bike, [0.58, 0.12, 0.42], [-0.58, 1.12, 0], materials.dark);
// Waiting shelving, chair, toaster, and tagged items.
for (const y of [0.42, 1.28, 2.12]) {
box(waitingZone, [3.05, 0.13, 0.82], [0, y, -0.95], materials.metal);
}
for (const x of [-1.45, 1.45]) {
box(waitingZone, [0.12, 2.55, 0.12], [x, 1.3, -0.95], materials.metal);
box(waitingZone, [0.12, 2.55, 0.12], [x, 1.3, -0.52], materials.metal);
}
crate(waitingZone, -0.95, 0.83, -0.95, 0.8, materials.wood);
crate(waitingZone, 0, 0.83, -0.95, 0.72, materials.woodLight);
box(waitingZone, [0.75, 0.58, 0.58], [1.05, 0.69, -0.95], materials.red);
box(waitingZone, [0.55, 0.14, 0.44], [1.05, 1.07, -0.95], materials.dark);
box(waitingZone, [0.48, 0.52, 0.5], [-1.05, 1.63, -0.95], materials.wood);
box(waitingZone, [0.48, 0.8, 0.12], [-1.05, 1.98, -1.18], materials.woodLight);
box(waitingZone, [0.42, 0.48, 0.45], [0.15, 1.64, -0.95], materials.orange);
box(waitingZone, [0.28, 0.18, 0.03], [0.15, 1.68, -0.71], materials.red);
box(waitingZone, [0.65, 0.42, 0.5], [0.95, 1.58, -0.95], materials.metal);
// Small pending-status flags.
for (const x of [-1.1, 0.1]) {
box(waitingZone, [0.05, 0.55, 0.05], [x, 2.72, -0.95], materials.dark);
box(waitingZone, [0.42, 0.25, 0.05], [x + 0.2, 2.9, -0.95], materials.red);
}
function voxelPerson(parent, x, z, shirtMaterial, skinMaterial = materials.cream, hatMaterial = null) {
const group = new THREE.Group();
group.position.set(x, 0, z);
parent.add(group);
box(group, [0.18, 0.42, 0.2], [-0.12, 0.24, 0], materials.dark);
box(group, [0.18, 0.42, 0.2], [0.12, 0.24, 0], materials.dark);
box(group, [0.52, 0.56, 0.34], [0, 0.72, 0], shirtMaterial);
box(group, [0.16, 0.5, 0.18], [-0.34, 0.72, 0], shirtMaterial);
box(group, [0.16, 0.5, 0.18], [0.34, 0.72, 0], shirtMaterial);
box(group, [0.4, 0.4, 0.38], [0, 1.22, 0], skinMaterial);
if (hatMaterial) box(group, [0.46, 0.13, 0.43], [0, 1.46, 0], hatMaterial);
return group;
}
voxelPerson(intakeZone, -1.35, 0.5, materials.orange, materials.cream, materials.lime);
voxelPerson(intakeZone, 0.8, 0.65, materials.green, materials.woodLight);
voxelPerson(diagnosisZone, -0.7, 0.65, materials.cyan, materials.cream, materials.dark);
voxelPerson(diagnosisZone, 0.65, 0.55, materials.blue, materials.woodLight);
voxelPerson(benchZone, -1.55, 0.72, materials.lime, materials.woodLight);
voxelPerson(benchZone, 0.15, 0.72, materials.purple, materials.cream, materials.purple);
voxelPerson(benchZone, 1.75, 0.75, materials.orange, materials.woodLight, materials.blue);
voxelPerson(waitingZone, -0.85, 0.72, materials.red, materials.cream, materials.red);
voxelPerson(waitingZone, 0.8, 0.68, materials.cream, materials.woodLight, materials.dark);
// Loose intake bags and crates.
for (let i = 0; i < 3; i++) {
box(scene, [0.55, 0.42, 0.42], [-9.2 + i * 0.7, 0.25, 5.65], i === 1 ? materials.blue : materials.cream);
box(scene, [0.12, 0.25, 0.1], [-9.2 + i * 0.7, 0.58, 5.65], materials.dark);
}
// Selectable zone props.
for (const zone of Object.values(zones)) {
zone.group.traverse((object) => {
if (object.isMesh && !pickables.includes(object)) {
object.userData.zone = zone.group.userData.zone;
pickables.push(object);
}
});
}
const labels = [
{ id: "intake", text: "01 · INTAKE", color: "#d7ff4f", position: new THREE.Vector3(-6.1, 2.8, 4.7) },
{ id: "diagnosis", text: "02 · DIAGNOSIS", color: "#62d8e9", position: new THREE.Vector3(-2.4, 2.75, 4.35) },
{ id: "bench", text: "03 · SKILLED BENCH", color: "#ff7d49", position: new THREE.Vector3(2.4, 2.75, 4.7) },
{ id: "waiting", text: "04 · WAITING", color: "#ff6262", position: new THREE.Vector3(7.6, 3.25, 4.45) }
];
const labelLayer = document.getElementById("world-labels");
labels.forEach((label) => {
const element = document.createElement("div");
element.className = "world-label";
element.style.setProperty("--label-color", label.color);
element.innerHTML = `<b>${label.text}</b>`;
labelLayer.appendChild(element);
label.element = element;
});
// Custom camera controls — no imported controls.
const cameraState = {
yaw: 0.64,
pitch: 0.61,
distance: 22,
target: new THREE.Vector3(0, 0.5, 0)
};
function updateCamera() {
const horizontal = Math.cos(cameraState.pitch) * cameraState.distance;
camera.position.set(
cameraState.target.x + Math.sin(cameraState.yaw) * horizontal,
cameraState.target.y + Math.sin(cameraState.pitch) * cameraState.distance,
cameraState.target.z + Math.cos(cameraState.yaw) * horizontal
);
camera.lookAt(cameraState.target);
}
updateCamera();
let dragging = false;
let pointerMoved = false;
let lastPointer = { x: 0, y: 0 };
renderer.domElement.addEventListener("pointerdown", (event) => {
dragging = true;
pointerMoved = false;
lastPointer = { x: event.clientX, y: event.clientY };
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!dragging) return;
const dx = event.clientX - lastPointer.x;
const dy = event.clientY - lastPointer.y;
if (Math.abs(dx) + Math.abs(dy) > 2) pointerMoved = true;
cameraState.yaw -= dx * 0.007;
cameraState.pitch = THREE.MathUtils.clamp(cameraState.pitch + dy * 0.006, 0.2, 1.18);
lastPointer = { x: event.clientX, y: event.clientY };
updateCamera();
});
renderer.domElement.addEventListener("pointerup", (event) => {
dragging = false;
if (!pointerMoved) selectZoneAt(event);
});
renderer.domElement.addEventListener("pointercancel", () => {
dragging = false;
});
renderer.domElement.addEventListener("wheel", (event) => {
event.preventDefault();
cameraState.distance = THREE.MathUtils.clamp(
cameraState.distance + event.deltaY * 0.015,
12,
31
);
updateCamera();
}, { passive: false });
document.getElementById("home-camera").addEventListener("click", () => {
cameraState.yaw = 0.64;
cameraState.pitch = 0.61;
cameraState.distance = 22;
cameraState.target.set(0, 0.5, 0);
updateCamera();
});
document.getElementById("top-camera").addEventListener("click", () => {
cameraState.yaw = 0;
cameraState.pitch = 1.15;
cameraState.distance = 24;
cameraState.target.set(0, 0, 0);
updateCamera();
});
document.getElementById("toggle-labels").addEventListener("click", (event) => {
const visible = !document.getElementById("world-labels").classList.contains("labels-off");
document.getElementById("world-labels").classList.toggle("labels-off", visible);
event.currentTarget.setAttribute("aria-pressed", String(!visible));
event.currentTarget.textContent = visible ? "Off" : "Labels";
});
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
function selectZoneAt(event) {
const rect = renderer.domElement.getBoundingClientRect();
pointer.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
pointer.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
raycaster.setFromCamera(pointer, camera);
const intersections = raycaster.intersectObjects(pickables, false);
if (!intersections.length) return;
const zoneId = intersections[0].object.userData.zone;
const firstJob = jobs.find((job) => job.zone === zoneId);
if (!firstJob) return;
currentTab = "jobs";
currentFilter = zoneId;
selectedJobId = firstJob.id;
renderRouting();
selectSceneJob(firstJob.id);
showToast(
zoneLabels[zoneId],
`${jobs.filter((job) => job.zone === zoneId).length} routed items shown. Select a job for the explicit capability match.`
);
}
function selectSceneJob(jobId) {
const job = jobs.find((item) => item.id === jobId);
if (!job) return;
for (const [id, zone] of Object.entries(zones)) {
const active = id === job.zone;
zone.baseMaterial.emissiveIntensity = active ? 0.38 : 0.05;
zone.baseMaterial.opacity = active ? 0.31 : 0.17;
}
const target = zones[job.zone].group.position;
cameraState.target.set(target.x, 0.65, target.z);
updateCamera();
}
function resize() {
const width = sceneHost.clientWidth;
const height = sceneHost.clientHeight;
renderer.setSize(width, height, false);
camera.aspect = width / Math.max(height, 1);
camera.updateProjectionMatrix();
}
const resizeObserver = new ResizeObserver(resize);
resizeObserver.observe(sceneHost);
resize();
const projected = new THREE.Vector3();
const clock = new THREE.Clock();
function animate() {
requestAnimationFrame(animate);
const elapsed = clock.getElapsedTime();
beacons.forEach((beacon, index) => {
beacon.position.y = 2.25 + Math.sin(elapsed * 2 + index * 1.4) * 0.09;
beacon.rotation.y += 0.01;
beacon.material.emissiveIntensity = 0.75 + Math.sin(elapsed * 2.4 + index) * 0.35;
});
for (const label of labels) {
projected.copy(label.position).project(camera);
const visible = projected.z > -1 && projected.z < 1;
label.element.style.opacity = visible ? "1" : "0";
label.element.style.left = `${(projected.x * 0.5 + 0.5) * sceneHost.clientWidth}px`;
label.element.style.top = `${(-projected.y * 0.5 + 0.5) * sceneHost.clientHeight}px`;
}
renderer.render(scene, camera);
}
animate();
</script>
</body>
</html>
```