Sonar Clock (Time Dilation)

by Chantal Roth

HTML

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Relativistic Length Measurement (Sonar Ticks)</title>
  <style>
    body { 
      margin: 0; 
      background: #0a1128; 
      font-family: 'Segoe UI', Arial, sans-serif;
      padding: 20px;
      color: #e0e0e0;
      overflow-x: hidden;
    }
    
    /* Layout Grid */
    .main-layout {
      display: grid;
      /* TWEAK: Increased right column to 500px */
      grid-template-columns: 1fr 500px;
      gap: 20px;
      /* TWEAK: Increased max-width to accommodate wider columns */
      max-width: 1300px; 
      margin: 0 auto;
      align-items: start;
    }

    .canvas-column {
      display: flex;
      flex-direction: column;
      gap: 15px;
    }

    canvas {
      display: block;
      background: #1a237e; 
      border: 2px solid #3949ab;
      box-shadow: 0 6px 12px rgba(0,0,0,0.4);
      border-radius: 6px;
      width: 100%;
      height: auto;
    }

    /* Controls Header */
    .controls-container {
      max-width: 1200px;
      margin: 0 auto 20px auto;
      background: rgba(255,255,255,0.05);
      padding: 15px;
      border-radius: 8px;
      text-align: center;
      border: 1px solid rgba(255,255,255,0.1);
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 20px;
    }

    .btn {
      background: #00bfa5; 
      border: none;
      color: white;
      padding: 8px 20px;
      font-size: 16px;
      cursor: pointer;
      border-radius: 4px;
      transition: all 0.3s ease;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    .btn:hover { background: #1de9b6; box-shadow: 0 4px 8px rgba(0,0,0,0.3); }

    /* Right Side Blackboard */
    .blackboard {
      background: #263238;
      border: 4px solid #37474f;
      border-radius: 8px;
      padding: 20px;
      box-shadow:...