Prompt specification
Build or customize the Three.js 3D scene "Barrier and contact counterfactual table" 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: Barrier and contact counterfactual table
Category: Biology & Nature · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/barrier-and-contact-counterfactual-table-x0960
Scene Description Prompt:
Build a self-contained HTML scene with Three.js from cdnjs featuring a low-poly table model of two fictional populations separated by a barrier. Represent individuals with simple tokens carrying several variant markers, and show each population's changing counts beside its habitat patch. Let users enable or disable migration while replaying the same seeded sequence of local reproduction and sampling. When migration is enabled, move actual individuals across the connection and update both populations consistently. Compare shared variation and differences over several rounds, keeping the inheritance and sampling rules explicit. The display should not claim that this simplified model alone establishes real species boundaries.
Working Three.js Starter (barrier-and-contact-counterfactual-table-x0960):
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Seeded Migration Table — Fictional Population Model</title>
<style>
:root {
color-scheme: dark;
--ink: #eaf2f1;
--muted: #a9b9ba;
--panel: rgba(17, 31, 36, 0.94);
--line: rgba(255, 255, 255, 0.12);
--a: #55d6c3;
--b: #ff9b6a;
--gold: #f1c75b;
}
* { box-sizing: border-box; }
html, body {
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
background: #e7e1d5;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
"Segoe UI", sans-serif;
}
button, input { font: inherit; }
#stage {
position: absolute;
inset: 0;
}
canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
}
#brand {
position: absolute;
top: 16px;
left: 18px;
max-width: min(490px, calc(100vw - 430px));
padding: 13px 16px;
border: 1px solid rgba(27, 48, 52, 0.13);
border-radius: 14px;
background: rgba(250, 247, 238, 0.9);
color: #193239;
box-shadow: 0 8px 30px rgba(28, 43, 44, 0.09);
backdrop-filter: blur(10px);
pointer-events: none;
}
#brand h1 {
margin: 0 0 3px;
font-size: 19px;
letter-spacing: -0.02em;
}
#brand p {
margin: 0;
color: #52686c;
font-size: 12px;
line-height: 1.45;
}
#panel {
position: absolute;
top: 14px;
right: 14px;
bottom: 14px;
width: min(390px, calc(100vw - 28px));
overflow: auto;
padding: 16px;
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 18px;
background: var(--panel);
color: var(--ink);
box-shadow: 0 18px 55px rgba(17, 30, 33, 0.25);
backdrop-filter: blur(16px);
scrollbar-width: thin;
scrollbar-color: #577073 transparent;
}
.eyebrow {
color: #87a4a5;
font-size: 10px;
font-weight: 800;
letter-spacing: 0.15em;
text-transform: uppercase;
}
h2 {
margin: 4px 0 13px;
font-size: 20px;
letter-spacing: -0.025em;
}
.control-card {
padding: 12px;
border: 1px solid var(--line);
border-radius: 13px;
background: rgba(255, 255, 255, 0.035);
}
.migration-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.migration-row strong {
display: block;
font-size: 13px;
}
.migration-row small {
display: block;
margin-top: 2px;
color: var(--muted);
font-size: 11px;
}
.switch {
position: relative;
flex: 0 0 auto;
width: 45px;
height: 25px;
}
.switch input {
position: absolute;
opacity: 0;
}
.switch span {
position: absolute;
inset: 0;
border-radius: 20px;
background: #44585c;
transition: 0.2s ease;
cursor: pointer;
}
.switch span::after {
content: "";
position: absolute;
width: 19px;
height: 19px;
left: 3px;
top: 3px;
border-radius: 50%;
background: #d8e0df;
transition: 0.2s ease;
}
.switch input:checked + span {
background: #2c9d8c;
}
.switch input:checked + span::after {
transform: translateX(20px);
background: white;
}
.seed-row {
display: grid;
grid-template-columns: 1fr auto;
gap: 8px;
margin-top: 12px;
}
input[type="text"] {
min-width: 0;
padding: 8px 10px;
border: 1px solid var(--line);
border-radius: 8px;
outline: none;
background: rgba(0, 0, 0, 0.18);
color: var(--ink);
font-size: 12px;
}
input[type="text"]:focus {
border-color: #62b7aa;
}
button {
padding: 8px 10px;
border: 1px solid var(--line);
border-radius: 8px;
background: #263a40;
color: var(--ink);
cursor: pointer;
font-size: 12px;
font-weight: 700;
}
button:hover { background: #30484e; }
button:disabled { opacity: 0.38; cursor: default; }
button.primary {
border-color: #58c6b3;
background: #3cad9c;
color: #08221f;
}
button.primary:hover { background: #55c6b4; }
.buttons {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin-top: 9px;
}
.speed-row {
display: flex;
align-items: center;
gap: 10px;
margin-top: 11px;
color: var(--muted);
font-size: 11px;
}
.speed-row input {
flex: 1;
accent-color: #55c6b4;
}
#status {
margin-top: 10px;
color: #d4e3e2;
font-size: 11px;
line-height: 1.45;
}
.count-cards {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin: 13px 0;
}
.count-card {
padding: 10px 11px;
border: 1px solid var(--line);
border-radius: 11px;
background: rgba(255, 255, 255, 0.035);
}
.count-card span {
display: block;
color: var(--muted);
font-size: 10px;
font-weight: 800;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.count-card strong {
display: inline-block;
margin-top: 2px;
font-size: 25px;
}
.count-card.a strong { color: var(--a); }
.count-card.b strong { color: var(--b); }
.section-title {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 8px;
margin: 15px 0 7px;
color: #e9f1f0;
font-size: 12px;
font-weight: 800;
}
.section-title small {
color: var(--muted);
font-size: 9px;
font-weight: 500;
}
.chips {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 5px 8px;
border: 1px solid var(--line);
border-radius: 999px;
background: rgba(255, 255, 255, 0.045);
color: #dce8e7;
font-size: 10px;
}
.dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--marker, #aaa);
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.muted {
color: var(--muted);
font-size: 10px;
line-height: 1.5;
}
.freq-row {
display: grid;
grid-template-columns: 65px 1fr 38px 1fr 38px;
align-items: center;
gap: 5px;
margin: 6px 0;
font-size: 10px;
}
.freq-name {
display: flex;
align-items: center;
gap: 5px;
font-weight: 700;
}
.bar-track {
height: 7px;
overflow: hidden;
border-radius: 9px;
background: rgba(255, 255, 255, 0.08);
}
.bar {
display: block;
height: 100%;
border-radius: inherit;
transition: width 0.25s ease;
}
.bar.a { background: var(--a); }
.bar.b { background: var(--b); }
.freq-value {
color: #d6e1e0;
text-align: right;
font-variant-numeric: tabular-nums;
}
.legend {
display: flex;
gap: 13px;
margin-top: 8px;
color: var(--muted);
font-size: 9px;
}
.legend span {
display: inline-flex;
align-items: center;
gap: 5px;
}
.legend i {
width: 9px;
height: 9px;
border-radius: 2px;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 10px;
font-variant-numeric: tabular-nums;
}
th, td {
padding: 6px 4px;
border-bottom: 1px solid var(--line);
text-align: right;
}
th {
color: #91aaab;
font-size: 9px;
font-weight: 700;
}
th:first-child, td:first-child { text-align: left; }
#history-wrap {
max-height: 190px;
overflow: auto;
}
#event-log {
display: grid;
gap: 6px;
max-height: 130px;
overflow: auto;
}
.event {
padding-left: 9px;
border-left: 2px solid #4c7779;
color: #c5d4d3;
font-size: 10px;
line-height: 1.45;
}
details {
margin-top: 13px;
border: 1px solid var(--line);
border-radius: 11px;
background: rgba(0, 0, 0, 0.12);
}
summary {
padding: 10px 11px;
cursor: pointer;
font-size: 11px;
font-weight: 800;
}
.rules {
padding: 0 12px 11px;
color: #b9c9c8;
font-size: 10px;
line-height: 1.55;
}
.rules ol {
margin: 0;
padding-left: 17px;
}
.rules li + li { margin-top: 5px; }
.disclaimer {
margin-top: 12px;
padding: 10px 11px;
border: 1px solid rgba(241, 199, 91, 0.3);
border-radius: 10px;
background: rgba(241, 199, 91, 0.07);
color: #e8d7a4;
font-size: 10px;
line-height: 1.5;
}
#tooltip {
position: fixed;
z-index: 10;
display: none;
pointer-events: none;
padding: 9px 11px;
border: 1px solid rgba(255, 255, 255, 0.18);
border-radius: 9px;
background: rgba(14, 27, 31, 0.95);
color: #eef5f4;
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.22);
font-size: 11px;
line-height: 1.5;
}
#tooltip .alleles {
display: flex;
flex-wrap: wrap;
gap: 5px;
margin-top: 5px;
}
#tooltip .allele {
padding: 2px 5px;
border-radius: 5px;
background: rgba(255, 255, 255, 0.08);
font-size: 9px;
}
@media (max-width: 760px) {
#brand {
top: 8px;
left: 8px;
max-width: calc(100vw - 16px);
padding: 9px 12px;
}
#brand h1 { font-size: 15px; }
#brand p { font-size: 10px; }
#panel {
top: auto;
right: 8px;
bottom: 8px;
left: 8px;
width: auto;
height: 48vh;
padding: 12px;
border-radius: 14px;
}
h2 { font-size: 17px; }
}
</style>
</head>
<body>
<div id="stage"></div>
<header id="brand">
<h1>Seeded Migration Table</h1>
<p>
Two fictional habitat patches, four binary variant markers, local reproduction,
habitat-weighted sampling, and optional movement of actual individuals.
</p>
</header>
<aside id="panel">
<div class="eyebrow">Interactive population model</div>
<h2>Two patches, one seeded sequence</h2>
<div class="control-card">
<div class="migration-row">
<div>
<strong>Enable migration</strong>
<small>One sampled adult crosses after each round.</small>
</div>
<label class="switch" aria-label="Enable migration">
<input id="migration" type="checkbox" checked>
<span></span>
</label>
</div>
<div class="seed-row">
<input id="seed" type="text" value="lumen-17" aria-label="Random seed">
<button id="replay" class="primary" title="Reset and replay this seed">Replay seed</button>
</div>
<div class="buttons">
<button id="run">Run</button>
<button id="step">Step one round</button>
</div>
<div class="speed-row">
<span>Speed</span>
<input id="speed" type="range" min="0.65" max="2.5" step="0.05" value="1.25">
<span id="speed-value">1.25×</span>
</div>
<div id="status" aria-live="polite">Ready.</div>
</div>
<div class="count-cards">
<div class="count-card a">
<span>Patch A · Alder</span>
<strong id="count-a">10</strong>
</div>
<div class="count-card b">
<span>Patch B · Ember</span>
<strong id="count-b">10</strong>
</div>
</div>
<div class="section-title">
Shared variation
<small>both populations 10–90% at a locus</small>
</div>
<div id="shared" class="chips"></div>
<div class="section-title">
Differences
<small>absolute allele-frequency gap ≥ 0.20</small>
</div>
<div id="differences" class="chips"></div>
<div class="section-title">
Allele frequencies
<small>Patch A / Patch B</small>
</div>
<div id="frequencies"></div>
<div class="legend">
<span><i style="background:var(--a)"></i> Patch A</span>
<span><i style="background:var(--b)"></i> Patch B</span>
</div>
<div class="section-title">
Round history
<small>after migration</small>
</div>
<div id="history-wrap">
<table>
<thead>
<tr>
<th>Round</th>
<th>A / B</th>
<th>Shared</th>
<th>Different</th>
<th>Overlap</th>
</tr>
</thead>
<tbody id="history"></tbody>
</table>
</div>
<div class="section-title">Event trace</div>
<div id="event-log"></div>
<details open>
<summary>Explicit model rules</summary>
<div class="rules">
<ol>
<li>
Each of four markers is binary. The initial population contains 10
individuals per patch, generated from the displayed seed.
</li>
<li>
<strong>Local reproduction:</strong> 8 distinct adults are selected
without replacement using habitat-weighted roulette selection.
Each selected adult produces one offspring.
</li>
<li>
<strong>Inheritance:</strong> an offspring copies all four parental
alleles. Each allele independently mutates with probability 0.05.
</li>
<li>
<strong>Habitat weighting:</strong> Patch A favors Shell = 1
(1.35 versus 0.70); Patch B favors Spot = 1 (1.35 versus 0.70).
Crest gives a small advantage in both patches. Other markers are neutral.
</li>
<li>
<strong>Sampling:</strong> after reproduction, 10 individuals are chosen
without replacement from the combined pool of current adults and 8
offspring, again using the local habitat weights.
</li>
<li>
<strong>Migration:</strong> when enabled, one actual sampled adult
crosses the marked connection after sampling. Direction alternates by
round. Its genotype does not change. Source and destination arrays and
both counts update atomically, conserving the total of 20 individuals.
</li>
<li>
Random draws are keyed by seed, round, patch, and event rather than
by call order. Replaying the same seed and migration setting therefore
repeats the same local rules and random draws. Changing migration can
change which individuals participate later, so downstream outcomes may
legitimately diverge.
</li>
</ol>
</div>
</details>
<div class="disclaimer">
<strong>Interpretation limit:</strong> this is a simplified teaching model.
Its arbitrary rules and invented populations do not establish real species
boundaries, evolutionary lineages, or conservation policy.
</div>
<p class="muted" style="margin-bottom:2px">
Camera: drag to orbit · Shift/right-drag to pan · wheel to zoom ·
hover a token for its genotype.
</p>
</aside>
<div id="tooltip"></div>
<script type="module">
import * as THREE from
"https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
/* --------------------------------------------------------------------------
Constants and model state
-------------------------------------------------------------------------- */
const $ = id => document.getElementById(id);
const LOCI = [
{ key: "shell", label: "Shell", color: "#55d6c3" },
{ key: "crest", label: "Crest", color: "#ff7d87" },
{ key: "spot", label: "Spot", color: "#f1c75b" },
{ key: "band", label: "Band", color: "#b99cff" }
];
const PATCHES = {
A: {
name: "Alder",
center: new THREE.Vector3(-4.3, 0, 0),
accent: "#55d6c3",
labelPosition: new THREE.Vector3(-6.2, 1.45, -3.65)
},
B: {
name: "Ember",
center: new THREE.Vector3(4.3, 0, 0),
accent: "#ff9b6a",
labelPosition: new THREE.Vector3(6.2, 1.45, -3.65)
}
};
const PATCH_TOP = 0.09;
const INITIAL_COUNT = 10;
const REPRODUCTION_COUNT = 8;
const SAMPLE_COUNT = 10;
const MUTATION_RATE = 0.05;
let seed = "lumen-17";
let populations = { A: [], B: [] };
let reproductionChildren = { A: [], B: [] };
let round = 0;
let phase = "ready";
let phaseElapsed = 0;
let phaseDuration = 1;
let playState = "paused";
let stepPending = false;
let speed = 1.25;
let flight = null;
let history = [];
let logEntries = [];
/* --------------------------------------------------------------------------
Seeded, event-keyed random numbers
-------------------------------------------------------------------------- */
function hash32(text) {
let h = 2166136261 >>> 0;
for (let i = 0; i < text.length; i++) {
h ^= text.charCodeAt(i);
h = Math.imul(h, 16777619);
}
return h >>> 0;
}
function unit(...parts) {
return hash32(parts.join("|")) / 4294967296;
}
function weightedPick(weights, key) {
const total = weights.reduce((sum, value) => sum + value, 0);
let threshold = unit(...key) * total;
for (let i = 0; i < weights.length; i++) {
threshold -= weights[i];
if (threshold <= 0) return i;
}
return weights.length - 1;
}
function sampleWithoutReplacement(pool, count, key, fitnessFunction) {
const remaining = pool.slice();
const selected = [];
for (let attempt = 0; attempt < count && remaining.length; attempt++) {
const weights = remaining.map(fitnessFunction);
const index = weightedPick(weights, [...key, attempt]);
selected.push(remaining.splice(index, 1)[0]);
}
return selected;
}
function fitness(individual, patch) {
let value = 1;
if (patch === "A") {
value *= individual.alleles[0] === 1 ? 1.35 : 0.70;
value *= individual.alleles[1] === 1 ? 1.10 : 0.95;
} else {
value *= individual.alleles[2] === 1 ? 1.35 : 0.70;
value *= individual.alleles[1] === 1 ? 1.08 : 0.94;
}
return value;
}
/* --------------------------------------------------------------------------
Three.js scene
-------------------------------------------------------------------------- */
const stage = $("stage");
const scene = new THREE.Scene();
scene.background = new THREE.Color("#e7e1d5");
scene.fog = new THREE.Fog("#e7e1d5", 28, 55);
const camera = new THREE.PerspectiveCamera(42, 1, 0.1, 100);
const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1.05;
stage.appendChild(renderer.domElement);
const hemisphere = new THREE.HemisphereLight("#fff7e6", "#526568", 2.25);
scene.add(hemisphere);
const sun = new THREE.DirectionalLight("#fff0d0", 3.1);
sun.position.set(8, 15, 10);
sun.castShadow = true;
sun.shadow.mapSize.set(2048, 2048);
sun.shadow.camera.left = -15;
sun.shadow.camera.right = 15;
sun.shadow.camera.top = 13;
sun.shadow.camera.bottom = -13;
sun.shadow.camera.near = 1;
sun.shadow.camera.far = 40;
sun.shadow.normalBias = 0.025;
scene.add(sun);
const fill = new THREE.DirectionalLight("#b9e8ed", 1.0);
fill.position.set(-10, 7, -8);
scene.add(fill);
const tokenRoot = new THREE.Group();
scene.add(tokenRoot);
const GEO = {
base: new THREE.CylinderGeometry(0.19, 0.24, 0.38, 6),
head: new THREE.IcosahedronGeometry(0.17, 0),
stem: new THREE.CylinderGeometry(0.018, 0.018, 0.22, 5),
tip: new THREE.OctahedronGeometry(0.065, 0)
};
function standardMaterial(color, options = {}) {
return new THREE.MeshStandardMaterial({
color,
flatShading: true,
roughness: 0.78,
metalness: 0.02,
...options
});
}
function roundedRect(context, x, y, width, height, radius) {
const r = Math.min(radius, width / 2, height / 2);
context.beginPath();
context.moveTo(x + r, y);
context.arcTo(x + width, y, x + width, y + height, r);
context.arcTo(x + width, y + height, x, y + height, r);
context.arcTo(x, y + height, x, y, r);
context.arcTo(x, y, x + width, y, r);
context.closePath();
}
function makeEnvironment() {
const floor = new THREE.Mesh(
new THREE.PlaneGeometry(80, 80),
standardMaterial("#d5d0c4", { roughness: 1 })
);
floor.rotation.x = -Math.PI / 2;
floor.position.y = -3.25;
floor.receiveShadow = true;
scene.add(floor);
const tableTop = new THREE.Mesh(
new THREE.BoxGeometry(18, 0.65, 11),
standardMaterial("#a97545")
);
tableTop.position.y = -0.5;
tableTop.castShadow = true;
tableTop.receiveShadow = true;
scene.add(tableTop);
const edge = new THREE.Mesh(
new THREE.BoxGeometry(18.2, 0.22, 11.2),
standardMaterial("#795031")
);
edge.position.y = -0.81;
edge.castShadow = true;
scene.add(edge);
for (const x of [-7.2, 7.2]) {
for (const z of [-4.2, 4.2]) {
const leg = new THREE.Mesh(
new THREE.BoxGeometry(0.8, 2.6, 0.8),
standardMaterial("#6f472c")
);
leg.position.set(x, -2.03, z);
leg.castShadow = true;
leg.receiveShadow = true;
scene.add(leg);
}
}
// Subtle tabletop planks.
for (let z = -4.5; z <= 4.5; z += 1.5) {
const seam = new THREE.Mesh(
new THREE.BoxGeometry(17.6, 0.018, 0.025),
standardMaterial("#805433")
);
seam.position.set(0, -0.165, z);
scene.add(seam);
}
// Low-poly habitat patches.
for (const patch of ["A", "B"]) {
const config = PATCHES[patch];
const rim = new THREE.Mesh(
new THREE.CylinderGeometry(3.48, 3.62, 0.16, 8),
standardMaterial(patch === "A" ? "#277d76" : "#ad6348")
);
rim.position.set(config.center.x, -0.045, config.center.z);
rim.rotation.y = patch === "A" ? 0.12 : -0.08;
rim.receiveShadow = true;
rim.castShadow = true;
scene.add(rim);
const surface = new THREE.Mesh(
new THREE.CylinderGeometry(3.3, 3.38, 0.15, 8),
standardMaterial(patch === "A" ? "#4ca99d" : "#d68a61")
);
surface.position.set(config.center.x, 0.015, config.center.z);
surface.rotation.y = patch === "A" ? 0.12 : -0.08;
surface.receiveShadow = true;
scene.add(surface);
}
// Central barrier: vertical posts and two rails.
const barrierMaterial = standardMaterial("#5b4b3d");
const railAccent = standardMaterial("#d3a45d");
for (const z of [-4.2, -2.1, 0, 2.1, 4.2]) {
const post = new THREE.Mesh(
new THREE.BoxGeometry(0.27, 1.7, 0.27),
barrierMaterial
);
post.position.set(0, 0.65, z);
post.castShadow = true;
scene.add(post);
const cap = new THREE.Mesh(
new THREE.ConeGeometry(0.22, 0.32, 4),
railAccent
);
cap.position.set(0, 1.62, z);
cap.rotation.y = Math.PI / 4;
cap.castShadow = true;
scene.add(cap);
}
for (const y of [0.62, 1.25]) {
const rail = new THREE.Mesh(
new THREE.BoxGeometry(0.17, 0.17, 9.1),
barrierMaterial
);
rail.position.set(0, y, 0);
rail.castShadow = true;
scene.add(rail);
}
// Dashed migration connection arches over the barrier.
const connectionPoints = [
new THREE.Vector3(-4.4, 0.35, 2.85),
new THREE.Vector3(-2.6, 1.35, 2.85),
new THREE.Vector3(0, 2.55, 2.85),
new THREE.Vector3(2.6, 1.35, 2.85),
new THREE.Vector3(4.4, 0.35, 2.85)
];
const connectionCurve = new THREE.CatmullRomCurve3(connectionPoints);
const connectionGeometry = new THREE.BufferGeometry().setFromPoints(
connectionCurve.getPoints(80)
);
const connection = new THREE.Line(
connectionGeometry,
new THREE.LineDashedMaterial({
color: "#e0b24c",
dashSize: 0.25,
gapSize: 0.16,
transparent: true,
opacity: 0.9
})
);
connection.computeLineDistances();
scene.add(connection);
// Low-poly vegetation and rocks around patch edges.
const plantLocations = [
[-6.7, -1.6, "#2f7657"], [-6.2, 1.7, "#3e8a62"],
[-5.1, 3.2, "#2f6c52"], [6.7, -1.4, "#8b5d37"],
[6.0, 1.8, "#a66a3e"], [5.2, 3.1, "#805838"]
];
for (const [x, z, color] of plantLocations) {
const plant = new THREE.Group();
const trunk = new THREE.Mesh(
new THREE.CylinderGeometry(0.06, 0.09, 0.5, 5),
standardMaterial("#72513a")
);
trunk.position.y = 0.25;
trunk.castShadow = true;
plant.add(trunk);
for (let layer = 0; layer < 2; layer++) {
const foliage = new THREE.Mesh(
new THREE.ConeGeometry(0.42 - layer * 0.1, 0.85 - layer * 0.15, 6),
standardMaterial(color)
);
foliage.position.y = 0.67 + layer * 0.34;
foliage.rotation.y = layer * 0.55;
foliage.castShadow = true;
plant.add(foliage);
}
plant.position.set(x, PATCH_TOP, z);
plant.scale.setScalar(0.75 + unit("plant", x, z) * 0.35);
scene.add(plant);
}
const rockGeometry = new THREE.DodecahedronGeometry(0.28, 0);
for (const [x, z] of [[-5.8, -2.8], [-3.1, 2.9], [3.2, -2.9], [5.9, 2.8]]) {
const rock = new THREE.Mesh(rockGeometry, standardMaterial("#7d817c"));
rock.position.set(x, 0.19, z);
rock.rotation.set(unit("rock", x, z), unit("rock", z, x), 0);
rock.castShadow = true;
rock.receiveShadow = true;
scene.add(rock);
}
}
makeEnvironment();
/* --------------------------------------------------------------------------
Population labels drawn into CanvasTextures
-------------------------------------------------------------------------- */
const patchLabels = {};
function makePatchLabel(patch) {
const canvas = document.createElement("canvas");
canvas.width = 512;
canvas.height = 230;
const texture = new THREE.CanvasTexture(canvas);
texture.colorSpace = THREE.SRGBColorSpace;
const material = new THREE.SpriteMaterial({
map: texture,
transparent: true,
depthTest: false,
depthWrite: false
});
const sprite = new THREE.Sprite(material);
sprite.position.copy(PATCHES[patch].labelPosition);
sprite.scale.set(3.25, 1.46, 1);
sprite.renderOrder = 20;
scene.add(sprite);
patchLabels[patch] = { canvas, context: canvas.getContext("2d"), texture };
}
makePatchLabel("A");
makePatchLabel("B");
function updatePatchLabel(patch) {
const { canvas, context, texture } = patchLabels[patch];
const config = PATCHES[patch];
const count = populations[patch].length;
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillStyle = "rgba(18, 35, 39, 0.94)";
roundedRect(context, 8, 8, 496, 214, 28);
context.fill();
context.strokeStyle = config.accent;
context.lineWidth = 8;
roundedRect(context, 12, 12, 488, 206, 24);
context.stroke();
context.fillStyle = config.accent;
context.font = "800 34px system-ui, sans-serif";
context.fillText(`PATCH ${patch} · ${config.name.toUpperCase()}`, 34, 62);
context.fillStyle = "#eef5f4";
context.font = "800 78px system-ui, sans-serif";
context.fillText(String(count), 34, 145);
context.fillStyle = "#b8c9c8";
context.font = "500 28px system-ui, sans-serif";
context.fillText("residents", 34, 184);
texture.needsUpdate = true;
}
/* --------------------------------------------------------------------------
Individual tokens
-------------------------------------------------------------------------- */
function colorForAlleles(alleles) {
const hue =
0.46 +
alleles[0] * 0.065 +
alleles[1] * 0.105 +
alleles[2] * 0.145 +
alleles[3] * 0.085;
return new THREE.Color().setHSL(hue % 1, 0.48, 0.56);
}
function createToken(individual) {
const group = new THREE.Group();
group.userData.individual = individual;
const bodyColor = colorForAlleles(individual.alleles);
const body = new THREE.Mesh(
GEO.base,
standardMaterial(bodyColor, { roughness: 0.62 })
);
body.position.y = 0.19;
body.castShadow = true;
body.receiveShadow = true;
group.add(body);
const head = new THREE.Mesh(
GEO.head,
standardMaterial(bodyColor.clone().offsetHSL(0, 0.02, 0.08))
);
head.position.y = 0.55;
head.castShadow = true;
group.add(head);
for (let locus = 0; locus < LOCI.length; locus++) {
const angle = locus * Math.PI / 2 + Math.PI / 4;
const stem = new THREE.Mesh(
GEO.stem,
standardMaterial("#33484c")
);
stem.position.set(
Math.cos(angle) * 0.205,
0.43,
Math.sin(angle) * 0.205
);
group.add(stem);
const present = individual.alleles[locus] === 1;
const tip = new THREE.Mesh(
GEO.tip,
standardMaterial(present ? LOCI[locus].color : "#3a484b", {
emissive: present ? LOCI[locus].color : "#000000",
emissiveIntensity: present ? 0.18 : 0
})
);
tip.position.set(
Math.cos(angle) * 0.205,
0.57,
Math.sin(angle) * 0.205
);
tip.rotation.y = angle;
tip.castShadow = true;
group.add(tip);
}
individual.mesh = group;
return group;
}
function disposeToken(group) {
group.traverse(object => {
if (object.material) {
const materials = Array.isArray(object.material)
? object.material
: [object.material];
materials.forEach(material => material.dispose());
}
});
}
function removeIndividual(individual) {
if (!individual.mesh) return;
tokenRoot.remove(individual.mesh);
disposeToken(individual.mesh);
individual.mesh = null;
}
function targetFor(patch, index, id) {
const config = PATCHES[patch];
const ring = index % 5;
const layer = Math.floor(index / 5);
const radius = 0.48 + ring * 0.46 + layer * 0.12;
const angle = index * 2.399963 + (patch === "A" ? 0.35 : 2.0);
const jitter = (unit(seed, "layout", patch, id) - 0.5) * 0.24;
return new THREE.Vector3(
config.center.x + Math.cos(angle) * radius + jitter,
PATCH_TOP,
config.center.z + Math.sin(angle) * radius * 0.76
);
}
function layoutPopulation(patch, immediate = false) {
populations[patch].forEach((individual, index) => {
individual.target = targetFor(patch, index, individual.id);
if (immediate) individual.mesh.position.copy(individual.target);
});
}
/* --------------------------------------------------------------------------
Statistics, comparison, and history
-------------------------------------------------------------------------- */
function getMetrics() {
const frequencies = { A: [], B: [] };
for (const patch of ["A", "B"]) {
const population = populations[patch];
frequencies[patch] = LOCI.map((_, locus) => {
if (!population.length) return 0;
const count = population.reduce(
(sum, individual) => sum + individual.alleles[locus],
0
);
return count / population.length;
});
}
const shared = [];
const different = [];
let overlapSum = 0;
LOCI.forEach((locus, index) => {
const a = frequencies.A[index];
const b = frequencies.B[index];
const minimum = Math.min(a, b);
const maximum = Math.max(a, b);
overlapSum += minimum;
if (minimum >= 0.10 && maximum <= 0.90) {
shared.push(index);
}
if (Math.abs(a - b) >= 0.20) {
different.push(index);
}
});
return {
frequencies,
shared,
different,
overlap: LOCI.length ? overlapSum / LOCI.length : 0
};
}
function markerChip(index, extraText = "") {
const locus = LOCI[index];
return `
<span class="chip" style="--marker:${locus.color}">
<i class="dot"></i>
${locus.label}${extraText ? ` ${extraText}` : ""}
</span>
`;
}
function renderStatistics() {
const metrics = getMetrics();
$("count-a").textContent = populations.A.length;
$("count-b").textContent = populations.B.length;
$("shared").innerHTML = metrics.shared.length
? metrics.shared.map(index => {
const a = metrics.frequencies.A[index].toFixed(2);
const b = metrics.frequencies.B[index].toFixed(2);
return markerChip(index, `A ${a} / B ${b}`);
}).join("")
: '<span class="muted">No locus currently meets the shared-variation rule.</span>';
$("differences").innerHTML = metrics.different.length
? metrics.different.map(index => {
const delta = Math.abs(
metrics.frequencies.A[index] - metrics.frequencies.B[index]
).toFixed(2);
return markerChip(index, `Δ ${delta}`);
}).join("")
: '<span class="muted">No locus currently differs by at least 0.20.</span>';
$("frequencies").innerHTML = LOCI.map((locus, index) => {
const a = metrics.frequencies.A[index];
const b = metrics.frequencies.B[index];
return `
<div class="freq-row">
<div class="freq-name">
<i class="dot" style="--marker:${locus.color}"></i>
${locus.label}
</div>
<div class="bar-track"><i class="bar a" style="width:${a * 100}%"></i></div>
<div class="freq-value">${a.toFixed(2)}</div>
<div class="bar-track"><i class="bar b" style="width:${b * 100}%"></i></div>
<div class="freq-value">${b.toFixed(2)}</div>
</div>
`;
}).join("");
renderHistory();
}
function pushHistory(roundNumber) {
const metrics = getMetrics();
history.push({
round: roundNumber,
a: populations.A.length,
b: populations.B.length,
shared: metrics.shared.length,
different: metrics.different.length,
overlap: metrics.overlap
});
}
function renderHistory() {
$("history").innerHTML = history.slice(-12).reverse().map(row => `
<tr>
<td>${row.round}</td>
<td>${row.a} / ${row.b}</td>
<td>${row.shared}</td>
<td>${row.different}</td>
<td>${(row.overlap * 100).toFixed(0)}%</td>
</tr>
`).join("");
}
function logEvent(message) {
logEntries.unshift(message);
logEntries = logEntries.slice(0, 9);
$("event-log").innerHTML = "";
for (const entry of logEntries) {
const element = document.createElement("div");
element.className = "event";
element.textContent = entry;
$("event-log").appendChild(element);
}
}
/* --------------------------------------------------------------------------
Simulation lifecycle
-------------------------------------------------------------------------- */
function resetSimulation() {
for (const child of [...tokenRoot.children]) {
tokenRoot.remove(child);
disposeToken(child);
}
seed = $("seed").value.trim() || "lumen-17";
populations = { A: [], B: [] };
reproductionChildren = { A: [], B: [] };
history = [];
logEntries = [];
round = 0;
phase = "ready";
phaseElapsed = 0;
phaseDuration = 1;
stepPending = false;
flight = null;
for (const patch of ["A", "B"]) {
for (let index = 0; index < INITIAL_COUNT; index++) {
const alleles = LOCI.map((_, locus) =>
unit(seed, "initial", patch, index, locus) < 0.5 ? 0 : 1
);
const individual = {
id: `${patch}-${String(index + 1).padStart(2, "0")}`,
alleles,
patch,
parentId: null,
mesh: null,
target: new THREE.Vector3()
};
individual.mesh = createToken(individual);
tokenRoot.add(individual.mesh);
populations[patch].push(individual);
}
layoutPopulation(patch, true);
}
pushHistory(0);
updatePatchLabel("A");
updatePatchLabel("B");
renderStatistics();
logEvent("Initial state: 10 Alder and 10 Ember individuals from the selected seed.");
syncUI();
}
function startRound() {
if (phase !== "ready") return;
round++;
phase = "reproduce";
phaseElapsed = 0;
phaseDuration = 1.15;
reproductionChildren = { A: [], B: [] };
for (const patch of ["A", "B"]) {
const adults = populations[patch].slice();
const parents = sampleWithoutReplacement(
adults,
Math.min(REPRODUCTION_COUNT, adults.length),
[seed, "parents", round, patch],
individual => fitness(individual, patch)
);
parents.forEach((parent, index) => {
const alleles = parent.alleles.map((allele, locus) => {
const mutation = unit(
seed,
"mutation",
round,
patch,
parent.id,
locus
) < MUTATION_RATE;
return mutation ? 1 - allele : allele;
});
const child = {
id: `${patch}-R${round}-${String(index + 1).padStart(2, "0")}`,
alleles,
patch,
parentId: parent.id,
mesh: null,
target: new THREE.Vector3()
};
child.mesh = createToken(child);
child.target = targetFor(patch, REPRODUCTION_COUNT + index, child.id);
child.mesh.position.copy(child.target);
child.mesh.scale.setScalar(0.02);
tokenRoot.add(child.mesh);
reproductionChildren[patch].push(child);
});
logEvent(
`R${round}: Patch ${patch} produced ${parents.length} offspring candidates; ` +
`each inherited four alleles with 5% per-marker mutation.`
);
}
syncUI();
}
function performSampling() {
for (const patch of ["A", "B"]) {
const adults = populations[patch].slice();
const children = reproductionChildren[patch].slice();
const pool = adults.concat(children);
const selected = sampleWithoutReplacement(
pool,
SAMPLE_COUNT,
[seed, "sampling", round, patch],
individual => fitness(individual, patch)
);
const selectedSet = new Set(selected);
for (const adult of adults) {
if (!selectedSet.has(adult)) removeIndividual(adult);
}
for (const child of children) {
if (!selectedSet.has(child)) removeIndividual(child);
}
populations[patch] = selected;
layoutPopulation(patch);
const adultCount = selected.filter(item => adults.includes(item)).length;
const childCount = selected.length - adultCount;
logEvent(
`R${round}: Patch ${patch} sampled ${selected.length} of ${pool.length} ` +
`(${adultCount} adults, ${childCount} offspring) using local habitat weights.`
);
}
updatePatchLabel("A");
updatePatchLabel("B");
renderStatistics();
}
function prepareMigration() {
flight = null;
if (!$("migration").checked) {
logEvent(`R${round}: Migration is disabled; no individual crossed the link.`);
phaseDuration = 0.42;
return;
}
const sourcePatch = round % 2 === 1 ? "A" : "B";
const destinationPatch = sourcePatch === "A" ? "B" : "A";
const source = populations[sourcePatch];
const destination = populations[destinationPatch];
const weights = source.map(individual => fitness(individual, sourcePatch));
const selectedIndex = weightedPick(
weights,
[seed, "migrant", round, sourcePatch]
);
const individual = source.splice(selectedIndex, 1)[0];
const destinationIndex = destination.length;
destination.push(individual);
// Membership and both counts are committed together before the flight.
individual.patch = "transit";
const destinationTarget = targetFor(
destinationPatch,
destinationIndex,
individual.id
);
const start = individual.mesh.position.clone();
const points = sourcePatch === "A"
? [
start,
new THREE.Vector3(-2.6, 1.35, 2.85),
new THREE.Vector3(0, 2.55, 2.85),
new THREE.Vector3(2.6, 1.35, 2.85),
destinationTarget
]
: [
start,
new THREE.Vector3(2.6, 1.35, 2.85),
new THREE.Vector3(0, 2.55, 2.85),
new THREE.Vector3(-2.6, 1.35, 2.85),
destinationTarget
];
flight = {
individual,
sourcePatch,
destinationPatch,
curve: new THREE.CatmullRomCurve3(points)
};
individual.mesh.scale.setScalar(1.08);
updatePatchLabel("A");
updatePatchLabel("B");
renderStatistics();
logEvent(
`R${round}: ${individual.id} migrated ${sourcePatch} → ${destinationPatch}. ` +
`Genotype ${individual.alleles.join("")} was conserved; both arrays and counts ` +
`were updated together (total ${populations.A.length + populations.B.length}).`
);
phaseDuration = 1.9;
}
function updateFlight(t) {
if (!flight) return;
const eased = t * t * (3 - 2 * t);
const position = flight.curve.getPointAt(eased);
position.y += Math.sin(eased * Math.PI) * 0.09;
flight.individual.mesh.position.copy(position);
flight.individual.mesh.rotation.y = eased * Math.PI * 2;
}
function finishMigration() {
if (!flight) return;
flight.individual.patch = flight.destinationPatch;
flight.individual.mesh.rotation.y = 0;
layoutPopulation(flight.destinationPatch);
flight.individual.mesh.position.copy(flight.individual.target);
logEvent(
`R${round}: ${flight.individual.id} arrived in Patch ${flight.destinationPatch}.`
);
flight = null;
}
function completeRound() {
pushHistory(round);
updatePatchLabel("A");
updatePatchLabel("B");
renderStatistics();
logEvent(
`R${round} complete: A=${populations.A.length}, B=${populations.B.length}, ` +
`total=${populations.A.length + populations.B.length}.`
);
if (stepPending) {
stepPending = false;
phase = "ready";
} else if (playState === "running") {
phase = "between";
phaseElapsed = 0;
phaseDuration = 0.9;
} else {
phase = "ready";
}
syncUI();
}
function transitionPhase() {
if (phase === "reproduce") {
performSampling();
phase = "sample";
phaseElapsed = 0;
phaseDuration = 0.78;
} else if (phase === "sample") {
prepareMigration();
phase = "migrate";
phaseElapsed = 0;
} else if (phase === "migrate") {
finishMigration();
phase = "settle";
phaseElapsed = 0;
phaseDuration = 0.48;
} else if (phase === "settle") {
completeRound();
}
syncUI();
}
function updateSimulation(delta) {
if (phase === "ready") {
if (playState === "running") startRound();
return;
}
if (playState !== "running" && !stepPending) return;
phaseElapsed += delta;
if (phase === "reproduce") {
const progress = Math.min(1, phaseElapsed / phaseDuration);
const eased = 1 - Math.pow(1 - progress, 3);
for (const children of Object.values(reproductionChildren)) {
for (const child of children) {
if (child.mesh) child.mesh.scale.setScalar(0.02 + eased * 0.98);
}
}
} else if (phase === "migrate") {
updateFlight(Math.min(1, phaseElapsed / phaseDuration));
}
if (phaseElapsed >= phaseDuration) {
if (phase === "between") {
phase = "ready";
startRound();
} else {
transitionPhase();
}
}
syncUI();
}
/* --------------------------------------------------------------------------
Interface
-------------------------------------------------------------------------- */
function syncUI() {
const phaseNames = {
ready: "ready",
reproduce: "local reproduction",
sample: "habitat sampling",
migrate: flight ? "migrating an actual adult" : "migration disabled",
settle: "settling",
between: "between rounds"
};
const state = playState === "running" ? "running" : "paused";
$("run").textContent = playState === "running" ? "Pause" : "Run";
$("step").disabled = !(phase === "ready" || phase === "between");
$("status").textContent =
`Round ${round} · ${phaseNames[phase]} · ${state}. ` +
(flight
? `${flight.individual.id} is committed to Patch ${flight.destinationPatch} and in transit.`
: `Total residents: ${populations.A.length + populations.B.length}.`);
}
$("run").addEventListener("click", () => {
if (playState === "running") {
playState = "paused";
stepPending = false;
} else {
playState = "running";
stepPending = false;
if (phase === "ready") startRound();
}
syncUI();
});
$("step").addEventListener("click", () => {
playState = "paused";
stepPending = true;
if (phase === "between") {
phase = "ready";
phaseElapsed = 0;
}
if (phase === "ready") startRound();
syncUI();
});
$("replay").addEventListener("click", () => {
resetSimulation();
playState = "running";
startRound();
syncUI();
});
$("migration").addEventListener("change", () => {
logEvent(
`Migration setting changed to ${$("migration").checked ? "enabled" : "disabled"}; ` +
`the next migration stage will use this setting.`
);
syncUI();
});
$("speed").addEventListener("input", event => {
speed = Number(event.target.value);
$("speed-value").textContent = `${speed.toFixed(2)}×`;
});
/* --------------------------------------------------------------------------
Direct camera controls, implemented without addons
-------------------------------------------------------------------------- */
const cameraState = {
theta: 0.72,
phi: 0.94,
radius: 20.5,
target: new THREE.Vector3(0, 0.15, 0)
};
let dragState = null;
function updateCamera() {
const sinPhi = Math.sin(cameraState.phi);
camera.position.set(
cameraState.target.x + cameraState.radius * sinPhi * Math.sin(cameraState.theta),
cameraState.target.y + cameraState.radius * Math.cos(cameraState.phi),
cameraState.target.z + cameraState.radius * sinPhi * Math.cos(cameraState.theta)
);
camera.lookAt(cameraState.target);
camera.updateMatrixWorld();
}
renderer.domElement.addEventListener("contextmenu", event => {
event.preventDefault();
});
renderer.domElement.addEventListener("pointerdown", event => {
dragState = {
x: event.clientX,
y: event.clientY,
pan: event.button === 2 || event.shiftKey
};
renderer.domElement.setPointerCapture(event.pointerId);
});
renderer.domElement.addEventListener("pointermove", event => {
if (dragState) {
const dx = event.clientX - dragState.x;
const dy = event.clientY - dragState.y;
if (dragState.pan) {
const forward = new THREE.Vector3();
camera.getWorldDirection(forward);
const right = new THREE.Vector3().crossVectors(forward, camera.up).normalize();
cameraState.target.addScaledVector(right, -dx * cameraState.radius * 0.0012);
cameraState.target.y += dy * cameraState.radius * 0.0012;
} else {
cameraState.theta -= dx * 0.006;
cameraState.phi = THREE.MathUtils.clamp(
cameraState.phi + dy * 0.005,
0.32,
1.36
);
}
dragState.x = event.clientX;
dragState.y = event.clientY;
}
updateHover(event);
});
renderer.domElement.addEventListener("pointerup", event => {
dragState = null;
if (renderer.domElement.hasPointerCapture(event.pointerId)) {
renderer.domElement.releasePointerCapture(event.pointerId);
}
});
renderer.domElement.addEventListener("pointercancel", () => {
dragState = null;
});
renderer.domElement.addEventListener("wheel", event => {
event.preventDefault();
cameraState.radius = THREE.MathUtils.clamp(
cameraState.radius * Math.exp(event.deltaY * 0.001),
10,
32
);
}, { passive: false });
/* --------------------------------------------------------------------------
Hover inspection
-------------------------------------------------------------------------- */
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
const tooltip = $("tooltip");
function findIndividual(object) {
while (object) {
if (object.userData.individual) return object.userData.individual;
object = object.parent;
}
return null;
}
function updateHover(event) {
const rect = renderer.domElement.getBoundingClientRect();
pointer.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
pointer.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
raycaster.setFromCamera(pointer, camera);
const hits = raycaster.intersectObjects(tokenRoot.children, true);
const individual = hits.length ? findIndividual(hits[0].object) : null;
if (!individual) {
tooltip.style.display = "none";
renderer.domElement.style.cursor = dragState ? "grabbing" : "grab";
return;
}
renderer.domElement.style.cursor = "pointer";
const alleleMarkup = LOCI.map((locus, index) => `
<span class="allele">
<i class="dot" style="--marker:${locus.color}"></i>
${locus.label}: ${individual.alleles[index]}
</span>
`).join("");
tooltip.innerHTML = `
<strong>${individual.id}</strong>
<span style="color:#a9b9ba">
· ${individual.patch === "transit" ? "in transit" : `Patch ${individual.patch}`}
</span>
<div style="color:#a9b9ba">Genotype: ${individual.alleles.join("")}</div>
<div class="alleles">${alleleMarkup}</div>
`;
tooltip.style.display = "block";
tooltip.style.left = `${Math.min(event.clientX + 14, window.innerWidth - 245)}px`;
tooltip.style.top = `${Math.min(event.clientY + 14, window.innerHeight - 115)}px`;
}
renderer.domElement.addEventListener("pointerleave", () => {
tooltip.style.display = "none";
});
/* --------------------------------------------------------------------------
Resize and render loop
-------------------------------------------------------------------------- */
function resize() {
const width = stage.clientWidth;
const height = stage.clientHeight;
renderer.setSize(width, height, false);
camera.aspect = width / Math.max(height, 1);
camera.updateProjectionMatrix();
}
new ResizeObserver(resize).observe(stage);
resize();
function animateTokens(delta) {
const factor = 1 - Math.exp(-delta * 7.5);
for (const group of tokenRoot.children) {
const individual = group.userData.individual;
if (!individual || !individual.mesh || !individual.target) continue;
if (individual.patch === "transit") continue;
individual.mesh.position.lerp(individual.target, factor);
}
}
let previousTime = performance.now();
function animate(now) {
requestAnimationFrame(animate);
const realDelta = Math.min(0.05, (now - previousTime) / 1000);
previousTime = now;
updateCamera();
animateTokens(realDelta);
updateSimulation(realDelta * speed);
renderer.render(scene, camera);
}
resetSimulation();
updateCamera();
requestAnimationFrame(animate);
</script>
</body>
</html>
```