Prompt specification
Build or customize the Three.js 3D scene "Neighborhood Ramp Installation" inside the active workspace.
Engineering Constraints:
1. Runtime & Orbit: Use Three.js r160 with OrbitControls (damping enabled) and ACESFilmicToneMapping.
2. Frame Timing: Drive all motion strictly with clock.getDelta() so animation speed is FPS-independent.
3. Viewport Hygiene: Handle window resize cleanly, cap DPR at Math.min(window.devicePixelRatio, 2), and dispose geometries/materials/renderer on unmount.
Scene Metadata:
Scene: Neighborhood Ramp Installation
Category: Voxel Worlds · Style: Voxel 3D
License: MIT · Reference: https://three3d.app/scene/neighborhood-ramp-installation-x3219
Scene Description Prompt:
Create a single self-contained HTML file using Three.js from cdnjs that shows coordinated movement of a shared load. Show volunteers assembling a temporary display ramp from panels and supports. Highlight role coordination and access clearance without presenting the scene as a certified construction design. Voxel style.
Working Three.js Starter (neighborhood-ramp-installation-x3219):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shared Load — Temporary Display Ramp Coordination Study</title>
<style>
:root {
--ink: #26323b;
--muted: #64717a;
--paper: rgba(255, 255, 255, 0.9);
--line: rgba(38, 50, 59, 0.13);
--blue: #3169df;
--teal: #1a9f9a;
--amber: #dc941b;
--purple: #8657c8;
--green: #3b9b5d;
--coral: #df605d;
--shadow: 0 12px 35px rgba(38, 50, 59, 0.12);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #e9e5dc;
color: var(--ink);
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button {
font: inherit;
}
#scene-wrap,
#scene-wrap canvas {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
display: block;
}
#scene-wrap canvas {
touch-action: none;
cursor: grab;
outline: none;
}
#scene-wrap canvas:active {
cursor: grabbing;
}
#label-layer {
position: absolute;
inset: 0;
z-index: 2;
pointer-events: none;
overflow: hidden;
}
.scene-label {
position: absolute;
left: 0;
top: 0;
transform: translate(-50%, -100%);
white-space: nowrap;
padding: 5px 8px;
border-radius: 6px;
border: 1px solid rgba(255, 255, 255, 0.85);
box-shadow: 0 5px 14px rgba(38, 50, 59, 0.14);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.055em;
text-transform: uppercase;
will-change: transform, left, top;
}
.scene-label.static {
color: #45535e;
background: rgba(255, 255, 255, 0.8);
}
.scene-label.role {
padding: 4px 7px;
border-radius: 999px;
font-size: 9px;
transform: translate(-50%, -100%);
}
.scene-label.cue {
color: #fff;
background: var(--coral);
border-color: rgba(255, 255, 255, 0.35);
font-size: 10px;
}
.glass {
background: var(--paper);
border: 1px solid rgba(255, 255, 255, 0.88);
box-shadow: var(--shadow);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
}
#ui {
position: absolute;
inset: 0;
z-index: 5;
pointer-events: none;
}
.brand {
position: absolute;
top: 18px;
left: 18px;
width: min(430px, calc(100vw - 36px));
padding: 15px 17px 14px;
border-radius: 13px;
}
.eyebrow {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 7px;
color: var(--blue);
font-size: 10px;
font-weight: 900;
letter-spacing: 0.16em;
text-transform: uppercase;
}
.eyebrow::before {
content: "";
width: 9px;
height: 9px;
border: 2px solid var(--blue);
border-radius: 2px;
transform: rotate(45deg);
}
h1 {
margin: 0;
font-size: clamp(19px, 2.2vw, 28px);
line-height: 1.08;
letter-spacing: -0.035em;
}
.subtitle {
margin: 7px 0 0;
color: var(--muted);
font-size: 12px;
line-height: 1.45;
}
.concept-chip {
display: inline-flex;
align-items: center;
gap: 6px;
margin-top: 10px;
padding: 5px 8px;
border-radius: 5px;
background: #fff2da;
color: #815b13;
font-size: 9px;
font-weight: 850;
letter-spacing: 0.07em;
text-transform: uppercase;
}
#phase-card {
position: absolute;
top: 18px;
right: 18px;
width: 318px;
padding: 15px;
border-radius: 13px;
}
.card-kicker {
color: var(--muted);
font-size: 9px;
font-weight: 850;
letter-spacing: 0.13em;
text-transform: uppercase;
}
#phase-title {
margin: 5px 0 5px;
font-size: 19px;
letter-spacing: -0.025em;
}
#phase-description {
min-height: 48px;
margin: 0;
color: var(--muted);
font-size: 12px;
line-height: 1.48;
}
.phase-meter {
height: 5px;
margin-top: 13px;
overflow: hidden;
border-radius: 999px;
background: #e7e9e8;
}
#phase-meter-fill {
width: 0;
height: 100%;
border-radius: inherit;
background: var(--blue);
transition: width 80ms linear;
}
.top-actions {
position: absolute;
top: 188px;
right: 18px;
display: flex;
gap: 6px;
padding: 6px;
border-radius: 10px;
pointer-events: auto;
}
.action-button {
min-height: 34px;
padding: 0 11px;
border: 0;
border-radius: 7px;
background: #eef1f3;
color: var(--ink);
cursor: pointer;
font-size: 11px;
font-weight: 800;
transition: transform 120ms ease, background 120ms ease;
}
.action-button:hover {
background: #dfe5e9;
transform: translateY(-1px);
}
.action-button.primary {
color: white;
background: var(--blue);
}
#roles-card {
position: absolute;
top: 240px;
right: 18px;
width: 318px;
padding: 14px 15px;
border-radius: 13px;
}
#roles-card h2 {
margin: 0 0 10px;
font-size: 12px;
letter-spacing: -0.01em;
}
.role-row {
display: grid;
grid-template-columns: 10px 1fr auto;
gap: 8px;
align-items: center;
padding: 6px 0;
border-top: 1px solid var(--line);
font-size: 11px;
}
.role-row:first-of-type {
border-top: 0;
}
.role-dot {
width: 8px;
height: 8px;
border-radius: 2px;
transform: rotate(45deg);
}
.role-status {
color: var(--muted);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.055em;
text-transform: uppercase;
}
#timeline-card {
position: absolute;
left: 50%;
bottom: 18px;
width: min(820px, calc(100vw - 36px));
padding: 12px 13px 10px;
border-radius: 13px;
transform: translateX(-50%);
}
.timeline-head {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 9px;
color: var(--muted);
font-size: 9px;
font-weight: 850;
letter-spacing: 0.1em;
text-transform: uppercase;
}
#timeline-progress {
position: absolute;
left: 13px;
right: 13px;
bottom: 5px;
height: 2px;
overflow: hidden;
border-radius: 999px;
background: #e5e8e9;
}
#timeline-progress-fill {
width: 0;
height: 100%;
background: var(--blue);
}
#timeline-steps {
display: flex;
gap: 5px;
pointer-events: auto;
}
.timeline-step {
position: relative;
min-width: 0;
padding: 8px 6px;
overflow: hidden;
border: 1px solid var(--line);
border-radius: 7px;
background: rgba(244, 246, 247, 0.85);
color: var(--muted);
cursor: pointer;
text-align: left;
font-size: 9px;
font-weight: 800;
line-height: 1.2;
transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}
.timeline-step:hover,
.timeline-step.active {
border-color: rgba(49, 105, 223, 0.42);
background: #eef3ff;
color: var(--blue);
}
.timeline-step.done {
color: #557066;
background: #edf6f1;
}
#disclaimer {
position: absolute;
left: 18px;
bottom: 18px;
width: min(330px, calc(100vw - 36px));
padding: 10px 12px;
border-radius: 10px;
color: #59656e;
font-size: 9px;
line-height: 1.45;
}
#disclaimer strong {
color: #774f10;
}
#camera-hint {
position: absolute;
left: 19px;
bottom: 92px;
color: rgba(38, 50, 59, 0.6);
font-size: 9px;
font-weight: 750;
letter-spacing: 0.04em;
text-transform: uppercase;
}
#loading {
position: absolute;
inset: 0;
z-index: 20;
display: grid;
place-items: center;
background: #e9e5dc;
color: var(--ink);
font-size: 12px;
font-weight: 800;
letter-spacing: 0.12em;
text-transform: uppercase;
transition: opacity 300ms ease;
}
#loading.hidden {
opacity: 0;
pointer-events: none;
}
@media (max-width: 900px) {
#roles-card {
display: none;
}
#phase-card {
top: auto;
right: 12px;
bottom: 92px;
width: 270px;
}
.top-actions {
top: 180px;
right: 12px;
}
.brand {
top: 12px;
left: 12px;
}
#timeline-card {
bottom: 12px;
}
#disclaimer {
display: none;
}
#camera-hint {
display: none;
}
}
@media (max-width: 620px) {
.brand {
padding: 11px 12px;
}
.brand .subtitle {
display: none;
}
.concept-chip {
margin-top: 7px;
}
#phase-card {
display: none;
}
.top-actions {
top: 103px;
left: 12px;
right: auto;
}
#timeline-card {
width: calc(100vw - 24px);
padding-left: 8px;
padding-right: 8px;
}
.timeline-step {
font-size: 0;
min-height: 31px;
padding: 5px 3px;
}
.timeline-step::after {
content: attr(data-short);
display: block;
font-size: 8px;
}
.scene-label.role {
font-size: 7px;
}
}
</style>
</head>
<body>
<div id="scene-wrap"></div>
<div id="label-layer"></div>
<div id="ui">
<header class="brand glass">
<div class="eyebrow">Coordinated movement study</div>
<h1>Shared Load / Temporary Display Ramp</h1>
<p class="subtitle">
Volunteers rehearse a matched lift, move through a cleared access lane,
assemble temporary display panels, and place a shared exhibit module.
</p>
<div class="concept-chip">Concept visualization · Not a certified design</div>
</header>
<section id="phase-card" class="glass" aria-live="polite">
<div class="card-kicker" id="phase-kicker">Phase 01 / 06</div>
<h2 id="phase-title">Stage and route check</h2>
<p id="phase-description"></p>
<div class="phase-meter"><div id="phase-meter-fill"></div></div>
</section>
<div class="top-actions glass">
<button class="action-button primary" id="pause-button" type="button">Pause</button>
<button class="action-button" id="replay-button" type="button">Replay</button>
<button class="action-button" id="speed-button" type="button">1×</button>
<button class="action-button" id="camera-button" type="button">Reset view</button>
</div>
<aside id="roles-card" class="glass">
<h2>Role coordination</h2>
<div class="role-row">
<span class="role-dot" style="background:#3169df"></span>
<span>Lift lead</span>
<span class="role-status" id="status-lead">Ready</span>
</div>
<div class="role-row">
<span class="role-dot" style="background:#1a9f9a"></span>
<span>Shared-load carriers</span>
<span class="role-status" id="status-carriers">Ready</span>
</div>
<div class="role-row">
<span class="role-dot" style="background:#dc941b"></span>
<span>Panel lead</span>
<span class="role-status" id="status-panels">Staged</span>
</div>
<div class="role-row">
<span class="role-dot" style="background:#8657c8"></span>
<span>Support lead</span>
<span class="role-status" id="status-supports">Staged</span>
</div>
<div class="role-row">
<span class="role-dot" style="background:#3b9b5d"></span>
<span>Access marshal</span>
<span class="role-status" id="status-access">Sweeping</span>
</div>
<div class="role-row">
<span class="role-dot" style="background:#df605d"></span>
<span>Handoff check</span>
<span class="role-status" id="status-check">Waiting</span>
</div>
</aside>
<div id="camera-hint">Drag to orbit · Wheel to zoom · Arrow keys to rotate</div>
<div id="disclaimer" class="glass">
<strong>Visualization only.</strong>
This scene communicates role handoffs and an illustrative access corridor.
It is not structural, engineering, accessibility-code, lifting, or site-safety
approval. Real work requires qualified review and site-specific procedures.
</div>
<section id="timeline-card" class="glass">
<div class="timeline-head">
<span>Coordination sequence</span>
<span id="time-readout">00.0 / 22.0 s</span>
</div>
<div id="timeline-steps">
<button class="timeline-step active" data-start="0" data-short="Stage" type="button">01 · Stage</button>
<button class="timeline-step" data-start="2" data-short="Lift" type="button">02 · Lift</button>
<button class="timeline-step" data-start="5.2" data-short="Move" type="button">03 · Move</button>
<button class="timeline-step" data-start="8.5" data-short="Build" type="button">04 · Build</button>
<button class="timeline-step" data-start="13.8" data-short="Ascend" type="button">05 · Ascend</button>
<button class="timeline-step" data-start="20.4" data-short="Check" type="button">06 · Check</button>
</div>
<div id="timeline-progress"><div id="timeline-progress-fill"></div></div>
</section>
</div>
<div id="loading">Building coordination scene…</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const DURATION = 22;
const COLORS = {
ink: 0x26323b,
floor: 0xd8d3c8,
grid: 0xb9b4aa,
blue: 0x3169df,
teal: 0x1a9f9a,
amber: 0xdc941b,
purple: 0x8657c8,
green: 0x3b9b5d,
coral: 0xdf605d,
cream: 0xf2ead8,
panel: 0x72b9c8,
panelEdge: 0x2f7689,
support: 0x8b65bd,
white: 0xf8f7f2,
dark: 0x3d4850
};
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xe9e5dc);
scene.fog = new THREE.Fog(0xe9e5dc, 42, 76);
const camera = new THREE.PerspectiveCamera(
42,
innerWidth / innerHeight,
0.1,
120
);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
renderer.setSize(innerWidth, innerHeight);
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.04;
renderer.domElement.tabIndex = 0;
renderer.domElement.setAttribute(
"aria-label",
"Interactive voxel visualization of volunteers coordinating a shared load"
);
document.getElementById("scene-wrap").appendChild(renderer.domElement);
const hemi = new THREE.HemisphereLight(0xffffff, 0x81776a, 2.15);
scene.add(hemi);
const sun = new THREE.DirectionalLight(0xfff4df, 3.2);
sun.position.set(-9, 19, 11);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -28;
sun.shadow.camera.right = 28;
sun.shadow.camera.top = 25;
sun.shadow.camera.bottom = -25;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 55;
sun.shadow.bias = -0.00035;
scene.add(sun);
const fill = new THREE.DirectionalLight(0xb9d8ff, 1.0);
fill.position.set(14, 8, -12);
scene.add(fill);
function material(color, options = {}) {
return new THREE.MeshStandardMaterial({
color,
roughness: 0.86,
metalness: 0,
flatShading: true,
...options
});
}
function box(width, height, depth, mat, parent = scene, x = 0, y = 0, z = 0) {
const mesh = new THREE.Mesh(new THREE.BoxGeometry(width, height, depth), mat);
mesh.position.set(x, y, z);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function lineFromPoints(points, color, dashed = false, opacity = 1) {
const geometry = new THREE.BufferGeometry().setFromPoints(
points.map((p) => new THREE.Vector3(...p))
);
const mat = dashed
? new THREE.LineDashedMaterial({
color,
dashSize: 0.45,
gapSize: 0.24,
transparent: true,
opacity
})
: new THREE.LineBasicMaterial({ color, transparent: true, opacity });
const line = new THREE.Line(geometry, mat);
if (dashed) line.computeLineDistances();
scene.add(line);
return line;
}
const floorMaterial = material(COLORS.floor);
const floor = box(44, 0.8, 30, floorMaterial, scene, 0, -0.42, 0);
floor.receiveShadow = true;
const gridPoints = [];
for (let x = -20; x <= 20; x += 2) {
gridPoints.push(x, 0.005, -14, x, 0.005, 14);
}
for (let z = -14; z <= 14; z += 2) {
gridPoints.push(-20, 0.005, z, 20, 0.005, z);
}
const gridGeometry = new THREE.BufferGeometry();
gridGeometry.setAttribute(
"position",
new THREE.Float32BufferAttribute(gridPoints, 3)
);
scene.add(
new THREE.LineSegments(
gridGeometry,
new THREE.LineBasicMaterial({
color: COLORS.grid,
transparent: true,
opacity: 0.22
})
)
);
// Upper display landing and its voxel supports.
const landingMaterial = material(0x65747d);
box(6.4, 0.34, 5.4, landingMaterial, scene, 15.25, 2.83, 0);
box(6.65, 0.14, 0.22, material(COLORS.panelEdge), scene, 15.25, 2.65, 2.63);
box(6.65, 0.14, 0.22, material(COLORS.panelEdge), scene, 15.25, 2.65, -2.63);
const landingLegMat = material(0x536068);
for (const x of [12.65, 15.25, 17.85]) {
for (const z of [-2.25, 2.25]) {
box(0.48, 2.64, 0.48, landingLegMat, scene, x, 1.32, z);
}
}
// Lower landing.
box(1.65, 0.16, 5.25, material(0x65747d), scene, 4.25, 0.08, 0);
// Clear access corridor.
const laneMaterial = new THREE.MeshBasicMaterial({
color: COLORS.green,
transparent: true,
opacity: 0.11,
depthWrite: false,
side: THREE.DoubleSide
});
const lane = new THREE.Mesh(new THREE.PlaneGeometry(13, 5.2), laneMaterial);
lane.rotation.x = -Math.PI / 2;
lane.position.set(-1.5, 0.014, 0);
scene.add(lane);
lineFromPoints(
[
[-8, 0.035, -2.6],
[5, 0.035, -2.6],
[5, 0.035, 2.6],
[-8, 0.035, 2.6],
[-8, 0.035, -2.6]
],
COLORS.green,
true,
0.9
);
// Voxel chevrons in the corridor.
const arrowMaterial = material(COLORS.green, {
transparent: true,
opacity: 0.48
});
for (const x of [-6.5, -3.5, -0.5, 2.5]) {
box(0.85, 0.025, 0.12, arrowMaterial, scene, x - 0.24, 0.04, -0.28).rotation.y = -0.62;
box(0.85, 0.025, 0.12, arrowMaterial, scene, x - 0.24, 0.04, 0.28).rotation.y = 0.62;
}
// Keep-clear hatching outside the route.
const hatchMaterial = material(COLORS.coral, {
transparent: true,
opacity: 0.32
});
for (let i = 0; i < 10; i++) {
const stripe = box(0.12, 0.025, 1.3, hatchMaterial, scene, -7.4 + i * 1.28, 0.043, -3.35);
stripe.rotation.y = -0.48;
}
// Sweep marker used by the access marshal.
const sweep = new THREE.Mesh(
new THREE.PlaneGeometry(0.22, 5.1),
new THREE.MeshBasicMaterial({
color: COLORS.green,
transparent: true,
opacity: 0.28,
depthWrite: false
})
);
sweep.rotation.x = -Math.PI / 2;
sweep.position.set(-7, 0.05, 0);
scene.add(sweep);
// Traffic blocks outside the corridor.
function makeCone(x, z) {
box(0.55, 0.12, 0.55, material(0x59656c), scene, x, 0.06, z);
box(0.34, 0.18, 0.34, material(COLORS.coral), scene, x, 0.2, z);
box(0.22, 0.22, 0.22, material(0xf5eee1), scene, x, 0.39, z);
box(0.16, 0.16, 0.16, material(COLORS.coral), scene, x, 0.56, z);
}
makeCone(-8.3, -3.25);
makeCone(4.7, -3.25);
makeCone(4.7, 3.25);
// Decorative voxel site blocks.
const planterMat = material(0x87948b);
const foliageMat = material(0x6c9f73);
for (const [x, z] of [[-18, -11], [-18, 10], [19, -11], [19, 10]]) {
box(1.4, 0.65, 1.4, planterMat, scene, x, 0.33, z);
box(0.65, 0.85, 0.65, foliageMat, scene, x - 0.25, 1.0, z);
box(0.8, 0.55, 0.72, foliageMat, scene, x + 0.25, 1.25, z + 0.1);
}
// Ramp panels: staged initially, then animated into the final ramp.
const panelMaterial = material(COLORS.panel);
const panelEdgeMaterial = material(COLORS.panelEdge);
const panelLength = Math.hypot(1.75, 2.82 / 4);
const panels = [];
for (let i = 0; i < 4; i++) {
const group = new THREE.Group();
scene.add(group);
box(panelLength, 0.18, 5, panelMaterial, group);
box(0.11, 0.08, 5, panelEdgeMaterial, group, -panelLength / 2 + 0.06, 0.13, 0);
box(0.11, 0.08, 5, panelEdgeMaterial, group, panelLength / 2 - 0.06, 0.13, 0);
const finalX = 5 + (i + 0.5) * 1.75;
const finalY = 0.18 + ((i + 0.5) / 4) * 2.82;
const finalQuaternion = new THREE.Quaternion().setFromEuler(
new THREE.Euler(0, 0, Math.atan2(2.82, 7))
);
panels.push({
group,
start: new THREE.Vector3(-10.8 + i * 0.1, 0.2 + i * 0.25, -6.8),
end: new THREE.Vector3(finalX, finalY, 0),
startQuaternion: new THREE.Quaternion(),
endQuaternion: finalQuaternion
});
}
// Adjustable voxel supports.
const supports = [];
const supportGeometry = new THREE.BoxGeometry(1, 1, 1);
const supportMaterial = material(COLORS.support);
function surfaceY(x) {
if (x <= 5) return 0.18;
if (x >= 12) return 3;
return 0.18 + ((x - 5) / 7) * 2.82;
}
for (let i = 0; i < 8; i++) {
const mesh = new THREE.Mesh(supportGeometry, supportMaterial);
mesh.castShadow = true;
mesh.receiveShadow = true;
scene.add(mesh);
const finalX = 5.65 + Math.floor(i / 2) * 1.75;
const finalZ = i % 2 === 0 ? -2.05 : 2.05;
const finalHeight = Math.max(0.48, surfaceY(finalX) - 0.18);
supports.push({
mesh,
start: new THREE.Vector3(
-12.4 + (i % 2) * 0.52,
0.25,
4.45 + Math.floor(i / 2) * 0.54
),
end: new THREE.Vector3(finalX, 0.08 + finalHeight / 2, finalZ),
startScale: new THREE.Vector3(0.48, 0.48, 0.48),
endScale: new THREE.Vector3(0.42, finalHeight, 0.42)
});
}
// Shared display module.
const load = new THREE.Group();
scene.add(load);
const loadBodyMaterial = material(COLORS.coral);
const loadTrimMaterial = material(0xf7d6c2);
const palletMaterial = material(0x92775b);
box(2.5, 0.18, 2.15, palletMaterial, load, 0, 0.09, 0);
box(1.78, 1.55, 1.78, loadBodyMaterial, load, 0, 0.97, 0);
box(1.88, 0.12, 1.88, loadTrimMaterial, load, 0, 1.78, 0);
box(1.28, 0.12, 0.08, loadTrimMaterial, load, 0, 1.05, 0.94);
box(0.08, 0.12, 1.28, loadTrimMaterial, load, 0.94, 1.05, 0);
box(0.16, 0.16, 1.95, material(COLORS.dark), load, -1.15, 0.95, 0);
box(0.16, 0.16, 1.95, material(COLORS.dark), load, 1.15, 0.95, 0);
// Volunteers are made only from box geometry.
function makeVolunteer(color) {
const root = new THREE.Group();
scene.add(root);
const shirt = material(color);
const trousers = material(0x34414b);
const skin = material(0xd9a77d);
const helmet = material(0xf2c84b);
const boot = material(0x273138);
box(0.62, 0.72, 0.36, shirt, root, 0, 1.02, 0);
box(0.44, 0.42, 0.42, skin, root, 0, 1.59, 0);
box(0.54, 0.16, 0.51, helmet, root, 0, 1.86, 0);
box(0.58, 0.07, 0.24, helmet, root, 0, 1.8, 0.22);
box(0.07, 0.07, 0.03, material(0x26323b), root, -0.12, 1.62, 0.22);
box(0.07, 0.07, 0.03, material(0x26323b), root, 0.12, 1.62, 0.22);
const leftArm = new THREE.Group();
const rightArm = new THREE.Group();
leftArm.position.set(-0.4, 1.28, 0);
rightArm.position.set(0.4, 1.28, 0);
root.add(leftArm, rightArm);
box(0.18, 0.62, 0.2, shirt, leftArm, 0, -0.26, 0);
box(0.18, 0.62, 0.2, shirt, rightArm, 0, -0.26, 0);
box(0.18, 0.16, 0.2, skin, leftArm, 0, -0.62, 0);
box(0.18, 0.16, 0.2, skin, rightArm, 0, -0.62, 0);
const leftLeg = new THREE.Group();
const rightLeg = new THREE.Group();
leftLeg.position.set(-0.17, 0.66, 0);
rightLeg.position.set(0.17, 0.66, 0);
root.add(leftLeg, rightLeg);
box(0.24, 0.57, 0.25, trousers, leftLeg, 0, -0.27, 0);
box(0.24, 0.57, 0.25, trousers, rightLeg, 0, -0.27, 0);
box(0.27, 0.14, 0.35, boot, leftLeg, 0, -0.56, 0.05);
box(0.27, 0.14, 0.35, boot, rightLeg, 0, -0.56, 0.05);
return { root, leftArm, rightArm, leftLeg, rightLeg };
}
const labelLayer = document.getElementById("label-layer");
function makeLabel(text, className = "static") {
const element = document.createElement("div");
element.className = `scene-label ${className}`;
element.textContent = text;
labelLayer.appendChild(element);
return element;
}
function attachRoleLabel(volunteer, text, color) {
volunteer.label = makeLabel(text, "role");
volunteer.label.style.color = color;
volunteer.label.style.background = "rgba(255,255,255,.93)";
}
const carrierA = makeVolunteer(COLORS.teal);
const carrierB = makeVolunteer(COLORS.teal);
const carrierC = makeVolunteer(COLORS.teal);
const liftLead = makeVolunteer(COLORS.blue);
const panelLead = makeVolunteer(COLORS.amber);
const supportLead = makeVolunteer(COLORS.purple);
const accessMarshal = makeVolunteer(COLORS.green);
const handoffCheck = makeVolunteer(COLORS.coral);
attachRoleLabel(liftLead, "Lift lead", "#3169df");
attachRoleLabel(carrierA, "Carrier A", "#1a9f9a");
attachRoleLabel(carrierB, "Carrier B", "#1a9f9a");
attachRoleLabel(carrierC, "Carrier C", "#1a9f9a");
attachRoleLabel(panelLead, "Panel lead", "#a5680e");
attachRoleLabel(supportLead, "Support lead", "#7143ac");
attachRoleLabel(accessMarshal, "Access marshal", "#287845");
attachRoleLabel(handoffCheck, "Handoff check", "#b54442");
const carriers = [liftLead, carrierA, carrierB, carrierC];
const panelStagingLabel = makeLabel("Panel staging");
const accessLabel = makeLabel("Illustrative clear access lane");
accessLabel.style.color = "#287845";
const rampLabel = makeLabel("Temporary display ramp");
const loadCue = makeLabel("Route check", "cue");
// Four coordination links connect the module corners to the carriers.
const coordinationPositions = new Float32Array(24);
const coordinationColors = new Float32Array(24);
const coordinationGeometry = new THREE.BufferGeometry();
coordinationGeometry.setAttribute(
"position",
new THREE.BufferAttribute(coordinationPositions, 3)
);
coordinationGeometry.setAttribute(
"color",
new THREE.BufferAttribute(coordinationColors, 3)
);
const carrierColor = new THREE.Color(COLORS.teal);
for (let i = 0; i < 4; i++) {
coordinationColors[i * 6] = carrierColor.r;
coordinationColors[i * 6 + 1] = carrierColor.g;
coordinationColors[i * 6 + 2] = carrierColor.b;
coordinationColors[i * 6 + 3] = carrierColor.r;
coordinationColors[i * 6 + 4] = carrierColor.g;
coordinationColors[i * 6 + 5] = carrierColor.b;
}
const coordinationLines = new THREE.LineSegments(
coordinationGeometry,
new THREE.LineBasicMaterial({
vertexColors: true,
transparent: true,
opacity: 0.78,
depthTest: true
})
);
scene.add(coordinationLines);
function clamp(value, min = 0, max = 1) {
return Math.min(max, Math.max(min, value));
}
function ease(value) {
const u = clamp(value);
return u * u * (3 - 2 * u);
}
function segment(t, start, end) {
return ease((t - start) / (end - start));
}
function mix(a, b, u) {
return a + (b - a) * u;
}
function setVolunteer(v, x, y, z, rotation, carrying, moving, gait = 0) {
v.root.position.set(x, y, z);
v.root.rotation.y = rotation;
if (carrying) {
v.leftArm.rotation.z = 1.03;
v.rightArm.rotation.z = -1.03;
} else {
const swing = moving ? Math.sin(gait) * 0.42 : 0;
v.leftArm.rotation.z = swing;
v.rightArm.rotation.z = -swing;
}
const legSwing = moving ? Math.sin(gait) * 0.5 : 0;
v.leftLeg.rotation.x = legSwing;
v.rightLeg.rotation.x = -legSwing;
}
function walkingSurface(x) {
if (x < 4.8) return 0.02;
if (x < 12.2) return surfaceY(x);
return 3;
}
function getLoadState(t) {
const state = {
x: -7,
y: 0.12,
z: 2.4,
carrying: false,
moving: false
};
if (t < 2) return state;
if (t < 5.2) {
state.y = mix(0.12, 0.87, segment(t, 2, 5.2));
state.carrying = true;
return state;
}
if (t < 7.8) {
const u = segment(t, 5.2, 7.8);
state.x = mix(-7, 4.6, u);
state.z = mix(2.4, 0, u);
state.y = 0.87;
state.carrying = true;
state.moving = true;
return state;
}
if (t < 8.5) {
state.x = 4.6;
state.z = 0;
state.y = mix(0.87, 0.12, segment(t, 7.8, 8.5));
state.carrying = true;
return state;
}
if (t < 13.8) {
state.x = 4.6;
state.z = 0;
state.y = 0.12;
return state;
}
if (t < 15) {
state.x = 4.6;
state.z = 0;
state.y = mix(0.12, 0.87, segment(t, 13.8, 15));
state.carrying = true;
return state;
}
if (t < 17.8) {
const u = segment(t, 15, 17.8);
state.x = mix(4.6, 12.1, u);
state.z = 0;
state.y = mix(0.87, 3.78, u);
state.carrying = true;
state.moving = true;
return state;
}
if (t < 19.3) {
const u = segment(t, 17.8, 19.3);
state.x = mix(12.1, 15.2, u);
state.y = 3.78;
state.z = 0;
state.carrying = true;
state.moving = true;
return state;
}
if (t < 20.4) {
state.x = 15.2;
state.y = mix(3.78, 3.12, segment(t, 19.3, 20.4));
state.z = 0;
state.carrying = true;
return state;
}
state.x = 15.2;
state.y = 3.12;
state.z = 0;
return state;
}
const phases = [
{
start: 0,
end: 2,
title: "Stage and route check",
description:
"The access marshal sweeps the green corridor while the shared display module remains staged."
},
{
start: 2,
end: 5.2,
title: "One cue, one lift",
description:
"The lift lead calls the cadence. Four carriers keep the module level and coordinated links show the shared hand-off."
},
{
start: 5.2,
end: 8.5,
title: "Matched carry to the ramp",
description:
"Carriers match pace through the cleared lane and place the module at the lower landing without changing roles."
},
{
start: 8.5,
end: 13.8,
title: "Build the temporary ramp",
description:
"Panel and support leads work in sequence. The module is held clear while the rehearsal ramp is assembled."
},
{
start: 13.8,
end: 19.3,
title: "Second lift and ramp ascent",
description:
"The same four-person team re-lifts together, then climbs the completed ramp with matched steps."
},
{
start: 19.3,
end: 22,
title: "Place, check, and reopen the route",
description:
"The module is set on the upper landing. The handoff check confirms the visual sequence and the access route is reopened."
}
];
function findPhase(t) {
for (let i = phases.length - 1; i >= 0; i--) {
if (t >= phases[i].start) return i;
}
return 0;
}
const ui = {
phaseKicker: document.getElementById("phase-kicker"),
phaseTitle: document.getElementById("phase-title"),
phaseDescription: document.getElementById("phase-description"),
phaseMeter: document.getElementById("phase-meter-fill"),
progress: document.getElementById("timeline-progress-fill"),
time: document.getElementById("time-readout"),
pause: document.getElementById("pause-button"),
replay: document.getElementById("replay-button"),
speed: document.getElementById("speed-button"),
camera: document.getElementById("camera-button"),
lead: document.getElementById("status-lead"),
carriers: document.getElementById("status-carriers"),
panels: document.getElementById("status-panels"),
supports: document.getElementById("status-supports"),
access: document.getElementById("status-access"),
check: document.getElementById("status-check"),
steps: [...document.querySelectorAll(".timeline-step")]
};
let time = 0;
let playing = true;
let playbackSpeed = 1;
ui.steps.forEach((button) => {
button.addEventListener("click", () => {
time = Number(button.dataset.start);
playing = true;
updatePauseButton();
});
});
function updatePauseButton() {
ui.pause.textContent = playing ? "Pause" : "Play";
}
ui.pause.addEventListener("click", () => {
if (time >= DURATION) {
time = 0;
playing = true;
} else {
playing = !playing;
}
updatePauseButton();
});
ui.replay.addEventListener("click", () => {
time = 0;
playing = true;
updatePauseButton();
});
ui.speed.addEventListener("click", () => {
const speeds = [0.5, 1, 1.5];
playbackSpeed =
speeds[(speeds.indexOf(playbackSpeed) + 1) % speeds.length];
ui.speed.textContent = `${playbackSpeed}×`;
});
// Custom orbit controls; no external controls addon is used.
const orbit = {
target: new THREE.Vector3(1.2, 1.1, 0),
radius: 34,
theta: 0.78,
phi: 0.9
};
function updateCamera() {
orbit.phi = clamp(orbit.phi, 0.34, 1.34);
orbit.radius = clamp(orbit.radius, 17, 55);
camera.position.set(
orbit.target.x + orbit.radius * Math.sin(orbit.phi) * Math.sin(orbit.theta),
orbit.target.y + orbit.radius * Math.cos(orbit.phi),
orbit.target.z + orbit.radius * Math.sin(orbit.phi) * Math.cos(orbit.theta)
);
camera.lookAt(orbit.target);
camera.updateMatrixWorld();
}
function resetCamera() {
orbit.target.set(1.2, 1.1, 0);
orbit.radius = 34;
orbit.theta = 0.78;
orbit.phi = 0.9;
updateCamera();
}
ui.camera.addEventListener("click", resetCamera);
let dragging = false;
let pointerX = 0;
let pointerY = 0;
renderer.domElement.addEventListener("pointerdown", (event) => {
dragging = true;
pointerX = event.clientX;
pointerY = event.clientY;
renderer.domElement.setPointerCapture(event.pointerId);
renderer.domElement.focus();
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!dragging) return;
const dx = event.clientX - pointerX;
const dy = event.clientY - pointerY;
pointerX = event.clientX;
pointerY = event.clientY;
orbit.theta -= dx * 0.006;
orbit.phi = clamp(orbit.phi + dy * 0.005, 0.34, 1.34);
updateCamera();
});
function endDrag(event) {
dragging = false;
if (event.pointerId !== undefined && renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
}
renderer.domElement.addEventListener("pointerup", endDrag);
renderer.domElement.addEventListener("pointercancel", endDrag);
renderer.domElement.addEventListener("contextmenu", (event) => event.preventDefault());
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
orbit.radius += event.deltaY * 0.018;
updateCamera();
},
{ passive: false }
);
window.addEventListener("keydown", (event) => {
if (["INPUT", "TEXTAREA", "SELECT", "BUTTON"].includes(document.activeElement.tagName)) {
return;
}
let handled = true;
switch (event.key) {
case "ArrowLeft":
orbit.theta -= 0.08;
break;
case "ArrowRight":
orbit.theta += 0.08;
break;
case "ArrowUp":
orbit.phi = clamp(orbit.phi - 0.06, 0.34, 1.34);
break;
case "ArrowDown":
orbit.phi = clamp(orbit.phi + 0.06, 0.34, 1.34);
break;
case "+":
case "=":
orbit.radius = clamp(orbit.radius - 2, 17, 55);
break;
case "-":
orbit.radius = clamp(orbit.radius + 2, 17, 55);
break;
case " ":
playing = !playing;
updatePauseButton();
break;
case "r":
case "R":
resetCamera();
break;
default:
handled = false;
}
if (handled) {
event.preventDefault();
updateCamera();
}
});
function projectLabel(element, worldPosition, visible = true) {
if (!visible) {
element.style.display = "none";
return;
}
const projected = worldPosition.clone().project(camera);
const inView =
projected.z > -1 &&
projected.z < 1 &&
projected.x > -1.12 &&
projected.x < 1.12 &&
projected.y > -1.15 &&
projected.y < 1.15;
if (!inView) {
element.style.display = "none";
return;
}
element.style.display = "block";
element.style.left = `${(projected.x * 0.5 + 0.5) * innerWidth}px`;
element.style.top = `${(-projected.y * 0.5 + 0.5) * innerHeight}px`;
}
const labelVector = new THREE.Vector3();
function updateVolunteerLabel(volunteer, visible = true) {
if (!volunteer.label) return;
labelVector.copy(volunteer.root.position);
labelVector.y += 2.35;
projectLabel(volunteer.label, labelVector, visible);
}
function updateScene(t) {
const loadState = getLoadState(t);
load.position.set(loadState.x, loadState.y, loadState.z);
const carrying = loadState.carrying;
// Carrier positions and gait.
const offsets = [
[-1.2, -1.65],
[1.2, -1.65],
[-1.2, 1.65],
[1.2, 1.65]
];
carriers.forEach((carrier, index) => {
const [ox, oz] = offsets[index];
const x = loadState.x + ox;
const z = loadState.z + oz;
const y = walkingSurface(x);
const rotation = Math.atan2(loadState.x - x, loadState.z - z);
const gait = t * (loadState.moving ? 8 : 2.5) + index * Math.PI * 0.45;
setVolunteer(
carrier,
x,
y,
z,
rotation,
carrying,
loadState.moving,
gait
);
});
// Panel placement.
panels.forEach((panel, index) => {
const startTime = 8.3 + index * 0.45;
const u = segment(t, startTime, startTime + 2.1);
panel.group.position.lerpVectors(panel.start, panel.end, u);
panel.group.position.y += Math.sin(u * Math.PI) * 1.25;
panel.group.quaternion.slerpQuaternions(
panel.startQuaternion,
panel.endQuaternion,
u
);
});
// Support placement.
supports.forEach((support, index) => {
const startTime = 10.15 + index * 0.3;
const u = segment(t, startTime, startTime + 1.85);
support.mesh.position.lerpVectors(support.start, support.end, u);
support.mesh.position.y += Math.sin(u * Math.PI) * 0.55;
support.mesh.scale.lerpVectors(support.startScale, support.endScale, u);
});
// Panel lead moves to the near side of the ramp during placement.
const panelMove = segment(t, 7.2, 9.2);
const panelReturn = segment(t, 12.8, 14.2);
const panelX = mix(mix(-8, 3.2, panelMove), -7.2, panelReturn);
const panelZ = mix(mix(-3.6, 3.1, panelMove), -3.6, panelReturn);
setVolunteer(panelLead, panelX, 0.02, panelZ, -0.65, false, panelMove > 0 && panelMove < 1);
// Support lead crosses to the opposite work side.
const supportMove = segment(t, 9.3, 10.7);
const supportReturn = segment(t, 13.6, 15);
const supportX = mix(mix(-8, 3.6, supportMove), -8.2, supportReturn);
const supportZ = mix(mix(5.4, -3.1, supportMove), 5.4, supportReturn);
setVolunteer(supportLead, supportX, 0.02, supportZ, 0.55, false, supportMove > 0 && supportMove < 1);
// Access marshal sweeps and then holds the route endpoint.
let accessX = -7;
if (t >= 0.2 && t < 3.6) {
accessX = mix(-7.2, 4.25, segment(t, 0.2, 3.6));
} else if (t >= 3.6) {
accessX = 4.25;
}
const accessZ = 3.25;
setVolunteer(
accessMarshal,
accessX,
0.02,
accessZ,
t < 3.6 ? Math.PI / 2 : 0,
false,
t >= 0.2 && t < 3.6,
t * 8
);
sweep.position.x = accessX;
sweep.visible = t > 0.15 && t < 3.75;
// Handoff check waits on the upper landing, then signals completion.
setVolunteer(handoffCheck, 15.45, 3, 2.55, Math.PI, false, false);
if (t >= 20.4) {
handoffCheck.leftArm.rotation.z = -2.35;
handoffCheck.rightArm.rotation.z = 2.35;
}
// Dynamic coordination links.
coordinationLines.visible = carrying;
if (carrying) {
carriers.forEach((carrier, index) => {
const [ox, oz] = offsets[index];
const startIndex = index * 6;
coordinationPositions[startIndex] = loadState.x + ox * 0.7;
coordinationPositions[startIndex + 1] = loadState.y + 1.05;
coordinationPositions[startIndex + 2] = loadState.z + oz * 0.62;
coordinationPositions[startIndex + 3] = carrier.root.position.x;
coordinationPositions[startIndex + 4] = carrier.root.position.y + 1.22;
coordinationPositions[startIndex + 5] = carrier.root.position.z;
});
coordinationGeometry.attributes.position.needsUpdate = true;
}
// Scene labels.
updateVolunteerLabel(liftLead);
updateVolunteerLabel(carrierA);
updateVolunteerLabel(carrierB);
updateVolunteerLabel(carrierC);
updateVolunteerLabel(panelLead);
updateVolunteerLabel(supportLead);
updateVolunteerLabel(accessMarshal);
updateVolunteerLabel(handoffCheck);
projectLabel(panelStagingLabel, new THREE.Vector3(-10.8, 1.45, -6.8));
projectLabel(accessLabel, new THREE.Vector3(-1.5, 0.35, 3.05));
projectLabel(rampLabel, new THREE.Vector3(8.4, 3.9, 0));
labelVector.set(loadState.x, loadState.y + 2.8, loadState.z);
projectLabel(loadCue, labelVector);
let cueText = "Route check";
if (t >= 2 && t < 5.2) cueText = "Lift together · one cue";
else if (t >= 5.2 && t < 8.5) cueText = "Matched carry";
else if (t >= 8.5 && t < 13.8) cueText = "Ramp crew working";
else if (t >= 13.8 && t < 15) cueText = "Second lift";
else if (t >= 15 && t < 19.3) cueText = "Carry up ramp";
else if (t >= 19.3 && t < 20.4) cueText = "Place module";
else if (t >= 20.4) cueText = "Handoff confirmed";
loadCue.textContent = cueText;
// Interface status.
const phaseIndex = findPhase(t);
const phase = phases[phaseIndex];
ui.phaseKicker.textContent = `Phase ${String(phaseIndex + 1).padStart(2, "0")} / 06`;
ui.phaseTitle.textContent = phase.title;
ui.phaseDescription.textContent = phase.description;
ui.phaseMeter.style.width = `${clamp((t - phase.start) / (phase.end - phase.start)) * 100}%`;
ui.progress.style.width = `${(t / DURATION) * 100}%`;
ui.time.textContent = `${t.toFixed(1).padStart(4, "0")} / 22.0 s`;
ui.steps.forEach((button, index) => {
button.classList.toggle("active", index === phaseIndex);
button.classList.toggle("done", index < phaseIndex);
});
ui.lead.textContent =
t < 2 ? "Ready" :
t < 5.2 ? "Calling cue" :
t < 20.4 ? "Directing" : "Complete";
ui.carriers.textContent =
t < 2 ? "Ready" :
t < 5.2 ? "Lift" :
t < 8.5 ? "Moving" :
t < 13.8 ? "Holding clear" :
t < 19.3 ? "Ascending" :
t < 20.4 ? "Placing" : "Released";
ui.panels.textContent =
t < 8.3 ? "Staged" :
t < 11.75 ? "Setting" : "Complete";
ui.supports.textContent =
t < 10.15 ? "Staged" :
t < 14.15 ? "Setting" : "Complete";
ui.access.textContent =
t < 3.6 ? "Sweeping" :
t < 20.4 ? "Route clear" : "Reopened";
ui.check.textContent =
t < 20.4 ? "Waiting" : "Confirmed";
}
function resize() {
camera.aspect = innerWidth / innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(innerWidth, innerHeight);
renderer.setPixelRatio(Math.min(devicePixelRatio, 2));
}
window.addEventListener("resize", resize);
resetCamera();
updateScene(0);
renderer.render(scene, camera);
requestAnimationFrame(() => {
document.getElementById("loading").classList.add("hidden");
});
let previousTime = performance.now();
function animate(now) {
const delta = Math.min((now - previousTime) / 1000, 0.05);
previousTime = now;
if (playing) {
time += delta * playbackSpeed;
if (time >= DURATION) {
time = DURATION;
playing = false;
updatePauseButton();
}
}
updateScene(time);
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
</script>
</body>
</html>
```