Back to the library

Stow — later, into the bell

Variant: Later to bell

A toast nobody acted on should not simply fade: a fade says “gone”, and the user who glanced away is left wondering whether they missed something. Sent into the notification bell instead, it says “filed, over there”. “Later” is pressed, the toast travels to the bell in 380ms on the stow curve and stays solid until two thirds of the way, the bell swings once — 9°, then half, then half again, enough to take the weight of what went in and no more, because a longer ring reads as a new alert — and the badge pops 0.6 → 1.08 → 1 under the toast’s last 60ms rather than after it, so there is never a beat where the bell holds nothing. The badge is the toast, arrived. Use it for deferrable alerts and anything with a notification centre behind it; for confirmations nobody needs again, the plain fade is still right.

transitiontoastbadgeloop

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>Stow — later, into the bell</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 — 6s, so 1% is 60ms. In over 300ms at 4%, "Later" at 26%,
           the trip to the bell 380ms from 28%, badge read and cleared at 80%. */
        --cycle: 6s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        --ease-accent: cubic-bezier(0.5, 0, 0.15, 1);
        --_ease-swing: cubic-bezier(0.37, 0, 0.63, 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);
      }

      .app {
        position: relative;
        container-type: inline-size;
        width: clamp(236px, 76vw, 320px);
        aspect-ratio: 3 / 2;
        border-radius: calc(12px * var(--round));
        background: var(--paper);
        border: 1px solid color-mix(in srgb, var(--slate) 10%, transparent);
        overflow: hidden;
        font-size: 11px;
      }

      .head {
        position: absolute;
        inset: 0 0 auto;
        height: 14cqw;
        border-bottom: 1px solid color-mix(in srgb, var(--slate) 8%, transparent);
      }

      .title {
        position: absolute;
        left: 6cqw;
        top: 7cqw;
        transform: translateY(-50%);
        font-weight: 600;
      }

      /* Centred on (90, 7): the point the toast is flown to. */
      .bell {
        position: absolute;
        left: 90cqw;
        top: 7cqw;
        width: 24px;
        height: 24px;
        margin: -12px 0 0 -12px;
        display: grid;
        place-items: center;
        border-radius: calc(6px * var(--round));
        animation: bell-press var(--t) infinite;
      }

      .bell svg {
        width: 15px;
        height: 15px;
        transform-origin: 50% 12%;
        animation: ring var(--t) infinite;
      }

      .dot {
        position: absolute;
        top: -4px;
        right: -5px;
        min-width: 15px;
        height: 15px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--rust);
        color: var(--paper);
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        line-height: 15px;
        text-align: center;
        opacity: 0;
        animation: badge var(--t) infinite;
      }

      .lines {
        position: absolute;
        left: 6cqw;
        right: 6cqw;
        top: 21cqw;
        display: grid;
        gap: 3.4cqw;
      }

      .lines span {
        height: 6px;
        border-radius: 3px;
        background: color-mix(in srgb, var(--slate) 7%, transparent);
      }

      /* Centred on (58, 51); the stow vector to the bell is (32, -44). */
      .toast {
        position: absolute;
        z-index: 1;
        left: 22cqw;
        top: 42cqw;
        width: 72cqw;
        height: 18cqw;
        display: flex;
        align-items: center;
        gap: 2.4cqw;
        padding: 0 2cqw 0 3.6cqw;
        border-radius: calc(9px * var(--round));
        background: var(--paper);
        border: 1px solid color-mix(in srgb, var(--slate) 12%, transparent);
        box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--slate) 40%, transparent);
        animation:
          toast-move var(--t) infinite,
          toast-fade var(--t) infinite;
        will-change: transform, opacity;
      }

      .toast i {
        flex: none;
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--rust);
      }

      .toast b {
        flex: 1;
        font-weight: 600;
        white-space: nowrap;
      }

      .later {
        flex: none;
        padding: 4px 8px;
        border-radius: calc(6px * var(--round));
        font-weight: 600;
        color: var(--clay-d);
        animation: later var(--t) infinite;
      }

      @keyframes toast-move {
        0%,
        4% {
          transform: translate(0, 5cqw) scale(1);
          animation-timing-function: var(--ease-out);
        }
        9%,
        28% {
          transform: translate(0, 0) scale(1);
          animation-timing-function: var(--ease-accent);
        }
        34.33%,
        100% {
          transform: translate(32cqw, -44cqw) scale(0.1);
        }
      }

      /* Solid until two thirds of the way: a toast that dims as it leaves
         reads as dismissed, and this one is being kept. */
      @keyframes toast-fade {
        0%,
        4% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        9%,
        32.2% {
          opacity: 1;
          animation-timing-function: linear;
        }
        34.33%,
        100% {
          opacity: 0;
        }
      }

      @keyframes later {
        0%,
        25.5% {
          background: transparent;
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        26.5% {
          background: color-mix(in srgb, var(--clay) 16%, transparent);
          transform: scale(0.94);
          animation-timing-function: var(--ease-out);
        }
        28%,
        100% {
          background: transparent;
          transform: scale(1);
        }
      }

      /* The count lands as the toast does, never as it leaves — it starts
         60ms before arrival, under the toast's last frames, so the badge is
         the toast, arrived. 0.6 → 1.08 → 1, not from zero. */
      @keyframes badge {
        0%,
        33.33% {
          opacity: 0;
          transform: scale(0.6);
          animation-timing-function: var(--ease-out);
        }
        35.33% {
          opacity: 1;
          transform: scale(1.08);
          animation-timing-function: var(--ease-out);
        }
        37.83%,
        82% {
          opacity: 1;
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        85%,
        100% {
          opacity: 0;
          transform: scale(0.8);
        }
      }

      /* One damped swing, 9° and halving, so the bell takes the weight of what
         just went in. Any more and it starts to read as a new alert. */
      @keyframes ring {
        0%,
        34.33% {
          transform: rotate(0);
          animation-timing-function: var(--_ease-swing);
        }
        36.33% {
          transform: rotate(9deg);
          animation-timing-function: var(--_ease-swing);
        }
        38.33% {
          transform: rotate(-4.5deg);
          animation-timing-function: var(--_ease-swing);
        }
        40.33% {
          transform: rotate(2.25deg);
          animation-timing-function: var(--_ease-swing);
        }
        42.33%,
        100% {
          transform: rotate(0);
        }
      }

      @keyframes bell-press {
        0%,
        79.5% {
          background: transparent;
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        80.8% {
          background: color-mix(in srgb, var(--slate) 9%, transparent);
          transform: scale(0.92);
          animation-timing-function: var(--ease-out);
        }
        83%,
        100% {
          background: transparent;
          transform: scale(1);
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* Twice as slow and nothing moves: the toast appears and goes where
           it stands, and the badge still fades in on the frame it leaves,
           which is the one part that carries meaning. */
        :root {
          --t: calc(var(--cycle) * 2 / var(--speed));
        }

        .toast {
          animation: toast-fade var(--t) infinite;
        }

        .bell svg {
          animation: none;
        }

        .bell,
        .dot,
        .later {
          transform: none !important;
        }
      }
    </style>
  </head>
  <body>
    <div
      class="app"
      role="img"
      aria-label="A toast reporting lost signal on channel 7 is deferred with Later and flies into the notification bell, which swings once as a badge appears; opening the bell clears it"
    >
      <div class="head">
        <span class="title">FOH · Desk A</span>
        <span class="bell">
          <svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
            <path
              d="M8 1.8c-2.4 0-4.2 1.9-4.2 4.3v2.6L2.6 11h10.8l-1.2-2.3V6.1C12.2 3.7 10.4 1.8 8 1.8Z"
              stroke="currentColor"
              stroke-width="1.4"
              stroke-linejoin="round"
            />
            <path
              d="M6.3 13.2c.3.7 1 1.1 1.7 1.1s1.4-.4 1.7-1.1"
              stroke="currentColor"
              stroke-width="1.4"
              stroke-linecap="round"
            />
          </svg>
          <span class="dot">1</span>
        </span>
      </div>
      <div class="lines">
        <span style="width: 82%"></span>
        <span style="width: 64%"></span>
        <span style="width: 74%"></span>
      </div>
      <div class="toast">
        <i></i>
        <b>Ch 7 · no signal</b>
        <span class="later">Later</span>
      </div>
    </div>
  </body>
</html>

The variant family

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