Special Relativity (Wave based)
by Chantal Roth
HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>SR Simulation: Infinite Stationary</title>
<script src="https://cdn.jsdelivr.net/npm/three@0.124.0/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.124.0/examples/js/controls/OrbitControls.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap" rel="stylesheet">
<style>
body { margin:0; padding:0; background:#111; overflow:hidden; font-family: 'Roboto Mono', monospace; color: #eee; }
#container3d { position:relative; width:100vw; height:100vh; }
#myCanvas { width:100%; height:100%; display:block; }
/* Control Panel */
#controls {
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
background: rgba(30, 30, 40, 0.9);
padding: 15px 25px;
border-radius: 12px;
border: 1px solid #444;
display: flex;
flex-wrap: wrap;
gap: 15px;
align-items: center;
justify-content: center;
box-shadow: 0 0 20px rgba(0,0,0,0.5);
max-width: calc(100vw - 40px);
}
label { font-size: 12px; color: #aaa; text-transform: uppercase; letter-spacing: 1px; margin-right: 5px; }
select, button {
background: #222;
color: #fff;
border: 1px solid #555;
padding: 6px 12px;
border-radius: 4px;
font-family: inherit;
font-size: 13px;
cursor: pointer;
transition: all 0.2s;
}
select:hover, button:hover { background: #333; border-color: #888; }
button#restartButton { background: #0055aa; border:none; }
button#restartButton:hover { background: #0077cc; }
/* HUD */
#hud {
position: absolute;
top: 20px;
right: 20px;
width: 320px;
...