Back to the library

Dry stone — lob and line, one gravity

Variant: Lob and line

Two stones thrown together at the same wall under one gravity of 600px/s²: a low line throw that climbs 40px and a lob that climbs 76px. The line lands in 0.60s; the lob lands 1.54× later, across the joint between the line stone and its neighbour — one over two, the way a dry-stone course is laid. Flight time is set by height alone — √(2h/g) up plus √(2h/g) down — and the horizontal distance has no say, which is the mistake almost every fly-to-cart arc makes: give every throw one duration and each higher arc quietly needs a stronger gravity, so the room changes weight from item to item and a burst of them reads as a juggling act rather than one physics. Both planned paths are drawn as SVG quadratic Béziers before anything leaves, because a quadratic Bézier is exactly a parabola — the guide and the flight agree by construction. Each landing stamps its time as a ratio to the line throw rather than in seconds, so the readout survives the speed knob. Use it whenever arcs of different heights share a screen: derive each duration from its apex, or fix the height and let distance vary.

physicseasingsvgloop

The source

A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Dry stone — lob and line, one gravity</title>
    <style>
      :root {
        /* Neutrals — fixed, never remixed. */
        --ivory: #faf9f5;
        --paper: #ffffff;
        --oat: #e3dacc;
        --slate: #141413;

        /* Knobs — the remix API. A knob exists iff declared here and used below. */
        --hue: 38.8;
        --lift: 0;
        --chroma: 1;
        --round: 1;
        --speed: 1;

        /* Accents — derived from the knobs with the family's offsets baked in,
           so one hue roll moves them together. Defaults reproduce the original hex. */
        --clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
        --clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
        --olive: oklch(
          calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
        );
        --rust: oklch(
          calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
        );

        /* Clock — every duration in the document runs off --t. */
        --cycle: 4.4s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
        /* Gravity: the cubic forms of 2s − s² (rising, losing speed) and s²
           (falling, gaining it). Physics, so not in --ease-accent. */
        --_rise: cubic-bezier(0.333, 0.667, 0.667, 1);
        --_fall: cubic-bezier(0.333, 0, 0.667, 0.333);
      }

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      body {
        min-height: 100vh;
        display: grid;
        place-items: center;
        background: var(--ivory);
        font-family:
          system-ui,
          -apple-system,
          'Segoe UI',
          Roboto,
          sans-serif;
        color: var(--slate);
      }

      .stage {
        display: grid;
        gap: 10px;
        width: 240px;
      }

      .cap,
      .legend {
        font-size: 11px;
        letter-spacing: 0.04em;
        color: color-mix(in srgb, var(--slate) 52%, transparent);
      }

      .scene {
        position: relative;
        width: 240px;
        height: 140px;
      }

      .ground {
        position: absolute;
        left: 0;
        right: 0;
        top: 126px;
        height: 2px;
        background: var(--oat);
      }

      .wall {
        position: absolute;
        display: grid;
        gap: 2px;
      }

      .wall.near {
        left: 10px;
        top: 111px;
      }

      .wall.far {
        left: 160px;
        top: 87px;
      }

      .course {
        display: flex;
        gap: 2px;
        height: 11px;
      }

      .near .course {
        height: 15px;
      }

      .far .course:last-child {
        height: 13px;
      }

      .course span,
      .laid {
        border-radius: calc(3px * var(--round));
        background: color-mix(in srgb, var(--oat) 72%, var(--paper));
      }

      .course span:nth-child(2n) {
        background: var(--oat);
      }

      .laid {
        position: absolute;
        left: 212px;
        top: 73px;
        width: 22px;
        height: 14px;
        background: var(--oat);
      }

      /* The plan, drawn before either stone leaves. An SVG quadratic Bézier
         is exactly a parabola, so the guide and the flight are the same curve
         by construction rather than by eye. */
      .guides {
        position: absolute;
        inset: 0;
        overflow: visible;
      }

      .guides path {
        fill: none;
        stroke: color-mix(in srgb, var(--slate) 20%, transparent);
        stroke-width: 1.5;
        stroke-dasharray: 2 5;
        stroke-linecap: round;
      }

      .rig {
        position: absolute;
        inset: 0;
        animation: rig-cycle var(--t) linear infinite;
      }

      .x {
        position: absolute;
        left: 23px;
      }

      .stone {
        width: 22px;
        height: 14px;
        border-radius: calc(3px * var(--round));
      }

      .line {
        top: 97px;
        animation: across-line var(--t) infinite;
      }

      .line .y {
        animation: updown-line var(--t) infinite;
      }

      .line .stone {
        background: var(--clay);
      }

      .lob {
        top: 83px;
        animation: across-lob var(--t) infinite;
      }

      .lob .y {
        animation: updown-lob var(--t) infinite;
      }

      .lob .stone {
        background: var(--olive);
      }

      /* Both leave on the same frame (13.64%) for the same wall, under one
         gravity of 600px/s². Flight time is set by how high a stone goes —
         t = √(2h/g) up plus √(2h/g) down — and not by how far, so the line
         lands in 0.60s and the lob, climbing 36px further, in 0.92s. Give both arcs one
         duration and the lob would need a stronger gravity than the line:
         the room would change weight between throws. */
      @keyframes across-line {
        0%,
        13.636% {
          transform: translateX(0);
          animation-timing-function: linear;
        }
        27.184%,
        94% {
          transform: translateX(164px);
        }
        95%,
        100% {
          transform: translateX(0);
        }
      }

      @keyframes updown-line {
        0%,
        13.636% {
          transform: translateY(0);
          animation-timing-function: var(--_rise);
        }
        21.935% {
          transform: translateY(-40px);
          animation-timing-function: var(--_fall);
        }
        27.184%,
        94% {
          transform: translateY(-24px);
        }
        95%,
        100% {
          transform: translateY(0);
        }
      }

      @keyframes across-lob {
        0%,
        13.636% {
          transform: translateX(0);
          animation-timing-function: linear;
        }
        34.538%,
        94% {
          transform: translateX(176.5px);
        }
        95%,
        100% {
          transform: translateX(0);
        }
      }

      /* It comes down across the joint between the stone the line throw just
         laid and the one beside it — one over two, never a running joint —
         and the course is built in flight order, which is why the line goes
         first. */
      @keyframes updown-lob {
        0%,
        13.636% {
          transform: translateY(0);
          animation-timing-function: var(--_rise);
        }
        25.076% {
          transform: translateY(-76px);
          animation-timing-function: var(--_fall);
        }
        34.538%,
        94% {
          transform: translateY(-24px);
        }
        95%,
        100% {
          transform: translateY(0);
        }
      }

      .legend {
        display: flex;
        gap: 18px;
        font-variant-numeric: tabular-nums;
      }

      .legend span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
      }

      .legend span::before {
        content: '';
        width: 8px;
        height: 8px;
        border-radius: calc(2px * var(--round));
        background: var(--clay);
      }

      .legend .k-lob::before {
        background: var(--olive);
      }

      .legend b {
        font-weight: 600;
        color: var(--slate);
        opacity: 0;
      }

      /* Each time is written on the frame its stone lands, as a ratio to the
         line throw — a ratio survives the speed knob; seconds would not. */
      .k-line b {
        animation: stamp-line var(--t) infinite;
      }

      .k-lob b {
        animation: stamp-lob var(--t) infinite;
      }

      @keyframes stamp-line {
        0%,
        27.184% {
          opacity: 0;
          transform: translateY(3px);
          animation-timing-function: var(--ease-out);
        }
        32%,
        86% {
          opacity: 1;
          transform: translateY(0);
        }
        92%,
        100% {
          opacity: 0;
          transform: translateY(0);
        }
      }

      @keyframes stamp-lob {
        0%,
        34.538% {
          opacity: 0;
          transform: translateY(3px);
          animation-timing-function: var(--ease-out);
        }
        39.4%,
        86% {
          opacity: 1;
          transform: translateY(0);
        }
        92%,
        100% {
          opacity: 0;
          transform: translateY(0);
        }
      }

      @keyframes rig-cycle {
        0% {
          opacity: 0;
        }
        5%,
        86% {
          opacity: 1;
        }
        92%,
        100% {
          opacity: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* Nothing flies. Both stones sit where they landed, the two planned
           arcs stay drawn, and the ratio that is the lesson breathes. */
        .rig,
        .x.line,
        .x.lob,
        .line .y,
        .lob .y {
          animation: none;
          opacity: 1;
        }

        .x.line {
          transform: translateX(164px);
        }

        .x.lob {
          transform: translateX(176.5px);
        }

        .line .y,
        .lob .y {
          transform: translateY(-24px);
        }

        .legend b {
          animation: rest-cue calc(var(--t) * 1.6) var(--ease-in-out) infinite;
        }

        @keyframes rest-cue {
          0%,
          100% {
            opacity: 0.45;
          }
          50% {
            opacity: 1;
          }
        }
      }
    </style>
  </head>
  <body>
    <div
      class="stage"
      role="img"
      aria-label="Two stones are thrown together at the same wall under the same gravity: a low line throw lands first, and a high lob lands about one and a half times later, on top of the first stone"
    >
      <p class="cap">one gravity &middot; higher arcs fly longer</p>
      <div class="scene">
        <div class="ground"></div>
        <div class="wall near">
          <div class="course">
            <span style="width: 24px"></span><span style="width: 24px"></span>
          </div>
        </div>
        <div class="wall far">
          <div class="course">
            <span style="width: 26px"></span><span style="width: 28px"></span
            ><span style="width: 22px"></span>
          </div>
          <div class="course">
            <span style="width: 14px"></span><span style="width: 32px"></span
            ><span style="width: 30px"></span>
          </div>
          <div class="course">
            <span style="width: 30px"></span><span style="width: 24px"></span
            ><span style="width: 22px"></span>
          </div>
        </div>
        <span class="laid"></span>
        <svg class="guides" viewBox="0 0 240 140" width="240" height="140" aria-hidden="true">
          <path d="M34 104 Q116 38.7 198 80" />
          <path d="M34 90 Q122.25 -48.86 210.5 66" />
        </svg>
        <div class="rig">
          <div class="x line">
            <div class="y"><div class="stone"></div></div>
          </div>
          <div class="x lob">
            <div class="y"><div class="stone"></div></div>
          </div>
        </div>
      </div>
      <p class="legend">
        <span class="k-line">line <b>1.00&times;</b></span>
        <span class="k-lob">lob <b>1.54&times;</b></span>
      </p>
    </div>
  </body>
</html>

The variant family

Same idea, one axis moved. Compare them side by side before you commit.