Prompt specification
Build or customize the Three.js 3D scene "Missing-information handover puzzle" 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: Missing-information handover puzzle
Category: Art & Culture · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/missing-information-handover-puzzle-x3868
Scene Description Prompt:
Create a fictional garden routine where one task card lacks a location; users inspect labels and previous actions to restore the missing link before completing the handover. Build this with Three.js from cdnjs as a low-poly scene in one self-contained HTML file.
Working Three.js Starter (missing-information-handover-puzzle-x3868):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bramblewake Garden — Morning Handover</title>
<style>
:root {
--ink: #243a31;
--muted: #718078;
--paper: rgba(255, 251, 241, 0.92);
--paper-solid: #fffaf0;
--line: rgba(50, 74, 61, 0.15);
--green: #496b4f;
--green-dark: #304c39;
--sage: #8fa47b;
--gold: #e8b85d;
--coral: #d96f4d;
--blue: #5f9eaa;
--shadow: 0 18px 50px rgba(34, 54, 43, 0.15);
}
* {
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
color: var(--ink);
background: #dce8df;
font-family:
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button,
select {
font: inherit;
}
button {
color: inherit;
}
#scene-container,
#labels-layer {
position: fixed;
inset: 0;
}
#scene-container {
z-index: 0;
}
#scene-container canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
}
#scene-container canvas:active {
cursor: grabbing;
}
#labels-layer {
z-index: 3;
pointer-events: none;
transition: opacity 180ms ease;
}
body.labels-hidden #labels-layer {
opacity: 0;
pointer-events: none;
}
.topbar {
position: fixed;
z-index: 10;
top: 14px;
left: 16px;
right: 16px;
min-height: 66px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 18px;
padding: 10px 12px 10px 18px;
border: 1px solid rgba(255, 255, 255, 0.66);
border-radius: 18px;
background: rgba(255, 251, 241, 0.84);
box-shadow: var(--shadow);
backdrop-filter: blur(16px);
}
.brand {
display: flex;
align-items: center;
gap: 12px;
min-width: 250px;
}
.brand-mark {
position: relative;
width: 42px;
height: 42px;
flex: 0 0 auto;
border-radius: 14px;
background: var(--green-dark);
box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.08);
}
.brand-mark::before,
.brand-mark::after {
content: "";
position: absolute;
left: 11px;
bottom: 9px;
width: 4px;
height: 23px;
border-radius: 4px;
background: #a9bf83;
transform-origin: bottom;
}
.brand-mark::before {
transform: rotate(-27deg);
}
.brand-mark::after {
left: 25px;
height: 19px;
transform: rotate(30deg);
}
.brand h1 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 21px;
font-weight: 600;
letter-spacing: -0.02em;
}
.brand p {
margin: 2px 0 0;
color: var(--muted);
font-size: 11px;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.top-meta {
display: flex;
align-items: center;
justify-content: center;
gap: 14px;
flex: 1;
}
.weather {
color: var(--muted);
font-size: 12px;
white-space: nowrap;
}
.progress-pill {
display: flex;
align-items: center;
gap: 9px;
padding: 8px 12px;
border: 1px solid var(--line);
border-radius: 999px;
background: rgba(255, 255, 255, 0.48);
font-size: 12px;
font-weight: 700;
white-space: nowrap;
}
.progress-dots {
display: flex;
gap: 4px;
}
.progress-dots i {
width: 7px;
height: 7px;
border-radius: 50%;
background: #d8ded5;
}
.progress-dots i.done {
background: var(--green);
}
.top-actions {
display: flex;
align-items: center;
gap: 8px;
}
.button {
min-height: 38px;
border: 1px solid var(--line);
border-radius: 11px;
padding: 8px 13px;
background: rgba(255, 255, 255, 0.66);
cursor: pointer;
font-size: 12px;
font-weight: 750;
transition:
transform 150ms ease,
background 150ms ease,
box-shadow 150ms ease;
}
.button:hover:not(:disabled) {
transform: translateY(-1px);
background: white;
box-shadow: 0 8px 18px rgba(45, 67, 54, 0.1);
}
.button:focus-visible,
select:focus-visible,
.world-label:focus-visible,
.evidence-row:focus-visible {
outline: 3px solid rgba(217, 111, 77, 0.35);
outline-offset: 2px;
}
.button.primary {
border-color: var(--green-dark);
color: white;
background: var(--green-dark);
}
.button.primary:hover:not(:disabled) {
background: #3c6048;
}
.button.gold {
border-color: #d7a345;
color: #4d3812;
background: var(--gold);
}
.button.coral {
border-color: #c65e40;
color: white;
background: var(--coral);
}
.button:disabled {
cursor: not-allowed;
opacity: 0.42;
}
.button.compact {
min-height: 31px;
padding: 6px 10px;
font-size: 11px;
}
.panel {
position: fixed;
z-index: 8;
top: 96px;
bottom: 20px;
overflow: auto;
border: 1px solid rgba(255, 255, 255, 0.68);
border-radius: 20px;
background: var(--paper);
box-shadow: var(--shadow);
backdrop-filter: blur(17px);
scrollbar-width: thin;
scrollbar-color: rgba(50, 74, 61, 0.25) transparent;
}
.task-panel {
left: 16px;
width: 334px;
}
.evidence-panel {
right: 16px;
width: 320px;
}
.panel-inner {
padding: 19px;
}
.eyebrow {
margin: 0 0 6px;
color: var(--coral);
font-size: 10px;
font-weight: 850;
letter-spacing: 0.15em;
text-transform: uppercase;
}
.panel h2 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 25px;
font-weight: 600;
letter-spacing: -0.025em;
}
.panel-intro {
margin: 8px 0 17px;
color: var(--muted);
font-size: 12px;
line-height: 1.55;
}
.handover-note {
display: flex;
gap: 10px;
margin-bottom: 15px;
padding: 11px;
border: 1px solid rgba(232, 184, 93, 0.35);
border-radius: 13px;
background: rgba(232, 184, 93, 0.13);
font-size: 11px;
line-height: 1.45;
}
.handover-note .icon {
color: #a76e17;
font-size: 16px;
line-height: 1;
}
.routine-list {
display: grid;
gap: 9px;
}
.task-card {
position: relative;
overflow: hidden;
padding: 12px;
border: 1px solid var(--line);
border-radius: 14px;
background: rgba(255, 255, 255, 0.52);
}
.task-card::before {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 4px;
background: #cbd4c9;
}
.task-card.complete::before {
background: var(--green);
}
.task-card.missing {
border-color: rgba(217, 111, 77, 0.48);
background: rgba(255, 249, 240, 0.92);
box-shadow: 0 8px 26px rgba(167, 78, 47, 0.09);
}
.task-card.missing::before {
background: var(--coral);
}
.task-card.linked::before {
background: var(--gold);
}
.task-card.finished-missing::before {
background: var(--green);
}
.task-top {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 8px;
}
.task-title {
margin: 0;
font-size: 12px;
font-weight: 800;
line-height: 1.35;
}
.task-code {
display: block;
margin-bottom: 4px;
color: var(--muted);
font-size: 9px;
letter-spacing: 0.11em;
text-transform: uppercase;
}
.status {
flex: 0 0 auto;
padding: 4px 7px;
border-radius: 999px;
color: var(--muted);
background: #edf0e9;
font-size: 9px;
font-weight: 850;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.complete .status,
.finished-missing .status {
color: #31573c;
background: #dfeadd;
}
.missing .status {
color: #a64c31;
background: #f8dfd6;
}
.linked .status {
color: #7b5317;
background: #f7e8bd;
}
.task-location {
display: flex;
align-items: center;
gap: 6px;
margin-top: 7px;
color: var(--muted);
font-size: 10px;
}
.task-location .pin {
font-size: 12px;
}
.location-missing {
color: var(--coral);
font-weight: 800;
}
.missing-tools {
margin-top: 11px;
padding-top: 11px;
border-top: 1px dashed rgba(217, 111, 77, 0.35);
}
.field-label {
display: block;
margin-bottom: 6px;
color: var(--muted);
font-size: 9px;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
select {
width: 100%;
height: 38px;
border: 1px solid var(--line);
border-radius: 10px;
padding: 0 34px 0 10px;
color: var(--ink);
background: rgba(255, 255, 255, 0.78);
font-size: 11px;
cursor: pointer;
}
.tool-row {
display: flex;
gap: 7px;
margin-top: 8px;
}
.tool-row .button {
flex: 1;
}
.verify-box {
margin-top: 10px;
padding: 9px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.55);
}
.verify-title {
margin-bottom: 7px;
color: var(--muted);
font-size: 9px;
line-height: 1.4;
}
.verify-checks {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.check {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 5px 7px;
border: 1px solid var(--line);
border-radius: 999px;
color: var(--muted);
background: white;
font-size: 9px;
font-weight: 800;
}
.check::before {
content: "○";
color: #aab4aa;
}
.check.done {
border-color: rgba(73, 107, 79, 0.24);
color: #31573c;
background: #e4eee1;
}
.check.done::before {
content: "✓";
color: var(--green);
}
.panel-footer {
display: flex;
justify-content: space-between;
gap: 10px;
margin-top: 14px;
padding-top: 13px;
border-top: 1px solid var(--line);
color: var(--muted);
font-size: 10px;
}
.text-button {
border: 0;
padding: 0;
color: var(--green);
background: transparent;
cursor: pointer;
font-size: 10px;
font-weight: 800;
}
.section-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin: 17px 0 8px;
}
.section-head h3 {
margin: 0;
font-size: 11px;
letter-spacing: 0.03em;
}
.section-head span {
color: var(--muted);
font-size: 9px;
}
.evidence-list {
display: grid;
gap: 6px;
}
.evidence-row {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
border: 1px solid transparent;
border-radius: 10px;
padding: 8px 9px;
color: var(--ink);
background: rgba(255, 255, 255, 0.44);
cursor: pointer;
text-align: left;
}
.evidence-row:hover,
.evidence-row.active {
border-color: rgba(73, 107, 79, 0.2);
background: rgba(255, 255, 255, 0.85);
}
.evidence-row strong {
display: block;
font-size: 10px;
}
.evidence-row small {
display: block;
margin-top: 2px;
color: var(--muted);
font-size: 8px;
}
.evidence-arrow {
color: var(--muted);
font-size: 13px;
}
.detail-card {
margin-top: 15px;
padding: 13px;
border: 1px solid var(--line);
border-radius: 14px;
background:
linear-gradient(135deg, rgba(143, 164, 123, 0.1), transparent),
rgba(255, 255, 255, 0.62);
}
.detail-kicker {
margin: 0 0 5px;
color: var(--coral);
font-size: 8px;
font-weight: 850;
letter-spacing: 0.13em;
text-transform: uppercase;
}
.detail-card h4 {
margin: 0 0 6px;
font-family: Georgia, "Times New Roman", serif;
font-size: 17px;
font-weight: 600;
}
.detail-card p {
margin: 0;
color: #607168;
font-size: 10px;
line-height: 1.55;
}
.detail-card .source {
margin-top: 9px;
padding-top: 8px;
border-top: 1px solid var(--line);
color: var(--muted);
font-size: 8px;
font-weight: 750;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.scene-help {
position: fixed;
z-index: 5;
left: 50%;
bottom: 18px;
transform: translateX(-50%);
display: flex;
align-items: center;
gap: 9px;
padding: 8px 12px;
border: 1px solid rgba(255, 255, 255, 0.58);
border-radius: 999px;
color: rgba(36, 58, 49, 0.8);
background: rgba(255, 251, 241, 0.72);
box-shadow: 0 8px 22px rgba(44, 65, 53, 0.1);
backdrop-filter: blur(12px);
font-size: 10px;
white-space: nowrap;
pointer-events: none;
}
.world-label {
position: absolute;
display: flex;
align-items: center;
gap: 6px;
max-width: 150px;
transform: translate(-50%, -100%);
border: 1px solid rgba(255, 255, 255, 0.75);
border-radius: 999px;
padding: 5px 8px 5px 6px;
color: var(--ink);
background: rgba(255, 251, 241, 0.88);
box-shadow: 0 6px 16px rgba(35, 54, 43, 0.15);
cursor: pointer;
pointer-events: auto;
font-size: 9px;
font-weight: 800;
white-space: nowrap;
transition:
transform 150ms ease,
background 150ms ease;
}
.world-label::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
width: 1px;
height: 12px;
background: rgba(48, 76, 57, 0.45);
}
.world-label:hover,
.world-label.active {
z-index: 2;
transform: translate(-50%, -100%) scale(1.04);
color: white;
background: var(--green-dark);
}
.label-dot {
width: 9px;
height: 9px;
flex: 0 0 auto;
border: 2px solid white;
border-radius: 50%;
background: var(--coral);
box-shadow: 0 0 0 1px rgba(48, 76, 57, 0.25);
}
.world-label.active .label-dot {
background: var(--gold);
}
.toast {
position: fixed;
z-index: 30;
left: 50%;
bottom: 58px;
max-width: min(430px, calc(100vw - 30px));
transform: translate(-50%, 20px);
padding: 12px 16px;
border-radius: 12px;
color: white;
background: var(--green-dark);
box-shadow: 0 12px 30px rgba(30, 48, 37, 0.25);
opacity: 0;
pointer-events: none;
font-size: 11px;
font-weight: 700;
line-height: 1.45;
text-align: center;
transition:
opacity 180ms ease,
transform 180ms ease;
}
.toast.show {
opacity: 1;
transform: translate(-50%, 0);
}
.toast.error {
background: #a65036;
}
.modal-backdrop {
position: fixed;
z-index: 50;
inset: 0;
display: grid;
place-items: center;
padding: 20px;
background: rgba(31, 49, 39, 0.48);
backdrop-filter: blur(8px);
opacity: 0;
pointer-events: none;
transition: opacity 180ms ease;
}
.modal-backdrop.open {
opacity: 1;
pointer-events: auto;
}
.modal {
width: min(510px, 100%);
max-height: calc(100vh - 40px);
overflow: auto;
border: 1px solid rgba(255, 255, 255, 0.75);
border-radius: 23px;
padding: 26px;
background: var(--paper-solid);
box-shadow: 0 30px 90px rgba(20, 37, 27, 0.3);
transform: translateY(14px) scale(0.98);
transition: transform 180ms ease;
}
.modal-backdrop.open .modal {
transform: translateY(0) scale(1);
}
.success-seal {
width: 58px;
height: 58px;
display: grid;
place-items: center;
margin-bottom: 15px;
border-radius: 19px;
color: white;
background: var(--green);
box-shadow: 0 10px 20px rgba(48, 76, 57, 0.2);
font-size: 28px;
}
.modal h2 {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
font-size: 31px;
font-weight: 600;
letter-spacing: -0.03em;
}
.modal > p {
margin: 9px 0 18px;
color: var(--muted);
font-size: 12px;
line-height: 1.6;
}
.handover-summary {
display: grid;
gap: 8px;
margin: 18px 0;
padding: 14px;
border: 1px solid var(--line);
border-radius: 14px;
background: #f4f5ed;
}
.summary-row {
display: flex;
justify-content: space-between;
gap: 12px;
font-size: 11px;
}
.summary-row span:first-child {
color: var(--muted);
}
.summary-row.recovered {
padding-top: 8px;
border-top: 1px solid var(--line);
color: var(--green-dark);
font-weight: 800;
}
.modal-actions {
display: flex;
justify-content: flex-end;
gap: 9px;
margin-top: 20px;
}
.evidence-toggle {
display: none;
}
#loading {
position: fixed;
z-index: 100;
inset: 0;
display: grid;
place-items: center;
color: var(--green-dark);
background: #e3eadf;
font-family: Georgia, "Times New Roman", serif;
font-size: 20px;
transition: opacity 300ms ease;
}
#loading.hidden {
opacity: 0;
pointer-events: none;
}
@media (max-width: 1000px) {
.top-meta .weather {
display: none;
}
.task-panel {
width: 306px;
}
.evidence-panel {
width: 294px;
}
.brand {
min-width: auto;
}
}
@media (max-width: 760px) {
.topbar {
top: 8px;
left: 8px;
right: 8px;
gap: 8px;
padding-left: 11px;
}
.brand-mark {
width: 36px;
height: 36px;
}
.brand h1 {
font-size: 16px;
}
.brand p,
.progress-pill .progress-dots,
#labelsToggle {
display: none;
}
.top-actions .button {
min-height: 34px;
padding: 6px 9px;
font-size: 10px;
}
.evidence-toggle {
display: inline-block;
}
.panel {
top: 76px;
bottom: 8px;
}
.task-panel {
left: 8px;
width: calc(50% - 12px);
}
.evidence-panel {
right: 8px;
width: calc(50% - 12px);
}
.panel-inner {
padding: 15px;
}
.scene-help {
display: none;
}
}
@media (max-width: 560px) {
.brand p,
#handoverBtn {
display: none;
}
.brand h1 {
max-width: 128px;
line-height: 1.05;
}
.task-panel {
right: 8px;
width: auto;
max-height: 46vh;
}
.evidence-panel {
display: none;
left: 8px;
top: auto;
width: auto;
height: 61vh;
}
body.evidence-open .task-panel {
display: none;
}
body.evidence-open .evidence-panel {
display: block;
}
.toast {
bottom: 15px;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
transition-duration: 0.01ms !important;
}
}
</style>
</head>
<body>
<div id="loading">Growing the garden…</div>
<div id="scene-container" aria-label="Interactive low-poly garden"></div>
<div id="labels-layer"></div>
<header class="topbar">
<div class="brand">
<div class="brand-mark" aria-hidden="true"></div>
<div>
<h1>Bramblewake Garden</h1>
<p>Morning handover · H-04</p>
</div>
</div>
<div class="top-meta">
<span class="weather">08:20 · Soft breeze · 17°C</span>
<div class="progress-pill" aria-label="Routine progress">
<span id="progressText">4 of 5 prepared</span>
<span class="progress-dots" aria-hidden="true">
<i class="done"></i>
<i class="done"></i>
<i class="done"></i>
<i class="done"></i>
<i id="progressDot5"></i>
</span>
</div>
</div>
<div class="top-actions">
<button class="button" id="labelsToggle" aria-pressed="true">Labels</button>
<button class="button evidence-toggle" id="evidenceToggle">Evidence</button>
<button class="button primary" id="handoverBtn" disabled>Complete handover</button>
</div>
</header>
<aside class="panel task-panel" aria-label="Garden routine cards">
<div class="panel-inner">
<p class="eyebrow">Routine H-04</p>
<h2>Morning garden loop</h2>
<p class="panel-intro">
Pip is handing the garden to Noor. One card was damaged overnight and its
location link is missing.
</p>
<div class="handover-note">
<span class="icon">✦</span>
<span>
Inspect the garden labels and Pip’s previous actions before restoring
the blank link.
</span>
</div>
<div class="routine-list">
<article class="task-card complete">
<div class="task-top">
<div>
<span class="task-code">H-01</span>
<h3 class="task-title">Refill the birdbath</h3>
</div>
<span class="status">Done</span>
</div>
<div class="task-location"><span class="pin">⌖</span> Willow Basin</div>
</article>
<article class="task-card complete">
<div class="task-top">
<div>
<span class="task-code">H-02</span>
<h3 class="task-title">Tie back the rosemary</h3>
</div>
<span class="status">Done</span>
</div>
<div class="task-location"><span class="pin">⌖</span> Rosemary Bed</div>
</article>
<article class="task-card complete">
<div class="task-top">
<div>
<span class="task-code">H-03</span>
<h3 class="task-title">Empty the compost caddy</h3>
</div>
<span class="status">Done</span>
</div>
<div class="task-location"><span class="pin">⌖</span> Compost Yard</div>
</article>
<article class="task-card missing" id="missingCard">
<div class="task-top">
<div>
<span class="task-code">H-04 · Damaged card</span>
<h3 class="task-title">Sweep the greenhouse threshold</h3>
</div>
<span class="status" id="missingStatus">Link needed</span>
</div>
<div class="task-location">
<span class="pin">⌖</span>
<span class="location-missing" id="locationStatus">Location field is blank</span>
</div>
<div class="missing-tools" id="missingTools">
<label class="field-label" for="locationSelect">Restore the location</label>
<select id="locationSelect">
<option value="">Choose a garden location…</option>
<option value="Glasshouse South Door">Glasshouse South Door</option>
<option value="Rosemary Bed">Rosemary Bed</option>
<option value="Compost Yard">Compost Yard</option>
<option value="Willow Basin">Willow Basin</option>
<option value="South Gate">South Gate</option>
</select>
<div class="tool-row">
<button class="button coral" id="linkBtn">Restore link</button>
<button class="button" id="scanBtn">Scan labels</button>
</div>
<div class="verify-box">
<div class="verify-title">
Verify the restored link against both evidence sources:
</div>
<div class="verify-checks">
<span class="check" id="labelCheck">Wall-hook label</span>
<span class="check" id="actionCheck">Action P-18</span>
</div>
</div>
<div class="tool-row">
<button class="button primary" id="completeCardBtn" hidden>
Mark card complete
</button>
</div>
</div>
</article>
<article class="task-card complete">
<div class="task-top">
<div>
<span class="task-code">H-05</span>
<h3 class="task-title">Close the garden gate</h3>
</div>
<span class="status">Done</span>
</div>
<div class="task-location"><span class="pin">⌖</span> South Gate</div>
</article>
</div>
<div class="panel-footer">
<span>Signed in by Pip</span>
<button class="text-button" id="resetBtn">Reset routine</button>
</div>
</div>
</aside>
<aside class="panel evidence-panel" aria-label="Garden evidence">
<div class="panel-inner">
<p class="eyebrow">Evidence desk</p>
<h2>Read the garden</h2>
<p class="panel-intro">
Labels identify places and objects. Previous actions explain how the
gardener normally uses them.
</p>
<div class="section-head">
<h3>World labels</h3>
<span>Tap to inspect</span>
</div>
<div class="evidence-list" id="labelList"></div>
<div class="section-head">
<h3>Previous actions</h3>
<span>Pip’s log</span>
</div>
<div class="evidence-list" id="actionList"></div>
<section class="detail-card" id="evidenceDetail" aria-live="polite">
<p class="detail-kicker">Nothing inspected</p>
<h4>Choose a source</h4>
<p>
Inspect the wall hook near the glasshouse, then open action P-18.
</p>
<div class="source">Evidence record will appear here</div>
</section>
</div>
</aside>
<div class="scene-help">
<span>Drag to orbit</span><span>·</span><span>Scroll to zoom</span><span>·</span>
<span>Tap a label</span><span>·</span><span>Double-click to reset</span>
</div>
<div class="toast" id="toast" role="status" aria-live="polite"></div>
<div class="modal-backdrop" id="modalBackdrop" role="dialog" aria-modal="true" aria-labelledby="modalTitle">
<div class="modal">
<div class="success-seal" aria-hidden="true">✓</div>
<p class="eyebrow">Handover accepted</p>
<h2 id="modalTitle">The garden is ready.</h2>
<p>
Noor has received all five routine cards. The missing location was
recovered from the garden’s label and Pip’s previous action.
</p>
<div class="handover-summary">
<div class="summary-row">
<span>Routine</span>
<strong>H-04 · Morning garden loop</strong>
</div>
<div class="summary-row">
<span>Prepared by</span>
<strong>Pip</strong>
</div>
<div class="summary-row">
<span>Accepted by</span>
<strong>Noor</strong>
</div>
<div class="summary-row recovered">
<span>Recovered link</span>
<strong>Glasshouse South Door</strong>
</div>
</div>
<div class="modal-actions">
<button class="button" id="resetModalBtn">Start over</button>
<button class="button primary" id="downloadBtn">Download handover</button>
</div>
</div>
</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
// -------------------------------------------------------------------------
// State and content
// -------------------------------------------------------------------------
const CORRECT_LOCATION = "Glasshouse South Door";
const state = {
inspectedLabels: new Set(),
inspectedActions: new Set(),
candidate: "",
linked: false,
completedMissing: false,
handedOver: false,
showLabels: true,
lastEvidence: null
};
const labelData = {
hook: {
title: "Glasshouse Wall Hook",
short: "Wall hook",
kicker: "World label · H-04 clue",
anchor: [5.55, 2.05, 0.25],
text:
"Green-handled broom. The hook is fixed to the outer wall at the " +
"Glasshouse South Door. Threshold sweeps are recorded from this anchor."
},
bench: {
title: "Glasshouse Potting Bench",
short: "Potting bench",
kicker: "World label",
anchor: [4.0, 1.65, -1.25],
text:
"A cedar bench for seed trays, small pots, and the routine brush. " +
"It sits inside the glasshouse, opposite the south entrance."
},
rosemary: {
title: "Rosemary Bed",
short: "Rosemary bed",
kicker: "World label",
anchor: [-3.0, 1.0, 3.0],
text:
"Silver-green rosemary, clipped after flowering. The bed is used for " +
"culinary herbs and is not connected to the glasshouse."
},
compost: {
title: "Compost Yard",
short: "Compost yard",
kicker: "World label",
anchor: [6.0, 1.35, 5.0],
text:
"Three timber compost bays behind the shed. Only garden waste and " +
"finished compost are stored here."
},
basin: {
title: "Willow Basin",
short: "Willow basin",
kicker: "World label",
anchor: [-7.0, 0.7, 4.0],
text:
"A shallow stone basin fed by the old rain pipe. It is checked for " +
"water clarity at the start of every routine."
},
gate: {
title: "South Gate",
short: "South gate",
kicker: "World label",
anchor: [0.0, 1.75, 7.15],
text:
"The visitor entrance at the south end of the main path. The latch is " +
"checked after the final outdoor task."
}
};
const actionData = {
"P-17": {
title: "Rosemary ties refreshed",
summary: "07:42 · Rosemary bed",
kicker: "Previous action · P-17",
text:
"Tied the rosemary into three loose bundles and replaced a frayed " +
"length of garden twine beside the bed."
},
"P-18": {
title: "Potting bench cleared",
summary: "08:15 · Tool return",
kicker: "Previous action · P-18",
text:
"After sweeping soil from the potting bench, the small green-handled " +
"broom was returned to its wall hook. The same broom is reserved for " +
"the glasshouse threshold."
},
"P-19": {
title: "Willow Basin topped up",
summary: "08:32 · Basin checked",
kicker: "Previous action · P-19",
text:
"Rinsed the birdbath, replaced the water, and checked that the stone " +
"basin was draining into the narrow side channel."
}
};
const $ = (selector) => document.querySelector(selector);
const labelList = $("#labelList");
const actionList = $("#actionList");
const detail = $("#evidenceDetail");
const toast = $("#toast");
let toastTimer;
function showToast(message, error = false) {
toast.textContent = message;
toast.classList.toggle("error", error);
toast.classList.add("show");
clearTimeout(toastTimer);
toastTimer = setTimeout(() => toast.classList.remove("show"), 3400);
}
function renderEvidenceLists() {
Object.entries(labelData).forEach(([id, item]) => {
const button = document.createElement("button");
button.className = "evidence-row";
button.dataset.label = id;
button.innerHTML = `
<span>
<strong>${item.title}</strong>
<small>${item.short}</small>
</span>
<span class="evidence-arrow">›</span>
`;
button.addEventListener("click", () => inspectLabel(id));
labelList.append(button);
});
Object.entries(actionData).forEach(([id, item]) => {
const button = document.createElement("button");
button.className = "evidence-row";
button.dataset.action = id;
button.innerHTML = `
<span>
<strong>${item.title}</strong>
<small>${item.summary}</small>
</span>
<span class="evidence-arrow">›</span>
`;
button.addEventListener("click", () => inspectAction(id));
actionList.append(button);
});
}
function setDetail(kicker, title, text, source) {
detail.innerHTML = `
<p class="detail-kicker">${kicker}</p>
<h4>${title}</h4>
<p>${text}</p>
<div class="source">${source}</div>
`;
}
function inspectLabel(id) {
const item = labelData[id];
if (!item) return;
state.inspectedLabels.add(id);
state.lastEvidence = { type: "label", id };
setDetail(
item.kicker,
item.title,
item.text,
`Inspected ${new Date().toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })} · Garden label`
);
document.querySelectorAll("[data-label]").forEach((button) => {
button.classList.toggle("active", button.dataset.label === id);
});
focusOn(item.anchor);
updateEvidenceChecks();
if (id === "hook") {
showToast("Wall-hook label inspected. The location is now identified.");
}
}
function inspectAction(id) {
const item = actionData[id];
if (!item) return;
state.inspectedActions.add(id);
state.lastEvidence = { type: "action", id };
setDetail(
item.kicker,
item.title,
item.text,
`Pip’s log · ${id}`
);
document.querySelectorAll("[data-action]").forEach((button) => {
button.classList.toggle("active", button.dataset.action === id);
});
updateEvidenceChecks();
if (id === "P-18") {
showToast("Action P-18 inspected. The broom’s wall hook matches the card.");
}
}
function updateEvidenceChecks() {
const labelDone = state.inspectedLabels.has("hook");
const actionDone = state.inspectedActions.has("P-18");
$("#labelCheck").classList.toggle("done", labelDone);
$("#actionCheck").classList.toggle("done", actionDone);
}
function updateProgress() {
const complete = 4 + (state.completedMissing ? 1 : 0);
$("#progressText").textContent = `${complete} of 5 prepared`;
$("#progressDot5").classList.toggle("done", state.completedMissing);
$("#handoverBtn").disabled = !state.completedMissing || state.handedOver;
}
function restoreLink() {
if (state.linked) return;
if (!state.candidate) {
showToast("Choose the location that should fill the blank field.", true);
return;
}
if (state.candidate !== CORRECT_LOCATION) {
showToast(
"That location does not match the broom and threshold evidence.",
true
);
return;
}
const labelDone = state.inspectedLabels.has("hook");
const actionDone = state.inspectedActions.has("P-18");
if (!labelDone || !actionDone) {
const missing = [];
if (!labelDone) missing.push("the wall-hook label");
if (!actionDone) missing.push("action P-18");
showToast(
`The match looks right. Inspect ${missing.join(" and ")} to verify it.`,
true
);
return;
}
state.linked = true;
$("#missingCard").classList.remove("missing");
$("#missingCard").classList.add("linked");
$("#missingStatus").textContent = "Link restored";
$("#locationStatus").textContent = CORRECT_LOCATION;
$("#locationSelect").value = CORRECT_LOCATION;
$("#locationSelect").disabled = true;
$("#linkBtn").hidden = true;
$("#scanBtn").hidden = true;
$("#completeCardBtn").hidden = false;
setDetail(
"Link verified",
"Location restored",
"The wall-hook label identifies the outer glasshouse door, and action " +
"P-18 confirms that the green-handled broom is returned there.",
"H-04 · Two-source match"
);
showToast("Location restored. The card can now be completed.");
}
function completeMissingCard() {
if (!state.linked) return;
state.completedMissing = true;
$("#missingCard").classList.remove("linked");
$("#missingCard").classList.add("finished-missing");
$("#missingStatus").textContent = "Done";
$("#completeCardBtn").hidden = true;
updateProgress();
showToast("All five cards are prepared. Handover is ready.");
}
function resetRoutine() {
state.inspectedLabels.clear();
state.inspectedActions.clear();
state.candidate = "";
state.linked = false;
state.completedMissing = false;
state.handedOver = false;
$("#missingCard").className = "task-card missing";
$("#missingStatus").textContent = "Link needed";
$("#locationStatus").textContent = "Location field is blank";
$("#locationStatus").classList.add("location-missing");
$("#locationSelect").value = "";
$("#locationSelect").disabled = false;
$("#linkBtn").hidden = false;
$("#scanBtn").hidden = false;
$("#completeCardBtn").hidden = true;
$("#handoverBtn").disabled = true;
$("#handoverBtn").textContent = "Complete handover";
document.querySelectorAll(".evidence-row").forEach((button) => {
button.classList.remove("active");
});
updateEvidenceChecks();
updateProgress();
closeModal();
resetCamera();
setDetail(
"Nothing inspected",
"Choose a source",
"Inspect the wall hook near the glasshouse, then open action P-18.",
"Evidence record will appear here"
);
}
function openModal() {
if (!state.completedMissing || state.handedOver) return;
state.handedOver = true;
$("#handoverBtn").textContent = "Handover accepted";
updateProgress();
$("#modalBackdrop").classList.add("open");
}
function closeModal() {
$("#modalBackdrop").classList.remove("open");
}
function downloadHandover() {
const lines = [
"BRAMBLEWAKE COMMUNITY GARDEN",
"MORNING GARDEN HANDOVER — ROUTINE H-04",
"",
"Routine: Morning garden loop",
"Prepared by: Pip",
"Accepted by: Noor",
"Status: Complete",
"",
"Tasks:",
"H-01 Refill the birdbath — Willow Basin — Done",
"H-02 Tie back the rosemary — Rosemary Bed — Done",
"H-03 Empty the compost caddy — Compost Yard — Done",
"H-04 Sweep the greenhouse threshold — Glasshouse South Door — Done",
"H-05 Close the garden gate — South Gate — Done",
"",
"Recovered link: Glasshouse South Door",
"Evidence checked: Glasshouse Wall Hook label; previous action P-18",
"",
"Handover accepted."
];
const blob = new Blob([lines.join("\n")], { type: "text/plain" });
const url = URL.createObjectURL(blob);
const anchor = document.createElement("a");
anchor.href = url;
anchor.download = "bramblewake-handover-H-04.txt";
document.body.append(anchor);
anchor.click();
anchor.remove();
setTimeout(() => URL.revokeObjectURL(url), 1000);
}
renderEvidenceLists();
$("#locationSelect").addEventListener("change", (event) => {
state.candidate = event.target.value;
});
$("#linkBtn").addEventListener("click", restoreLink);
$("#completeCardBtn").addEventListener("click", completeMissingCard);
$("#scanBtn").addEventListener("click", () => {
state.showLabels = true;
document.body.classList.remove("labels-hidden");
$("#labelsToggle").setAttribute("aria-pressed", "true");
showToast("All garden labels are visible. Look for the wall hook.");
});
$("#labelsToggle").addEventListener("click", () => {
state.showLabels = !state.showLabels;
document.body.classList.toggle("labels-hidden", !state.showLabels);
$("#labelsToggle").setAttribute("aria-pressed", String(state.showLabels));
});
$("#evidenceToggle").addEventListener("click", () => {
document.body.classList.toggle("evidence-open");
});
$("#handoverBtn").addEventListener("click", openModal);
$("#resetBtn").addEventListener("click", resetRoutine);
$("#resetModalBtn").addEventListener("click", resetRoutine);
$("#downloadBtn").addEventListener("click", downloadHandover);
$("#modalBackdrop").addEventListener("click", (event) => {
if (event.target === $("#modalBackdrop")) closeModal();
});
document.addEventListener("keydown", (event) => {
if (event.key === "Escape") closeModal();
});
// -------------------------------------------------------------------------
// Three.js scene
// -------------------------------------------------------------------------
const container = $("#scene-container");
const scene = new THREE.Scene();
scene.background = new THREE.Color(0xdce8df);
scene.fog = new THREE.Fog(0xdce8df, 24, 43);
const camera = new THREE.PerspectiveCamera(
38,
window.innerWidth / window.innerHeight,
0.1,
100
);
const renderer = new THREE.WebGLRenderer({
antialias: true,
alpha: false,
powerPreference: "high-performance"
});
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.08;
container.append(renderer.domElement);
const hemisphere = new THREE.HemisphereLight(0xf7f3d9, 0x59705c, 2.1);
scene.add(hemisphere);
const sun = new THREE.DirectionalLight(0xffe5ad, 3.3);
sun.position.set(-9, 16, 10);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -18;
sun.shadow.camera.right = 18;
sun.shadow.camera.top = 18;
sun.shadow.camera.bottom = -18;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 45;
sun.shadow.bias = -0.00025;
scene.add(sun);
const materials = {
grass: new THREE.MeshStandardMaterial({
color: 0x8fa36f,
roughness: 1,
flatShading: true
}),
grassDark: new THREE.MeshStandardMaterial({
color: 0x718c5e,
roughness: 1,
flatShading: true
}),
path: new THREE.MeshStandardMaterial({
color: 0xd6c59c,
roughness: 1,
flatShading: true
}),
stone: new THREE.MeshStandardMaterial({
color: 0x9a9e8c,
roughness: 1,
flatShading: true
}),
stoneLight: new THREE.MeshStandardMaterial({
color: 0xc4c3ac,
roughness: 1,
flatShading: true
}),
soil: new THREE.MeshStandardMaterial({
color: 0x6f5038,
roughness: 1,
flatShading: true
}),
timber: new THREE.MeshStandardMaterial({
color: 0x9a6d45,
roughness: 0.95,
flatShading: true
}),
timberDark: new THREE.MeshStandardMaterial({
color: 0x674b34,
roughness: 1,
flatShading: true
}),
cream: new THREE.MeshStandardMaterial({
color: 0xeee4ca,
roughness: 0.9,
flatShading: true
}),
roof: new THREE.MeshStandardMaterial({
color: 0xb85f49,
roughness: 0.9,
flatShading: true
}),
frame: new THREE.MeshStandardMaterial({
color: 0x6f8f7d,
roughness: 0.8,
flatShading: true
}),
glass: new THREE.MeshStandardMaterial({
color: 0xb9e2dc,
roughness: 0.25,
metalness: 0,
transparent: true,
opacity: 0.28,
depthWrite: false,
side: THREE.DoubleSide
}),
water: new THREE.MeshStandardMaterial({
color: 0x68aeb9,
roughness: 0.24,
metalness: 0.05,
transparent: true,
opacity: 0.88,
flatShading: true
}),
foliage: new THREE.MeshStandardMaterial({
color: 0x587b55,
roughness: 1,
flatShading: true
}),
foliageLight: new THREE.MeshStandardMaterial({
color: 0x79945e,
roughness: 1,
flatShading: true
}),
foliageDark: new THREE.MeshStandardMaterial({
color: 0x3e6246,
roughness: 1,
flatShading: true
}),
rosemary: new THREE.MeshStandardMaterial({
color: 0x78937c,
roughness: 1,
flatShading: true
}),
broom: new THREE.MeshStandardMaterial({
color: 0x3f7d57,
roughness: 0.9,
flatShading: true
}),
straw: new THREE.MeshStandardMaterial({
color: 0xc79b58,
roughness: 1,
flatShading: true
}),
flowerPink: new THREE.MeshStandardMaterial({
color: 0xd98183,
roughness: 0.9,
flatShading: true
}),
flowerYellow: new THREE.MeshStandardMaterial({
color: 0xe5bd55,
roughness: 0.9,
flatShading: true
}),
white: new THREE.MeshStandardMaterial({
color: 0xf4f0df,
roughness: 1,
flatShading: true
}),
dark: new THREE.MeshStandardMaterial({
color: 0x35473d,
roughness: 0.9,
flatShading: true
})
};
function box(parent, w, h, d, x, y, z, material, castShadow = true) {
const mesh = new THREE.Mesh(new THREE.BoxGeometry(w, h, d), material);
mesh.position.set(x, y, z);
mesh.castShadow = castShadow;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function cylinder(
parent,
topRadius,
bottomRadius,
height,
segments,
x,
y,
z,
material,
castShadow = true
) {
const mesh = new THREE.Mesh(
new THREE.CylinderGeometry(
topRadius,
bottomRadius,
height,
segments
),
material
);
mesh.position.set(x, y, z);
mesh.castShadow = castShadow;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
function icosahedron(parent, radius, x, y, z, material, detail = 0) {
const mesh = new THREE.Mesh(
new THREE.IcosahedronGeometry(radius, detail),
material
);
mesh.position.set(x, y, z);
mesh.castShadow = true;
mesh.receiveShadow = true;
parent.add(mesh);
return mesh;
}
const clickableMeshes = [];
function registerInspectable(group, id) {
group.traverse((child) => {
if (child.isMesh) {
child.userData.inspectId = id;
clickableMeshes.push(child);
}
});
}
// Raised low-poly garden island.
const island = cylinder(
scene,
13.8,
14.2,
0.65,
14,
0,
-0.38,
0,
materials.grass
);
island.receiveShadow = true;
// Main and cross paths.
box(scene, 2.5, 0.07, 15, 0, 0.025, 1.5, materials.path, false);
box(scene, 13.5, 0.07, 1.7, -1.2, 0.026, 1.0, materials.path, false);
box(scene, 7.5, 0.07, 1.4, -6.3, 0.028, 3.8, materials.path, false);
// Irregular stepping stones.
const stonePositions = [
[-0.3, 7.4],
[0.3, 6.2],
[-0.35, 5.0],
[0.4, 3.9],
[-0.2, 2.8],
[0.3, 1.6]
];
stonePositions.forEach(([x, z], index) => {
const stone = cylinder(
scene,
0.52,
0.56,
0.11,
6,
x,
0.105,
z,
index % 2 ? materials.stoneLight : materials.stone
);
stone.rotation.y = index * 0.41;
});
// A small timber cottage.
const house = new THREE.Group();
house.position.set(-7.2, 0, -5.0);
scene.add(house);
box(house, 5.0, 3.2, 3.8, 0, 1.6, 0, materials.cream);
box(house, 5.25, 0.18, 4.05, 0, 0.12, 0, materials.stone);
const roof = new THREE.Mesh(
new THREE.ConeGeometry(3.85, 1.8, 4),
materials.roof
);
roof.position.set(0, 3.95, 0);
roof.rotation.y = Math.PI / 4;
roof.scale.z = 0.78;
roof.castShadow = true;
house.add(roof);
box(house, 0.85, 1.8, 0.12, 0.35, 0.9, 1.95, materials.timberDark);
box(house, 0.85, 0.85, 0.12, -1.45, 1.85, 1.95, materials.dark);
box(house, 0.85, 0.85, 0.12, 1.45, 1.85, 1.95, materials.dark);
box(house, 0.95, 0.12, 0.13, 1.45, 1.85, 2.02, materials.frame);
cylinder(house, 0.22, 0.28, 1.4, 6, -1.8, 4.1, -0.5, materials.stone);
// Glasshouse.
const greenhouse = new THREE.Group();
greenhouse.position.set(4.0, 0, -2.0);
scene.add(greenhouse);
box(greenhouse, 4.5, 0.16, 4.1, 0, 0.08, 0, materials.stone, false);
// Transparent walls.
box(greenhouse, 0.08, 2.8, 4.0, -2.2, 1.55, 0, materials.glass, false);
box(greenhouse, 0.08, 2.8, 4.0, 2.2, 1.55, 0, materials.glass, false);
box(greenhouse, 4.4, 2.8, 0.08, 0, 1.55, -2.0, materials.glass, false);
box(greenhouse, 0.9, 2.8, 0.08, -1.65, 1.55, 2.0, materials.glass, false);
box(greenhouse, 0.9, 2.8, 0.08, 1.65, 1.55, 2.0, materials.glass, false);
// Frame.
[-2.2, 0, 2.2].forEach((x) => {
box(greenhouse, 0.09, 3.0, 0.09, x, 1.55, 2.02, materials.frame);
box(greenhouse, 0.09, 3.0, 0.09, x, 1.55, -2.02, materials.frame);
});
[-2.0, 0, 2.0].forEach((z) => {
box(greenhouse, 4.5, 0.09, 0.09, 0, 3.0, z, materials.frame);
box(greenhouse, 4.5, 0.09, 0.09, 0, 0.17, z, materials.frame);
});
[-2.2, 2.2].forEach((x) => {
[-2.0, 2.0].forEach((z) => {
box(greenhouse, 0.09, 3.0, 0.09, x, 1.55, z, materials.frame);
});
});
// Gable roof panels.
const roofLeft = box(
greenhouse,
2.75,
0.08,
4.2,
-1.1,
3.38,
0,
materials.glass,
false
);
roofLeft.rotation.z = 0.61;
const roofRight = box(
greenhouse,
2.75,
0.08,
4.2,
1.1,
3.38,
0,
materials.glass,
false
);
roofRight.rotation.z = -0.61;
box(greenhouse, 0.09, 0.09, 4.3, 0, 4.25, 0, materials.frame);
// South-facing door.
const doorGroup = new THREE.Group();
greenhouse.add(doorGroup);
box(doorGroup, 0.08, 2.6, 0.10, -0.75, 1.4, 2.05, materials.frame);
box(doorGroup, 0.08, 2.6, 0.10, 0.75, 1.4, 2.05, materials.frame);
box(doorGroup, 1.6, 0.08, 0.10, 0, 2.72, 2.05, materials.frame);
box(doorGroup, 1.4, 2.4, 0.06, 0, 1.3, 2.02, materials.glass, false);
box(doorGroup, 0.08, 0.35, 0.10, 0.48, 1.25, 2.12, materials.frame);
// Wall hook and the small green broom.
const hookGroup = new THREE.Group();
greenhouse.add(hookGroup);
box(hookGroup, 0.13, 0.13, 0.22, 1.55, 1.42, 2.10, materials.dark);
const broomHandle = cylinder(
hookGroup,
0.045,
0.045,
1.35,
6,
1.55,
0.92,
2.16,
materials.broom
);
broomHandle.rotation.z = -0.08;
box(hookGroup, 0.52, 0.20, 0.24, 1.59, 0.25, 2.16, materials.straw);
// Potting bench and trays.
const benchGroup = new THREE.Group();
greenhouse.add(benchGroup);
box(benchGroup, 2.5, 0.14, 0.8, 0, 0.95, -1.05, materials.timber);
box(benchGroup, 0.13, 0.95, 0.65, -1.05, 0.48, -1.05, materials.timberDark);
box(benchGroup, 0.13, 0.95, 0.65, 1.05, 0.48, -1.05, materials.timberDark);
box(benchGroup, 0.65, 0.18, 0.45, -0.55, 1.11, -1.05, materials.soil);
box(benchGroup, 0.65, 0.18, 0.45, 0.35, 1.11, -1.05, materials.soil);
cylinder(benchGroup, 0.19, 0.14, 0.25, 6, 0.85, 1.12, -1.05, materials.roof);
registerInspectable(doorGroup, "hook");
registerInspectable(hookGroup, "hook");
registerInspectable(benchGroup, "bench");
// Rosemary bed.
const rosemaryGroup = new THREE.Group();
rosemaryGroup.position.set(-3.0, 0, 3.0);
scene.add(rosemaryGroup);
box(rosemaryGroup, 3.1, 0.42, 1.55, 0, 0.22, 0, materials.timberDark);
box(rosemaryGroup, 2.85, 0.16, 1.3, 0, 0.45, 0, materials.soil);
for (let row = 0; row < 2; row++) {
for (let column = 0; column < 5; column++) {
const x = -1.05 + column * 0.52;
const z = row === 0 ? -0.32 : 0.32;
cylinder(rosemaryGroup, 0.06, 0.08, 0.65, 5, x, 0.75, z, materials.rosemary);
const shrub = icosahedron(
rosemaryGroup,
0.25,
x,
1.05,
z,
materials.rosemary
);
shrub.scale.y = 0.85;
}
}
registerInspectable(rosemaryGroup, "rosemary");
// Compost bays.
const compostGroup = new THREE.Group();
compostGroup.position.set(6.0, 0, 5.0);
scene.add(compostGroup);
for (let i = 0; i < 3; i++) {
const x = (i - 1) * 1.45;
box(compostGroup, 1.25, 1.1, 1.25, x, 0.55, 0, materials.timberDark);
box(compostGroup, 1.35, 0.14, 1.35, x, 1.18, 0, materials.timber);
box(compostGroup, 1.17, 0.08, 1.16, x, 1.28, 0, materials.soil);
box(compostGroup, 0.12, 1.25, 0.12, x - 0.64, 0.63, 0.65, materials.timber);
box(compostGroup, 0.12, 1.25, 0.12, x + 0.64, 0.63, 0.65, materials.timber);
}
registerInspectable(compostGroup, "compost");
// Willow Basin pond.
const pondGroup = new THREE.Group();
pondGroup.position.set(-7.0, 0, 4.0);
scene.add(pondGroup);
const bank = new THREE.Mesh(
new THREE.TorusGeometry(2.05, 0.23, 4, 14),
materials.stone
);
bank.rotation.x = Math.PI / 2;
bank.position.y = 0.14;
bank.castShadow = true;
pondGroup.add(bank);
const water = cylinder(
pondGroup,
1.85,
1.85,
0.12,
14,
0,
0.14,
0,
materials.water,
false
);
for (let i = 0; i < 9; i++) {
const angle = (i / 9) * Math.PI * 2;
const stone = icosahedron(
pondGroup,
0.28 + (i % 3) * 0.04,
Math.cos(angle) * 1.82,
0.28,
Math.sin(angle) * 1.82,
i % 2 ? materials.stoneLight : materials.stone
);
stone.scale.y = 0.65;
}
const birdbath = new THREE.Group();
birdbath.position.set(-6.1, 0, 5.4);
scene.add(birdbath);
cylinder(birdbath, 0.14, 0.22, 0.85, 8, 0, 0.43, 0, materials.stone);
cylinder(birdbath, 0.52, 0.38, 0.15, 10, 0, 0.92, 0, materials.stoneLight);
cylinder(birdbath, 0.4, 0.4, 0.03, 10, 0, 1.01, 0, materials.water, false);
registerInspectable(pondGroup, "basin");
registerInspectable(birdbath, "basin");
// South gate and fence.
const gateGroup = new THREE.Group();
gateGroup.position.set(0, 0, 7.2);
scene.add(gateGroup);
box(gateGroup, 0.22, 1.8, 0.22, -1.35, 0.9, 0, materials.timberDark);
box(gateGroup, 0.22, 1.8, 0.22, 1.35, 0.9, 0, materials.timberDark);
box(gateGroup, 2.9, 0.18, 0.16, 0, 1.62, 0, materials.timber);
box(gateGroup, 2.9, 0.14, 0.14, 0, 0.35, 0, materials.timber);
for (let i = 0; i < 7; i++) {
box(gateGroup, 0.1, 1.1, 0.1, -1.15 + i * 0.38, 0.9, 0, materials.timber);
}
registerInspectable(gateGroup, "gate");
// Garden shed.
const shed = new THREE.Group();
shed.position.set(8.4, 0, -4.4);
scene.add(shed);
box(shed, 3.2, 2.3, 2.5, 0, 1.15, 0, materials.timber);
const shedRoof = new THREE.Mesh(
new THREE.ConeGeometry(2.45, 1.25, 4),
materials.roof
);
shedRoof.position.y = 2.75;
shedRoof.rotation.y = Math.PI / 4;
shedRoof.scale.z = 0.82;
shedRoof.castShadow = true;
shed.add(shedRoof);
box(shed, 0.85, 1.6, 0.1, 0, 0.8, 1.3, materials.timberDark);
// Perimeter fence.
for (let x = -11; x <= 11; x += 1.5) {
box(scene, 0.12, 1.0, 0.12, x, 0.5, -7.3, materials.timber);
}
box(scene, 22.3, 0.1, 0.1, 0, 0.78, -7.3, materials.timber);
box(scene, 22.3, 0.1, 0.1, 0, 0.38, -7.3, materials.timber);
// Willow-like tree.
const tree = new THREE.Group();
tree.position.set(-9.1, 0, -0.3);
scene.add(tree);
cylinder(tree, 0.34, 0.52, 3.7, 6, 0, 1.85, 0, materials.timberDark);
icosahedron(tree, 1.9, 0, 4.3, 0, materials.foliage);
icosahedron(tree, 1.35, -1.0, 3.65, 0.2, materials.foliageDark);
icosahedron(tree, 1.3, 1.05, 3.7, -0.1, materials.foliageLight);
// Bushes and flowers.
const flowerColors = [materials.flowerPink, materials.flowerYellow, materials.flowerPink];
[
[-10.1, 5.8],
[-5.1, 6.0],
[2.7, 5.5],
[8.7, 2.7],
[10.1, -1.4],
[-10.2, -2.8]
].forEach(([x, z], bushIndex) => {
const bush = icosahedron(
scene,
0.65 + (bushIndex % 2) * 0.12,
x,
0.62,
z,
bushIndex % 2 ? materials.foliageLight : materials.foliageDark
);
bush.scale.y = 0.8;
});
for (let i = 0; i < 22; i++) {
const x = -10.5 + (i * 1.37) % 21;
const z = i % 2 === 0 ? 5.6 + (i % 3) * 0.22 : -6.2 - (i % 2) * 0.3;
cylinder(scene, 0.025, 0.035, 0.42, 5, x, 0.25, z, materials.foliageDark, false);
const bloom = icosahedron(
scene,
0.11,
x,
0.49,
z,
flowerColors[i % flowerColors.length]
);
bloom.scale.y = 0.65;
}
// A wheelbarrow.
const barrow = new THREE.Group();
barrow.position.set(-1.3, 0, -1.6);
scene.add(barrow);
const barrowBody = box(
barrow,
1.15,
0.5,
0.8,
0,
0.65,
0,
materials.coral
);
barrowBody.rotation.x = -0.08;
box(barrow, 0.1, 0.1, 1.45, -0.35, 0.5, -0.9, materials.timberDark);
box(barrow, 0.1, 0.1, 1.45, 0.35, 0.5, -0.9, materials.timberDark);
const wheel = cylinder(
barrow,
0.32,
0.32,
0.16,
10,
0,
0.34,
0.48,
materials.dark
);
wheel.rotation.z = Math.PI / 2;
// Soft clouds.
const clouds = [];
[
[-8, 8.8, -6],
[4, 9.3, -9],
[10, 7.7, 3]
].forEach(([x, y, z], index) => {
const cloud = new THREE.Group();
cloud.position.set(x, y, z);
cloud.userData.baseX = x;
cloud.userData.speed = 0.08 + index * 0.025;
scene.add(cloud);
[
[-0.8, 0, 0, 0.65],
[0, 0.12, 0, 0.85],
[0.85, 0, 0, 0.58]
].forEach(([cx, cy, cz, size]) => {
const puff = icosahedron(cloud, size, cx, cy, cz, materials.white);
puff.scale.y = 0.62;
});
clouds.push(cloud);
});
// Selection marker.
const selectionMarker = new THREE.Group();
selectionMarker.visible = false;
scene.add(selectionMarker);
const markerMaterial = new THREE.MeshStandardMaterial({
color: 0xe8b85d,
emissive: 0xa56d18,
emissiveIntensity: 0.32,
roughness: 0.55
});
const markerRing = new THREE.Mesh(
new THREE.TorusGeometry(0.38, 0.055, 5, 18),
markerMaterial
);
selectionMarker.add(markerRing);
const markerCore = new THREE.Mesh(
new THREE.IcosahedronGeometry(0.13, 0),
markerMaterial
);
selectionMarker.add(markerCore);
// -------------------------------------------------------------------------
// HTML world labels
// -------------------------------------------------------------------------
const labelElements = new Map();
Object.entries(labelData).forEach(([id, item]) => {
const button = document.createElement("button");
button.className = "world-label";
button.dataset.label = id;
button.setAttribute("aria-label", `Inspect ${item.title}`);
button.innerHTML = `
<span class="label-dot" aria-hidden="true"></span>
<span>${item.short}</span>
`;
button.addEventListener("click", (event) => {
event.stopPropagation();
inspectLabel(id);
});
$("#labels-layer").append(button);
labelElements.set(id, button);
});
const projected = new THREE.Vector3();
function updateLabels() {
const width = window.innerWidth;
const height = window.innerHeight;
labelElements.forEach((button, id) => {
const item = labelData[id];
projected.set(...item.anchor).project(camera);
const onScreen =
projected.z > -1 &&
projected.z < 1 &&
projected.x > -1.1 &&
projected.x < 1.1 &&
projected.y > -1.1 &&
projected.y < 1.1;
button.style.display = onScreen ? "flex" : "none";
if (onScreen) {
const x = (projected.x * 0.5 + 0.5) * width;
const y = (-projected.y * 0.5 + 0.5) * height;
button.style.left = `${x}px`;
button.style.top = `${y}px`;
}
});
}
// -------------------------------------------------------------------------
// Direct camera controls — no external controls module
// -------------------------------------------------------------------------
const cameraState = {
yaw: 0.54,
pitch: 0.58,
radius: 25,
target: new THREE.Vector3(0, 0.5, 0.2)
};
const desiredCamera = {
yaw: cameraState.yaw,
pitch: cameraState.pitch,
radius: cameraState.radius,
target: cameraState.target.clone()
};
function resetCamera() {
desiredCamera.yaw = 0.54;
desiredCamera.pitch = 0.58;
desiredCamera.radius = 25;
desiredCamera.target.set(0, 0.5, 0.2);
}
function focusOn(anchor) {
desiredCamera.target.set(anchor[0], Math.max(0.55, anchor[1] - 0.4), anchor[2]);
desiredCamera.radius = 16.5;
}
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
let pointerDown = null;
let dragging = false;
renderer.domElement.addEventListener("pointerdown", (event) => {
pointerDown = {
x: event.clientX,
y: event.clientY,
pointerId: event.pointerId
};
dragging = false;
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", (event) => {
if (!pointerDown || pointerDown.pointerId !== event.pointerId) return;
const dx = event.clientX - pointerDown.x;
const dy = event.clientY - pointerDown.y;
if (Math.abs(dx) + Math.abs(dy) > 4) dragging = true;
if (dragging) {
desiredCamera.yaw -= dx * 0.006;
desiredCamera.pitch = THREE.MathUtils.clamp(
desiredCamera.pitch + dy * 0.004,
0.28,
1.12
);
pointerDown.x = event.clientX;
pointerDown.y = event.clientY;
}
});
renderer.domElement.addEventListener("pointerup", (event) => {
if (!pointerDown || pointerDown.pointerId !== event.pointerId) return;
if (!dragging) {
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 hits = raycaster.intersectObjects(clickableMeshes, false);
if (hits.length) {
const id = hits[0].object.userData.inspectId;
if (id) inspectLabel(id);
}
}
pointerDown = null;
dragging = false;
if (renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
});
renderer.domElement.addEventListener("pointercancel", () => {
pointerDown = null;
dragging = false;
});
renderer.domElement.addEventListener(
"wheel",
(event) => {
event.preventDefault();
desiredCamera.radius = THREE.MathUtils.clamp(
desiredCamera.radius + event.deltaY * 0.012,
10.5,
33
);
},
{ passive: false }
);
renderer.domElement.addEventListener("dblclick", resetCamera);
// -------------------------------------------------------------------------
// Animation and resize
// -------------------------------------------------------------------------
const clock = new THREE.Clock();
function animate() {
const elapsed = clock.getElapsedTime();
cameraState.yaw = THREE.MathUtils.lerp(
cameraState.yaw,
desiredCamera.yaw,
0.08
);
cameraState.pitch = THREE.MathUtils.lerp(
cameraState.pitch,
desiredCamera.pitch,
0.08
);
cameraState.radius = THREE.MathUtils.lerp(
cameraState.radius,
desiredCamera.radius,
0.08
);
cameraState.target.lerp(desiredCamera.target, 0.075);
const horizontal = cameraState.radius * Math.cos(cameraState.pitch);
camera.position.set(
cameraState.target.x + horizontal * Math.sin(cameraState.yaw),
cameraState.target.y + cameraState.radius * Math.sin(cameraState.pitch),
cameraState.target.z + horizontal * Math.cos(cameraState.yaw)
);
camera.lookAt(cameraState.target);
water.material.opacity = 0.84 + Math.sin(elapsed * 0.9) * 0.04;
clouds.forEach((cloud) => {
cloud.position.x = cloud.userData.baseX + Math.sin(elapsed * cloud.userData.speed) * 1.8;
cloud.position.y += Math.sin(elapsed * 0.25 + cloud.userData.baseX) * 0.0008;
});
if (selectionMarker.visible) {
const pulse = 1 + Math.sin(elapsed * 3.5) * 0.13;
selectionMarker.scale.setScalar(pulse);
markerRing.quaternion.copy(camera.quaternion);
}
updateLabels();
renderer.render(scene, camera);
requestAnimationFrame(animate);
}
function onResize() {
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.setSize(window.innerWidth, window.innerHeight);
}
window.addEventListener("resize", onResize);
updateEvidenceChecks();
updateProgress();
animate();
requestAnimationFrame(() => {
$("#loading").classList.add("hidden");
setTimeout(() => $("#loading").remove(), 350);
});
</script>
</body>
</html>
```