Back to the library

Thread — jump to the quoted message

Variant: Jump to source

A quoted reply works like a call number: it is the address of the original, and pressing it should take the reader to the shelf, not open a copy. The quote takes a 128ms press, then the whole list glides 204px back up to the source in 560ms on ease-in-out — the list is already on screen going from A to B, and the soft start keeps the reader attached to the row they left while the soft stop hands them the one they came for. The landing mark waits until the list has stopped: lit during the glide it would be a moving target, lit after it answers the only question a jump raises, which of these rows is it. It arrives in 128ms and leaves over 1.4s, in fast and out slow, so it has gone by the time the line is read and never needs dismissing. Every row is one fixed pitch so the jump is a whole number of rows. Reach for it on quoted replies, permalinks, search hits inside a long thread and "jump to first unread"; for jumps of more than a screen or two, cut to just short of the target and glide only the last stretch.

transitionscrolllistemphasisloop

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>Thread — jump to the quoted message</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 — 6.4s, so 1% is 64ms. Press at 14%, the glide runs 18% to
           26.75% (560ms), the landing mark arrives only after it, and the
           view resets behind a fade from 86%. */
        --cycle: 6.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);

        --_muted: color-mix(in srgb, var(--slate) 58%, transparent);
        --_quote: color-mix(in srgb, var(--oat) 45%, var(--paper));
        --_quote-press: color-mix(in srgb, var(--oat) 85%, var(--paper));
        --_mark: color-mix(in srgb, var(--clay) 16%, var(--paper));
        --_a: color-mix(in srgb, var(--clay) 30%, var(--paper));
        --_j: color-mix(in srgb, var(--olive) 32%, var(--paper));
        --_m: color-mix(in srgb, var(--oat) 90%, var(--paper));
        --_row: 28px;
        --_gap: 6px;
        --_pitch: calc(var(--_row) + var(--_gap));
      }

      * {
        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);
      }

      .card {
        width: min(340px, 92vw);
        background: var(--paper);
        border: 1px solid var(--oat);
        border-radius: calc(14px * var(--round));
        overflow: hidden;
      }

      .head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 32px;
        padding: 0 14px;
        font-size: 12px;
        color: var(--_muted);
        border-bottom: 1px solid var(--oat);
      }

      .head b {
        color: var(--slate);
        font-weight: 600;
      }

      /* Five rows tall. Every row is one fixed pitch, so a jump is a whole
         number of pitches and the landing never depends on text wrapping. */
      .view {
        position: relative;
        height: calc(5 * var(--_pitch) - var(--_gap) + 16px);
        padding: 8px 10px;
        overflow: hidden;
      }

      .strip {
        display: grid;
        gap: var(--_gap);
        transform: translateY(calc(-6 * var(--_pitch)));
        animation: strip var(--t) infinite;
      }

      .row {
        position: relative;
        isolation: isolate;
        display: flex;
        align-items: center;
        gap: 8px;
        height: var(--_row);
        padding: 0 6px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
      }

      .av {
        flex: none;
        display: grid;
        place-items: center;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        font-size: 11px;
        font-style: normal;
        font-weight: 600;
        background: var(--_m);
      }
      .a .av {
        background: var(--_a);
      }
      .j .av {
        background: var(--_j);
      }

      .row b {
        flex: none;
        font-weight: 600;
      }

      .row span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--_muted);
      }

      /* The reply is two pitches tall: the quote, then the answer. */
      .reply {
        height: calc(2 * var(--_row) + var(--_gap));
        align-items: flex-start;
        padding-top: 5px;
      }

      .reply .body {
        display: grid;
        gap: 6px;
        min-width: 0;
      }

      .quote {
        justify-self: start;
        max-width: 100%;
        padding: 3px 8px;
        font-size: 12px;
        color: var(--_muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        background: var(--_quote);
        border-left: 2px solid var(--clay);
        border-radius: calc(4px * var(--round));
        transform-origin: 0 50%;
        animation: press var(--t) infinite;
      }

      .quote {
        position: relative;
        isolation: isolate;
      }

      /* The press tint is a layer that fades, so only opacity animates. */
      .quote::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--_quote-press);
        opacity: 0;
        animation: tint var(--t) infinite;
      }

      .reply .text {
        color: var(--slate);
      }

      /* The mark lands on the source, but only once the list has stopped.
         Lit during the glide it would be a moving target; lit after, it
         answers the one question a jump raises — which of these is it. */
      .src::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--_mark);
        border-radius: calc(6px * var(--round));
        opacity: 0;
        animation: mark var(--t) infinite;
      }

      /* The bar is its own straight-edged layer: a border on a rounded box
         curls at the corners. */
      .src::after {
        content: '';
        position: absolute;
        left: 0;
        top: 5px;
        bottom: 5px;
        width: 2px;
        border-radius: 999px;
        background: var(--clay);
        opacity: 0;
        animation: mark var(--t) infinite;
      }

      /* 204px in 560ms on ease-in-out: the list is already on screen going
         from A to B, and the soft start keeps the reader attached to the row
         they left while the soft stop gives them the row they came for. */
      @keyframes strip {
        0%,
        18% {
          opacity: 1;
          transform: translateY(calc(-6 * var(--_pitch)));
          animation-timing-function: var(--ease-in-out);
        }
        26.75%,
        86% {
          opacity: 1;
          transform: translateY(0);
          animation-timing-function: var(--ease-out);
        }
        /* The reset never scrolls back. Gliding down again would read as a
           second jump the reader did not ask for. */
        91% {
          opacity: 0;
          transform: translateY(0);
        }
        91.1% {
          opacity: 0;
          transform: translateY(calc(-6 * var(--_pitch)));
          animation-timing-function: var(--ease-out);
        }
        97%,
        100% {
          opacity: 1;
          transform: translateY(calc(-6 * var(--_pitch)));
        }
      }

      @keyframes press {
        0%,
        14% {
          transform: none;
          animation-timing-function: var(--ease-out);
        }
        16% {
          transform: scale(0.97);
          animation-timing-function: var(--ease-out);
        }
        19%,
        100% {
          transform: none;
        }
      }

      @keyframes tint {
        0%,
        14% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        16% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        19%,
        100% {
          opacity: 0;
        }
      }

      /* In fast, out slow: 128ms to arrive, 1.4s to leave, so it is gone by
         the time the reader has finished the line and never needs dismissing. */
      @keyframes mark {
        0%,
        27% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        29%,
        52% {
          opacity: 1;
          animation-timing-function: var(--ease-in-out);
        }
        74%,
        100% {
          opacity: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* The list does not travel: it dips out at the old place and comes
           back at the source, and the mark still lands after. The press
           keeps its tint and loses its scale. Everything runs 1.5x. */
        :root {
          --t: calc(var(--cycle) * 1.5 / var(--speed));
        }

        .strip {
          animation-name: strip-still;
        }

        @keyframes strip-still {
          0%,
          18% {
            opacity: 1;
            transform: translateY(calc(-6 * var(--_pitch)));
          }
          21% {
            opacity: 0;
            transform: translateY(calc(-6 * var(--_pitch)));
          }
          21.1% {
            opacity: 0;
            transform: translateY(0);
          }
          25%,
          86% {
            opacity: 1;
            transform: translateY(0);
          }
          91% {
            opacity: 0;
            transform: translateY(0);
          }
          91.1% {
            opacity: 0;
            transform: translateY(calc(-6 * var(--_pitch)));
          }
          97%,
          100% {
            opacity: 1;
            transform: translateY(calc(-6 * var(--_pitch)));
          }
        }

        .quote {
          animation: none;
        }
      }
    </style>
  </head>
  <body>
    <div
      class="card"
      role="img"
      aria-label="A channel scrolled to its latest reply, which quotes an earlier message; the quote is pressed, the list glides back up to the original message, and only once it stops does that message take a soft highlight that fades"
    >
      <div class="head"><b># launch</b><span>4 members</span></div>
      <div class="view">
        <div class="strip" aria-hidden="true">
          <div class="row j"><i class="av">J</i><b>Joel</b><span>Morning all</span></div>
          <div class="row a src">
            <i class="av">A</i><b>Ana</b><span>Ship the beta Friday?</span>
          </div>
          <div class="row m"><i class="av">M</i><b>Mei</b><span>Docs are nearly done</span></div>
          <div class="row j"><i class="av">J</i><b>Joel</b><span>QA is on it today</span></div>
          <div class="row a"><i class="av">A</i><b>Ana</b><span>Changelog draft is up</span></div>
          <div class="row m"><i class="av">M</i><b>Mei</b><span>Screens are exported</span></div>
          <div class="row j"><i class="av">J</i><b>Joel</b><span>Reviewing it now</span></div>
          <div class="row a"><i class="av">A</i><b>Ana</b><span>Pricing page is live</span></div>
          <div class="row m"><i class="av">M</i><b>Mei</b><span>Looks sharp</span></div>
          <div class="row j reply">
            <i class="av">J</i>
            <div class="body">
              <span class="quote">Ana: Ship the beta Friday?</span>
              <span class="text">Friday works. QA signed off.</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>