Back to the library

Dry stone — rocked to a seat

Variant: Rocked to a seat

A stone set down on one corner and let go. It rocks corner to corner until it seats, and the settle accelerates: each knock keeps 0.75 of the angular speed — a chosen restitution, livelier than a real slab this shape would give, as if the bed were slightly crowned — so each rock reaches 0.56 of the last angle, 12° down to 0.7°, and takes 0.75 of the last one’s time: 368ms down, then 276, 207, 155, 116 and 87ms legs. That quickening is what hard contact sounds like — the same law a dropped ball’s bounces follow — and the opposite of a spring, whose period never changes as it dies away; a constant-rhythm settle reads as elastic, a quickening one reads as a hard thing finding its bed. The stone turns about whichever corner is down, so it is two nested layers with opposite transform origins, each holding at zero while the other works and handing over at flat, where both agree. Beneath it a log stamps one tick per knock, at its time and as tall as the speed it struck at, uncovered by a linear wipe in step with the stone, so the ticks arrive shrinking and crowding until there is nothing left to log. Use it for a card, tile or sheet that lands on a surface, and whenever a settle should say "solid" rather than "springy".

physicseasingentranceloop

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 — rocked to a seat</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);
        /* A rocking block's restoring torque is close to constant for small
           tilts, so each rock is a little bounce in angle: 2s − s² up onto a
           corner, s² back down. 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 {
        font-size: 11px;
        letter-spacing: 0.04em;
        color: color-mix(in srgb, var(--slate) 52%, transparent);
      }

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

      .wall {
        position: absolute;
        left: 40px;
        top: 60px;
        width: 160px;
        display: grid;
        gap: 2px;
      }

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

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

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

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

      .drop {
        position: absolute;
        left: 96px;
        top: 34px;
        width: 48px;
        height: 26px;
        animation: lower var(--t) infinite;
      }

      /* Two pivots, two layers. A rocking block turns about whichever corner
         is down, so the outer layer only ever tips onto the left corner and
         the inner only onto the right; each holds at zero while the other
         works, and the handover happens at flat, where both agree. */
      .pivot-l,
      .pivot-r {
        width: 100%;
        height: 100%;
      }

      .pivot-l {
        transform-origin: 0 100%;
        animation: rock-l var(--t) infinite;
      }

      .pivot-r {
        transform-origin: 100% 100%;
        transform: rotate(12deg);
        animation: rock-r var(--t) infinite;
      }

      .stone {
        width: 100%;
        height: 100%;
        border-radius: calc(4px * var(--round));
        background: var(--clay);
      }

      /* Set down on its right corner, the left edge 10px proud. */
      @keyframes lower {
        0%,
        3% {
          transform: translateY(-18px);
          animation-timing-function: var(--ease-out);
        }
        13%,
        100% {
          transform: translateY(0);
        }
      }

      /* Released at 17%. Each knock keeps 0.75 of the angular speed — a
         chosen restitution, livelier than a slab this shape strictly earns,
         as if the bed were crowned — so each rock reaches 0.56 of the last
         angle (12°, 6.75°, 3.8°, 2.1°, 1.2°, 0.7°) and takes 0.75 of the last
         one's time: 368ms down, then 276, 207, 155, 116, 87ms legs. Unlike a
         spring, whose period is fixed, a rocking block quickens as it dies.
         Impacts fall at 25.36, 37.91, 47.32, 54.36, 59.64 and 63.59%. */
      @keyframes rock-r {
        0%,
        17% {
          transform: rotate(12deg);
          animation-timing-function: var(--_fall);
        }
        25.36%,
        37.91% {
          transform: rotate(0deg);
          animation-timing-function: var(--_rise);
        }
        42.61% {
          transform: rotate(3.8deg);
          animation-timing-function: var(--_fall);
        }
        47.32%,
        54.36% {
          transform: rotate(0deg);
          animation-timing-function: var(--_rise);
        }
        57% {
          transform: rotate(1.2deg);
          animation-timing-function: var(--_fall);
        }
        59.64%,
        94% {
          transform: rotate(0deg);
        }
        95%,
        100% {
          transform: rotate(12deg);
        }
      }

      @keyframes rock-l {
        0%,
        25.36% {
          transform: rotate(0deg);
          animation-timing-function: var(--_rise);
        }
        31.64% {
          transform: rotate(-6.75deg);
          animation-timing-function: var(--_fall);
        }
        37.91%,
        47.32% {
          transform: rotate(0deg);
          animation-timing-function: var(--_rise);
        }
        50.84% {
          transform: rotate(-2.14deg);
          animation-timing-function: var(--_fall);
        }
        54.36%,
        59.64% {
          transform: rotate(0deg);
          animation-timing-function: var(--_rise);
        }
        61.61% {
          transform: rotate(-0.68deg);
          animation-timing-function: var(--_fall);
        }
        63.59%,
        100% {
          transform: rotate(0deg);
        }
      }

      .seated {
        position: absolute;
        left: 152px;
        top: 42px;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.04em;
        line-height: 1;
        color: var(--olive);
        opacity: 0;
        animation: seated var(--t) infinite;
      }

      @keyframes seated {
        0%,
        63.59% {
          opacity: 0;
          transform: translateX(-3px);
          animation-timing-function: var(--ease-out);
        }
        68.5%,
        86% {
          opacity: 1;
          transform: translateX(0);
        }
        92%,
        100% {
          opacity: 0;
          transform: translateX(0);
        }
      }

      /* The impact log. x is time since release, 200px for 2.05s, and each
         tick's height is the speed the stone struck at. A linear wipe uncovers
         it in step with the stone, so the ticks arrive as the knocks do:
         shorter, and closer together, until there is nothing left to log. */
      .base {
        position: absolute;
        left: 20px;
        top: 112px;
        width: 206px;
        height: 1px;
        background: var(--oat);
      }

      .base::before {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 1px;
        height: 5px;
        background: color-mix(in srgb, var(--slate) 34%, transparent);
      }

      .log {
        position: absolute;
        inset: 0;
        clip-path: inset(0 220px 0 0);
        animation: uncover var(--t) linear infinite;
      }

      .log i {
        position: absolute;
        bottom: 4px;
        width: 2px;
        margin-left: -1px;
        border-radius: 1px;
        background: var(--clay-d);
      }

      .head {
        position: absolute;
        left: 20px;
        top: 94px;
        width: 1px;
        height: 18px;
        background: color-mix(in srgb, var(--slate) 34%, transparent);
        opacity: 0;
        animation: sweep var(--t) linear infinite;
      }

      @keyframes uncover {
        0%,
        17% {
          clip-path: inset(0 220px 0 0);
        }
        63.59%,
        94% {
          clip-path: inset(0 18px 0 0);
        }
        95%,
        100% {
          clip-path: inset(0 220px 0 0);
        }
      }

      @keyframes sweep {
        0%,
        16.9% {
          opacity: 0;
          transform: translateX(0);
        }
        17% {
          opacity: 1;
          transform: translateX(0);
        }
        63.59% {
          opacity: 1;
          transform: translateX(200px);
        }
        66.5%,
        100% {
          opacity: 0;
          transform: translateX(200px);
        }
      }

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

      @media (prefers-reduced-motion: reduce) {
        /* The tilt is the motion and it goes. The stone sits seated, the full
           log of knocks is on the card, and the log breathes — the shape of
           the settle is the thing to read, and it reads at rest. */
        .rig,
        .drop,
        .pivot-l,
        .pivot-r,
        .head {
          animation: none;
          transform: none;
        }

        .rig {
          opacity: 1;
        }

        .head {
          opacity: 0;
        }

        .seated {
          animation: none;
          opacity: 1;
        }

        .log {
          clip-path: none;
          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="A flat stone is set down tilted on one corner of a wall and released. It rocks from corner to corner, each rock smaller and quicker than the last, until it sits flat; a log beneath stamps one tick per knock, the ticks shrinking and crowding together toward rest"
    >
      <p class="cap">each rock smaller, and sooner</p>
      <div class="scene">
        <div class="wall">
          <div class="course">
            <span style="width: 34px"></span><span style="width: 40px"></span
            ><span style="width: 44px"></span><span style="width: 36px"></span>
          </div>
          <div class="course">
            <span style="width: 20px"></span><span style="width: 42px"></span
            ><span style="width: 38px"></span><span style="width: 54px"></span>
          </div>
        </div>
        <span class="base"></span>
        <div class="rig">
          <div class="drop">
            <div class="pivot-l">
              <div class="pivot-r"><div class="stone"></div></div>
            </div>
          </div>
          <span class="seated">seated</span>
          <div class="log">
            <i style="left: 55.9px; height: 16px"></i>
            <i style="left: 109.76px; height: 12px"></i>
            <i style="left: 150.15px; height: 9px"></i>
            <i style="left: 180.39px; height: 6.75px"></i>
            <i style="left: 203.02px; height: 5.06px"></i>
            <i style="left: 220px; height: 3.8px"></i>
          </div>
          <span class="head"></span>
        </div>
      </div>
    </div>
  </body>
</html>

The variant family

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