Back to the library

Transit — echo trail

Variant: Echo

Onion skinning as a UI device: four copies of the token ride the same carrier on the same curve, each started 7ms behind the last, at 40%, 28%, 18% and 10% opacity in the darker clay. Nothing fades them. At rest every late copy has caught up and sits hidden under the token. In flight, the gaps open exactly as wide as the token is fast, so the trail is the velocity graph drawn in space: pressed together at departure, spread at the middle, folded back in on arrival. The 7ms comes from the peak speed: it is less than one token-width of travel at the fastest point, so the copies overlap and read as one thing moving rather than a row of beads. It is the louder sibling of the smear. Use it when the destination is far from where the eye is, or the moving thing is small enough to lose, like a dot jumping across a timeline or an item sent to a distant tray. Under reduced motion the trail goes with the travel, and the token crossfades between sockets.

transitionspatialstaggereasingloop

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>Transit — echo trail</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;
        --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 — 3.2s: rest, 400ms across (12.5%), rest, 400ms back, rest. */
        --cycle: 3.2s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

        --_d: 28px;
      }

      * {
        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: clamp(14px, 5vh, 22px);
        justify-items: center;
      }

      .track {
        position: relative;
        overflow: clip;
        /* The carriers are track-sized, so in flight their empty boxes run
           past the edge; clipping here keeps the page from scrolling. The
           margin leaves room for the token's shadow. */
        overflow-clip-margin: 4px;
        width: min(280px, 78vw);
        height: var(--_d);
      }

      .socket {
        position: absolute;
        top: 0;
        width: var(--_d);
        height: var(--_d);
        border-radius: 50%;
        border: 1.5px dashed color-mix(in srgb, var(--slate) 22%, transparent);
      }

      .socket.a {
        left: 0;
      }

      .socket.b {
        right: 0;
      }

      /* The rail is dots, not a line: a fixed reference the eye can measure
         the spacing against. */
      .rail {
        position: absolute;
        left: calc(var(--_d) + 12px);
        right: calc(var(--_d) + 12px);
        top: 50%;
        height: 3px;
        transform: translateY(-50%);
        background: radial-gradient(
            circle,
            color-mix(in srgb, var(--slate) 18%, transparent) 1.5px,
            transparent 1.6px
          )
          0 50% / 14px 3px repeat-x;
      }

      .x {
        position: absolute;
        inset: 0;
        animation: travel var(--t) var(--ease-in-out) infinite;
      }

      .token {
        position: absolute;
        left: 0;
        top: 0;
        width: var(--_d);
        height: var(--_d);
        border-radius: 50%;
        background: var(--clay);
      }

      /* Each echo is the same carrier on the same curve, started a little
         later — 7ms apart, under a token-width at peak speed, so the copies
         overlap and the trail stays continuous instead of breaking into beads. Nothing fades them.
         At rest a late copy has caught up and sits under the token, hidden;
         in flight the gaps open exactly as wide as the token is fast. The
         spacing is the velocity graph, drawn in space. */
      .echo {
        animation-delay: calc(var(--_i) * 7ms / var(--speed));
      }

      .echo .token {
        background: var(--clay-d);
        opacity: var(--_a);
      }

      .echo:nth-of-type(1) {
        --_i: 4;
        --_a: 0.1;
      }

      .echo:nth-of-type(2) {
        --_i: 3;
        --_a: 0.18;
      }

      .echo:nth-of-type(3) {
        --_i: 2;
        --_a: 0.28;
      }

      .echo:nth-of-type(4) {
        --_i: 1;
        --_a: 0.4;
      }

      .cap {
        font-size: 11.5px;
        letter-spacing: 0.02em;
        color: color-mix(in srgb, var(--slate) 55%, transparent);
      }

      @keyframes travel {
        0%,
        15% {
          transform: translateX(0);
        }
        27.5%,
        65% {
          transform: translateX(calc(100% - var(--_d)));
        }
        77.5%,
        100% {
          transform: translateX(0);
        }
      }

      .token.ghost {
        display: none;
      }

      @media (prefers-reduced-motion: reduce) {
        /* The trail exists only as a by-product of travel, so with the
           travel gone it goes too, and the token crossfades between sockets. */
        .x {
          animation: none;
        }

        .x.echo {
          display: none;
        }

        .token {
          animation: seat-a calc(var(--t) * 1.6) ease infinite;
        }

        .token.ghost {
          display: block;
          left: auto;
          right: 0;
          animation-name: seat-b;
        }

        @keyframes seat-a {
          0%,
          15% {
            opacity: 1;
          }
          27.5%,
          65% {
            opacity: 0;
          }
          77.5%,
          100% {
            opacity: 1;
          }
        }

        @keyframes seat-b {
          0%,
          15% {
            opacity: 0;
          }
          27.5%,
          65% {
            opacity: 1;
          }
          77.5%,
          100% {
            opacity: 0;
          }
        }
      }
    </style>
  </head>
  <body>
    <div
      class="stage"
      role="img"
      aria-label="A dot crosses between two sockets trailing fading copies of itself that spread apart at the fastest moment and collapse back under it on arrival"
    >
      <div class="track">
        <span class="rail"></span>
        <span class="socket a"></span>
        <span class="socket b"></span>
        <div class="x echo"><span class="token"></span></div>
        <div class="x echo"><span class="token"></span></div>
        <div class="x echo"><span class="token"></span></div>
        <div class="x echo"><span class="token"></span></div>
        <div class="x lead"><span class="token"></span></div>
        <span class="token ghost"></span>
      </div>
      <p class="cap">echo spacing = speed</p>
    </div>
  </body>
</html>

The variant family

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