Back to the library

Fly — trapezoid profile

Variant: Trapezoid

A drop flown in on a winch that accelerates for a third of the trip, cruises for a third and brakes for a third — the textbook trapezoid, and the shape of any motion built from eased segments glued end to end. Speed is continuous; acceleration is not. It steps four times per move, the trace marks each step in rust, and each one is an instant of infinite jerk that the cloth answers on its lines: it jigs through the whole flight and lands in a bob that swings 4.6px past trim after the pipe has stopped and takes most of a second to die. That swing is the card’s verdict, stamped beside the hem and the trace on the frame it peaks. Every third is an exact cubic-bezier (a quadratic is a bezier with x at thirds), and the rope is a damped spring simulated against the pipe and keyed at its turning points, so the bob is a consequence of the profile rather than a wobble added for character. Open it when a container moves on a stitched curve and whatever it carries — a spring-coupled child, a follower, a sheet’s content — wobbles on arrival: the bounce is not in the child’s spring, it is in the parent’s corners.

physicseasingdiagramloop

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>Fly — trapezoid profile</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: 4s;
        --t: calc(var(--cycle) / var(--speed));
        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        /* Only the reduced-motion breathing uses it. */
        --_breathe: cubic-bezier(0.45, 0, 0.55, 1);
      }

      * {
        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;
        text-wrap: balance;
        letter-spacing: 0.04em;
        color: color-mix(in srgb, var(--slate) 52%, transparent);
      }

      .scene {
        position: relative;
        width: 240px;
        height: 132px;
        overflow: hidden;
      }

      /* The masking border across the top of the opening: everything flown
         out is parked behind it, so the loop never needs a blackout. */
      .border {
        position: absolute;
        inset: 0 0 auto;
        height: 16px;
        background: var(--oat);
        z-index: 2;
      }

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

      /* Batten travel and rope stretch, in px. Two registered numbers drive
         every moving part, so the pipe, the lines and the cloth cannot
         disagree on any frame. */
      @property --_y {
        syntax: '<number>';
        inherits: true;
        initial-value: -96;
      }

      @property --_r {
        syntax: '<number>';
        inherits: true;
        initial-value: 0;
      }

      .rig {
        position: absolute;
        inset: 0;
        animation:
          travel var(--t) infinite,
          rope var(--t) infinite;
      }

      .set {
        position: absolute;
        left: 0;
        top: 40px;
        width: 240px;
        transform: translateY(calc(var(--_y) * 1px));
      }

      /* Lift lines run up into the loft, past the top of the frame. */
      .lift {
        position: absolute;
        bottom: 100%;
        width: 1px;
        height: 220px;
        background: color-mix(in srgb, var(--slate) 26%, transparent);
      }

      .lift.l {
        left: 62px;
      }

      .lift.r {
        left: 177px;
      }

      .batten {
        position: absolute;
        left: 42px;
        top: 0;
        width: 156px;
        height: 4px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--slate) 72%, transparent);
      }

      /* The pickups are the spring. Rest length 20px; they lengthen by
         exactly what the cloth sinks, so stretch is drawn, not implied. */
      .pick {
        position: absolute;
        top: 4px;
        width: 1.5px;
        height: 20px;
        background: color-mix(in srgb, var(--slate) 46%, transparent);
        transform-origin: top;
        transform: scaleY(calc(1 + var(--_r) / 20));
      }

      .pick.l {
        left: 61.75px;
      }

      .pick.r {
        left: 176.75px;
      }

      .drop {
        position: absolute;
        left: 54px;
        top: 24px;
        width: 132px;
        height: 44px;
        overflow: hidden;
        background: var(--paper);
        border: 1.5px solid var(--oat);
        border-bottom: 2px solid var(--clay-d);
        border-radius: calc(2px * var(--round)) calc(2px * var(--round)) 0 0;
        transform: translateY(calc(var(--_r) * 1px));
      }

      .drop::before {
        content: '';
        position: absolute;
        inset: auto 0 0;
        height: 42%;
        background: color-mix(in srgb, var(--clay) 16%, transparent);
      }

      /* Trim: where the hem belongs. The rule runs past both edges of the
         cloth so every crossing of it stays visible. */
      .trim {
        position: absolute;
        left: 34px;
        top: 107px;
        width: 172px;
        height: 1.5px;
        background: repeating-linear-gradient(
          to right,
          color-mix(in srgb, var(--slate) 34%, transparent) 0 3px,
          transparent 3px 6px
        );
      }

      .spike {
        position: absolute;
        left: 208px;
        top: 106px;
        width: 6px;
        height: 3px;
        border-radius: 1px;
        background: var(--clay);
      }

      .tag {
        position: absolute;
        font-size: 11px;
        line-height: 1;
        color: color-mix(in srgb, var(--slate) 58%, transparent);
      }

      .tag.trim-tag {
        left: 217px;
        top: 102px;
      }

      .trace {
        position: relative;
        display: grid;
        gap: 4px;
      }

      .tag.axis-tag {
        position: static;
      }

      .trace-head {
        display: flex;
        justify-content: space-between;
      }

      .trace svg {
        display: block;
        width: 240px;
        height: 28px;
        overflow: visible;
      }

      .axis {
        stroke: var(--oat);
        stroke-width: 1;
      }

      .curve {
        fill: none;
        stroke: color-mix(in srgb, var(--slate) 62%, transparent);
        stroke-width: 1.25;
        stroke-linejoin: round;
      }

      /* A linear playhead, because x is wall time and this is a clock. */
      .head {
        position: absolute;
        left: 0;
        bottom: 0;
        width: 1.5px;
        height: 28px;
        background: var(--clay);
        animation: sweep var(--t) linear infinite;
      }

      @keyframes sweep {
        from {
          transform: translateX(0);
        }
        to {
          transform: translateX(240px);
        }
      }

      /* The four steps per move, where jerk is infinite. */
      .jump {
        stroke: var(--rust);
        stroke-width: 2.5;
        stroke-linecap: round;
      }

      /* The verdict, read after the pipe has stopped: a tick at the hem's
         largest swing past trim, dropped in on the frame it happens, and
         the same number beside the trace. Both stay until the line flies. */
      .ring {
        position: absolute;
        left: 36px;
        top: 102.16px;
        width: 12px;
        height: 2px;
        border-radius: 1px;
        background: var(--rust);
        transform-origin: right;
        animation: ring var(--t) infinite;
      }

      .tag.ring-tag {
        position: static;
        color: var(--rust);
        font-variant-numeric: tabular-nums;
        animation: ring-tag var(--t) infinite;
      }

      @keyframes ring {
        0%,
        35.983% {
          opacity: 0;
          transform: scaleX(0.4);
        }
        36.008% {
          opacity: 1;
          transform: scaleX(0.4);
          animation-timing-function: var(--ease-out);
        }
        40.008%,
        60% {
          opacity: 1;
          transform: scaleX(1);
          animation-timing-function: var(--ease-out);
        }
        65%,
        100% {
          opacity: 0;
          transform: scaleX(1);
        }
      }

      @keyframes ring-tag {
        0%,
        36.008% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        40.008%,
        60% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        65%,
        100% {
          opacity: 0;
        }
      }

      /* Trapezoidal velocity: constant acceleration for a third of the
         move, cruise for a third, constant deceleration for a third. Each
         third is exact — a quadratic is a cubic-bezier with x at thirds —
         so the pipe's speed is continuous and its acceleration is not: it
         steps four times per move, and every step is an instant of
         infinite jerk. */
      @keyframes travel {
        0% {
          --_y: -96;
        }
        4% {
          --_y: -96;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.333);
        }
        14% {
          --_y: -72;
          animation-timing-function: linear;
        }
        24% {
          --_y: -24;
          animation-timing-function: cubic-bezier(0.333, 0.667, 0.667, 1);
        }
        34% {
          --_y: 0;
        }
        60% {
          --_y: 0;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.333);
        }
        70% {
          --_y: -24;
          animation-timing-function: linear;
        }
        80% {
          --_y: -72;
          animation-timing-function: cubic-bezier(0.333, 0.667, 0.667, 1);
        }
        90% {
          --_y: -96;
        }
        100% {
          --_y: -96;
        }
      }

      /* The rope: a damped spring (160ms period, ζ 0.08) driven by the
         pipe's acceleration, simulated and keyed at its turning points and
         at every change of segment. Each span is the cubic through the
         sim's position and velocity at both ends, so it tracks within
         0.15px; ring tails under 0.3px are landed on zero. */
      @keyframes rope {
        0% {
          --_r: 0;
          animation-timing-function: linear;
        }
        4% {
          --_r: 0;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        5.003% {
          --_r: -4.65;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        6.006% {
          --_r: -8.89;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        7.01% {
          --_r: -5.27;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        8.013% {
          --_r: -1.98;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        10.019% {
          --_r: -7.35;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        12.026% {
          --_r: -3.18;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.978);
        }
        14% {
          --_r: -6.42;
          animation-timing-function: linear;
        }
        14.007% {
          --_r: -6.42;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        15.01% {
          --_r: -0.45;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        16.013% {
          --_r: 4.99;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        17.017% {
          --_r: 0.35;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        18.02% {
          --_r: -3.87;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        19.023% {
          --_r: -0.27;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        20.026% {
          --_r: 3.01;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        22.033% {
          --_r: -2.34;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.972);
        }
        24% {
          --_r: 1.82;
          animation-timing-function: cubic-bezier(0.333, 0.02, 0.667, 0.515);
        }
        24.992% {
          --_r: 4.83;
          animation-timing-function: cubic-bezier(0.333, 0.551, 0.667, 1);
        }
        25.984% {
          --_r: 7.48;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        27.99% {
          --_r: 3.08;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        29.997% {
          --_r: 6.5;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        32.003% {
          --_r: 3.84;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.994);
        }
        34% {
          --_r: 5.9;
          animation-timing-function: linear;
        }
        34.001% {
          --_r: 5.9;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        35.005% {
          --_r: 0.42;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        36.008% {
          --_r: -4.59;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        37.011% {
          --_r: -0.32;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        38.014% {
          --_r: 3.57;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        39.018% {
          --_r: 0.25;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        40.021% {
          --_r: -2.77;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        42.027% {
          --_r: 2.15;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        44.033% {
          --_r: -1.67;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        46.04% {
          --_r: 1.3;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        48.046% {
          --_r: -1.01;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        50.053% {
          --_r: 0.79;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        52.059% {
          --_r: -0.61;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        54.065% {
          --_r: 0.47;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        56.072% {
          --_r: -0.37;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        58.078% {
          --_r: 0;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1.048);
        }
        58.319% {
          --_r: 0.27;
          animation-timing-function: cubic-bezier(0.333, 0.234, 0.667, 0.578);
        }
        58.559% {
          --_r: 0.21;
          animation-timing-function: cubic-bezier(0.333, 0.266, 0.667, 0.634);
        }
        59.039% {
          --_r: 0.04;
          animation-timing-function: cubic-bezier(0.333, 0.496, 0.667, 0.946);
        }
        60% {
          --_r: -0.22;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        60.004% {
          --_r: 0;
        }
        68.029% {
          --_r: 0;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.972);
        }
        68.275% {
          --_r: 3.23;
          animation-timing-function: cubic-bezier(0.333, 0.235, 0.667, 0.579);
        }
        68.522% {
          --_r: 3.62;
          animation-timing-function: cubic-bezier(0.333, 0.269, 0.667, 0.638);
        }
        69.014% {
          --_r: 4.82;
          animation-timing-function: cubic-bezier(0.333, 0.525, 0.667, 0.975);
        }
        70% {
          --_r: 6.48;
          animation-timing-function: linear;
        }
        70.008% {
          --_r: 6.48;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        71.011% {
          --_r: 0.46;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        72.014% {
          --_r: -5.03;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        73.017% {
          --_r: -0.36;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        74.021% {
          --_r: 3.91;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        75.024% {
          --_r: 0.28;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        76.027% {
          --_r: -3.04;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        78.034% {
          --_r: 2.36;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.971);
        }
        80% {
          --_r: -1.83;
          animation-timing-function: cubic-bezier(0.333, 0.02, 0.667, 0.515);
        }
        80.991% {
          --_r: -4.83;
          animation-timing-function: cubic-bezier(0.333, 0.551, 0.667, 1);
        }
        81.983% {
          --_r: -7.46;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        83.989% {
          --_r: -3.09;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        85.996% {
          --_r: -6.49;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        88.002% {
          --_r: -3.84;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.995);
        }
        90% {
          --_r: -5.9;
          animation-timing-function: linear;
        }
        90.001% {
          --_r: -5.9;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        91.005% {
          --_r: -0.41;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        92.008% {
          --_r: 4.58;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        93.011% {
          --_r: 0.32;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        94.014% {
          --_r: -3.56;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.5);
        }
        95.017% {
          --_r: -0.25;
          animation-timing-function: cubic-bezier(0.333, 0.548, 0.667, 1);
        }
        96.021% {
          --_r: 2.77;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 1);
        }
        98.027% {
          --_r: -2.15;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.976);
        }
        100% {
          --_r: 1.67;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* Travel and bob are the vestibular part and both go: the cloth
           hangs at trim, the playhead stops, and the verdict stays on the
           card — the ring tick and its number, breathing, so the argument
           survives without anything moving. */
        .rig,
        .head {
          animation: none;
        }

        .rig {
          --_y: 0;
          --_r: 0;
        }

        .head {
          opacity: 0;
        }

        .ring,
        .tag.ring-tag {
          animation: rest-cue calc(var(--t) * 0.6) var(--_breathe) infinite alternate;
        }

        @keyframes rest-cue {
          from {
            opacity: 0.45;
            transform: none;
          }
          to {
            opacity: 1;
            transform: none;
          }
        }
      }
    </style>
  </head>
  <body>
    <div
      class="stage"
      role="img"
      aria-label="A theatre drop flies in on a winch whose acceleration steps on and off: the cloth jigs on its lines throughout the move and keeps bobbing across its trim mark after the pipe has stopped, then flies out the same way"
    >
      <p class="cap">trapezoid &middot; the acceleration steps, so the cloth rings</p>
      <div class="scene">
        <span class="deck"></span>
        <span class="trim"></span>
        <span class="spike"></span>
        <span class="tag trim-tag">trim</span>
        <span class="ring"></span>
        <div class="rig">
          <div class="set">
            <span class="lift l"></span>
            <span class="lift r"></span>
            <span class="batten"></span>
            <span class="pick l"></span>
            <span class="pick r"></span>
            <div class="drop"></div>
          </div>
        </div>
        <span class="border"></span>
      </div>
      <div class="trace">
        <div class="trace-head">
          <span class="tag axis-tag">batten acceleration</span
          ><span class="tag ring-tag">rings 4.6px after stop</span>
        </div>
        <svg viewBox="0 0 240 28" aria-hidden="true">
          <line class="axis" x1="0" y1="14" x2="240" y2="14" />
          <path
            class="curve"
            d="M0 14 L9.6 14 L9.6 8 L33.6 8 L33.6 14 L57.6 14 L57.6 20 L81.6 20 L81.6 14 L144 14 L144 20 L168 20 L168 14 L192 14 L192 8 L216 8 L216 14 L240 14"
          />
          <line class="jump" x1="9.6" y1="14" x2="9.6" y2="8" />
          <line class="jump" x1="33.6" y1="8" x2="33.6" y2="14" />
          <line class="jump" x1="57.6" y1="14" x2="57.6" y2="20" />
          <line class="jump" x1="81.6" y1="20" x2="81.6" y2="14" />
          <line class="jump" x1="144" y1="14" x2="144" y2="20" />
          <line class="jump" x1="168" y1="20" x2="168" y2="14" />
          <line class="jump" x1="192" y1="14" x2="192" y2="8" />
          <line class="jump" x1="216" y1="8" x2="216" y2="14" />
        </svg>
        <span class="head"></span>
      </div>
    </div>
  </body>
</html>

The variant family

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