Prompt specification
Build or customize the Three.js 3D scene "Shared Memory Exhibition Revision" 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: Shared Memory Exhibition Revision
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/shared-memory-exhibition-revision-x3340
Scene Description Prompt:
Build a self-contained HTML scene with Three.js from cdnjs featuring public art and interpretations of shared memory. Build a fictional public-art planning table with several evidence-backed event cards and community perspectives. Let users compare proposed arrangements without treating one viewpoint as the whole history. Low-poly.
Working Three.js Starter (shared-memory-exhibition-revision-x3340):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Shared Table — Public Memory Planning Scene</title>
<style>
:root {
--ink: #202522;
--muted: #66706a;
--paper: #f6f1e7;
--paper-strong: #fffdf7;
--line: #d7d0c2;
--green: #315c50;
--green-soft: #e0ebe5;
--orange: #c66a3d;
--blue: #467b93;
--purple: #77648e;
--shadow: 0 18px 50px rgba(38, 44, 39, 0.16);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
color: var(--ink);
background: #e8e0d1;
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button,
select {
font: inherit;
}
button {
color: inherit;
}
#scene {
position: fixed;
inset: 0;
}
#scene canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
outline: none;
}
.topbar {
position: fixed;
z-index: 10;
top: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 24px;
padding: 22px 26px;
pointer-events: none;
}
.brand {
max-width: 580px;
pointer-events: auto;
}
.eyebrow {
display: inline-flex;
align-items: center;
gap: 8px;
margin-bottom: 8px;
padding: 6px 10px;
border: 1px solid rgba(49, 92, 80, 0.25);
border-radius: 999px;
background: rgba(255, 253, 247, 0.78);
color: var(--green);
font-size: 11px;
font-weight: 800;
letter-spacing: 0.12em;
text-transform: uppercase;
backdrop-filter: blur(12px);
}
.eyebrow::before {
content: "";
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--green);
}
h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: clamp(32px, 4vw, 58px);
font-weight: 500;
line-height: 0.95;
letter-spacing: -0.035em;
text-wrap: balance;
}
.brand p {
max-width: 520px;
margin: 10px 0 0;
color: #49534d;
font-size: 14px;
line-height: 1.5;
text-wrap: balance;
}
.top-actions {
display: flex;
gap: 8px;
pointer-events: auto;
}
.icon-button,
.quiet-button,
.primary-button,
.secondary-button {
border: 1px solid var(--line);
border-radius: 10px;
background: rgba(255, 253, 247, 0.9);
box-shadow: 0 5px 18px rgba(35, 43, 38, 0.08);
cursor: pointer;
transition:
transform 160ms ease,
background 160ms ease,
border-color 160ms ease;
}
.icon-button:hover,
.quiet-button:hover,
.secondary-button:hover {
transform: translateY(-1px);
border-color: #a9afa8;
background: #fffdf7;
}
.icon-button {
width: 42px;
height: 42px;
font-size: 18px;
}
.quiet-button {
padding: 10px 13px;
font-size: 12px;
font-weight: 750;
}
.primary-button {
padding: 11px 15px;
border-color: var(--green);
background: var(--green);
color: white;
font-size: 12px;
font-weight: 800;
}
.primary-button:hover {
transform: translateY(-1px);
background: #264c42;
}
.secondary-button {
padding: 10px 14px;
font-size: 12px;
font-weight: 750;
}
.panel {
position: fixed;
z-index: 20;
top: 156px;
right: 22px;
width: min(356px, calc(100vw - 32px));
max-height: calc(100vh - 180px);
overflow: auto;
border: 1px solid rgba(118, 112, 96, 0.25);
border-radius: 18px;
background: rgba(255, 253, 247, 0.92);
box-shadow: var(--shadow);
backdrop-filter: blur(18px);
}
.panel-section {
padding: 18px;
border-bottom: 1px solid rgba(118, 112, 96, 0.18);
}
.panel-section:last-child {
border-bottom: 0;
}
.section-heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 12px;
}
.section-heading h2 {
margin: 0;
font-size: 12px;
font-weight: 900;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.section-heading small {
color: var(--muted);
font-size: 11px;
}
.argument-note {
margin: 0 0 13px;
padding: 11px 12px;
border-left: 3px solid var(--orange);
background: #f3e9dd;
color: #684936;
font-family: Georgia, "Times New Roman", serif;
font-size: 14px;
line-height: 1.4;
}
.layout-list {
display: grid;
gap: 8px;
}
.layout-button {
display: grid;
grid-template-columns: 54px 1fr auto;
align-items: center;
gap: 11px;
width: 100%;
padding: 10px;
border: 1px solid var(--line);
border-radius: 12px;
background: #fffdf8;
text-align: left;
cursor: pointer;
transition:
border 150ms ease,
background 150ms ease,
transform 150ms ease;
}
.layout-button:hover {
transform: translateX(-2px);
border-color: #aeb6af;
}
.layout-button.active {
border-color: var(--green);
background: var(--green-soft);
}
.layout-button strong {
display: block;
margin-bottom: 2px;
font-size: 13px;
}
.layout-button span {
display: block;
color: var(--muted);
font-size: 11px;
line-height: 1.35;
}
.layout-number {
color: #8c958f;
font-size: 11px;
font-weight: 900;
}
.layout-glyph {
display: grid;
grid-template-columns: repeat(3, 5px);
gap: 3px;
width: 54px;
height: 42px;
padding: 5px;
border-radius: 8px;
background: #e9e4da;
}
.layout-glyph i {
width: 5px;
height: 5px;
border-radius: 1px;
background: #6d8c7c;
}
.layout-glyph.timeline i:nth-child(2n) {
background: var(--orange);
}
.layout-glyph.themes i:nth-child(3n + 1) {
background: var(--blue);
}
.layout-glyph.voices i:nth-child(2n) {
background: var(--purple);
}
.layout-caption {
margin: 12px 0 0;
color: var(--muted);
font-size: 12px;
line-height: 1.45;
}
.compare-button {
width: 100%;
margin-top: 12px;
}
.event-list {
display: grid;
gap: 6px;
}
.event-item {
display: grid;
grid-template-columns: 9px 44px 1fr;
align-items: center;
gap: 9px;
width: 100%;
padding: 8px 9px;
border: 1px solid transparent;
border-radius: 10px;
background: transparent;
text-align: left;
cursor: pointer;
}
.event-item:hover,
.event-item.active {
border-color: var(--line);
background: #f0ece3;
}
.event-swatch {
width: 8px;
height: 27px;
border-radius: 5px;
}
.event-year {
color: var(--muted);
font-size: 12px;
font-weight: 850;
}
.event-item strong {
display: block;
font-size: 12px;
line-height: 1.25;
}
.event-item small {
display: block;
margin-top: 2px;
color: var(--muted);
font-size: 10px;
}
.scene-hint {
position: fixed;
z-index: 8;
left: 24px;
bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
padding: 9px 12px;
border: 1px solid rgba(118, 112, 96, 0.2);
border-radius: 999px;
background: rgba(255, 253, 247, 0.78);
color: #56605a;
font-size: 11px;
backdrop-filter: blur(12px);
pointer-events: none;
}
kbd {
padding: 3px 6px;
border: 1px solid #cbc6ba;
border-bottom-width: 2px;
border-radius: 5px;
background: #fffdf7;
color: #39413c;
font-family: inherit;
font-size: 10px;
font-weight: 800;
}
.drawer {
position: fixed;
z-index: 40;
top: 156px;
left: 24px;
width: min(480px, calc(100vw - 48px));
max-height: calc(100vh - 185px);
overflow: auto;
border: 1px solid rgba(118, 112, 96, 0.28);
border-radius: 18px;
background: rgba(255, 253, 247, 0.96);
box-shadow: var(--shadow);
backdrop-filter: blur(20px);
transform-origin: left center;
animation: drawer-in 220ms ease-out;
}
@keyframes drawer-in {
from {
opacity: 0;
transform: translateX(-12px) scale(0.985);
}
to {
opacity: 1;
transform: translateX(0) scale(1);
}
}
.drawer[hidden],
.modal[hidden] {
display: none;
}
.drawer-header {
position: relative;
padding: 22px 22px 18px;
border-bottom: 1px solid var(--line);
background: linear-gradient(135deg, #fffdf7, #eee7da);
}
.drawer-header::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 7px;
height: 100%;
background: var(--event-color, var(--green));
}
.drawer-close {
position: absolute;
top: 13px;
right: 13px;
width: 32px;
height: 32px;
border: 1px solid var(--line);
border-radius: 50%;
background: rgba(255, 255, 255, 0.75);
cursor: pointer;
}
.record-label {
margin-bottom: 7px;
color: var(--muted);
font-size: 10px;
font-weight: 900;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.drawer h2 {
max-width: 390px;
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 31px;
font-weight: 500;
line-height: 1.05;
}
.drawer-meta {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 12px;
}
.chip {
padding: 5px 8px;
border: 1px solid #d6d0c3;
border-radius: 999px;
background: rgba(255, 255, 255, 0.66);
color: #56605a;
font-size: 10px;
font-weight: 800;
}
.drawer-body {
padding: 20px 22px 24px;
}
.drawer-body h3 {
margin: 22px 0 8px;
font-size: 11px;
font-weight: 900;
letter-spacing: 0.1em;
text-transform: uppercase;
}
.drawer-body h3:first-child {
margin-top: 0;
}
.drawer-body p {
margin: 0 0 10px;
color: #4e5751;
font-size: 13px;
line-height: 1.55;
}
.evidence-item {
margin-bottom: 8px;
padding: 11px 12px;
border: 1px solid var(--line);
border-radius: 10px;
background: #f8f5ed;
}
.evidence-item strong {
display: block;
margin-bottom: 4px;
font-size: 11px;
}
.evidence-item span {
display: block;
color: #58615b;
font-size: 11px;
line-height: 1.45;
}
.evidence-item code {
display: inline-block;
margin-top: 6px;
color: var(--green);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 10px;
font-weight: 800;
}
.supports-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.supports-grid div {
padding: 11px;
border-radius: 10px;
font-size: 11px;
line-height: 1.45;
}
.supports-grid .supports {
background: #e2ede6;
color: #315548;
}
.supports-grid .limits {
background: #f1e4da;
color: #704b37;
}
.reading {
margin-bottom: 8px;
padding: 12px;
border-left: 3px solid var(--purple);
background: #eee9f1;
color: #51445c;
font-family: Georgia, "Times New Roman", serif;
font-size: 13px;
line-height: 1.45;
}
.reading cite {
display: block;
margin-top: 6px;
color: #756b7b;
font-family: Inter, ui-sans-serif, system-ui, sans-serif;
font-size: 10px;
font-style: normal;
font-weight: 800;
}
.provenance-note {
margin-top: 18px;
padding-top: 14px;
border-top: 1px solid var(--line);
color: #7a817c;
font-size: 10px;
line-height: 1.5;
}
.focus-button {
margin-top: 17px;
}
.modal {
position: fixed;
z-index: 60;
inset: 0;
display: grid;
place-items: center;
padding: 22px;
background: rgba(31, 39, 34, 0.48);
backdrop-filter: blur(8px);
}
.modal-card {
width: min(940px, 100%);
max-height: calc(100vh - 44px);
overflow: auto;
border-radius: 20px;
background: var(--paper-strong);
box-shadow: 0 30px 100px rgba(17, 24, 20, 0.3);
}
.modal-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 20px;
padding: 22px 24px;
border-bottom: 1px solid var(--line);
}
.modal-header h2 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 31px;
font-weight: 500;
}
.modal-header p {
max-width: 650px;
margin: 6px 0 0;
color: var(--muted);
font-size: 12px;
line-height: 1.5;
}
.modal-close {
flex: 0 0 auto;
width: 36px;
height: 36px;
border: 1px solid var(--line);
border-radius: 50%;
background: #f6f1e7;
cursor: pointer;
}
.compare-controls {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: end;
gap: 12px;
padding: 16px 24px;
background: #f3eee4;
}
.compare-controls label {
display: grid;
gap: 6px;
color: var(--muted);
font-size: 10px;
font-weight: 900;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.compare-controls select {
width: 100%;
padding: 10px 34px 10px 11px;
border: 1px solid #cfc8ba;
border-radius: 9px;
background: #fffdf7;
color: var(--ink);
font-size: 12px;
font-weight: 700;
}
.versus {
padding-bottom: 10px;
color: #8a918b;
font-family: Georgia, "Times New Roman", serif;
font-size: 13px;
font-style: italic;
}
.comparison {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1px;
background: var(--line);
}
.comparison-column {
padding: 22px 24px;
background: #fffdf7;
}
.comparison-column h3 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 25px;
font-weight: 500;
}
.comparison-column > p {
min-height: 58px;
color: #58615b;
font-size: 12px;
line-height: 1.5;
}
.mini-plan {
display: block;
width: 100%;
max-width: 330px;
margin: 12px auto 18px;
border: 1px solid var(--line);
border-radius: 13px;
background: #eee7da;
}
.comparison-row {
display: grid;
grid-template-columns: 88px 1fr;
gap: 10px;
padding: 9px 0;
border-top: 1px solid #e5dfd3;
font-size: 11px;
line-height: 1.45;
}
.comparison-row strong {
color: #727a74;
}
.comparison-actions {
display: flex;
justify-content: space-between;
gap: 12px;
padding: 16px 24px 22px;
}
.modal-caution {
padding: 14px 24px;
border-top: 1px solid var(--line);
background: #efe5d8;
color: #654b39;
font-family: Georgia, "Times New Roman", serif;
font-size: 13px;
line-height: 1.5;
}
#loading {
position: fixed;
z-index: 100;
inset: 0;
display: grid;
place-items: center;
background: #e8e0d1;
color: var(--green);
font-family: Georgia, "Times New Roman", serif;
font-size: 22px;
}
@media (max-width: 900px) {
.brand p {
max-width: 390px;
}
.panel {
top: auto;
bottom: 14px;
max-height: 43vh;
}
.drawer {
top: 120px;
bottom: 20px;
max-height: calc(100vh - 140px);
}
.scene-hint {
display: none;
}
}
@media (max-width: 650px) {
.topbar {
padding: 15px;
}
.brand p {
display: none;
}
.brand .eyebrow {
font-size: 9px;
}
h1 {
font-size: 36px;
}
.top-actions {
flex-direction: column;
}
.panel {
right: 10px;
left: 10px;
width: auto;
}
.drawer {
right: 10px;
left: 10px;
width: auto;
}
.comparison {
grid-template-columns: 1fr;
}
.compare-controls {
grid-template-columns: 1fr;
}
.versus {
display: none;
}
.comparison-actions {
flex-direction: column;
}
.comparison-actions button {
width: 100%;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
</style>
</head>
<body>
<div id="scene"></div>
<header class="topbar">
<div class="brand">
<div class="eyebrow">Fictional civic archive · Bellweather Ward</div>
<h1>The Shared Table</h1>
<p>
A public-art planning table for comparing how shared memory can be
arranged. Records support different readings; no layout is the whole history.
</p>
</div>
<div class="top-actions">
<button class="icon-button" id="compareTop" title="Compare arrangements" aria-label="Compare arrangements">
⇄
</button>
<button class="icon-button" id="resetCamera" title="Reset camera" aria-label="Reset camera">
⌂
</button>
</div>
</header>
<aside class="panel" aria-label="Arrangement controls">
<section class="panel-section">
<div class="section-heading">
<h2>Arrangement lab</h2>
<small>3 proposals</small>
</div>
<p class="argument-note">
Every arrangement is an argument. Compare what each one makes visible—and what it risks hiding.
</p>
<div class="layout-list">
<button class="layout-button active" data-layout="chronological" aria-pressed="true">
<span class="layout-glyph timeline" aria-hidden="true">
<i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i>
</span>
<span>
<strong>Timeline walk</strong>
<span>Orders the cards by year.</span>
</span>
<span class="layout-number">1</span>
</button>
<button class="layout-button" data-layout="themes" aria-pressed="false">
<span class="layout-glyph themes" aria-hidden="true">
<i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i>
</span>
<span>
<strong>Theme constellations</strong>
<span>Groups recurring civic concerns.</span>
</span>
<span class="layout-number">2</span>
</button>
<button class="layout-button" data-layout="voices" aria-pressed="false">
<span class="layout-glyph voices" aria-hidden="true">
<i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i>
</span>
<span>
<strong>Neighborhood lens</strong>
<span>Places a community reading beside each event.</span>
</span>
<span class="layout-number">3</span>
</button>
</div>
<p class="layout-caption" id="layoutCaption">
Timeline walk foregrounds change over time. It can make later records feel like a final resolution.
</p>
<button class="secondary-button compare-button" id="compareButton">
Compare two arrangements
</button>
</section>
<section class="panel-section">
<div class="section-heading">
<h2>Evidence cards</h2>
<small>Select to inspect</small>
</div>
<div class="event-list" id="eventList"></div>
</section>
</aside>
<aside class="drawer" id="detailPanel" hidden aria-live="polite"></aside>
<div class="scene-hint">
<span><kbd>Drag</kbd> orbit</span>
<span><kbd>Shift + drag</kbd> pan</span>
<span><kbd>Scroll</kbd> zoom</span>
<span><kbd>1–3</kbd> arrangements</span>
</div>
<div class="modal" id="compareModal" hidden role="dialog" aria-modal="true" aria-labelledby="compareTitle">
<div class="modal-card">
<header class="modal-header">
<div>
<h2 id="compareTitle">Compare the arrangements</h2>
<p>
Change the two proposals to compare their visual logic, practical value,
and interpretive blind spots.
</p>
</div>
<button class="modal-close" id="closeCompare" aria-label="Close comparison">×</button>
</header>
<div class="compare-controls">
<label>
Arrangement A
<select id="compareA"></select>
</label>
<span class="versus">versus</span>
<label>
Arrangement B
<select id="compareB"></select>
</label>
</div>
<div class="comparison" id="comparisonContent"></div>
<div class="comparison-actions">
<button class="secondary-button" id="loadA">Show A in scene</button>
<button class="secondary-button" id="loadB">Show B in scene</button>
</div>
<div class="modal-caution">
A comparison is not a verdict. A useful public history keeps enough context
for evidence, community interpretation, disagreement, and revision to coexist.
</div>
</div>
</div>
<div id="loading">Preparing the shared table…</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const $ = (selector) => document.querySelector(selector);
const events = [
{
id: "fair",
year: 1968,
title: "Lantern Street Fair",
short: "Lantern Street Fair",
theme: "Belonging",
cluster: "Togetherness",
color: "#c87945",
record:
"A one-night neighborhood fair filled three closed street blocks with handmade lanterns, shared food, and temporary public artwork.",
evidence: [
{
type: "Photograph",
ref: "BW-PH-68-14",
detail:
"A wide street photograph shows at least 42 visible participants, eight lantern poles, and banners spanning the intersection."
},
{
type: "Municipal ledger",
ref: "BW-REC-68-27",
detail:
"The closure ledger records three blocks, six temporary structures, and a request from two merchants for additional access routes."
}
],
supports:
"The event was public, organized, and attended by multiple neighborhood groups.",
limits:
"The photograph cannot identify everyone, and attendance totals in the ledger were estimates.",
readings: [
{
name: "Nia R.",
role: "festival regular",
text:
"For my family, the lanterns made the street feel shared. The photograph shows the joy, but not the long negotiations that made it possible."
},
{
name: "Leila H.",
role: "access organizer",
text:
"The open street mattered because it changed who could enter public life. I would ask for oral histories from people using the side entrances."
}
]
},
{
id: "banner",
year: 1979,
title: "Borrowed Banner Workshop",
short: "Borrowed Banner Workshop",
theme: "Making",
cluster: "Making & repair",
color: "#568b75",
record:
"Residents repaired donated fabric and printed a banner to campaign for a community workshop space.",
evidence: [
{
type: "Workshop inventory",
ref: "BW-INV-79-08",
detail:
"The inventory records thirty-one meters of fabric, shared printing equipment, and six repair stations."
},
{
type: "Oral-history excerpt",
ref: "BW-OH-03-19",
detail:
"A printmaker recalls that material was donated by businesses while labor was exchanged through a neighborhood skills list."
}
],
supports:
"The banner was collaboratively produced through donated and exchanged resources.",
limits:
"The surviving records emphasize materials more clearly than the people who did the invisible repair work.",
readings: [
{
name: "Omar K.",
role: "printmaker",
text:
"People called it a banner project, but it was really a skills inventory. The cloth came from many hands."
},
{
name: "Tomas L.",
role: "repair volunteer",
text:
"Repair is not background labor. It is one of the ways this neighborhood decided what deserved to continue."
}
]
},
{
id: "mural",
year: 1994,
title: "Market Mouth Mural",
short: "Market Mouth Mural",
theme: "Visibility",
cluster: "Public voice",
color: "#4e7f99",
record:
"A painted market mural depicted speech bubbles, produce stalls, and the silhouettes of market workers.",
evidence: [
{
type: "Before-and-after images",
ref: "BW-PH-94-03",
detail:
"Paired photographs document a blank brick wall and the completed mural across eight working days."
},
{
type: "Vendor meeting minutes",
ref: "BW-MIN-94-11",
detail:
"Minutes record disagreement over the placement of three named vendor portraits."
}
],
supports:
"The mural was commissioned by a market association and completed through a timed public works project.",
limits:
"The images do not show all of the objections raised after the final portrait positions were changed.",
readings: [
{
name: "Esme V.",
role: "market cook",
text:
"People saw the market made visible. Others felt the wall had been spoken for before they arrived."
},
{
name: "Nia R.",
role: "festival regular",
text:
"The speech bubbles made the work feel public, but a mural can be celebrated without everyone agreeing with it."
}
]
},
{
id: "bench",
year: 2003,
title: "The Listening Bench",
short: "The Listening Bench",
theme: "Care",
cluster: "Togetherness",
color: "#7f7291",
record:
"A bench, audio prompt, and rotating question board invited residents to record memories of a renovated square.",
evidence: [
{
type: "Fabrication log",
ref: "BW-FAB-03-06",
detail:
"The log records a wide seat, armrests, an audio unit, and a removable question panel."
},
{
type: "Interview transcript",
ref: "BW-OH-11-02",
detail:
"A resident describes shorter seating edges and the removal of an initial height that blocked wheelchair users."
}
],
supports:
"The public artwork was revised after an accessibility concern and included a mechanism for collecting oral histories.",
limits:
"The log records design changes but not how often the listening station was used.",
readings: [
{
name: "Rafi A.",
role: "access organizer",
text:
"The revision is part of the story. The bench was not finished when installed; people changed what it could be."
},
{
name: "June S.",
role: "family historian",
text:
"A prompt produces a memory, not the whole memory. We should keep the question cards as evidence too."
}
]
},
{
id: "repair",
year: 2018,
title: "Repair Saturday",
short: "Repair Saturday",
theme: "Maintenance",
cluster: "Making & repair",
color: "#b18a45",
record:
"A monthly repair gathering paired broken household objects with volunteers and a communal parts shelf.",
evidence: [
{
type: "Parts ledger",
ref: "BW-LED-18-31",
detail:
"The ledger lists donated motors, sewing-machine parts, and electrical components sorted by residents."
},
{
type: "Volunteer sign-in",
ref: "BW-SGN-18-44",
detail:
"Sign-in sheets include forty-one volunteers, with repair skills documented in free-text notes."
}
],
supports:
"The gathering sustained a recurring repair practice and relied on a mixed network of volunteers and donated resources.",
limits:
"Sign-in sheets count participation, not how many objects were successfully repaired.",
readings: [
{
name: "Tomas L.",
role: "repair volunteer",
text:
"We were preserving access as much as objects. A working radio or kettle could stay in a household."
},
{
name: "Omar K.",
role: "printmaker",
text:
"The parts shelf is an artwork too: it shows a neighborhood deciding that usefulness deserves display."
}
]
},
{
id: "memorial",
year: 2024,
title: "The Unfinished Memorial",
short: "The Unfinished Memorial",
theme: "Contested meaning",
cluster: "Public voice",
color: "#a6555a",
record:
"A temporary memorial installation left part of its central surface blank while competing community proposals were reviewed.",
evidence: [
{
type: "Installation images",
ref: "BW-PH-24-05",
detail:
"Images document twelve name panels, a central blank panel, and three different published proposal diagrams."
},
{
type: "Consultation minutes",
ref: "BW-MIN-24-18",
detail:
"Minutes record support for a shared process and disagreement over the wording and ownership of the final panel."
}
],
supports:
"The installation was intentionally unfinished and the central space remained part of an active consultation.",
limits:
"The photographic record does not capture people excluded from the meetings or decisions made outside them.",
readings: [
{
name: "June S.",
role: "family historian",
text:
"For some families, the blank center was respectful uncertainty. For others, it looked like unfinished care."
},
{
name: "Rafi A.",
role: "access organizer",
text:
"A process is not neutral if only some people can reach it. The missing voices belong in the evidence too."
}
]
}
];
const layouts = {
chronological: {
id: "chronological",
title: "Timeline walk",
short: "Year order",
summary:
"Places the six records in chronological order, making change and continuity easy to see.",
emphasis: "Change over time and the sequence of public interventions.",
risk:
"Later records can appear to settle earlier disputes, even though unresolved memories continue alongside them.",
use: "A chronological orientation, introductory labels, or a timeline kiosk.",
caption:
"Timeline walk foregrounds change over time. It can make later records feel like a final resolution.",
positions: [
{ x: -5.2, z: 1.0, ry: 0.08 },
{ x: -3.1, z: -2.8, ry: 0.08 },
{ x: 0.0, z: -4.2, ry: 0.08 },
{ x: 3.2, z: -2.9, ry: 0.08 },
{ x: 5.2, z: 0.5, ry: 0.08 },
{ x: 0.3, z: 3.2, ry: 0.08 }
]
},
themes: {
id: "themes",
title: "Theme constellations",
short: "Civic themes",
summary:
"Groups records around recurring concerns such as togetherness, making and repair, and public voice.",
emphasis: "Recurring needs and relationships that span different decades.",
risk:
"Themes can flatten the specific people, conflicts, and contexts that make each record distinct.",
use: "Workshops, thematic tours, or exploring connections across generations.",
caption:
"Theme constellations reveal recurring civic concerns. They can also make unlike events feel too similar.",
positions: [
{ x: -4.8, z: -1.7, ry: 0.08 },
{ x: -4.8, z: 1.1, ry: 0.08 },
{ x: -1.2, z: -4.2, ry: 0.08 },
{ x: 1.3, z: -3.9, ry: 0.08 },
{ x: 4.5, z: -1.5, ry: 0.08 },
{ x: 4.6, z: 1.3, ry: 0.08 }
]
},
voices: {
id: "voices",
title: "Neighborhood lens",
short: "Community anchors",
summary:
"Places a primary community reading near each event card while retaining the event’s evidence references.",
emphasis: "Lived experience, interpretation, and whose questions shape the archive.",
risk:
"One adjacent reading may be mistaken for the complete meaning of the event.",
use: "Community interpretation sessions, oral-history launches, or facilitated discussion.",
caption:
"Neighborhood lens centers lived experience. One reading should never stand in for the whole event.",
positions: [-150, -90, -30, 30, 90, 150].map((angle) => {
const radians = THREE.MathUtils.degToRad(angle);
return {
x: Math.sin(radians) * 5.45,
z: Math.cos(radians) * 5.45,
ry: 0.08
};
})
}
};
const voices = [
{
name: "Nia R.",
lens: "belonging",
eventId: "fair",
color: "#c87945",
angle: -150
},
{
name: "Omar K.",
lens: "making",
eventId: "banner",
color: "#568b75",
angle: -90
},
{
name: "Esme V.",
lens: "visibility",
eventId: "mural",
color: "#4e7f99",
angle: -30
},
{
name: "Rafi A.",
lens: "access",
eventId: "bench",
color: "#7f7291",
angle: 30
},
{
name: "Tomas L.",
lens: "maintenance",
eventId: "repair",
color: "#b18a45",
angle: 90
},
{
name: "June S.",
lens: "meaning",
eventId: "memorial",
color: "#a6555a",
angle: 150
}
];
const sceneHost = $("#scene");
const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: false });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.12;
renderer.domElement.setAttribute("aria-label", "Interactive low-poly public memory planning table");
renderer.domElement.tabIndex = 0;
sceneHost.appendChild(renderer.domElement);
const scene = new THREE.Scene();
scene.background = new THREE.Color("#e8e0d1");
scene.fog = new THREE.Fog("#e8e0d1", 25, 48);
const camera = new THREE.PerspectiveCamera(
42,
window.innerWidth / window.innerHeight,
0.1,
80
);
const hemi = new THREE.HemisphereLight("#fff8e9", "#738177", 2.25);
scene.add(hemi);
const sun = new THREE.DirectionalLight("#fff0d5", 3.2);
sun.position.set(8, 16, 10);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -20;
sun.shadow.camera.right = 20;
sun.shadow.camera.top = 20;
sun.shadow.camera.bottom = -20;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 45;
sun.shadow.bias = -0.0003;
scene.add(sun);
const fill = new THREE.DirectionalLight("#bfd4d3", 1.1);
fill.position.set(-10, 7, -8);
scene.add(fill);
const cameraState = {
target: new THREE.Vector3(0, 0.65, 0),
desiredTarget: new THREE.Vector3(0, 0.65, 0),
radius: 24,
desiredRadius: 24,
theta: 0.56,
desiredTheta: 0.56,
phi: 0.91,
desiredPhi: 0.91
};
function updateCamera(instant = false) {
const ease = instant ? 1 : 0.085;
cameraState.radius +=
(cameraState.desiredRadius - cameraState.radius) * ease;
cameraState.theta +=
(cameraState.desiredTheta - cameraState.theta) * ease;
cameraState.phi +=
(cameraState.desiredPhi - cameraState.phi) * ease;
cameraState.target.lerp(cameraState.desiredTarget, ease);
const sinPhi = Math.sin(cameraState.phi);
camera.position.set(
cameraState.target.x +
cameraState.radius * sinPhi * Math.sin(cameraState.theta),
cameraState.target.y + cameraState.radius * Math.cos(cameraState.phi),
cameraState.target.z +
cameraState.radius * sinPhi * Math.cos(cameraState.theta)
);
camera.lookAt(cameraState.target);
}
updateCamera(true);
const floor = new THREE.Mesh(
new THREE.CircleGeometry(32, 48),
new THREE.MeshStandardMaterial({
color: "#d9d1c2",
roughness: 0.95,
metalness: 0
})
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.02;
floor.receiveShadow = true;
scene.add(floor);
const innerFloor = new THREE.Mesh(
new THREE.CircleGeometry(12.8, 36),
new THREE.MeshStandardMaterial({
color: "#e3dbcc",
roughness: 0.92
})
);
innerFloor.rotation.x = -Math.PI / 2;
innerFloor.position.y = 0.002;
innerFloor.receiveShadow = true;
scene.add(innerFloor);
const ring = new THREE.Mesh(
new THREE.RingGeometry(11.9, 12.05, 64),
new THREE.MeshBasicMaterial({
color: "#b8ad9b",
transparent: true,
opacity: 0.45,
side: THREE.DoubleSide
})
);
ring.rotation.x = -Math.PI / 2;
ring.position.y = 0.012;
scene.add(ring);
const tableBase = new THREE.Mesh(
new THREE.CylinderGeometry(7.65, 8.2, 0.62, 12),
new THREE.MeshStandardMaterial({
color: "#3f5b51",
roughness: 0.78,
flatShading: true
})
);
tableBase.position.y = 0.31;
tableBase.castShadow = true;
tableBase.receiveShadow = true;
scene.add(tableBase);
const tableTop = new THREE.Mesh(
new THREE.CylinderGeometry(7.62, 7.78, 0.26, 12),
new THREE.MeshStandardMaterial({
color: "#e8dfcf",
roughness: 0.86,
flatShading: true
})
);
tableTop.position.y = 0.74;
tableTop.castShadow = true;
tableTop.receiveShadow = true;
scene.add(tableTop);
const tableRim = new THREE.Mesh(
new THREE.TorusGeometry(7.68, 0.08, 5, 12),
new THREE.MeshStandardMaterial({
color: "#d0b994",
roughness: 0.7,
flatShading: true
})
);
tableRim.rotation.x = Math.PI / 2;
tableRim.position.y = 0.87;
scene.add(tableRim);
function roundedRect(ctx, x, y, w, h, r) {
const radius = Math.min(r, w / 2, h / 2);
ctx.beginPath();
ctx.moveTo(x + radius, y);
ctx.arcTo(x + w, y, x + w, y + h, radius);
ctx.arcTo(x + w, y + h, x, y + h, radius);
ctx.arcTo(x, y + h, x, y, radius);
ctx.arcTo(x, y, x + w, y, radius);
ctx.closePath();
}
function wrapText(ctx, text, x, y, maxWidth, lineHeight, maxLines = 99) {
const words = text.split(/\s+/);
let line = "";
let lineCount = 0;
for (let i = 0; i < words.length; i++) {
const testLine = line ? `${line} ${words[i]}` : words[i];
if (ctx.measureText(testLine).width > maxWidth && line) {
ctx.fillText(line, x, y);
y += lineHeight;
lineCount++;
line = words[i];
if (lineCount >= maxLines - 1) {
break;
}
} else {
line = testLine;
}
}
if (line && lineCount < maxLines) {
ctx.fillText(line, x, y);
}
}
function createCardTexture(event) {
const canvas = document.createElement("canvas");
canvas.width = 1024;
canvas.height = 620;
const ctx = canvas.getContext("2d");
ctx.fillStyle = "#fffdf7";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = event.color;
ctx.fillRect(0, 0, 30, canvas.height);
ctx.fillStyle = "#69716c";
ctx.font = "800 32px system-ui, sans-serif";
ctx.fillText(String(event.year), 72, 67);
ctx.fillStyle = "#202522";
ctx.font = "600 55px Georgia, serif";
wrapText(ctx, event.title, 70, 135, 875, 61, 2);
roundedRect(ctx, 72, 258, 275, 51, 25);
ctx.fillStyle = `${event.color}24`;
ctx.fill();
ctx.fillStyle = event.color;
ctx.font = "800 25px system-ui, sans-serif";
ctx.fillText(event.theme, 95, 292);
ctx.strokeStyle = "#d8d2c5";
ctx.lineWidth = 3;
ctx.beginPath();
ctx.moveTo(72, 348);
ctx.lineTo(952, 348);
ctx.stroke();
ctx.fillStyle = "#4f5953";
ctx.font = "500 28px system-ui, sans-serif";
wrapText(
ctx,
event.record,
72,
402,
850,
38,
3
);
roundedRect(ctx, 72, 516, 605, 58, 14);
ctx.fillStyle = "#ebe6dc";
ctx.fill();
ctx.fillStyle = event.color;
ctx.font = "900 21px system-ui, sans-serif";
ctx.fillText("EVIDENCE CARD", 94, 552);
ctx.fillStyle = "#69716c";
ctx.font = "600 21px system-ui, sans-serif";
ctx.fillText("• select to inspect sources", 300, 552);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = Math.min(
8,
renderer.capabilities.getMaxAnisotropy()
);
return texture;
}
function createPlaqueTexture() {
const canvas = document.createElement("canvas");
canvas.width = 1024;
canvas.height = 640;
const ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, 1024, 640);
ctx.fillStyle = "#f7f0e3";
roundedRect(ctx, 18, 18, 988, 604, 48);
ctx.fill();
ctx.strokeStyle = "#658174";
ctx.lineWidth = 12;
ctx.stroke();
ctx.textAlign = "center";
ctx.fillStyle = "#315c50";
ctx.font = "900 29px system-ui, sans-serif";
ctx.fillText("BELLWEATHER WARD", 512, 100);
ctx.fillStyle = "#202522";
ctx.font = "600 66px Georgia, serif";
ctx.fillText("THE SHARED TABLE", 512, 210);
ctx.strokeStyle = "#baa98d";
ctx.lineWidth = 4;
ctx.beginPath();
ctx.moveTo(260, 260);
ctx.lineTo(764, 260);
ctx.stroke();
ctx.fillStyle = "#536058";
ctx.font = "500 32px system-ui, sans-serif";
ctx.fillText("Evidence • Interpretation • Revision", 512, 328);
ctx.fillStyle = "#a4553c";
ctx.font = "900 26px system-ui, sans-serif";
ctx.fillText("NO SINGLE LENS", 512, 420);
ctx.fillStyle = "#747b75";
ctx.font = "500 25px system-ui, sans-serif";
ctx.fillText("Fictional public-art planning model", 512, 497);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
return texture;
}
const plaque = new THREE.Group();
plaque.position.y = 0.89;
const plaqueDisc = new THREE.Mesh(
new THREE.CylinderGeometry(2.05, 2.05, 0.055, 16),
new THREE.MeshStandardMaterial({
color: "#f5edde",
roughness: 0.8,
flatShading: true
})
);
plaqueDisc.castShadow = true;
plaque.add(plaqueDisc);
const plaqueFace = new THREE.Mesh(
new THREE.PlaneGeometry(3.55, 2.22),
new THREE.MeshBasicMaterial({
map: createPlaqueTexture(),
transparent: true,
side: THREE.DoubleSide,
depthWrite: false
})
);
plaqueFace.rotation.x = -Math.PI / 2;
plaqueFace.position.y = 0.034;
plaque.add(plaqueFace);
scene.add(plaque);
const cardMeshes = [];
const cardGroups = [];
events.forEach((event, index) => {
const group = new THREE.Group();
const baseMaterial = new THREE.MeshStandardMaterial({
color: event.color,
roughness: 0.72,
flatShading: true,
emissive: event.color,
emissiveIntensity: 0
});
const base = new THREE.Mesh(
new THREE.BoxGeometry(2.55, 0.14, 1.58),
baseMaterial
);
base.castShadow = true;
base.receiveShadow = true;
base.userData = {
type: "event",
id: event.id,
baseMaterial
};
group.add(base);
const face = new THREE.Mesh(
new THREE.PlaneGeometry(2.46, 1.48),
new THREE.MeshBasicMaterial({
map: createCardTexture(event),
side: THREE.DoubleSide
})
);
face.rotation.x = -Math.PI / 2;
face.position.y = 0.076;
face.userData = {
type: "event",
id: event.id,
baseMaterial
};
group.add(face);
group.position.set(
layouts.chronological.positions[index].x,
0.94,
layouts.chronological.positions[index].z
);
group.rotation.y = 0.08;
group.userData = {
eventId: event.id,
target: group.position.clone(),
targetRotation: 0.08,
baseMaterial
};
cardGroups.push(group);
cardMeshes.push(base, face);
scene.add(group);
});
const markerGroups = [];
function createVoiceTexture(voice) {
const canvas = document.createElement("canvas");
canvas.width = 768;
canvas.height = 200;
const ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.width, canvas.height);
roundedRect(ctx, 8, 8, 752, 184, 36);
ctx.fillStyle = "rgba(255,253,247,0.95)";
ctx.fill();
ctx.strokeStyle = voice.color;
ctx.lineWidth = 8;
ctx.stroke();
ctx.fillStyle = voice.color;
ctx.beginPath();
ctx.arc(78, 100, 38, 0, Math.PI * 2);
ctx.fill();
ctx.fillStyle = "#ffffff";
ctx.textAlign = "center";
ctx.font = "900 37px system-ui, sans-serif";
ctx.fillText(
voice.name.charAt(0),
78,
113
);
ctx.textAlign = "left";
ctx.fillStyle = "#26302b";
ctx.font = "800 35px system-ui, sans-serif";
ctx.fillText(voice.name, 137, 84);
ctx.fillStyle = "#657069";
ctx.font = "700 28px system-ui, sans-serif";
ctx.fillText(`${voice.lens} lens`, 137, 132);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
return texture;
}
voices.forEach((voice) => {
const radians = THREE.MathUtils.degToRad(voice.angle);
const group = new THREE.Group();
group.position.set(
Math.sin(radians) * 9.35,
0,
Math.cos(radians) * 9.35
);
const plinth = new THREE.Mesh(
new THREE.CylinderGeometry(0.48, 0.62, 0.44, 6),
new THREE.MeshStandardMaterial({
color: "#7b827c",
roughness: 0.86,
flatShading: true
})
);
plinth.position.y = 0.22;
plinth.castShadow = true;
plinth.receiveShadow = true;
group.add(plinth);
const marker = new THREE.Mesh(
new THREE.DodecahedronGeometry(0.47, 0),
new THREE.MeshStandardMaterial({
color: voice.color,
roughness: 0.66,
flatShading: true,
emissive: voice.color,
emissiveIntensity: 0.04
})
);
marker.position.y = 1.02;
marker.castShadow = true;
marker.userData = {
type: "voice",
id: voice.eventId
};
group.add(marker);
const label = new THREE.Sprite(
new THREE.SpriteMaterial({
map: createVoiceTexture(voice),
transparent: true,
depthWrite: false
})
);
label.position.set(0, 2.02, 0);
label.scale.set(3.55, 0.925, 1);
label.userData = {
type: "voice",
id: voice.eventId
};
group.add(label);
markerGroups.push({ group, marker, label });
cardMeshes.push(marker, label);
scene.add(group);
});
// Low-poly stools make the object read as a shared planning table.
for (let i = 0; i < 6; i++) {
const angle = THREE.MathUtils.degToRad(i * 60 + 30);
const stool = new THREE.Group();
stool.position.set(
Math.sin(angle) * 10.25,
0,
Math.cos(angle) * 10.25
);
stool.rotation.y = angle;
const seat = new THREE.Mesh(
new THREE.CylinderGeometry(0.62, 0.68, 0.18, 6),
new THREE.MeshStandardMaterial({
color: i % 2 ? "#8e7960" : "#6b8177",
roughness: 0.9,
flatShading: true
})
);
seat.position.y = 0.7;
seat.castShadow = true;
stool.add(seat);
for (let legIndex = 0; legIndex < 3; legIndex++) {
const legAngle = (legIndex / 3) * Math.PI * 2;
const leg = new THREE.Mesh(
new THREE.CylinderGeometry(0.055, 0.075, 0.67, 5),
new THREE.MeshStandardMaterial({
color: "#5d625d",
roughness: 0.88,
flatShading: true
})
);
leg.position.set(
Math.sin(legAngle) * 0.35,
0.33,
Math.cos(legAngle) * 0.35
);
leg.castShadow = true;
stool.add(leg);
}
scene.add(stool);
}
// Small evidence pieces around the table rim.
const evidenceGeometry = new THREE.TetrahedronGeometry(0.17, 0);
for (let i = 0; i < 24; i++) {
const angle = (i / 24) * Math.PI * 2;
const piece = new THREE.Mesh(
evidenceGeometry,
new THREE.MeshStandardMaterial({
color: i % 3 === 0 ? "#c87945" : i % 3 === 1 ? "#648a79" : "#748ba0",
roughness: 0.85,
flatShading: true
})
);
piece.position.set(
Math.sin(angle) * 7.25,
0.98,
Math.cos(angle) * 7.25
);
piece.rotation.set(i * 0.31, i * 0.57, i * 0.19);
piece.castShadow = true;
scene.add(piece);
}
// Abstract public-art fragments in the distance.
const sculptureData = [
{ x: -11, z: -9, color: "#a96748", shape: 0 },
{ x: 11, z: -10, color: "#587e76", shape: 1 },
{ x: 12, z: 9, color: "#758395", shape: 2 }
];
sculptureData.forEach((item) => {
const plinth = new THREE.Mesh(
new THREE.CylinderGeometry(1.1, 1.25, 0.65, 6),
new THREE.MeshStandardMaterial({
color: "#c8bead",
roughness: 0.94,
flatShading: true
})
);
plinth.position.set(item.x, 0.325, item.z);
plinth.castShadow = true;
plinth.receiveShadow = true;
scene.add(plinth);
let geometry;
if (item.shape === 0) {
geometry = new THREE.ConeGeometry(0.85, 2.3, 5);
} else if (item.shape === 1) {
geometry = new THREE.TorusKnotGeometry(0.65, 0.2, 48, 6, 2, 3);
} else {
geometry = new THREE.DodecahedronGeometry(1.05, 0);
}
const sculpture = new THREE.Mesh(
geometry,
new THREE.MeshStandardMaterial({
color: item.color,
roughness: 0.72,
flatShading: true
})
);
sculpture.position.set(item.x, 2.05, item.z);
sculpture.rotation.set(0.2, item.x * 0.08, 0.12);
sculpture.castShadow = true;
scene.add(sculpture);
});
let activeLayout = "chronological";
let selectedEventId = null;
function setLayout(layoutId, announce = true) {
const layout = layouts[layoutId];
if (!layout) return;
activeLayout = layoutId;
layout.positions.forEach((position, index) => {
const group = cardGroups[index];
group.userData.target.set(position.x, 0.94, position.z);
group.userData.targetRotation = position.ry ?? 0.08;
});
document.querySelectorAll(".layout-button").forEach((button) => {
const active = button.dataset.layout === layoutId;
button.classList.toggle("active", active);
button.setAttribute("aria-pressed", String(active));
});
$("#layoutCaption").textContent = layout.caption;
if (announce) {
$("#layoutCaption").setAttribute(
"aria-label",
`${layout.title}. ${layout.summary} ${layout.risk}`
);
}
}
document.querySelectorAll(".layout-button").forEach((button) => {
button.addEventListener("click", () => {
setLayout(button.dataset.layout);
});
});
function escapeHTML(value) {
return String(value).replace(
/[&<>'"]/g,
(character) =>
({
"&": "&",
"<": "<",
">": ">",
"'": "'",
'"': """
})[character]
);
}
$("#eventList").innerHTML = events
.map(
(event) => `
<button class="event-item" data-event="${event.id}">
<span class="event-swatch" style="background:${event.color}"></span>
<span class="event-year">${event.year}</span>
<span>
<strong>${escapeHTML(event.short)}</strong>
<small>${escapeHTML(event.theme)} · select evidence</small>
</span>
</button>
`
)
.join("");
function focusEvent(eventId) {
const card = cardGroups.find((group) => group.userData.eventId === eventId);
if (!card) return;
cameraState.desiredTarget.set(card.position.x * 0.55, 0.75, card.position.z * 0.55);
cameraState.desiredRadius = 17.5;
cameraState.desiredPhi = 0.82;
}
function selectEvent(eventId, focus = false) {
const event = events.find((item) => item.id === eventId);
if (!event) return;
selectedEventId = eventId;
document.querySelectorAll(".event-item").forEach((button) => {
button.classList.toggle("active", button.dataset.event === eventId);
});
cardGroups.forEach((group) => {
const selected = group.userData.eventId === eventId;
group.userData.baseMaterial.emissiveIntensity = selected ? 0.2 : 0;
group.position.y = selected ? 1.03 : 0.94;
group.userData.target.y = selected ? 1.03 : 0.94;
});
const drawer = $("#detailPanel");
drawer.hidden = false;
drawer.style.setProperty("--event-color", event.color);
drawer.innerHTML = `
<div class="drawer-header">
<button class="drawer-close" aria-label="Close evidence details">×</button>
<div class="record-label">Evidence record ${event.year} · BW-${event.year}-04</div>
<h2>${escapeHTML(event.title)}</h2>
<div class="drawer-meta">
<span class="chip">${escapeHTML(event.theme)}</span>
<span class="chip">${event.evidence.length} evidence items</span>
<span class="chip">Community record</span>
</div>
</div>
<div class="drawer-body">
<h3>What the record shows</h3>
<p>${escapeHTML(event.record)}</p>
${event.evidence
.map(
(item) => `
<div class="evidence-item">
<strong>${escapeHTML(item.type)}</strong>
<span>${escapeHTML(item.detail)}</span>
<code>${escapeHTML(item.ref)}</code>
</div>
`
)
.join("")}
<h3>Supports / does not settle</h3>
<div class="supports-grid">
<div class="supports">
<strong>Supports</strong><br>
${escapeHTML(event.supports)}
</div>
<div class="limits">
<strong>Does not settle</strong><br>
${escapeHTML(event.limits)}
</div>
</div>
<h3>Community readings</h3>
${event.readings
.map(
(reading) => `
<blockquote class="reading">
“${escapeHTML(reading.text)}”
<cite>${escapeHTML(reading.name)} · ${escapeHTML(reading.role)}</cite>
</blockquote>
`
)
.join("")}
<button class="secondary-button focus-button" id="focusSelected">
Focus this card in the scene
</button>
<div class="provenance-note">
This is a fictional planning artifact. The Bellweather archive,
residents, quotations, and source identifiers are invented for the
demonstration; “evidence” here means internally traceable scenario
material rather than real-world documentation.
</div>
</div>
`;
drawer.querySelector(".drawer-close").addEventListener("click", () => {
drawer.hidden = true;
selectedEventId = null;
cardGroups.forEach((group) => {
group.userData.baseMaterial.emissiveIntensity = 0;
group.position.y = 0.94;
group.userData.target.y = 0.94;
});
});
drawer.querySelector("#focusSelected").addEventListener("click", () => {
focusEvent(eventId);
});
if (focus) focusEvent(eventId);
}
$("#eventList").addEventListener("click", (event) => {
const button = event.target.closest("[data-event]");
if (button) selectEvent(button.dataset.event);
});
// Custom camera controls: drag orbit, shift/right-drag pan, wheel zoom.
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
const activePointers = new Map();
let dragMode = "orbit";
let dragMoved = 0;
let previousPointer = { x: 0, y: 0 };
let pinchDistance = 0;
renderer.domElement.addEventListener("contextmenu", (event) => {
event.preventDefault();
});
renderer.domElement.addEventListener("pointerdown", (event) => {
renderer.domElement.setPointerCapture(event.pointerId);
activePointers.set(event.pointerId, {
x: event.clientX,
y: event.clientY
});
if (activePointers.size === 2) {
const points = [...activePointers.values()];
pinchDistance = Math.hypot(
points[0].x - points[1].x,
points[0].y - points[1].y
);
dragMode = "pinch";
} else {
dragMode =
event.button === 2 || event.shiftKey ? "pan" : "orbit";
dragMoved = 0;
}
previousPointer = {
x: event.clientX,
y: event.clientY
};
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!activePointers.has(event.pointerId)) return;
const previous = activePointers.get(event.pointerId);
const dx = event.clientX - previous.x;
const dy = event.clientY - previous.y;
activePointers.set(event.pointerId, {
x: event.clientX,
y: event.clientY
});
if (dragMode === "pinch" && activePointers.size === 2) {
const points = [...activePointers.values()];
const distance = Math.hypot(
points[0].x - points[1].x,
points[0].y - points[1].y
);
cameraState.desiredRadius = THREE.MathUtils.clamp(
cameraState.desiredRadius * (pinchDistance / Math.max(distance, 1)),
12,
34
);
pinchDistance = distance;
return;
}
dragMoved += Math.abs(dx) + Math.abs(dy);
if (dragMode === "orbit") {
cameraState.desiredTheta -= dx * 0.006;
cameraState.desiredPhi = THREE.MathUtils.clamp(
cameraState.desiredPhi + dy * 0.005,
0.45,
1.34
);
} else if (dragMode === "pan") {
const panScale = cameraState.desiredRadius * 0.0012;
const right = new THREE.Vector3(
Math.cos(cameraState.desiredTheta),
0,
-Math.sin(cameraState.desiredTheta)
);
const forward = new THREE.Vector3(
Math.sin(cameraState.desiredTheta),
0,
Math.cos(cameraState.desiredTheta)
);
cameraState.desiredTarget.addScaledVector(right, -dx * panScale);
cameraState.desiredTarget.addScaledVector(forward, -dy * panScale);
cameraState.desiredTarget.x = THREE.MathUtils.clamp(
cameraState.desiredTarget.x,
-7,
7
);
cameraState.desiredTarget.z = THREE.MathUtils.clamp(
cameraState.desiredTarget.z,
-7,
7
);
}
previousPointer = {
x: event.clientX,
y: event.clientY
};
});
function handlePointerEnd(event) {
const wasClick = dragMoved < 7 && activePointers.size === 1;
activePointers.delete(event.pointerId);
if (wasClick) {
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(cardMeshes, false);
if (intersections.length) {
const hit = intersections[0].object.userData;
if (hit.id) selectEvent(hit.id);
}
}
if (activePointers.size < 2) dragMode = "orbit";
}
renderer.domElement.addEventListener("pointerup", handlePointerEnd);
renderer.domElement.addEventListener("pointercancel", handlePointerEnd);
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
cameraState.desiredRadius = THREE.MathUtils.clamp(
cameraState.desiredRadius + event.deltaY * 0.012,
12,
34
);
},
{ passive: false }
);
function resetCamera() {
cameraState.desiredTarget.set(0, 0.65, 0);
cameraState.desiredRadius = 24;
cameraState.desiredTheta = 0.56;
cameraState.desiredPhi = 0.91;
}
$("#resetCamera").addEventListener("click", resetCamera);
// Comparison view.
const compareA = $("#compareA");
const compareB = $("#compareB");
Object.values(layouts).forEach((layout) => {
const option = document.createElement("option");
option.value = layout.id;
option.textContent = layout.title;
compareA.appendChild(option.cloneNode(true));
compareB.appendChild(option.cloneNode(true));
});
compareA.value = "chronological";
compareB.value = "voices";
function miniPlan(layoutId) {
const layout = layouts[layoutId];
const pieces = layout.positions
.map((position, index) => {
const x = 110 + position.x * 13;
const y = 74 + position.z * 9.5;
const color = events[index].color;
const rotation = (position.ry ?? 0) * (180 / Math.PI);
return `
<g transform="translate(${x} ${y}) rotate(${rotation})">
<rect
x="-10"
y="-5.7"
width="20"
height="11.4"
rx="2.5"
fill="${color}"
stroke="#fffdf7"
stroke-width="1.3"
/>
</g>
`;
})
.join("");
return `
<svg class="mini-plan" viewBox="0 0 220 150" role="img"
aria-label="${escapeHTML(layout.title)} diagram">
<rect width="220" height="150" fill="#eee7da"/>
<circle cx="110" cy="74" r="58" fill="#f9f5ec" stroke="#9fa99f" stroke-width="2"/>
<circle cx="110" cy="74" r="25" fill="#dce5de" stroke="#708c7e" stroke-width="1.5"/>
<path d="M110 45 L133 62 L124 94 L92 97 L83 65 Z"
fill="none" stroke="#80958a" stroke-width="1" opacity=".65"/>
${pieces}
</svg>
`;
}
function comparisonColumn(layoutId) {
const layout = layouts[layoutId];
return `
<article class="comparison-column">
<h3>${escapeHTML(layout.title)}</h3>
<p>${escapeHTML(layout.summary)}</p>
${miniPlan(layoutId)}
<div class="comparison-row">
<strong>Emphasizes</strong>
<span>${escapeHTML(layout.emphasis)}</span>
</div>
<div class="comparison-row">
<strong>Useful for</strong>
<span>${escapeHTML(layout.use)}</span>
</div>
<div class="comparison-row">
<strong>Watch for</strong>
<span>${escapeHTML(layout.risk)}</span>
</div>
</article>
`;
}
function renderComparison() {
$("#comparisonContent").innerHTML =
comparisonColumn(compareA.value) +
comparisonColumn(compareB.value);
}
compareA.addEventListener("change", renderComparison);
compareB.addEventListener("change", renderComparison);
renderComparison();
function openCompare() {
$("#compareModal").hidden = false;
renderComparison();
}
function closeCompare() {
$("#compareModal").hidden = true;
}
$("#compareButton").addEventListener("click", openCompare);
$("#compareTop").addEventListener("click", openCompare);
$("#closeCompare").addEventListener("click", closeCompare);
$("#compareModal").addEventListener("click", (event) => {
if (event.target === $("#compareModal")) closeCompare();
});
$("#loadA").addEventListener("click", () => {
setLayout(compareA.value);
closeCompare();
});
$("#loadB").addEventListener("click", () => {
setLayout(compareB.value);
closeCompare();
});
document.addEventListener("keydown", (event) => {
const tag = document.activeElement?.tagName;
if (tag === "INPUT" || tag === "SELECT" || tag === "TEXTAREA") return;
if (event.key === "Escape") {
closeCompare();
$("#detailPanel").hidden = true;
}
if (event.key === "1") setLayout("chronological");
if (event.key === "2") setLayout("themes");
if (event.key === "3") setLayout("voices");
if (event.key.toLowerCase() === "r") resetCamera();
});
window.addEventListener("resize", () => {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
});
const reducedMotion = window.matchMedia(
"(prefers-reduced-motion: reduce)"
).matches;
function animate() {
requestAnimationFrame(animate);
const transition = reducedMotion ? 1 : 0.075;
cardGroups.forEach((group) => {
group.position.lerp(group.userData.target, transition);
group.rotation.y +=
(group.userData.targetRotation - group.rotation.y) * transition;
});
updateCamera(false);
renderer.render(scene, camera);
}
animate();
$("#loading").remove();
</script>
</body>
</html>
```