Prompt specification
Build or customize the Three.js 3D scene "Community Timeline With Missing Cards" inside the active workspace.
Engineering Constraints:
1. Runtime & Orbit: Use Three.js r160 with OrbitControls (damping enabled) and ACESFilmicToneMapping.
2. Frame Timing: Drive all motion strictly with clock.getDelta() so animation speed is FPS-independent.
3. Viewport Hygiene: Handle window resize cleanly, cap DPR at Math.min(window.devicePixelRatio, 2), and dispose geometries/materials/renderer on unmount.
Scene Metadata:
Scene: Community Timeline With Missing Cards
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/community-timeline-with-missing-cards-x3209
Scene Description Prompt:
A stylized community timeline with dated cards, source holders, and gaps clearly marked as missing records. Three.js from cdnjs, one HTML file.
Working Three.js Starter (community-timeline-with-missing-cards-x3209):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#0b1113" />
<title>Common Ground — Community Archive</title>
<style>
:root {
color-scheme: dark;
--ink: #edf1ea;
--muted: #99aaa6;
--line: rgba(221, 235, 228, 0.16);
--panel: rgba(12, 19, 21, 0.82);
--accent: #c5dfcf;
--gap: #ff665f;
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background:
radial-gradient(circle at 48% 43%, #1c292a 0%, #11191b 38%, #090d0f 100%);
color: var(--ink);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
body::before {
position: fixed;
inset: 0;
z-index: 4;
pointer-events: none;
content: "";
background:
linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px);
background-size: 4px 4px;
opacity: 0.16;
mix-blend-mode: soft-light;
}
body::after {
position: fixed;
inset: 0;
z-index: 3;
pointer-events: none;
content: "";
box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.72);
}
button {
font: inherit;
}
#scene,
#scene canvas {
position: fixed;
inset: 0;
width: 100%;
height: 100%;
}
#scene canvas {
display: block;
cursor: grab;
touch-action: none;
outline: none;
}
#scene canvas:active {
cursor: grabbing;
}
.masthead {
position: fixed;
top: 26px;
left: 30px;
right: 30px;
z-index: 10;
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 28px;
pointer-events: none;
}
.title-block {
max-width: 610px;
}
.eyebrow {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 13px;
color: #b8c9c2;
font-size: 10px;
font-weight: 700;
letter-spacing: 0.19em;
text-transform: uppercase;
}
.eyebrow-mark {
display: inline-grid;
width: 23px;
height: 23px;
place-items: center;
border: 1px solid rgba(212, 232, 221, 0.38);
border-radius: 50%;
color: #d7e8df;
font-size: 9px;
letter-spacing: 0;
}
h1 {
max-width: 610px;
margin: 0;
font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
font-size: clamp(35px, 4.4vw, 66px);
font-weight: 400;
line-height: 0.96;
letter-spacing: -0.047em;
text-wrap: balance;
}
h1 em {
color: #b8cfc3;
font-weight: 400;
}
.subtitle {
max-width: 460px;
margin: 15px 0 0;
color: var(--muted);
font-size: 12px;
line-height: 1.6;
letter-spacing: 0.025em;
}
.filter-panel {
min-width: 330px;
padding-top: 4px;
pointer-events: auto;
}
.filter-label {
margin-bottom: 9px;
color: #758985;
font-size: 9px;
font-weight: 700;
letter-spacing: 0.17em;
text-align: right;
text-transform: uppercase;
}
.filters {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 6px;
}
.filter {
appearance: none;
padding: 8px 11px;
border: 1px solid rgba(222, 238, 230, 0.15);
border-radius: 999px;
background: rgba(9, 15, 17, 0.52);
color: #8fa19c;
cursor: pointer;
font-size: 9px;
font-weight: 650;
letter-spacing: 0.055em;
transition:
border-color 180ms ease,
color 180ms ease,
background 180ms ease,
transform 180ms ease;
backdrop-filter: blur(10px);
}
.filter:hover {
border-color: rgba(222, 238, 230, 0.35);
color: var(--ink);
transform: translateY(-1px);
}
.filter.active {
border-color: rgba(206, 231, 218, 0.5);
background: rgba(203, 225, 214, 0.12);
color: #e2eee7;
}
.archive-status {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
margin-top: 14px;
color: #7f918c;
font-size: 9px;
letter-spacing: 0.09em;
text-transform: uppercase;
}
.status-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #9ed4b6;
box-shadow: 0 0 12px rgba(158, 212, 182, 0.8);
animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
50% {
opacity: 0.42;
transform: scale(0.78);
}
}
.archive-note {
position: fixed;
top: 147px;
right: 30px;
z-index: 8;
width: 235px;
padding: 14px 15px;
border: 1px solid rgba(255, 102, 95, 0.21);
border-radius: 3px;
background: rgba(29, 15, 16, 0.47);
color: #a68e8b;
font-size: 10px;
line-height: 1.55;
pointer-events: none;
backdrop-filter: blur(10px);
}
.archive-note strong {
display: block;
margin-bottom: 5px;
color: #e08a84;
font-size: 9px;
letter-spacing: 0.13em;
text-transform: uppercase;
}
.legend {
position: fixed;
left: 30px;
bottom: 25px;
z-index: 10;
display: flex;
align-items: center;
gap: 18px;
padding: 11px 14px;
border: 1px solid rgba(223, 238, 230, 0.12);
border-radius: 3px;
background: rgba(8, 14, 16, 0.62);
color: #8fa09b;
font-size: 9px;
letter-spacing: 0.045em;
pointer-events: none;
backdrop-filter: blur(12px);
}
.legend-item {
display: flex;
align-items: center;
gap: 7px;
white-space: nowrap;
}
.legend-symbol {
position: relative;
display: inline-block;
width: 13px;
height: 17px;
border: 1px solid #a9beb6;
border-radius: 2px;
background: #d7c8aa;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.28);
}
.legend-symbol.holder::after {
position: absolute;
left: 3px;
bottom: -5px;
width: 5px;
height: 4px;
border: 1px solid #78928a;
border-radius: 0 0 3px 3px;
content: "";
}
.legend-symbol.gap {
border: 1px dashed var(--gap);
background: rgba(255, 102, 95, 0.05);
box-shadow: none;
}
.interaction-hint {
position: fixed;
left: 50%;
bottom: 29px;
z-index: 8;
color: rgba(176, 195, 187, 0.55);
font-size: 9px;
letter-spacing: 0.11em;
text-transform: uppercase;
transform: translateX(-50%);
pointer-events: none;
}
.zoom-controls {
position: fixed;
right: 30px;
bottom: 25px;
z-index: 12;
display: flex;
overflow: hidden;
border: 1px solid rgba(223, 238, 230, 0.13);
border-radius: 3px;
background: rgba(8, 14, 16, 0.72);
backdrop-filter: blur(12px);
}
.zoom-controls button {
display: grid;
width: 39px;
height: 38px;
place-items: center;
border: 0;
border-right: 1px solid rgba(223, 238, 230, 0.1);
background: transparent;
color: #b4c5bf;
cursor: pointer;
font-size: 16px;
transition: background 160ms ease, color 160ms ease;
}
.zoom-controls button:last-child {
border-right: 0;
font-size: 13px;
}
.zoom-controls button:hover {
background: rgba(215, 235, 225, 0.08);
color: white;
}
#tooltip {
position: fixed;
z-index: 30;
width: 255px;
padding: 13px 14px;
border: 1px solid rgba(224, 238, 231, 0.18);
border-radius: 3px;
background: rgba(8, 14, 16, 0.93);
box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
opacity: 0;
pointer-events: none;
transform: translateY(6px);
transition: opacity 130ms ease, transform 130ms ease;
backdrop-filter: blur(14px);
}
#tooltip.visible {
opacity: 1;
transform: translateY(0);
}
.tooltip-date {
margin-bottom: 5px;
color: #9fb3aa;
font-size: 8px;
font-weight: 700;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.tooltip-title {
margin-bottom: 6px;
font-family: "Iowan Old Style", Georgia, serif;
font-size: 18px;
line-height: 1.1;
}
.tooltip-source {
color: #8fa19b;
font-size: 9px;
line-height: 1.45;
}
.tooltip-source.gap {
color: #e1857f;
}
#detail-panel {
position: fixed;
right: 30px;
bottom: 80px;
z-index: 20;
width: 315px;
padding: 20px;
border: 1px solid rgba(225, 238, 232, 0.17);
border-radius: 4px;
background: rgba(9, 15, 17, 0.9);
box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
opacity: 0;
pointer-events: none;
transform: translateY(12px);
transition: opacity 220ms ease, transform 220ms ease;
backdrop-filter: blur(18px);
}
#detail-panel.open {
opacity: 1;
pointer-events: auto;
transform: translateY(0);
}
#detail-panel.gap {
border-color: rgba(255, 102, 95, 0.3);
}
.detail-close {
position: absolute;
top: 10px;
right: 11px;
border: 0;
background: transparent;
color: #80928d;
cursor: pointer;
font-size: 17px;
}
.detail-date {
margin-bottom: 10px;
color: #9eb3a9;
font-size: 9px;
font-weight: 700;
letter-spacing: 0.14em;
text-transform: uppercase;
}
.detail-title {
margin: 0 0 11px;
font-family: "Iowan Old Style", Georgia, serif;
font-size: 29px;
font-weight: 400;
line-height: 1.02;
letter-spacing: -0.025em;
}
.detail-source {
margin-bottom: 14px;
padding-bottom: 14px;
border-bottom: 1px solid rgba(225, 238, 232, 0.11);
color: #b4c6bf;
font-size: 10px;
line-height: 1.5;
}
.detail-description {
margin: 0;
color: #8da09a;
font-size: 11px;
line-height: 1.65;
}
#loading {
position: fixed;
inset: 0;
z-index: 100;
display: grid;
place-items: center;
background: #0b1113;
color: #9eb3aa;
font-size: 10px;
letter-spacing: 0.18em;
text-transform: uppercase;
transition: opacity 450ms ease;
}
#loading.hidden {
opacity: 0;
pointer-events: none;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
}
@media (max-width: 860px) {
.masthead {
top: 18px;
left: 18px;
right: 18px;
}
h1 {
max-width: 440px;
font-size: clamp(34px, 8vw, 48px);
}
.subtitle {
max-width: 390px;
font-size: 10px;
}
.filter-panel {
min-width: 235px;
}
.filter {
padding: 7px 9px;
font-size: 8px;
}
.archive-note {
display: none;
}
.legend {
left: 18px;
bottom: 18px;
gap: 10px;
padding: 9px 11px;
}
.legend-item:last-child {
display: none;
}
.zoom-controls {
right: 18px;
bottom: 18px;
}
.interaction-hint {
display: none;
}
#detail-panel {
right: 18px;
bottom: 70px;
width: min(315px, calc(100vw - 36px));
}
}
@media (max-width: 620px) {
.masthead {
display: block;
}
.title-block {
max-width: 92vw;
}
.subtitle {
display: none;
}
.filter-panel {
margin-top: 16px;
}
.filter-label,
.archive-status {
display: none;
}
.filters {
justify-content: flex-start;
}
.filter {
padding: 6px 8px;
}
.legend {
max-width: calc(100vw - 134px);
overflow: hidden;
}
.legend-item {
font-size: 8px;
}
.legend-item:nth-child(2) {
display: none;
}
}
</style>
</head>
<body>
<div id="scene"></div>
<header class="masthead">
<div class="title-block">
<div class="eyebrow">
<span class="eyebrow-mark">CG</span>
Common Ground / Community Archive
</div>
<h1>A neighborhood,<br /><em>held in sequence.</em></h1>
<p class="subtitle">
A living index of shared meals, meetings, images, and remembered voices.
Gaps are preserved as part of the story.
</p>
</div>
<div class="filter-panel">
<div class="filter-label">Browse source types</div>
<div class="filters" role="group" aria-label="Filter timeline records">
<button class="filter active" data-filter="all" type="button">All sources</button>
<button class="filter" data-filter="oral" type="button">Oral histories</button>
<button class="filter" data-filter="print" type="button">Printed records</button>
<button class="filter" data-filter="photo" type="button">Photographs</button>
</div>
<div class="archive-status">
<span class="status-dot"></span>
<span id="record-count">9 records · 2 gaps preserved</span>
</div>
</div>
</header>
<aside class="archive-note">
<strong>Absence is indexed</strong>
Dashed frames mark intervals where no surviving source has been found.
They are never silently filled.
</aside>
<div class="legend" aria-hidden="true">
<span class="legend-item">
<span class="legend-symbol"></span>
Documented card
</span>
<span class="legend-item">
<span class="legend-symbol holder"></span>
Source holder
</span>
<span class="legend-item">
<span class="legend-symbol gap"></span>
Missing record
</span>
</div>
<div class="interaction-hint">Drag to orbit · Scroll to zoom · Select a card</div>
<div class="zoom-controls" aria-label="Camera controls">
<button id="zoom-out" type="button" aria-label="Zoom out">−</button>
<button id="zoom-in" type="button" aria-label="Zoom in">+</button>
<button id="reset-view" type="button" aria-label="Reset camera">↺</button>
</div>
<div id="tooltip" role="status">
<div class="tooltip-date"></div>
<div class="tooltip-title"></div>
<div class="tooltip-source"></div>
</div>
<section id="detail-panel" aria-live="polite">
<button class="detail-close" type="button" aria-label="Close details">×</button>
<div class="detail-date"></div>
<h2 class="detail-title"></h2>
<div class="detail-source"></div>
<p class="detail-description"></p>
</section>
<div id="loading">Opening the community archive…</div>
<section id="archive-summary" class="sr-only">
<h1>Common Ground community timeline</h1>
<p>
1978: Kitchen-table kickoff, twelve oral histories.
1981: The first garden, garden committee notes.
1985: Mutual-aid ledger, ledger and receipts.
1988: No surviving source.
1993: River clean-up, forty-two photographs.
1997: Youth media room, nine cassette recordings.
2002: Neighborhood charter, signed petitions.
2006: No surviving source.
2011: Community kitchen, recipe cards.
2017: Open-air cinema, audience field notes.
2023: The handover, seven video interviews.
</p>
</section>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const sceneHost = document.getElementById("scene");
const loading = document.getElementById("loading");
const tooltip = document.getElementById("tooltip");
const detailPanel = document.getElementById("detail-panel");
const scene = new THREE.Scene();
scene.fog = new THREE.FogExp2(0x0b1113, 0.026);
const renderer = new THREE.WebGLRenderer({
antialias: true,
alpha: true,
powerPreference: "high-performance"
});
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setClearColor(0x0b1113, 0);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.domElement.setAttribute(
"aria-label",
"Interactive three-dimensional timeline of community records and missing-record gaps"
);
renderer.domElement.setAttribute("role", "img");
sceneHost.appendChild(renderer.domElement);
const camera = new THREE.OrthographicCamera(-14, 14, 8, -8, 0.1, 100);
const world = new THREE.Group();
scene.add(world);
const cameraState = {
theta: 0,
thetaTarget: 0,
phi: 1.04,
phiTarget: 1.04,
radius: 18,
zoom: 1.06,
zoomTarget: 1.06
};
function resize() {
const width = window.innerWidth;
const height = window.innerHeight;
const aspect = width / height;
const viewHeight = aspect > 1.05 ? 15.8 : Math.max(15.8, 26 / aspect);
camera.left = (-viewHeight * aspect) / 2;
camera.right = (viewHeight * aspect) / 2;
camera.top = viewHeight / 2;
camera.bottom = -viewHeight / 2;
camera.updateProjectionMatrix();
renderer.setSize(width, height);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
}
window.addEventListener("resize", resize);
resize();
// Lighting and material palette.
scene.add(new THREE.HemisphereLight(0xbdd8ce, 0x171b19, 1.65));
const ambient = new THREE.AmbientLight(0x9fb4ae, 0.55);
scene.add(ambient);
const keyLight = new THREE.DirectionalLight(0xffefd4, 2.8);
keyLight.position.set(-7, 12, 9);
keyLight.castShadow = true;
keyLight.shadow.mapSize.set(2048, 2048);
keyLight.shadow.camera.left = -18;
keyLight.shadow.camera.right = 18;
keyLight.shadow.camera.top = 12;
keyLight.shadow.camera.bottom = -8;
keyLight.shadow.camera.near = 1;
keyLight.shadow.camera.far = 40;
keyLight.shadow.bias = -0.0006;
scene.add(keyLight);
const warmLight = new THREE.PointLight(0xff9e75, 24, 19, 2);
warmLight.position.set(-9, 5.5, 5);
scene.add(warmLight);
const coolLight = new THREE.PointLight(0x91d2ca, 21, 18, 2);
coolLight.position.set(9, 5, 3);
scene.add(coolLight);
const floorMaterial = new THREE.MeshStandardMaterial({
color: 0x0e1516,
roughness: 0.98,
metalness: 0.02
});
const floor = new THREE.Mesh(new THREE.PlaneGeometry(80, 50), floorMaterial);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -0.01;
floor.receiveShadow = true;
world.add(floor);
// A faint elliptical archival frame behind the timeline.
const ellipse = new THREE.EllipseCurve(0, 0, 16, 8.3, 0, Math.PI * 2);
const ellipsePoints = ellipse.getPoints(180).map(
(point) => new THREE.Vector3(point.x, point.y + 2.4, -4.2)
);
const ellipseGeometry = new THREE.BufferGeometry().setFromPoints(ellipsePoints);
const ellipseLine = new THREE.Line(
ellipseGeometry,
new THREE.LineBasicMaterial({
color: 0x9abbb0,
transparent: true,
opacity: 0.085
})
);
world.add(ellipseLine);
const railMaterial = new THREE.MeshStandardMaterial({
color: 0x61736e,
metalness: 0.62,
roughness: 0.37
});
const rail = new THREE.Mesh(
new THREE.CylinderGeometry(0.027, 0.027, 24.5, 10),
railMaterial
);
rail.rotation.z = Math.PI / 2;
rail.position.set(0, 0.15, -0.28);
world.add(rail);
const tickGeometry = new THREE.BoxGeometry(0.025, 0.17, 0.025);
const tickMaterial = new THREE.MeshStandardMaterial({
color: 0x849a92,
metalness: 0.5,
roughness: 0.45
});
for (let i = 0; i < 11; i++) {
const tick = new THREE.Mesh(tickGeometry, tickMaterial);
tick.position.set(-12 + i * 2.4, 0.2, -0.28);
world.add(tick);
}
const pulseOrb = new THREE.Mesh(
new THREE.SphereGeometry(0.075, 14, 14),
new THREE.MeshStandardMaterial({
color: 0xd9fff0,
emissive: 0x82c8ad,
emissiveIntensity: 2.1,
roughness: 0.25
})
);
pulseOrb.position.set(-12, 0.15, -0.26);
world.add(pulseOrb);
// Sparse atmospheric dust.
const dustGeometry = new THREE.BufferGeometry();
const dustPositions = [];
for (let i = 0; i < 240; i++) {
dustPositions.push(
(Math.random() - 0.5) * 42,
Math.random() * 12 - 0.2,
(Math.random() - 0.5) * 12 - 1.2
);
}
dustGeometry.setAttribute(
"position",
new THREE.Float32BufferAttribute(dustPositions, 3)
);
const dust = new THREE.Points(
dustGeometry,
new THREE.PointsMaterial({
color: 0xc7dbd2,
size: 0.025,
transparent: true,
opacity: 0.2,
depthWrite: false
})
);
world.add(dust);
const records = [
{
year: "1978",
date: "12 AUG 1978",
title: "Kitchen-table kickoff",
category: "oral",
source: "12 oral histories",
description:
"Neighbors gather around a borrowed table to sketch the first shared food plan.",
accent: "#e99676",
background: "#f0e1d3",
seed: 3
},
{
year: "1981",
date: "04 MAY 1981",
title: "The first garden",
category: "print",
source: "Garden committee notes",
description:
"A seed exchange begins behind the library and becomes the block’s first shared garden.",
accent: "#93b895",
background: "#e1ead9",
seed: 8
},
{
year: "1985",
date: "19 NOV 1985",
title: "Mutual-aid ledger",
category: "print",
source: "Ledger & receipts",
description:
"A handwritten ledger tracks hours, tools, errands, and care exchanged between homes.",
accent: "#d3a846",
background: "#eee3bd",
seed: 13
},
{
year: "1993",
date: "26 JUN 1993",
title: "River clean-up",
category: "photo",
source: "42 photographs",
description:
"Three blocks meet at the river to clear plastic, brush, and decades of industrial debris.",
accent: "#6ea4bc",
background: "#d8e5e7",
seed: 21
},
{
year: "1997",
date: "17 OCT 1997",
title: "Youth media room",
category: "oral",
source: "9 cassette recordings",
description:
"Teenagers document what the old recreation room sounded like when it belonged to them.",
accent: "#a385bc",
background: "#e4dce9",
seed: 29
},
{
year: "2002",
date: "08 SEP 2002",
title: "Neighborhood charter",
category: "print",
source: "Signed petitions",
description:
"A shared charter gathers 311 signatures and one promise to care for the block together.",
accent: "#df8069",
background: "#eddbd2",
seed: 34
},
{
year: "2011",
date: "23 FEB 2011",
title: "Community kitchen",
category: "oral",
source: "Recipe cards",
description:
"Recipes become a rotating calendar of shared meals, from winter soup to summer pies.",
accent: "#c87f55",
background: "#eadac6",
seed: 42
},
{
year: "2017",
date: "14 JUL 2017",
title: "Open-air cinema",
category: "photo",
source: "Audience field notes",
description:
"A borrowed projector turns the basketball court into a one-night neighborhood cinema.",
accent: "#5e9e98",
background: "#d7e6df",
seed: 51
},
{
year: "2023",
date: "30 SEP 2023",
title: "The handover",
category: "oral",
source: "7 video interviews",
description:
"A new generation records what should be carried forward, remembered, and kept in common.",
accent: "#b0bd69",
background: "#e3e5c9",
seed: 63
}
];
const categoryLabels = {
oral: "Oral history",
print: "Printed record",
photo: "Photograph"
};
const gaps = [
{
year: "1988",
date: "1988 / RECORD GAP",
title: "No surviving source",
description:
"This interval remains intentionally open. The absence is indexed rather than silently filled.",
seed: 16
},
{
year: "2006",
date: "2006 / RECORD GAP",
title: "No surviving source",
description:
"No verifiable source has been located for this year. The empty holder remains part of the index.",
seed: 47
}
];
const timeline = [];
let recordIndex = 0;
let gapIndex = 0;
for (let i = 0; i < 11; i++) {
if (i === 3 || i === 7) {
timeline.push({
kind: "gap",
data: gaps[gapIndex++],
x: -12 + i * 2.4
});
} else {
timeline.push({
kind: "record",
data: records[recordIndex++],
x: -12 + i * 2.4
});
}
}
function roundedRectPath(ctx, x, y, width, height, radius) {
const r = Math.min(radius, width / 2, height / 2);
ctx.beginPath();
ctx.moveTo(x + r, y);
ctx.lineTo(x + width - r, y);
ctx.quadraticCurveTo(x + width, y, x + width, y + r);
ctx.lineTo(x + width, y + height - r);
ctx.quadraticCurveTo(x + width, y + height, x + width - r, y + height);
ctx.lineTo(x + r, y + height);
ctx.quadraticCurveTo(x, y + height, x, y + height - r);
ctx.lineTo(x, y + r);
ctx.quadraticCurveTo(x, y, x + r, y);
ctx.closePath();
}
function wrapText(ctx, text, x, y, maxWidth, lineHeight, maxLines = 4) {
const words = text.split(" ");
const lines = [];
let current = "";
for (const word of words) {
const test = current ? `${current} ${word}` : word;
if (ctx.measureText(test).width > maxWidth && current) {
lines.push(current);
current = word;
if (lines.length === maxLines - 1) break;
} else {
current = test;
}
}
if (lines.length < maxLines && current) lines.push(current);
lines.forEach((line, index) => {
ctx.fillText(line, x, y + index * lineHeight);
});
return lines.length * lineHeight;
}
function drawCommunityMark(ctx, accent, seed) {
const cx = 360;
const cy = 662;
const radius = 112;
ctx.save();
ctx.globalAlpha = 0.2;
ctx.fillStyle = accent;
ctx.beginPath();
ctx.arc(cx, cy, radius, 0, Math.PI * 2);
ctx.fill();
ctx.restore();
ctx.save();
ctx.strokeStyle = "rgba(20, 34, 35, 0.68)";
ctx.lineWidth = 4;
ctx.lineCap = "round";
const angles = [
seed * 0.47,
seed * 0.47 + 1.8,
seed * 0.47 + 3.5,
seed * 0.47 + 5.1
];
const nodes = angles.map((angle, index) => ({
x: cx + Math.cos(angle) * (92 + index * 5),
y: cy + Math.sin(angle) * (75 + (index % 2) * 12)
}));
ctx.beginPath();
nodes.forEach((node, index) => {
if (index === 0) ctx.moveTo(node.x, node.y);
else ctx.lineTo(node.x, node.y);
});
ctx.stroke();
nodes.forEach((node, index) => {
ctx.fillStyle = index % 2 === 0 ? accent : "#172426";
ctx.beginPath();
ctx.arc(node.x, node.y, 20 + (index % 2) * 4, 0, Math.PI * 2);
ctx.fill();
});
ctx.fillStyle = accent;
ctx.beginPath();
ctx.arc(cx, cy, 34, 0, Math.PI * 2);
ctx.fill();
ctx.strokeStyle = "rgba(20, 34, 35, 0.6)";
ctx.lineWidth = 3;
for (let i = 0; i < 6; i++) {
const x = 110 + i * 101;
ctx.beginPath();
ctx.moveTo(x, 835);
ctx.lineTo(x, 835 + (i % 2 === 0 ? 13 : -10));
ctx.stroke();
}
ctx.restore();
}
function createRecordTexture(record) {
const canvas = document.createElement("canvas");
canvas.width = 720;
canvas.height = 1024;
const ctx = canvas.getContext("2d");
const gradient = ctx.createLinearGradient(0, 0, 720, 1024);
gradient.addColorStop(0, record.background);
gradient.addColorStop(1, "#eee8dc");
ctx.fillStyle = gradient;
ctx.fillRect(0, 0, 720, 1024);
ctx.strokeStyle = "rgba(22, 37, 38, 0.28)";
ctx.lineWidth = 3;
roundedRectPath(ctx, 20, 20, 680, 984, 18);
ctx.stroke();
ctx.fillStyle = "#172426";
ctx.font = "700 27px ui-sans-serif, system-ui, sans-serif";
ctx.fillText(record.date, 55, 80);
const label = categoryLabels[record.category].toUpperCase();
ctx.font = "700 18px ui-sans-serif, system-ui, sans-serif";
const labelWidth = ctx.measureText(label).width + 34;
ctx.fillStyle = record.accent;
roundedRectPath(ctx, 55, 108, labelWidth, 38, 19);
ctx.fill();
ctx.fillStyle = "#172426";
ctx.fillText(label, 72, 134);
ctx.fillStyle = "#152325";
ctx.font = "400 59px Georgia, serif";
const titleHeight = wrapText(ctx, record.title, 55, 240, 610, 63, 3);
ctx.fillStyle = "rgba(23, 36, 38, 0.7)";
ctx.font = "400 25px ui-sans-serif, system-ui, sans-serif";
wrapText(
ctx,
record.description,
55,
285 + titleHeight,
605,
34,
4
);
drawCommunityMark(ctx, record.accent, record.seed);
ctx.strokeStyle = "rgba(23, 36, 38, 0.22)";
ctx.lineWidth = 2;
ctx.beginPath();
ctx.moveTo(55, 890);
ctx.lineTo(665, 890);
ctx.stroke();
ctx.fillStyle = record.accent;
roundedRectPath(ctx, 55, 921, 15, 15, 3);
ctx.fill();
ctx.fillStyle = "rgba(23, 36, 38, 0.72)";
ctx.font = "700 18px ui-sans-serif, system-ui, sans-serif";
ctx.fillText("SOURCE", 86, 935);
ctx.fillStyle = "#172426";
ctx.font = "400 23px ui-sans-serif, system-ui, sans-serif";
ctx.fillText(record.source, 86, 967);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = Math.min(8, renderer.capabilities.getMaxAnisotropy());
return texture;
}
function createGapTexture(gap) {
const canvas = document.createElement("canvas");
canvas.width = 720;
canvas.height = 1024;
const ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, 720, 1024);
ctx.fillStyle = "rgba(31, 10, 12, 0.89)";
roundedRectPath(ctx, 18, 18, 684, 988, 18);
ctx.fill();
ctx.save();
ctx.beginPath();
ctx.rect(18, 18, 684, 988);
ctx.clip();
ctx.strokeStyle = "rgba(255, 102, 95, 0.09)";
ctx.lineWidth = 12;
for (let x = -1024; x < 1024; x += 54) {
ctx.beginPath();
ctx.moveTo(x, 1024);
ctx.lineTo(x + 1024, 0);
ctx.stroke();
}
ctx.restore();
ctx.setLineDash([18, 13]);
ctx.strokeStyle = "#ff665f";
ctx.lineWidth = 5;
roundedRectPath(ctx, 31, 31, 658, 962, 12);
ctx.stroke();
ctx.setLineDash([]);
ctx.textAlign = "center";
ctx.fillStyle = "#ff8b84";
ctx.font = "700 27px ui-sans-serif, system-ui, sans-serif";
ctx.fillText(gap.date, 360, 105);
ctx.fillStyle = "#ffe0dc";
ctx.font = "400 79px Georgia, serif";
ctx.fillText("RECORD", 360, 325);
ctx.fillText("GAP", 360, 410);
ctx.strokeStyle = "rgba(255, 102, 95, 0.7)";
ctx.lineWidth = 3;
ctx.beginPath();
ctx.moveTo(155, 465);
ctx.lineTo(565, 465);
ctx.stroke();
ctx.fillStyle = "#d89b96";
ctx.font = "700 22px ui-sans-serif, system-ui, sans-serif";
ctx.fillText("NO SURVIVING SOURCE", 360, 525);
ctx.fillStyle = "rgba(234, 170, 165, 0.7)";
ctx.font = "400 25px ui-sans-serif, system-ui, sans-serif";
wrapText(
ctx,
"This space is intentionally left open. Absence is preserved as part of the neighborhood record.",
110,
610,
500,
35,
4
);
ctx.strokeStyle = "#ff665f";
ctx.lineWidth = 7;
ctx.beginPath();
ctx.moveTo(288, 807);
ctx.lineTo(432, 919);
ctx.moveTo(432, 807);
ctx.lineTo(288, 919);
ctx.stroke();
ctx.fillStyle = "#ff8b84";
ctx.font = "700 18px ui-sans-serif, system-ui, sans-serif";
ctx.fillText("EMPTY INDEX / PRESERVED ABSENCE", 360, 968);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
texture.anisotropy = Math.min(8, renderer.capabilities.getMaxAnisotropy());
return texture;
}
function createHolderLabel(year, accent) {
const canvas = document.createElement("canvas");
canvas.width = 360;
canvas.height = 120;
const ctx = canvas.getContext("2d");
ctx.fillStyle = "rgba(16, 25, 27, 0.92)";
roundedRectPath(ctx, 8, 8, 344, 104, 12);
ctx.fill();
ctx.fillStyle = accent;
roundedRectPath(ctx, 21, 27, 8, 66, 4);
ctx.fill();
ctx.fillStyle = "#e1ebe5";
ctx.font = "700 43px Georgia, serif";
ctx.fillText(year, 50, 75);
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
return texture;
}
function roundedPanelGeometry(width, height, radius) {
const x = -width / 2;
const y = -height / 2;
const shape = new THREE.Shape();
shape.moveTo(x + radius, y);
shape.lineTo(x + width - radius, y);
shape.quadraticCurveTo(x + width, y, x + width, y + radius);
shape.lineTo(x + width, y + height - radius);
shape.quadraticCurveTo(
x + width,
y + height,
x + width - radius,
y + height
);
shape.lineTo(x + radius, y + height);
shape.quadraticCurveTo(x, y + height, x, y + height - radius);
shape.lineTo(x, y + radius);
shape.quadraticCurveTo(x, y, x + radius, y);
return new THREE.ExtrudeGeometry(shape, {
depth: 0.12,
steps: 1,
bevelEnabled: true,
bevelSegments: 3,
bevelSize: 0.045,
bevelThickness: 0.035,
curveSegments: 8
});
}
const items = [];
const pickables = [];
for (const entry of timeline) {
const x = entry.x;
const z = entry.kind === "record" ? 0.06 : -0.05;
if (entry.kind === "record") {
const record = entry.data;
const holder = new THREE.Group();
holder.position.set(x, 0, z);
world.add(holder);
const holderMaterials = [];
const baseMaterial = new THREE.MeshStandardMaterial({
color: 0x263235,
metalness: 0.62,
roughness: 0.42,
transparent: true
});
holderMaterials.push(baseMaterial);
const base = new THREE.Mesh(
new THREE.CylinderGeometry(0.48, 0.53, 0.12, 28),
baseMaterial
);
base.position.y = 0.1;
base.castShadow = true;
base.receiveShadow = true;
holder.add(base);
const stemMaterial = new THREE.MeshStandardMaterial({
color: 0x52635f,
metalness: 0.56,
roughness: 0.38,
transparent: true
});
holderMaterials.push(stemMaterial);
const stem = new THREE.Mesh(
new THREE.CylinderGeometry(0.26, 0.31, 0.38, 24),
stemMaterial
);
stem.position.y = 0.33;
stem.castShadow = true;
holder.add(stem);
const accentMaterial = new THREE.MeshStandardMaterial({
color: record.accent,
emissive: record.accent,
emissiveIntensity: 0.2,
metalness: 0.38,
roughness: 0.32,
transparent: true
});
holderMaterials.push(accentMaterial);
const ring = new THREE.Mesh(
new THREE.TorusGeometry(0.34, 0.045, 10, 40),
accentMaterial
);
ring.rotation.x = Math.PI / 2;
ring.position.y = 0.53;
ring.castShadow = true;
holder.add(ring);
const sourceSlipMaterial = new THREE.MeshStandardMaterial({
color: 0xc8c0aa,
roughness: 0.9,
transparent: true
});
holderMaterials.push(sourceSlipMaterial);
for (let slipIndex = 0; slipIndex < 3; slipIndex++) {
const slip = new THREE.Mesh(
new THREE.BoxGeometry(0.58, 0.025, 0.22),
sourceSlipMaterial
);
slip.position.set(
-0.04 + slipIndex * 0.025,
0.49 + slipIndex * 0.035,
-0.1 + slipIndex * 0.03
);
slip.rotation.y = -0.14 + slipIndex * 0.11;
slip.castShadow = true;
holder.add(slip);
}
const labelMaterial = new THREE.MeshBasicMaterial({
map: createHolderLabel(record.year, record.accent),
transparent: true,
depthWrite: false
});
holderMaterials.push(labelMaterial);
const label = new THREE.Mesh(new THREE.PlaneGeometry(0.76, 0.25), labelMaterial);
label.position.set(0, 0.73, 0.16);
holder.add(label);
const cardGroup = new THREE.Group();
cardGroup.position.set(x, 2.17, z);
cardGroup.rotation.y = Math.sin(x * 0.37) * 0.045;
world.add(cardGroup);
const panelMaterial = new THREE.MeshStandardMaterial({
color: record.background,
roughness: 0.82,
metalness: 0.02,
emissive: 0x172426,
emissiveIntensity: 0,
transparent: true
});
const panel = new THREE.Mesh(
roundedPanelGeometry(1.82, 2.56, 0.13),
panelMaterial
);
panel.position.z = -0.08;
panel.castShadow = true;
panel.receiveShadow = true;
cardGroup.add(panel);
const textureMaterial = new THREE.MeshBasicMaterial({
map: createRecordTexture(record),
transparent: true,
toneMapped: false,
depthWrite: false
});
const textureMesh = new THREE.Mesh(
new THREE.PlaneGeometry(1.64, 2.36),
textureMaterial
);
textureMesh.position.z = 0.09;
textureMesh.renderOrder = 2;
cardGroup.add(textureMesh);
const clipMaterial = new THREE.MeshStandardMaterial({
color: record.accent,
metalness: 0.48,
roughness: 0.32,
transparent: true
});
holderMaterials.push(clipMaterial);
const clip = new THREE.Mesh(
new THREE.CylinderGeometry(0.055, 0.055, 0.17, 16),
clipMaterial
);
clip.rotation.x = Math.PI / 2;
clip.position.set(0, 1.16, 0.16);
clip.castShadow = true;
cardGroup.add(clip);
const item = {
kind: "record",
data: record,
x,
cardGroup,
holder,
panel,
texture: textureMesh,
holderMaterials,
accentMaterial,
opacity: 1,
targetOpacity: 1,
hover: false,
selected: false,
appeared: 0
};
textureMesh.userData.item = item;
pickables.push(textureMesh);
items.push(item);
} else {
const gap = entry.data;
const group = new THREE.Group();
group.position.set(x, 2.17, z);
world.add(group);
const textureMaterial = new THREE.MeshBasicMaterial({
map: createGapTexture(gap),
transparent: true,
toneMapped: false,
depthWrite: false
});
const textureMesh = new THREE.Mesh(
new THREE.PlaneGeometry(1.82, 2.56),
textureMaterial
);
textureMesh.renderOrder = 2;
group.add(textureMesh);
const framePoints = [
new THREE.Vector3(-0.91, -1.28, 0.025),
new THREE.Vector3(0.91, -1.28, 0.025),
new THREE.Vector3(0.91, -1.28, 0.025),
new THREE.Vector3(0.91, 1.28, 0.025),
new THREE.Vector3(0.91, 1.28, 0.025),
new THREE.Vector3(-0.91, 1.28, 0.025),
new THREE.Vector3(-0.91, 1.28, 0.025),
new THREE.Vector3(-0.91, -1.28, 0.025)
];
const frameMaterial = new THREE.LineDashedMaterial({
color: 0xff665f,
dashSize: 0.12,
gapSize: 0.08,
transparent: true,
opacity: 0.9
});
const frame = new THREE.LineSegments(
new THREE.BufferGeometry().setFromPoints(framePoints),
frameMaterial
);
frame.computeLineDistances();
group.add(frame);
const lightMaterial = new THREE.MeshBasicMaterial({
color: 0xff554f,
transparent: true,
opacity: 0.035,
depthWrite: false,
side: THREE.DoubleSide
});
const glow = new THREE.Mesh(
new THREE.PlaneGeometry(2.25, 3.1),
lightMaterial
);
glow.position.z = -0.04;
group.add(glow);
const floorGroup = new THREE.Group();
floorGroup.position.set(x, 0, z);
world.add(floorGroup);
const gapRingMaterial = new THREE.MeshStandardMaterial({
color: 0xff665f,
emissive: 0xff443e,
emissiveIntensity: 0.7,
metalness: 0.2,
roughness: 0.4,
transparent: true
});
const gapRing = new THREE.Mesh(
new THREE.TorusGeometry(0.46, 0.024, 8, 48),
gapRingMaterial
);
gapRing.rotation.x = Math.PI / 2;
gapRing.position.y = 0.09;
floorGroup.add(gapRing);
const crossGeometry = new THREE.BufferGeometry().setFromPoints([
new THREE.Vector3(-0.22, 0.1, 0),
new THREE.Vector3(0.22, 0.1, 0),
new THREE.Vector3(0.22, 0.1, 0),
new THREE.Vector3(-0.22, 0.1, 0)
]);
const cross = new THREE.LineSegments(
crossGeometry,
new THREE.LineBasicMaterial({
color: 0xff665f,
transparent: true,
opacity: 0.72
})
);
floorGroup.add(cross);
const item = {
kind: "gap",
data: gap,
x,
cardGroup: group,
frameMaterial,
lightMaterial,
floorGroup,
opacity: 1,
targetOpacity: 1,
hover: false,
selected: false,
appeared: 0
};
textureMesh.userData.item = item;
pickables.push(textureMesh);
items.push(item);
}
}
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2(10, 10);
const pointerPosition = { x: 0, y: 0 };
let pointerDown = null;
let dragged = false;
let hoveredItem = null;
let selectedItem = null;
function updatePointer(event) {
const rect = renderer.domElement.getBoundingClientRect();
pointer.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
pointer.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
pointerPosition.x = event.clientX;
pointerPosition.y = event.clientY;
}
function pickItem() {
raycaster.setFromCamera(pointer, camera);
const intersections = raycaster.intersectObjects(pickables, false);
for (const intersection of intersections) {
const item = intersection.object.userData.item;
if (item && item.opacity > 0.48) return item;
}
return null;
}
function showTooltip(item) {
const isGap = item.kind === "gap";
tooltip.querySelector(".tooltip-date").textContent = isGap
? item.data.date
: `${item.data.date} · ${categoryLabels[item.data.category]}`;
tooltip.querySelector(".tooltip-title").textContent = item.data.title;
const source = tooltip.querySelector(".tooltip-source");
source.textContent = isGap
? "No verifiable source located · Select for archive note"
: `Source: ${item.data.source}`;
source.classList.toggle("gap", isGap);
tooltip.style.left = `${Math.min(pointerPosition.x + 18, window.innerWidth - 278)}px`;
tooltip.style.top = `${Math.min(pointerPosition.y + 18, window.innerHeight - 140)}px`;
tooltip.classList.add("visible");
}
function hideTooltip() {
tooltip.classList.remove("visible");
}
function setHovered(item) {
if (hoveredItem === item) return;
hoveredItem = item;
if (item) showTooltip(item);
else hideTooltip();
}
function selectItem(item) {
selectedItem = item;
for (const timelineItem of items) {
timelineItem.selected = timelineItem === item;
}
const isGap = item.kind === "gap";
detailPanel.classList.toggle("gap", isGap);
detailPanel.classList.add("open");
detailPanel.querySelector(".detail-date").textContent = isGap
? item.data.date
: `${item.data.date} · ${categoryLabels[item.data.category]}`;
detailPanel.querySelector(".detail-title").textContent = item.data.title;
detailPanel.querySelector(".detail-source").textContent = isGap
? "Source status: no surviving source located"
: `Source holder: ${item.data.source}`;
detailPanel.querySelector(".detail-description").textContent = item.data.description;
}
renderer.domElement.addEventListener("pointerdown", (event) => {
pointerDown = {
id: event.pointerId,
x: event.clientX,
y: event.clientY,
lastX: event.clientX,
lastY: event.clientY
};
dragged = false;
renderer.domElement.setPointerCapture(event.pointerId);
hideTooltip();
});
renderer.domElement.addEventListener("pointermove", (event) => {
updatePointer(event);
if (pointerDown && pointerDown.id === event.pointerId) {
const dx = event.clientX - pointerDown.lastX;
const dy = event.clientY - pointerDown.lastY;
const travel = Math.hypot(
event.clientX - pointerDown.x,
event.clientY - pointerDown.y
);
if (travel > 4) dragged = true;
if (dragged) {
cameraState.thetaTarget = THREE.MathUtils.clamp(
cameraState.thetaTarget - dx * 0.004,
-0.52,
0.52
);
cameraState.phiTarget = THREE.MathUtils.clamp(
cameraState.phiTarget + dy * 0.003,
0.72,
1.24
);
}
pointerDown.lastX = event.clientX;
pointerDown.lastY = event.clientY;
return;
}
if (event.pointerType !== "touch") {
setHovered(pickItem());
}
});
renderer.domElement.addEventListener("pointerup", (event) => {
if (pointerDown && pointerDown.id === event.pointerId) {
if (!dragged) {
updatePointer(event);
const item = pickItem();
if (item) selectItem(item);
}
pointerDown = null;
}
if (renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
});
renderer.domElement.addEventListener("pointercancel", () => {
pointerDown = null;
dragged = false;
});
renderer.domElement.addEventListener("pointerleave", () => {
if (!pointerDown) setHovered(null);
});
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
cameraState.zoomTarget = THREE.MathUtils.clamp(
cameraState.zoomTarget * Math.exp(-event.deltaY * 0.001),
0.72,
2.65
);
},
{ passive: false }
);
document.getElementById("zoom-in").addEventListener("click", () => {
cameraState.zoomTarget = THREE.MathUtils.clamp(
cameraState.zoomTarget * 1.18,
0.72,
2.65
);
});
document.getElementById("zoom-out").addEventListener("click", () => {
cameraState.zoomTarget = THREE.MathUtils.clamp(
cameraState.zoomTarget / 1.18,
0.72,
2.65
);
});
document.getElementById("reset-view").addEventListener("click", () => {
cameraState.thetaTarget = 0;
cameraState.phiTarget = 1.04;
cameraState.zoomTarget = 1.06;
});
document.querySelector(".detail-close").addEventListener("click", () => {
detailPanel.classList.remove("open");
selectedItem = null;
for (const item of items) item.selected = false;
});
const filterButtons = [...document.querySelectorAll(".filter")];
const recordCount = document.getElementById("record-count");
filterButtons.forEach((button) => {
button.addEventListener("click", () => {
filterButtons.forEach((candidate) =>
candidate.classList.toggle("active", candidate === button)
);
const filter = button.dataset.filter;
let visibleRecords = 0;
for (const item of items) {
if (item.kind === "record") {
const visible =
filter === "all" || item.data.category === filter;
item.targetOpacity = visible ? 1 : 0.095;
if (visible) visibleRecords++;
} else {
item.targetOpacity = 1;
}
}
recordCount.textContent =
`${visibleRecords} record${visibleRecords === 1 ? "" : "s"} · 2 gaps preserved`;
});
});
window.addEventListener("keydown", (event) => {
if (event.key === "Escape") {
detailPanel.classList.remove("open");
selectedItem = null;
for (const item of items) item.selected = false;
}
});
const clock = new THREE.Clock();
const startTime = performance.now();
function animate() {
requestAnimationFrame(animate);
const elapsed = clock.getElapsedTime();
const now = performance.now();
const delta = Math.min(clock.getDelta(), 0.05);
cameraState.theta +=
(cameraState.thetaTarget - cameraState.theta) * 0.085;
cameraState.phi +=
(cameraState.phiTarget - cameraState.phi) * 0.085;
cameraState.zoom +=
(cameraState.zoomTarget - cameraState.zoom) * 0.1;
const target = new THREE.Vector3(0, 1.55, 0);
camera.position.set(
target.x + cameraState.radius * Math.sin(cameraState.phi) * Math.sin(cameraState.theta),
target.y + cameraState.radius * Math.cos(cameraState.phi),
target.z + cameraState.radius * Math.sin(cameraState.phi) * Math.cos(cameraState.theta)
);
camera.lookAt(target);
camera.zoom = cameraState.zoom;
camera.updateProjectionMatrix();
pulseOrb.position.x = -12.15 + ((elapsed * 0.72) % 24.3);
pulseOrb.scale.setScalar(0.9 + Math.sin(elapsed * 4) * 0.12);
dust.rotation.y = elapsed * 0.006;
dust.position.y = Math.sin(elapsed * 0.16) * 0.12;
items.forEach((item, index) => {
const appearDelay = index * 58;
const appearProgress = THREE.MathUtils.clamp(
(now - startTime - appearDelay) / 650,
0,
1
);
const ease = 1 - Math.pow(1 - appearProgress, 3);
item.appeared = ease;
item.opacity += (item.targetOpacity - item.opacity) * 0.09;
if (item.kind === "record") {
const hoverScale = item.hover ? 0.035 : 0;
const scale = (0.86 + ease * 0.14) * (1 + hoverScale);
item.cardGroup.scale.setScalar(scale);
item.cardGroup.position.y =
2.17 + (1 - ease) * 0.52 + (item.hover ? 0.075 : 0);
item.panel.material.opacity = item.opacity;
item.texture.material.opacity = item.opacity;
item.holderMaterials.forEach((material) => {
const baseOpacity = material.userData.baseOpacity ?? 1;
material.userData.baseOpacity = baseOpacity;
material.opacity = baseOpacity * item.opacity;
});
item.panel.material.emissiveIntensity =
item.selected ? 0.16 : item.hover ? 0.09 : 0;
item.accentMaterial.emissiveIntensity =
item.hover ? 0.55 : 0.2 + Math.sin(elapsed * 2 + index) * 0.05;
} else {
item.cardGroup.scale.setScalar(0.86 + ease * 0.14);
item.cardGroup.position.y = 2.17 + (1 - ease) * 0.35;
item.frameMaterial.opacity =
0.65 + Math.sin(elapsed * 2.6 + index) * 0.18;
item.lightMaterial.opacity =
0.025 + Math.sin(elapsed * 2.1 + index) * 0.009;
}
});
renderer.render(scene, camera);
}
animate();
loading.classList.add("hidden");
</script>
</body>
</html>
```