Aberration Simulation

by Chantal Roth

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Aberration in a Medium</title>
<style>
  body{
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1a1a2e;
    color: #eee;
    padding: 20px;
  }
  canvas{
    background: #16213e;
    border: 1px solid #0f3460;
    margin: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  #controls{
    margin: 12px 0;
    padding: 16px 24px;
    background: #0f3460;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    max-width: 760px;
  }
  label{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
  }
  input[type="range"]{
    width: 140px;
    height: 6px;
    background: #16213e;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
  }
  input[type="range"]::-webkit-slider-thumb{
    appearance: none;
    width: 16px;
    height: 16px;
    background: #e94560;
    border-radius: 50%;
    cursor: pointer;
  }
  input[type="checkbox"]{
    width: 16px;
    height: 16px;
    accent-color: #e94560;
    cursor: pointer;
  }
  .value{
    color: #e94560;
    font-weight: bold;
    min-width: 40px;
  }
  #angleInfo{
    color: #ffd166;
    font-size: 13px;
    min-width: 156px;
  }
  #lastHit{
    background: #16213e;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    min-width: 126px;
    text-align: center;
  }
  h2{
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #aaa;
  }
  .note{
    color: #aaa;
    font-size: 12px;
    line-height: 1.45;
    text-align: center;
    max-width: 680px;
    margin: 8px 0 0 0;
 ...