Prompt specification
Build or customize the Three.js 3D scene "Neighborhood Packaging Lifecycle Exhibit" 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: Neighborhood Packaging Lifecycle Exhibit
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/neighborhood-packaging-lifecycle-exhibit-x3951
Scene Description Prompt:
Make a voxel Three.js scene in a self-contained HTML file using cdnjs: neighborhood packaging lifecycle exhibit. Build a small exhibition comparing material flows for several fictional packaging systems. Show stated assumptions and separate qualitative pathways from quantitative environmental claims.
Working Three.js Starter (neighborhood-packaging-lifecycle-exhibit-x3951):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Loop / Block — Neighborhood Packaging Lifecycle Exhibit</title>
<style>
:root {
--bg: #071217;
--panel: rgba(10, 24, 30, 0.9);
--panel-solid: #0b1b22;
--line: rgba(190, 229, 232, 0.16);
--line-strong: rgba(190, 229, 232, 0.3);
--text: #eff8f7;
--muted: #a4b8ba;
--faint: #6f898c;
--teal: #5ee7c7;
--gold: #f6c85f;
--coral: #ff7b72;
--blue: #76b8ff;
--radius: 18px;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: var(--bg);
color: var(--text);
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button {
font: inherit;
}
button:focus-visible {
outline: 2px solid var(--teal);
outline-offset: 3px;
}
[hidden] {
display: none !important;
}
.mono,
.eyebrow,
.chip,
.metric-label,
.system-code,
.marker-letter,
.status,
th {
font-family:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
"Liberation Mono", monospace;
}
header {
position: relative;
z-index: 50;
height: 70px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 24px;
padding: 0 22px;
background: rgba(5, 15, 19, 0.95);
border-bottom: 1px solid var(--line);
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}
.brand {
display: flex;
align-items: center;
min-width: 0;
gap: 13px;
}
.brand-mark {
position: relative;
width: 34px;
height: 34px;
flex: 0 0 auto;
}
.brand-mark i {
position: absolute;
display: block;
width: 15px;
height: 15px;
background: var(--teal);
box-shadow: inset -4px -4px rgba(0, 0, 0, 0.16);
}
.brand-mark i:nth-child(1) {
left: 1px;
top: 9px;
opacity: 0.45;
}
.brand-mark i:nth-child(2) {
left: 10px;
top: 16px;
}
.brand-mark i:nth-child(3) {
left: 19px;
top: 2px;
background: var(--gold);
}
.brand-title {
margin: 0;
font-size: 17px;
font-weight: 760;
letter-spacing: 0.06em;
white-space: nowrap;
}
.brand-subtitle {
margin: 3px 0 0;
color: var(--muted);
font-size: 11px;
letter-spacing: 0.04em;
white-space: nowrap;
}
.header-actions {
display: flex;
align-items: center;
gap: 9px;
}
.header-button {
border: 1px solid var(--line-strong);
border-radius: 10px;
padding: 9px 12px;
color: var(--text);
background: rgba(255, 255, 255, 0.035);
cursor: pointer;
font-size: 12px;
font-weight: 650;
transition: 160ms ease;
}
.header-button:hover {
border-color: rgba(94, 231, 199, 0.65);
background: rgba(94, 231, 199, 0.08);
}
.status {
display: inline-flex;
align-items: center;
gap: 7px;
padding: 8px 10px;
border: 1px solid rgba(246, 200, 95, 0.3);
border-radius: 999px;
color: var(--gold);
font-size: 10px;
letter-spacing: 0.08em;
white-space: nowrap;
}
.status::before {
content: "";
width: 6px;
height: 6px;
border-radius: 50%;
background: currentColor;
box-shadow: 0 0 10px currentColor;
}
main {
position: relative;
width: 100%;
height: calc(100vh - 70px);
overflow: hidden;
}
#stage {
position: absolute;
inset: 0;
overflow: hidden;
background:
radial-gradient(circle at 52% 45%, #17313a 0%, #0a171d 48%, #071217 100%);
}
#stage canvas {
position: absolute;
inset: 0;
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
outline: none;
}
#stage canvas:active {
cursor: grabbing;
}
.vignette {
position: absolute;
inset: 0;
pointer-events: none;
background:
linear-gradient(90deg, rgba(3, 11, 14, 0.35), transparent 28%, transparent 72%, rgba(3, 11, 14, 0.28)),
linear-gradient(0deg, rgba(3, 11, 14, 0.42), transparent 25%, transparent 80%, rgba(3, 11, 14, 0.22));
z-index: 2;
}
#labels {
position: absolute;
inset: 0;
z-index: 4;
pointer-events: none;
overflow: hidden;
}
.marker {
position: absolute;
left: 0;
top: 0;
white-space: nowrap;
transform: translate(-50%, -50%);
transition: opacity 180ms ease;
will-change: transform, opacity;
}
.system-marker {
display: flex;
align-items: center;
gap: 8px;
padding: 7px 10px 7px 7px;
border: 1px solid var(--marker-color);
border-radius: 9px;
background: rgba(5, 16, 21, 0.88);
box-shadow: 0 7px 20px rgba(0, 0, 0, 0.28);
font-size: 11px;
font-weight: 760;
letter-spacing: 0.02em;
}
.marker-letter {
display: grid;
place-items: center;
width: 22px;
height: 22px;
border-radius: 6px;
color: #071217;
background: var(--marker-color);
font-size: 11px;
font-weight: 900;
}
.node-marker {
padding: 5px 8px;
border: 1px solid rgba(224, 245, 243, 0.25);
border-radius: 7px;
background: rgba(5, 16, 21, 0.86);
color: #edf8f7;
font-size: 10px;
letter-spacing: 0.035em;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.22);
}
.panel {
position: absolute;
z-index: 10;
border: 1px solid var(--line);
border-radius: var(--radius);
background: var(--panel);
backdrop-filter: blur(18px) saturate(125%);
-webkit-backdrop-filter: blur(18px) saturate(125%);
box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}
.intro-panel {
top: 18px;
left: 18px;
width: 315px;
padding: 20px;
}
.eyebrow {
color: var(--teal);
font-size: 10px;
font-weight: 750;
letter-spacing: 0.13em;
text-transform: uppercase;
}
h1 {
margin: 10px 0 11px;
max-width: 270px;
font-size: clamp(27px, 3vw, 39px);
line-height: 0.98;
letter-spacing: -0.045em;
}
.intro-copy {
margin: 0;
color: #b7c8ca;
font-size: 13px;
line-height: 1.55;
}
.notice {
margin-top: 16px;
padding: 12px;
border: 1px solid rgba(246, 200, 95, 0.26);
border-radius: 12px;
background: rgba(246, 200, 95, 0.06);
}
.notice strong {
display: block;
margin-bottom: 4px;
color: var(--gold);
font-size: 10px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.notice p {
margin: 0;
color: #c6d0cf;
font-size: 11px;
line-height: 1.5;
}
.route-key {
display: grid;
gap: 8px;
margin-top: 15px;
}
.key-row {
display: flex;
align-items: center;
gap: 9px;
color: #aec0c2;
font-size: 11px;
}
.key-line {
width: 22px;
height: 3px;
border-radius: 3px;
background: var(--key-color);
box-shadow: 0 0 10px color-mix(in srgb, var(--key-color) 60%, transparent);
}
.text-button {
margin-top: 16px;
padding: 0;
border: 0;
color: var(--teal);
background: none;
cursor: pointer;
font-size: 11px;
font-weight: 750;
letter-spacing: 0.02em;
}
.text-button:hover {
color: #b0ffeb;
}
#inspector {
top: 18px;
right: 18px;
width: 370px;
max-height: calc(100% - 170px);
overflow: hidden;
display: flex;
flex-direction: column;
}
.inspector-head {
padding: 19px 19px 15px;
border-bottom: 1px solid var(--line);
}
.inspector-head h2 {
margin: 7px 0 7px;
font-size: 23px;
line-height: 1.05;
letter-spacing: -0.035em;
}
.inspector-head p {
margin: 0;
color: var(--muted);
font-size: 12px;
line-height: 1.5;
}
.tabs {
display: grid;
grid-template-columns: repeat(3, 1fr);
padding: 8px;
gap: 4px;
border-bottom: 1px solid var(--line);
background: rgba(0, 0, 0, 0.12);
}
.tab {
border: 1px solid transparent;
border-radius: 8px;
padding: 8px 5px;
color: var(--muted);
background: transparent;
cursor: pointer;
font-size: 10px;
font-weight: 750;
letter-spacing: 0.04em;
}
.tab:hover {
color: var(--text);
background: rgba(255, 255, 255, 0.035);
}
.tab[aria-selected="true"] {
color: var(--text);
border-color: var(--line-strong);
background: rgba(255, 255, 255, 0.07);
}
#inspectorBody {
padding: 16px 18px 20px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.section-note {
margin: 0 0 14px;
padding: 10px 11px;
border-left: 2px solid var(--teal);
color: #c3d3d3;
background: rgba(94, 231, 199, 0.055);
font-size: 11px;
line-height: 1.5;
}
.path-list {
display: grid;
gap: 0;
}
.path-step {
position: relative;
display: grid;
grid-template-columns: 29px 1fr;
gap: 10px;
padding-bottom: 17px;
}
.path-step:not(:last-child)::before {
content: "";
position: absolute;
left: 13px;
top: 28px;
bottom: 0;
width: 1px;
background: var(--step-color, var(--teal));
opacity: 0.5;
}
.step-number {
position: relative;
z-index: 1;
display: grid;
place-items: center;
width: 27px;
height: 27px;
border: 1px solid var(--step-color, var(--teal));
border-radius: 8px;
color: var(--step-color, var(--teal));
background: #0b1b22;
font-size: 10px;
font-weight: 800;
}
.step-title {
margin: 2px 0 4px;
font-size: 12px;
font-weight: 780;
}
.step-text {
margin: 0;
color: var(--muted);
font-size: 11px;
line-height: 1.5;
}
.chip {
display: inline-flex;
align-items: center;
margin-top: 7px;
padding: 4px 6px;
border: 1px solid var(--line);
border-radius: 999px;
color: #9eb7b8;
background: rgba(255, 255, 255, 0.025);
font-size: 8px;
letter-spacing: 0.06em;
text-transform: uppercase;
}
.mini-table,
.ledger-table {
width: 100%;
border-collapse: collapse;
font-size: 10px;
}
.mini-table th,
.mini-table td,
.ledger-table th,
.ledger-table td {
padding: 10px 8px;
border-bottom: 1px solid var(--line);
text-align: left;
vertical-align: top;
}
.mini-table th,
.ledger-table th {
color: var(--faint);
font-size: 9px;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.mini-table td:first-child,
.ledger-table td:first-child {
color: var(--muted);
}
.table-system {
display: flex;
align-items: center;
gap: 6px;
color: var(--text);
font-weight: 750;
}
.table-dot {
width: 7px;
height: 7px;
border-radius: 2px;
background: var(--dot-color);
}
.assumption-list {
display: grid;
gap: 1px;
overflow: hidden;
border: 1px solid var(--line);
border-radius: 12px;
background: var(--line);
}
.assumption-row {
display: grid;
grid-template-columns: 1fr auto;
gap: 12px;
padding: 11px 12px;
background: rgba(7, 20, 25, 0.9);
}
.assumption-row span:first-child {
color: var(--muted);
font-size: 10px;
}
.assumption-row strong {
font-size: 10px;
text-align: right;
}
.claim-card {
padding: 15px;
border: 1px solid rgba(246, 200, 95, 0.28);
border-radius: 13px;
background: rgba(246, 200, 95, 0.055);
}
.claim-card .status {
padding: 0;
border: 0;
background: transparent;
font-size: 9px;
}
.claim-card h3 {
margin: 10px 0 7px;
font-size: 16px;
letter-spacing: -0.02em;
}
.claim-card p {
margin: 0;
color: #c3cfcd;
font-size: 11px;
line-height: 1.55;
}
.claim-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 7px;
margin-top: 12px;
}
.claim-grid div {
padding: 9px;
border: 1px solid var(--line);
border-radius: 9px;
background: rgba(0, 0, 0, 0.1);
}
.claim-grid strong {
display: block;
margin-bottom: 3px;
color: var(--gold);
font-size: 9px;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.claim-grid span {
color: var(--muted);
font-size: 9px;
}
.fine-print {
margin: 12px 0 0;
color: var(--faint);
font-size: 9px;
line-height: 1.55;
}
.systems-tray {
position: absolute;
z-index: 12;
left: 50%;
bottom: 18px;
width: min(900px, calc(100% - 40px));
transform: translateX(-50%);
display: flex;
gap: 8px;
padding: 9px;
border: 1px solid var(--line);
border-radius: 18px;
background: rgba(7, 18, 23, 0.9);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);
box-shadow: 0 18px 55px rgba(0, 0, 0, 0.36);
}
.all-button,
.system-card {
position: relative;
min-width: 0;
border: 1px solid var(--line);
border-radius: 12px;
color: var(--text);
background: rgba(255, 255, 255, 0.035);
cursor: pointer;
text-align: left;
transition: 160ms ease;
}
.all-button {
flex: 0 0 78px;
display: grid;
place-items: center;
padding: 10px;
color: var(--muted);
font-size: 10px;
font-weight: 750;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.system-card {
flex: 1 1 0;
padding: 11px 13px;
overflow: hidden;
}
.system-card::before,
.all-button::before {
content: "";
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 3px;
background: var(--card-color, transparent);
opacity: 0.8;
}
.all-button:hover,
.system-card:hover {
border-color: var(--card-color, var(--line-strong));
background: rgba(255, 255, 255, 0.07);
transform: translateY(-1px);
}
.system-card.selected,
.all-button.selected {
border-color: var(--card-color, var(--teal));
background: color-mix(in srgb, var(--card-color, #5ee7c7) 9%, rgba(255, 255, 255, 0.04));
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--card-color, #5ee7c7) 20%, transparent);
}
.system-card-top {
display: flex;
align-items: center;
gap: 8px;
}
.system-code {
display: grid;
place-items: center;
width: 23px;
height: 23px;
flex: 0 0 auto;
border-radius: 6px;
color: #071217;
background: var(--card-color);
font-size: 10px;
font-weight: 900;
}
.system-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 12px;
font-weight: 780;
}
.system-type {
margin-top: 5px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--muted);
font-size: 9px;
}
.stage-help {
position: absolute;
z-index: 8;
right: 20px;
bottom: 23px;
color: rgba(211, 231, 231, 0.58);
font-size: 9px;
line-height: 1.6;
text-align: right;
pointer-events: none;
}
.stage-help kbd {
padding: 2px 4px;
border: 1px solid var(--line);
border-radius: 4px;
color: #c8dada;
background: rgba(0, 0, 0, 0.2);
font: inherit;
}
#loading {
position: absolute;
inset: 0;
z-index: 30;
display: grid;
place-items: center;
color: var(--muted);
background: var(--bg);
font-size: 12px;
letter-spacing: 0.08em;
text-transform: uppercase;
transition: opacity 300ms ease;
}
.modal {
position: fixed;
inset: 0;
z-index: 100;
display: grid;
place-items: center;
padding: 24px;
background: rgba(2, 8, 11, 0.76);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
.modal-card {
position: relative;
width: min(980px, 100%);
max-height: min(850px, calc(100vh - 48px));
overflow-y: auto;
padding: 25px;
border: 1px solid var(--line-strong);
border-radius: 20px;
background: #09191f;
box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}
.modal-card h2 {
margin: 7px 0 9px;
font-size: 27px;
letter-spacing: -0.035em;
}
.modal-card > p {
max-width: 780px;
margin: 0;
color: var(--muted);
font-size: 12px;
line-height: 1.6;
}
.modal-close {
position: absolute;
top: 17px;
right: 17px;
width: 34px;
height: 34px;
border: 1px solid var(--line);
border-radius: 9px;
color: var(--text);
background: rgba(255, 255, 255, 0.04);
cursor: pointer;
font-size: 20px;
}
.ledger-wrap {
margin-top: 22px;
overflow-x: auto;
border: 1px solid var(--line);
border-radius: 12px;
}
.ledger-table {
min-width: 760px;
}
.ledger-table td {
color: #d0dedd;
line-height: 1.45;
}
.modal-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 14px;
margin-top: 18px;
}
.modal-section {
padding: 17px;
border: 1px solid var(--line);
border-radius: 13px;
background: rgba(255, 255, 255, 0.025);
}
.modal-section h3 {
margin: 0 0 8px;
font-size: 14px;
}
.modal-section p,
.modal-section li {
color: var(--muted);
font-size: 11px;
line-height: 1.6;
}
.modal-section ul {
margin: 0;
padding-left: 18px;
}
.no-claim {
border-color: rgba(246, 200, 95, 0.28);
background: rgba(246, 200, 95, 0.055);
}
.no-claim .status {
margin-bottom: 10px;
padding: 0;
border: 0;
background: transparent;
}
@media (max-width: 1100px) {
.intro-panel {
width: 280px;
}
#inspector {
width: 330px;
}
.stage-help {
display: none;
}
}
@media (max-width: 820px) {
.brand-subtitle,
.header-button span,
.status {
display: none;
}
.intro-panel {
top: 10px;
left: 10px;
width: 250px;
padding: 15px;
}
.intro-panel h1 {
font-size: 25px;
}
.intro-copy,
.route-key,
.notice {
display: none;
}
#inspector {
top: auto;
right: 10px;
bottom: 145px;
width: min(340px, calc(100% - 20px));
max-height: 38vh;
}
.systems-tray {
width: calc(100% - 20px);
bottom: 10px;
overflow-x: auto;
}
.all-button {
flex-basis: 64px;
}
.system-card {
flex: 0 0 190px;
}
}
@media (max-width: 560px) {
header {
height: 60px;
padding: 0 12px;
}
main {
height: calc(100vh - 60px);
}
.brand-title {
font-size: 13px;
}
.brand-mark {
transform: scale(0.8);
}
.header-actions {
gap: 5px;
}
.header-button {
padding: 8px 9px;
font-size: 10px;
}
.intro-panel {
display: none;
}
#inspector {
left: 10px;
right: 10px;
width: auto;
max-height: 35vh;
}
.inspector-head {
padding: 14px 15px 12px;
}
.inspector-head h2 {
font-size: 19px;
}
#inspectorBody {
padding: 13px 14px 16px;
}
.modal {
padding: 10px;
}
.modal-card {
max-height: calc(100vh - 20px);
padding: 19px;
}
.modal-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<header>
<div class="brand">
<div class="brand-mark" aria-hidden="true"><i></i><i></i><i></i></div>
<div>
<h1 class="brand-title">LOOP / BLOCK</h1>
<p class="brand-subtitle">Neighborhood packaging lifecycle exhibit</p>
</div>
</div>
<div class="header-actions">
<button class="header-button" id="ledgerButton" type="button">
<span>Scenario ledger</span> ≡
</button>
<button class="header-button" id="overviewButton" type="button">
<span>Overview</span> ◫
</button>
<span class="status">Fictional systems</span>
</div>
</header>
<main>
<section id="stage" aria-label="Interactive voxel packaging lifecycle exhibit">
<div class="vignette"></div>
<div id="labels" aria-hidden="true"></div>
<div id="loading">Building neighborhood…</div>
</section>
<section class="panel intro-panel">
<div class="eyebrow">Material futures / neighborhood scale</div>
<h1>Packaging after the doorstep.</h1>
<p class="intro-copy">
Three fictional packaging systems move through the same imagined neighborhood.
Trace the carrier, fiber, or rigid material—and the return routes it may take.
</p>
<div class="notice">
<strong>Pathway, not impact ranking</strong>
<p>
Colors identify systems, not environmental performance.
All numbers are invented teaching assumptions.
No verified comparative environmental claim is made.
</p>
</div>
<div class="route-key" aria-label="System color key">
<div class="key-row"><span class="key-line" style="--key-color: var(--teal)"></span>Reusable carrier and maintenance loop</div>
<div class="key-row"><span class="key-line" style="--key-color: var(--gold)"></span>Fiber collection and reprocessing route</div>
<div class="key-row"><span class="key-line" style="--key-color: var(--coral)"></span>Rigid return, sorting, and recovery route</div>
</div>
<button class="text-button" id="assumptionsButton" type="button">
Read stated assumptions and claim policy →
</button>
</section>
<aside class="panel" id="inspector" aria-label="System inspector">
<div class="inspector-head">
<div class="eyebrow" id="inspectorKicker">Compare / three fictional systems</div>
<h2 id="inspectorTitle">Same doorstep, different routes</h2>
<p id="inspectorSummary">
Select a lane or a system card to inspect its material pathway and assumptions.
</p>
</div>
<div class="tabs" role="tablist" aria-label="Exhibit detail">
<button class="tab" id="tab-path" role="tab" aria-selected="true" aria-controls="inspectorBody" data-tab="path" type="button">PATHWAY</button>
<button class="tab" id="tab-assump" role="tab" aria-selected="false" aria-controls="inspectorBody" data-tab="assump" type="button">ASSUMPTIONS</button>
<button class="tab" id="tab-claims" role="tab" aria-selected="false" aria-controls="inspectorBody" data-tab="claims" type="button">CLAIMS</button>
</div>
<div id="inspectorBody" role="tabpanel"></div>
</aside>
<nav class="systems-tray" aria-label="Choose a packaging system">
<button class="all-button selected" id="allSystems" type="button">All</button>
<button class="system-card" data-system="0" style="--card-color: var(--teal)" type="button">
<div class="system-card-top">
<span class="system-code">A</span>
<span class="system-name">Loop Crate</span>
</div>
<div class="system-type">Reusable carrier / local return</div>
</button>
<button class="system-card" data-system="1" style="--card-color: var(--gold)" type="button">
<div class="system-card-top">
<span class="system-code">B</span>
<span class="system-name">Fiber Fold</span>
</div>
<div class="system-type">Paperboard / recovery-sensitive</div>
</button>
<button class="system-card" data-system="2" style="--card-color: var(--coral)" type="button">
<div class="system-card-top">
<span class="system-code">C</span>
<span class="system-name">Rigid Shell</span>
</div>
<div class="system-type">Rigid pack / partial return</div>
</button>
</nav>
<div class="stage-help">
Drag to orbit · scroll to zoom<br />
Click a lane to inspect · keys <kbd>1</kbd> <kbd>2</kbd> <kbd>3</kbd> · <kbd>0</kbd> overview
</div>
</main>
<div class="modal" id="ledger" hidden role="dialog" aria-modal="true" aria-labelledby="ledgerTitle">
<div class="modal-card">
<button class="modal-close" id="closeLedger" type="button" aria-label="Close">×</button>
<div class="eyebrow">Method / scenario ledger</div>
<h2 id="ledgerTitle">Stated assumptions, separated from claims</h2>
<p>
The exhibit is a material-flow teaching model, not a product comparison or life-cycle assessment.
Every operational number below is fictional and was selected to make assumptions visible.
None of these inputs is a measurement.
</p>
<div class="ledger-wrap">
<table class="ledger-table" id="ledgerTable"></table>
</div>
<div class="modal-grid">
<section class="modal-section">
<h3>Qualitative pathway logic</h3>
<ul>
<li>Each route shows where packaging is expected to move, what operation occurs, and where residual material may leave the loop.</li>
<li>Arrows describe a hypothetical system boundary; they do not imply that every package completes the pathway.</li>
<li>Colored packages animate the route direction and do not represent quantities or impact.</li>
</ul>
</section>
<section class="modal-section no-claim">
<div class="status">Quantitative environmental claims: none asserted</div>
<h3>No CO₂e, energy, water, toxicity, or waste total is presented</h3>
<p>
A valid environmental claim would require a defined functional unit and system boundary,
product-specific inventory data, allocation rules, a recognized impact method, and uncertainty or sensitivity analysis.
This fictional exhibit has none of those.
</p>
</section>
</div>
<div class="modal-section" style="margin-top: 14px">
<h3>What would be needed to add a quantitative claim</h3>
<ul>
<li>Define the comparison function, such as one equivalent delivered package.</li>
<li>Collect primary manufacturing, transport, use, return, washing, sorting, and recovery data.</li>
<li>Use verified supplier data or a product environmental declaration where available.</li>
<li>Document electricity mix, water treatment, drying energy, rejected material, and recovery yield.</li>
<li>Report results with uncertainty, sensitivity tests, and transparent exclusions.</li>
</ul>
</div>
</div>
</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const systems = [
{
id: "A",
name: "Loop Crate",
type: "Reusable carrier / local return",
color: "#5ee7c7",
colorHex: 0x5ee7c7,
summary: "A durable carrier circulates between a local depot, neighborhood use, cleaning, repair, and refill.",
steps: [
{
label: "Fill",
title: "Pack at a local depot",
text: "An empty carrier is filled near the neighborhood and dispatched on a short delivery loop.",
stream: "carrier movement"
},
{
label: "Use",
title: "Use, empty, and return",
text: "The carrier reaches participating households or shops, is emptied, and is brought back to a return point.",
stream: "reuse loop"
},
{
label: "Wash",
title: "Wash and inspect",
text: "A local hub removes residue and checks the carrier. Damaged units may be repaired; unusable parts leave the loop.",
stream: "water + repair"
},
{
label: "Refill",
title: "Return to the next cycle",
text: "Serviceable carriers are refilled. Retired carriers or components enter a separate residual or recovery stream.",
stream: "refill / residual"
}
],
assumptions: [
["Uses per unit", "24 delivery cycles"],
["Travel per delivery", "6 km round trip"],
["Unit mass", "0.42 kg"],
["Return rate", "94%"],
["Wash water", "0.9 L / cycle"],
["Damage requiring repair", "4% / cycle"]
],
gaps: [
"carrier manufacturing inventory",
"actual collection participation",
"washing and drying energy",
"repair and replacement lifetimes",
"verified end-of-life route"
]
},
{
id: "B",
name: "Fiber Fold",
type: "Paperboard / recovery-sensitive",
color: "#f6c85f",
colorHex: 0xf6c85f,
summary: "A one-way paperboard carton moves from a fiber mill through neighborhood use, collection, sorting, and possible reprocessing.",
steps: [
{
label: "Make",
title: "Produce and print a carton",
text: "Fiber is pulped, converted, printed, and shipped to a fulfillment point before packing.",
stream: "fiber supply"
},
{
label: "Use",
title: "Protect one delivery",
text: "The carton is filled and used for a single fictional neighborhood delivery before being emptied.",
stream: "one-way package"
},
{
label: "Collect",
title: "Collect at the curb",
text: "Empty cartons enter a neighborhood collection stream, where food residue or other contamination may affect recovery.",
stream: "fiber collection"
},
{
label: "Sort",
title: "Sort and possibly reprocess",
text: "Accepted clean fiber may be pulped and made into new board. Rejected material may be composted, incinerated, or landfilled.",
stream: "fiber recovery"
}
],
assumptions: [
["Uses per unit", "1 delivery"],
["Supply travel", "70 km one-way leg"],
["Unit mass", "0.11 kg"],
["Collection participation", "65%"],
["Contamination in collected stream", "12%"],
["Recycled content", "70%"]
],
gaps: [
"fiber mill energy and chemistry",
"printing and adhesive inputs",
"collection contamination",
"actual recovery yield and bale quality",
"composting infrastructure and emissions"
]
},
{
id: "C",
name: "Rigid Shell",
type: "Rigid pack / partial return",
color: "#ff7b72",
colorHex: 0xff7b72,
summary: "A rigid shell may be returned for a limited number of uses, then sorted for recycling or residual disposal.",
steps: [
{
label: "Make",
title: "Produce and import a shell",
text: "A rigid pack is molded, assembled with a closure, and transported from an upstream production site.",
stream: "rigid supply"
},
{
label: "Use",
title: "Use and attempt a return",
text: "The shell protects a delivery. Some units are brought back to participating shops, while others are not returned.",
stream: "reuse attempt"
},
{
label: "Sort",
title: "Inspect and sort returns",
text: "Returned units are inspected for cleaning, damage, and suitability for another use.",
stream: "return inspection"
},
{
label: "Recover",
title: "Reuse, recycle, or residual",
text: "Suitable shells return to service. Other polymers may enter a recycling stream if accepted, or a residual route.",
stream: "rigid recovery"
}
],
assumptions: [
["Uses per unit", "6 delivery cycles"],
["Supply travel", "80 km one-way leg"],
["Unit mass", "0.08 kg"],
["Return rate", "35%"],
["Material collection rate", "48%"],
["Recycled content", "20%"]
],
gaps: [
"polymer production inventory",
"closure and label materials",
"washability and contamination",
"return distance and participation",
"polymer-specific recycling acceptance"
]
}
];
const stage = document.getElementById("stage");
const labelsContainer = document.getElementById("labels");
const inspector = document.getElementById("inspector");
const inspectorKicker = document.getElementById("inspectorKicker");
const inspectorTitle = document.getElementById("inspectorTitle");
const inspectorSummary = document.getElementById("inspectorSummary");
const inspectorBody = document.getElementById("inspectorBody");
const cards = [...document.querySelectorAll(".system-card")];
const allSystemsButton = document.getElementById("allSystems");
const tabs = [...document.querySelectorAll(".tab")];
let selectedSystem = null;
let activeTab = "path";
// -------------------------------------------------------------------------
// Renderer and scene
// -------------------------------------------------------------------------
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x08161c);
scene.fog = new THREE.Fog(0x08161c, 32, 68);
const camera = new THREE.PerspectiveCamera(
42,
stage.clientWidth / stage.clientHeight,
0.1,
120
);
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(stage.clientWidth, stage.clientHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.08;
renderer.domElement.tabIndex = 0;
renderer.domElement.setAttribute(
"aria-label",
"Voxel neighborhood showing three fictional packaging material pathways. Drag to orbit and scroll to zoom."
);
stage.prepend(renderer.domElement);
const hemisphere = new THREE.HemisphereLight(0xc8e8ef, 0x152229, 2.2);
scene.add(hemisphere);
const sun = new THREE.DirectionalLight(0xffe4bd, 3.2);
sun.position.set(-13, 24, 14);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -30;
sun.shadow.camera.right = 30;
sun.shadow.camera.top = 25;
sun.shadow.camera.bottom = -25;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 70;
sun.shadow.bias = -0.0005;
scene.add(sun);
const coolFill = new THREE.DirectionalLight(0x78baff, 1.15);
coolFill.position.set(18, 10, -16);
scene.add(coolFill);
const geometryCache = new Map();
function boxGeometry(size) {
const key = size.join(",");
if (!geometryCache.has(key)) {
geometryCache.set(key, new THREE.BoxGeometry(...size));
}
return geometryCache.get(key);
}
function standardMaterial(color, options = {}) {
return new THREE.MeshStandardMaterial({
color,
roughness: 0.76,
metalness: 0.03,
...options
});
}
function addBox(parent, size, position, material, castShadow = true) {
const mesh = new THREE.Mesh(boxGeometry(size), material);
mesh.position.set(...position);
mesh.castShadow = castShadow;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
const groundMaterial = standardMaterial(0x193039);
const sidewalkMaterial = standardMaterial(0x34474c);
const roadMaterial = standardMaterial(0x101c21);
const darkMaterial = standardMaterial(0x102128);
const paleMaterial = standardMaterial(0xb5c5c3);
const windowMaterial = standardMaterial(0xffd98d, {
emissive: 0xffc75c,
emissiveIntensity: 0.55,
roughness: 0.4
});
// Ground, street, and curb.
addBox(scene, [54, 0.35, 36], [0, -0.48, 0], groundMaterial, false);
addBox(scene, [52, 0.12, 4.4], [0, -0.23, 8], roadMaterial, false);
addBox(scene, [52, 0.18, 1.5], [0, -0.18, 5.45], sidewalkMaterial, false);
addBox(scene, [52, 0.2, 0.45], [0, -0.18, 4.55], standardMaterial(0x60716f), false);
const roadDashMaterial = standardMaterial(0xb8c2af, {
emissive: 0x6a705c,
emissiveIntensity: 0.15
});
for (let x = -24; x <= 24; x += 3.2) {
addBox(scene, [1.55, 0.035, 0.1], [x, -0.155, 8], roadDashMaterial, false);
}
for (let z = 6.85; z <= 9.1; z += 0.42) {
addBox(scene, [1.7, 0.035, 0.23], [0, -0.15, z], paleMaterial, false);
}
// -------------------------------------------------------------------------
// Reusable voxel city pieces
// -------------------------------------------------------------------------
function makeBuilding(x, z, width, depth, height, bodyColor, roofColor) {
const group = new THREE.Group();
group.position.set(x, -0.27, z);
scene.add(group);
const body = standardMaterial(bodyColor);
const roof = standardMaterial(roofColor);
const trim = standardMaterial(0x52686a);
addBox(group, [width, height, depth], [0, height / 2, 0], body);
addBox(group, [width + 0.25, 0.24, depth + 0.25], [0, height + 0.12, 0], roof);
addBox(group, [width * 0.62, 0.22, depth * 0.55], [0, height + 0.32, 0], roof);
const columns = Math.max(2, Math.floor(width / 1.1));
const rows = Math.max(1, Math.floor((height - 0.7) / 1.15));
for (let row = 0; row < rows; row++) {
for (let col = 0; col < columns; col++) {
const wx = -width / 2 + 0.7 + col * ((width - 1.4) / Math.max(1, columns - 1));
const wy = 0.85 + row * 1.15;
if (row === 0 && col === Math.floor(columns / 2)) {
addBox(group, [0.72, 1.25, 0.1], [wx, 0.62, depth / 2 + 0.06], darkMaterial);
} else {
addBox(group, [0.58, 0.62, 0.08], [wx, wy, depth / 2 + 0.06], windowMaterial, false);
}
}
}
addBox(group, [0.32, 1.4, 0.35], [width * 0.28, height + 0.85, 0], trim);
}
makeBuilding(-18, -10.7, 5.4, 4.1, 4.8, 0x52656a, 0x33474b);
makeBuilding(-7.2, -11.2, 4.8, 3.8, 3.7, 0x725b4a, 0x4d4038);
makeBuilding(6.8, -10.9, 5.6, 4.0, 5.4, 0x475b67, 0x30434c);
makeBuilding(18, -10.8, 5.0, 4.2, 4.2, 0x635565, 0x443945);
function makeVoxelTree(x, z, scale = 1) {
const group = new THREE.Group();
group.position.set(x, -0.27, z);
group.scale.setScalar(scale);
scene.add(group);
const trunk = standardMaterial(0x75513b);
const leaf = standardMaterial(0x4d8a69);
const leafLight = standardMaterial(0x71a87a);
addBox(group, [0.28, 1.25, 0.28], [0, 0.62, 0], trunk);
addBox(group, [1.35, 1.05, 1.35], [0, 1.55, 0], leaf);
addBox(group, [0.95, 1.25, 0.95], [0.18, 2.22, -0.08], leafLight);
addBox(group, [0.8, 0.75, 0.8], [-0.35, 2.12, 0.22], leaf);
}
[
[-23, -5.7, 0.9], [-21, 4.8, 0.75], [-15, 4.7, 0.7],
[15, 4.7, 0.72], [22, -5.5, 0.95], [23.5, 4.7, 0.7],
[-2.5, 4.7, 0.62], [2.5, 4.7, 0.62]
].forEach(([x, z, s]) => makeVoxelTree(x, z, s));
function makePerson(x, z, color, phase = 0) {
const group = new THREE.Group();
group.position.set(x, -0.27, z);
group.userData.phase = phase;
scene.add(group);
const shirt = standardMaterial(color);
const skin = standardMaterial(0xd6a27d);
const pants = standardMaterial(0x263940);
addBox(group, [0.35, 0.58, 0.28], [0, 0.72, 0], shirt);
addBox(group, [0.33, 0.33, 0.3], [0, 1.2, 0], skin);
addBox(group, [0.14, 0.44, 0.16], [-0.1, 0.23, 0], pants);
addBox(group, [0.14, 0.44, 0.16], [0.1, 0.23, 0], pants);
group.userData.baseY = group.position.y;
return group;
}
const people = [
makePerson(-8, 4.9, 0xf6c85f, 0),
makePerson(7.8, 5.0, 0x76b8ff, 1.4),
makePerson(17.4, 4.9, 0xff7b72, 2.8)
];
// Small street bins.
const binMaterials = [0x5ee7c7, 0xf6c85f, 0xff7b72];
[-14, -5, 5, 14].forEach((x, i) => {
const bin = new THREE.Group();
bin.position.set(x, -0.26, 5.0);
scene.add(bin);
addBox(bin, [0.55, 0.9, 0.55], [0, 0.45, 0], standardMaterial(binMaterials[i % 3]));
addBox(bin, [0.65, 0.12, 0.65], [0, 0.94, 0], darkMaterial);
});
// Moving delivery truck.
const truck = new THREE.Group();
truck.position.set(-18, -0.22, 8);
scene.add(truck);
addBox(truck, [2.4, 1.15, 1.25], [-0.45, 0.8, 0], standardMaterial(0xd9e5df));
addBox(truck, [1.05, 1.05, 1.2], [1.2, 0.72, 0], standardMaterial(0x5ee7c7));
addBox(truck, [0.7, 0.45, 0.06], [1.25, 0.92, 0.63], windowMaterial, false);
addBox(truck, [0.48, 0.48, 0.16], [-0.65, 0.85, 0.66], standardMaterial(0x76b8ff), false);
// -------------------------------------------------------------------------
// Packaging icons and exhibit islands
// -------------------------------------------------------------------------
function makeCrate(color = 0x5ee7c7, scale = 1) {
const group = new THREE.Group();
const bodyMat = standardMaterial(color, { roughness: 0.58 });
const dark = standardMaterial(0x183e3b);
addBox(group, [0.72 * scale, 0.43 * scale, 0.68 * scale], [0, 0.25 * scale, 0], bodyMat);
addBox(group, [0.78 * scale, 0.11 * scale, 0.74 * scale], [0, 0.51 * scale, 0], bodyMat);
addBox(group, [0.18 * scale, 0.08 * scale, 0.05 * scale], [-0.22 * scale, 0.36 * scale, 0.36 * scale], dark, false);
addBox(group, [0.18 * scale, 0.08 * scale, 0.05 * scale], [0.22 * scale, 0.36 * scale, 0.36 * scale], dark, false);
return group;
}
function makeCarton(color = 0xf6c85f, scale = 1) {
const group = new THREE.Group();
const body = standardMaterial(color);
const tape = standardMaterial(0xb87836);
addBox(group, [0.72 * scale, 0.68 * scale, 0.62 * scale], [0, 0.36 * scale, 0], body);
addBox(group, [0.16 * scale, 0.025 * scale, 0.64 * scale], [0, 0.71 * scale, 0], tape, false);
addBox(group, [0.16 * scale, 0.68 * scale, 0.025 * scale], [0, 0.36 * scale, 0.32 * scale], tape, false);
return group;
}
function makeShell(color = 0xff7b72, scale = 1) {
const group = new THREE.Group();
const body = standardMaterial(color, { roughness: 0.42 });
const lid = standardMaterial(0x874d4b);
addBox(group, [0.66 * scale, 0.6 * scale, 0.66 * scale], [0, 0.33 * scale, 0], body);
addBox(group, [0.72 * scale, 0.14 * scale, 0.72 * scale], [0, 0.7 * scale, 0], lid);
addBox(group, [0.22 * scale, 0.08 * scale, 0.04 * scale], [0, 0.39 * scale, 0.35 * scale], paleMaterial, false);
return group;
}
function makeGroundArrow(start, end, color) {
const dx = end.x - start.x;
const dz = end.z - start.z;
const length = Math.hypot(dx, dz);
const group = new THREE.Group();
group.position.set((start.x + end.x) / 2, 0.25, (start.z + end.z) / 2);
group.rotation.y = Math.atan2(dx, dz);
const material = standardMaterial(color, {
emissive: color,
emissiveIntensity: 0.28,
roughness: 0.5
});
addBox(group, [0.13, 0.07, Math.max(0.2, length - 0.75)], [0, 0, -0.12], material, false);
const headA = addBox(group, [0.13, 0.08, 0.62], [-0.16, 0, length / 2 - 0.28], material, false);
const headB = addBox(group, [0.13, 0.08, 0.62], [0.16, 0, length / 2 - 0.28], material, false);
headA.rotation.y = -0.62;
headB.rotation.y = 0.62;
return group;
}
function addStationIcon(root, systemIndex, node, index) {
const [x, z] = node;
const color = systems[systemIndex].colorHex;
if (systemIndex === 0) {
if (index === 0) {
addBox(root, [1.45, 1.05, 1.1], [x, 0.82, z], standardMaterial(0x2e655f));
addBox(root, [1.7, 0.16, 1.3], [x, 1.42, z], standardMaterial(color));
addBox(root, [0.62, 0.55, 0.08], [x, 0.62, z + 0.58], darkMaterial);
} else if (index === 1) {
const crate = makeCrate(color, 0.85);
crate.position.set(x, 0.22, z);
root.add(crate);
} else if (index === 2) {
addBox(root, [1.35, 0.25, 1.0], [x, 0.42, z], standardMaterial(0x375158));
addBox(root, [1.05, 0.1, 0.72], [x, 0.58, z], standardMaterial(0x76b8ff, {
transparent: true,
opacity: 0.72,
emissive: 0x2e6595,
emissiveIntensity: 0.25
}));
addBox(root, [0.12, 1.05, 0.12], [x - 0.64, 0.82, z], standardMaterial(color));
addBox(root, [0.12, 1.05, 0.12], [x + 0.64, 0.82, z], standardMaterial(color));
} else {
for (let i = 0; i < 3; i++) {
const crate = makeCrate(color, 0.65);
crate.position.set(x - 0.35 + i * 0.34, 0.25 + (i % 2) * 0.38, z);
root.add(crate);
}
}
} else if (systemIndex === 1) {
if (index === 0) {
addBox(root, [1.35, 1.45, 1.1], [x, 0.98, z], standardMaterial(0x7a633d));
addBox(root, [1.55, 0.15, 1.3], [x, 1.77, z], standardMaterial(color));
addBox(root, [0.25, 1.05, 0.25], [x + 0.4, 2.1, z], standardMaterial(0x8a8372));
} else if (index === 1) {
for (let i = 0; i < 2; i++) {
const carton = makeCarton(color, 0.75);
carton.position.set(x + i * 0.28, 0.22, z + i * 0.12);
root.add(carton);
}
} else if (index === 2) {
addBox(root, [1.1, 0.9, 0.85], [x, 0.68, z], standardMaterial(0x8f733f));
addBox(root, [1.25, 0.12, 1.0], [x, 1.18, z], standardMaterial(color));
addBox(root, [0.62, 0.09, 0.08], [x, 1.25, z + 0.51], darkMaterial, false);
} else {
for (let i = 0; i < 2; i++) {
addBox(root, [0.95, 0.5, 0.75], [x - 0.36 + i * 0.72, 0.49, z], standardMaterial(0xc79a52));
addBox(root, [0.08, 0.52, 0.78], [x - 0.36 + i * 0.72, 0.49, z], darkMaterial, false);
}
}
} else {
if (index === 0) {
addBox(root, [1.5, 1.2, 1.2], [x, 0.85, z], standardMaterial(0x78504e));
addBox(root, [1.7, 0.18, 1.4], [x, 1.53, z], standardMaterial(color));
addBox(root, [0.26, 0.8, 0.26], [x + 0.45, 1.88, z], standardMaterial(0x9b625e));
} else if (index === 1) {
const shell = makeShell(color, 0.9);
shell.position.set(x, 0.22, z);
root.add(shell);
} else if (index === 2) {
addBox(root, [0.85, 0.95, 0.85], [x - 0.45, 0.7, z], standardMaterial(color));
addBox(root, [0.85, 0.95, 0.85], [x + 0.45, 0.7, z], standardMaterial(0x80504d));
addBox(root, [0.95, 0.12, 0.95], [x - 0.45, 1.23, z], darkMaterial);
addBox(root, [0.95, 0.12, 0.95], [x + 0.45, 1.23, z], darkMaterial);
} else {
for (let i = 0; i < 3; i++) {
const shell = makeShell(color, 0.55);
shell.position.set(x - 0.5 + i * 0.5, 0.2 + (i % 2) * 0.42, z);
root.add(shell);
}
}
}
}
const nodePositions = [
new THREE.Vector3(-1.65, 0.23, -3.35),
new THREE.Vector3(1.45, 0.23, -1.25),
new THREE.Vector3(-1.65, 0.23, 1.2),
new THREE.Vector3(1.45, 0.23, 3.3)
];
const markerRecords = [];
const systemRoots = [];
const movingPackages = [];
function addMarker(html, position, kind, systemIndex, color) {
const element = document.createElement("div");
element.className = `marker ${kind === "system" ? "system-marker" : "node-marker"}`;
element.innerHTML = html;
element.style.setProperty("--marker-color", color);
labelsContainer.appendChild(element);
markerRecords.push({
element,
position,
kind,
systemIndex
});
}
function buildExhibitSystem(systemIndex) {
const data = systems[systemIndex];
const root = new THREE.Group();
root.position.x = (systemIndex - 1) * 11.7;
root.userData.systemIndex = systemIndex;
scene.add(root);
systemRoots.push(root);
const platform = standardMaterial(0x12282f, { roughness: 0.92 });
const inset = standardMaterial(0x19353c);
const accent = standardMaterial(data.colorHex, {
emissive: data.colorHex,
emissiveIntensity: 0.22
});
addBox(root, [8.35, 0.28, 10.25], [0, 0, 0], platform);
addBox(root, [7.75, 0.06, 9.62], [0, 0.17, 0], inset, false);
// Corner registration marks.
[
[-3.75, -4.75], [3.75, -4.75], [-3.75, 4.75], [3.75, 4.75]
].forEach(([x, z]) => {
addBox(root, [0.44, 0.08, 0.12], [x, 0.25, z], accent, false);
addBox(root, [0.12, 0.08, 0.44], [x, 0.25, z], accent, false);
});
nodePositions.forEach((node) => {
addBox(root, [1.52, 0.08, 1.52], [node.x, 0.23, node.z], standardMaterial(0x29454a), false);
});
for (let i = 0; i < nodePositions.length; i++) {
const next = nodePositions[(i + 1) % nodePositions.length];
root.add(makeGroundArrow(nodePositions[i], next, data.colorHex));
addStationIcon(root, systemIndex, [nodePositions[i].x, nodePositions[i].z], i);
}
const light = new THREE.PointLight(data.colorHex, 1.3, 10, 2);
light.position.set(0, 4.2, 0.6);
root.add(light);
root.userData.accentLight = light;
const curvePoints = nodePositions.map((p) => new THREE.Vector3(p.x, 0.22, p.z));
const curve = new THREE.CatmullRomCurve3(curvePoints, true, "catmullrom", 0.12);
for (let i = 0; i < 3; i++) {
let mover;
if (systemIndex === 0) mover = makeCrate(data.colorHex, 0.58);
if (systemIndex === 1) mover = makeCarton(data.colorHex, 0.58);
if (systemIndex === 2) mover = makeShell(data.colorHex, 0.58);
root.add(mover);
movingPackages.push({
object: mover,
curve,
phase: i / 3 + systemIndex * 0.11,
speed: 0.026 + systemIndex * 0.002
});
}
addMarker(
`<span class="marker-letter">${data.id}</span><span>${data.name}</span>`,
new THREE.Vector3(root.position.x, 0.65, 4.9),
"system",
systemIndex,
data.color
);
nodePositions.forEach((node, i) => {
const label = data.steps[i].label;
addMarker(
label,
new THREE.Vector3(root.position.x + node.x, 1.85, node.z),
"node",
systemIndex,
data.color
);
});
}
systems.forEach((_, i) => buildExhibitSystem(i));
// -------------------------------------------------------------------------
// Inspector rendering
// -------------------------------------------------------------------------
function renderPathway() {
if (selectedSystem === null) {
return `
<p class="section-note">
These are qualitative pathways. The animation shows direction and sequence,
not material quantities, recovery rates, or environmental performance.
</p>
<div class="path-list">
${systems.map((data) => `
<div class="path-step" style="--step-color:${data.color}">
<div class="step-number">${data.id}</div>
<div>
<div class="step-title">${data.name}</div>
<p class="step-text">${data.summary}</p>
<span class="chip">${data.steps.map((s) => s.label).join(" → ")}</span>
</div>
</div>
`).join("")}
</div>
`;
}
const data = systems[selectedSystem];
return `
<p class="section-note">
The pathway follows one fictional package through its expected route.
It is not a measured material flow.
</p>
<div class="path-list">
${data.steps.map((step, i) => `
<div class="path-step" style="--step-color:${data.color}">
<div class="step-number">${String(i + 1).padStart(2, "0")}</div>
<div>
<div class="step-title">${step.title}</div>
<p class="step-text">${step.text}</p>
<span class="chip">${step.stream}</span>
</div>
</div>
`).join("")}
</div>
`;
}
function renderAssumptions() {
if (selectedSystem === null) {
return `
<p class="section-note">
These fictional inputs make the scenarios inspectable.
They are assumptions—not measurements—and should not be used to rank environmental impact.
</p>
<table class="mini-table">
<thead>
<tr>
<th>System</th>
<th>Uses</th>
<th>Travel input</th>
<th>Mass</th>
<th>Return / capture</th>
</tr>
</thead>
<tbody>
<tr>
<td><div class="table-system"><span class="table-dot" style="--dot-color:${systems[0].color}"></span>A</div></td>
<td>24 cycles</td><td>6 km round trip</td><td>0.42 kg</td><td>94% return</td>
</tr>
<tr>
<td><div class="table-system"><span class="table-dot" style="--dot-color:${systems[1].color}"></span>B</div></td>
<td>1 use</td><td>70 km supply leg</td><td>0.11 kg</td><td>65% collection</td>
</tr>
<tr>
<td><div class="table-system"><span class="table-dot" style="--dot-color:${systems[2].color}"></span>C</div></td>
<td>6 cycles</td><td>80 km supply leg</td><td>0.08 kg</td><td>35% return</td>
</tr>
</tbody>
</table>
<p class="fine-print">
A travel input is not an impact result. Different systems include different operational stages,
so the values should not be divided and compared without a defined functional unit.
</p>
`;
}
const data = systems[selectedSystem];
return `
<p class="section-note">
Fictional inputs for ${data.name}. These values set the teaching scenario only.
</p>
<div class="assumption-list">
${data.assumptions.map(([label, value]) => `
<div class="assumption-row">
<span>${label}</span>
<strong>${value}</strong>
</div>
`).join("")}
</div>
<p class="fine-print">
Functional unit: one equivalent fictional neighborhood delivery.
The model does not allocate impacts, calculate totals, or estimate waste.
</p>
`;
}
function renderClaims() {
const gaps = selectedSystem === null
? [...new Set(systems.flatMap((s) => s.gaps))]
: systems[selectedSystem].gaps;
return `
<div class="claim-card">
<div class="status">No verified comparative result</div>
<h3>Quantitative environmental claims: none asserted</h3>
<p>
This exhibit does not calculate CO₂e, energy, water, toxicity, waste,
or a composite environmental score. Route colors and package motion
must not be read as impact rankings.
</p>
<div class="claim-grid">
<div><strong>CO₂e</strong><span>Not estimated</span></div>
<div><strong>Energy</strong><span>Not estimated</span></div>
<div><strong>Water</strong><span>Not estimated</span></div>
<div><strong>Waste</strong><span>Not predicted</span></div>
</div>
</div>
<p class="section-note" style="margin-top: 14px">
A comparative claim would require a common functional unit and system boundary,
primary inventory data, transparent allocation, a recognized impact method,
and uncertainty or sensitivity analysis.
</p>
<div class="eyebrow" style="color: var(--muted)">Data still needed</div>
<div class="assumption-list" style="margin-top: 9px">
${gaps.map((gap) => `
<div class="assumption-row">
<span>${gap}</span>
<strong>missing</strong>
</div>
`).join("")}
</div>
`;
}
function renderInspector() {
tabs.forEach((tab) => {
tab.setAttribute("aria-selected", String(tab.dataset.tab === activeTab));
});
if (selectedSystem === null) {
inspectorKicker.textContent = "Compare / three fictional systems";
inspectorTitle.textContent = "Same doorstep, different routes";
inspectorSummary.textContent =
"Select a lane or a system card to inspect its pathway and assumptions.";
} else {
const data = systems[selectedSystem];
inspectorKicker.textContent = `System ${data.id} / ${data.type}`;
inspectorTitle.textContent = data.name;
inspectorSummary.textContent = data.summary;
}
if (activeTab === "path") inspectorBody.innerHTML = renderPathway();
if (activeTab === "assump") inspectorBody.innerHTML = renderAssumptions();
if (activeTab === "claims") inspectorBody.innerHTML = renderClaims();
}
function updateSelectionUI() {
cards.forEach((card, index) => {
card.classList.toggle("selected", selectedSystem === index);
card.setAttribute("aria-pressed", String(selectedSystem === index));
});
allSystemsButton.classList.toggle("selected", selectedSystem === null);
allSystemsButton.setAttribute("aria-pressed", String(selectedSystem === null));
systemRoots.forEach((root, index) => {
const selected = selectedSystem === index;
root.userData.accentLight.intensity = selected ? 4.2 : selectedSystem === null ? 1.3 : 0.35;
});
}
function selectSystem(index, resetTab = true) {
selectedSystem = index;
if (resetTab) activeTab = "path";
updateSelectionUI();
renderInspector();
focusCamera(index);
}
tabs.forEach((tab) => {
tab.addEventListener("click", () => {
activeTab = tab.dataset.tab;
renderInspector();
});
});
cards.forEach((card) => {
card.addEventListener("click", () => {
selectSystem(Number(card.dataset.system));
});
});
allSystemsButton.addEventListener("click", () => selectSystem(null));
document.getElementById("overviewButton").addEventListener("click", () => selectSystem(null));
// -------------------------------------------------------------------------
// Scenario ledger
// -------------------------------------------------------------------------
function renderLedger() {
const table = document.getElementById("ledgerTable");
table.innerHTML = `
<thead>
<tr>
<th>System</th>
<th>Use count</th>
<th>Travel input</th>
<th>Unit mass</th>
<th>Return / collection</th>
<th>Other assumptions</th>
</tr>
</thead>
<tbody>
${systems.map((data) => `
<tr>
<td>
<div class="table-system">
<span class="table-dot" style="--dot-color:${data.color}"></span>
${data.id} · ${data.name}
</div>
</td>
<td>${data.assumptions[0][1]}</td>
<td>${data.assumptions[1][1]}</td>
<td>${data.assumptions[2][1]}</td>
<td>${data.assumptions[3][1]}</td>
<td>${data.assumptions.slice(4).map(([label, value]) => `${label}: ${value}`).join("<br>")}</td>
</tr>
`).join("")}
</tbody>
`;
}
const ledger = document.getElementById("ledger");
function openLedger() {
ledger.hidden = false;
document.getElementById("closeLedger").focus();
}
function closeLedger() {
ledger.hidden = true;
}
document.getElementById("ledgerButton").addEventListener("click", openLedger);
document.getElementById("assumptionsButton").addEventListener("click", openLedger);
document.getElementById("closeLedger").addEventListener("click", closeLedger);
ledger.addEventListener("click", (event) => {
if (event.target === ledger) closeLedger();
});
window.addEventListener("keydown", (event) => {
if (event.key === "Escape" && !ledger.hidden) closeLedger();
});
renderLedger();
renderInspector();
updateSelectionUI();
// -------------------------------------------------------------------------
// Direct camera controls — no OrbitControls or addons
// -------------------------------------------------------------------------
const target = new THREE.Vector3(0, 0, 0);
const desiredTarget = new THREE.Vector3(0, 0, 0);
let yaw = 0.72;
let pitch = 0.67;
let radius = 34;
let desiredYaw = yaw;
let desiredPitch = pitch;
let desiredRadius = radius;
function focusCamera(index) {
if (index === null) {
desiredTarget.set(0, 0, 0);
desiredRadius = 34;
desiredYaw = 0.72;
desiredPitch = 0.67;
} else {
desiredTarget.set((index - 1) * 11.7, 0.3, -0.25);
desiredRadius = 14.7;
desiredYaw = 0.78;
desiredPitch = 0.74;
}
}
let pointerDown = false;
let pointerMoved = false;
let previousX = 0;
let previousY = 0;
let activePointerId = null;
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
renderer.domElement.addEventListener("pointerdown", (event) => {
pointerDown = true;
pointerMoved = false;
previousX = event.clientX;
previousY = event.clientY;
activePointerId = event.pointerId;
renderer.domElement.setPointerCapture(event.pointerId);
renderer.domElement.focus({ preventScroll: true });
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!pointerDown || event.pointerId !== activePointerId) return;
const dx = event.clientX - previousX;
const dy = event.clientY - previousY;
previousX = event.clientX;
previousY = event.clientY;
if (Math.abs(dx) + Math.abs(dy) > 2) pointerMoved = true;
desiredYaw -= dx * 0.006;
desiredPitch = THREE.MathUtils.clamp(desiredPitch + dy * 0.0045, 0.32, 1.25);
});
renderer.domElement.addEventListener("pointerup", (event) => {
if (!pointerDown || event.pointerId !== activePointerId) return;
pointerDown = false;
if (renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
if (!pointerMoved) {
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(scene.children, true);
for (const hit of intersections) {
let object = hit.object;
while (object && object.userData.systemIndex === undefined) {
object = object.parent;
}
if (object && object.userData.systemIndex !== undefined) {
selectSystem(object.userData.systemIndex);
break;
}
}
}
});
renderer.domElement.addEventListener("pointercancel", () => {
pointerDown = false;
});
renderer.domElement.addEventListener("wheel", (event) => {
event.preventDefault();
desiredRadius = THREE.MathUtils.clamp(
desiredRadius * Math.exp(event.deltaY * 0.001),
9,
48
);
}, { passive: false });
renderer.domElement.addEventListener("dblclick", () => {
focusCamera(selectedSystem);
});
window.addEventListener("keydown", (event) => {
const tag = document.activeElement?.tagName;
if (tag === "INPUT" || tag === "TEXTAREA") return;
if (event.key === "0") {
selectSystem(null);
} else if (["1", "2", "3"].includes(event.key)) {
selectSystem(Number(event.key) - 1);
} else if (event.key === "ArrowLeft") {
desiredYaw += 0.08;
} else if (event.key === "ArrowRight") {
desiredYaw -= 0.08;
} else if (event.key === "ArrowUp") {
desiredPitch = Math.min(1.25, desiredPitch + 0.05);
} else if (event.key === "ArrowDown") {
desiredPitch = Math.max(0.32, desiredPitch - 0.05);
} else if (event.key === "+" || event.key === "=") {
desiredRadius = Math.max(9, desiredRadius - 1);
} else if (event.key === "-") {
desiredRadius = Math.min(48, desiredRadius + 1);
}
});
function resize() {
const width = stage.clientWidth;
const height = stage.clientHeight;
camera.aspect = width / height;
camera.updateProjectionMatrix();
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(width, height);
}
window.addEventListener("resize", resize);
// -------------------------------------------------------------------------
// Animation
// -------------------------------------------------------------------------
const clock = new THREE.Clock();
const projected = new THREE.Vector3();
function updateMarkers() {
const width = stage.clientWidth;
const height = stage.clientHeight;
markerRecords.forEach((marker) => {
const isNode = marker.kind === "node";
const active = isNode ? selectedSystem === marker.systemIndex : true;
if (!active) {
marker.element.style.opacity = "0";
return;
}
projected.copy(marker.position).project(camera);
if (projected.z < -1 || projected.z > 1) {
marker.element.style.opacity = "0";
return;
}
const x = (projected.x * 0.5 + 0.5) * width;
const y = (-projected.y * 0.5 + 0.5) * height;
const opacity =
selectedSystem !== null && marker.systemIndex !== selectedSystem && !isNode
? 0.38
: 1;
marker.element.style.opacity = String(opacity);
marker.element.style.transform =
`translate(-50%, -50%) translate(${x.toFixed(1)}px, ${y.toFixed(1)}px)`;
});
}
function animate() {
const elapsed = clock.getElapsedTime();
const delta = Math.min(clock.getDelta(), 0.05);
const smoothing = 1 - Math.exp(-delta * 7);
yaw = THREE.MathUtils.lerp(yaw, desiredYaw, smoothing);
pitch = THREE.MathUtils.lerp(pitch, desiredPitch, smoothing);
radius = THREE.MathUtils.lerp(radius, desiredRadius, smoothing);
target.lerp(desiredTarget, smoothing);
camera.position.set(
target.x + radius * Math.sin(pitch) * Math.sin(yaw),
target.y + radius * Math.cos(pitch),
target.z + radius * Math.sin(pitch) * Math.cos(yaw)
);
camera.lookAt(target);
movingPackages.forEach((item) => {
const t = (elapsed * item.speed + item.phase) % 1;
const point = item.curve.getPointAt(t);
const tangent = item.curve.getTangentAt(t);
item.object.position.copy(point);
item.object.rotation.y = Math.atan2(tangent.x, tangent.z);
item.object.rotation.z = Math.sin(elapsed * 2 + item.phase * 9) * 0.025;
});
truck.position.x = ((elapsed * 1.55 + 7) % 48) - 24;
people.forEach((person, index) => {
person.position.y = person.userData.baseY + Math.sin(elapsed * 2.4 + index) * 0.018;
});
updateMarkers();
renderer.render(scene, camera);
}
renderer.setAnimationLoop(animate);
requestAnimationFrame(() => {
const loading = document.getElementById("loading");
loading.style.opacity = "0";
setTimeout(() => loading.remove(), 320);
});
</script>
</body>
</html>
```