Back to the library

Stow — minimize into the dock

Variant: Minimize to dock

A window sent to its dock tile rather than faded out of existence. It shrinks to exactly the size of the thumbnail waiting in the tile — 72cqw down to 7, a scale of 0.0972 — and travels centre to centre on the family’s stow curve, so the handover in the last 114ms is rect for rect and the eye never has to re-find it. It stays fully opaque for the first 70% of the 400ms trip: a window that dims as it leaves reads as closed, and this one is only going somewhere. The tile takes the arrival as a 6% nudge, a receipt rather than a celebration. Restoring is a tap on the tile, so it comes back on an ease-out in 320ms, faster than it left, growing from where it went. Use it for any minimise, park or send-to-tray where the user will want the thing back and needs to have watched where it went.

transitionlayoutloop

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 — minimize into the dock</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 — 5.2s, so 1% is 52ms. The stow is 400ms (16% → 23.7%) and the
           restore 320ms (60% → 66.15%): coming back answers a tap, so it is
           shorter and eases out from the tile instead of travelling in-out. */
        --cycle: 5.2s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        /* The family's stow curve: leaves without a wind-up, spends its last
           half settling, so the eye is still on it when it lands. */
        --ease-accent: cubic-bezier(0.5, 0, 0.15, 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);
      }

      /* Everything is placed in cqw of the desktop, so the trip from the
         window's centre to the tile's centre is a known vector at any size. */
      .desk {
        position: relative;
        container-type: inline-size;
        width: clamp(236px, 76vw, 320px);
        aspect-ratio: 3 / 2;
        border-radius: calc(12px * var(--round));
        background: color-mix(in srgb, var(--oat) 38%, var(--paper));
        border: 1px solid color-mix(in srgb, var(--slate) 10%, transparent);
        overflow: hidden;
      }

      .window {
        position: absolute;
        z-index: 1;
        left: 14cqw;
        top: 6cqw;
        width: 72cqw;
        height: 40cqw;
        display: grid;
        grid-template-rows: 8.5cqw 1fr;
        border-radius: calc(8px * var(--round));
        background: var(--paper);
        border: 1px solid color-mix(in srgb, var(--slate) 12%, transparent);
        box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--slate) 30%, transparent);
        animation:
          win-move var(--t) infinite,
          win-fade var(--t) infinite;
        will-change: transform, opacity;
      }

      .bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.6cqw 0 3cqw;
        border-bottom: 1px solid color-mix(in srgb, var(--slate) 8%, transparent);
        font-size: 11px;
        font-weight: 600;
      }

      .min {
        display: grid;
        place-items: center;
        width: 18px;
        height: 18px;
        border-radius: calc(5px * var(--round));
        animation: press var(--t) infinite;
      }

      .min::before {
        content: '';
        width: 8px;
        height: 1.5px;
        border-radius: 1px;
        background: var(--slate);
      }

      .faders {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        padding: 3cqw 4cqw;
      }

      .fader {
        position: relative;
        justify-self: center;
        width: 2px;
        border-radius: 1px;
        background: color-mix(in srgb, var(--slate) 14%, transparent);
      }

      .fader::after {
        content: '';
        position: absolute;
        left: 50%;
        bottom: var(--_lvl);
        width: 5.5cqw;
        height: 2.6cqw;
        border-radius: calc(2px * var(--round));
        background: var(--slate);
        transform: translate(-50%, 50%);
      }

      .fader.hot::after {
        background: var(--clay);
      }

      .dock {
        position: absolute;
        left: 27cqw;
        bottom: 3cqw;
        width: 46cqw;
        height: 13cqw;
        display: flex;
        gap: 2cqw;
        padding: 2cqw;
        border-radius: calc(9px * var(--round));
        background: color-mix(in srgb, var(--paper) 72%, transparent);
        border: 1px solid color-mix(in srgb, var(--slate) 8%, transparent);
      }

      .tile {
        position: relative;
        flex: none;
        display: grid;
        place-items: center;
        width: 9cqw;
        height: 9cqw;
        border-radius: calc(5px * var(--round));
        background: color-mix(in srgb, var(--slate) 7%, transparent);
      }

      .tile i {
        width: 3.6cqw;
        height: 3.6cqw;
        border-radius: 50%;
        background: color-mix(in srgb, var(--slate) 22%, transparent);
      }

      .tile:nth-child(3) i {
        border-radius: calc(2px * var(--round));
      }

      .tile.home {
        background: color-mix(in srgb, var(--clay) 16%, transparent);
        animation: catch var(--t) infinite;
      }

      /* The window's own silhouette at the size it lands at: 7cqw is 72cqw at
         the stow's end scale of 0.0972, so the handover is rect for rect. */
      .thumb {
        position: absolute;
        width: 7cqw;
        height: 3.9cqw;
        display: grid;
        place-items: center;
        border-radius: calc(1.5px * var(--round));
        background: var(--paper);
        border: 1px solid color-mix(in srgb, var(--slate) 40%, transparent);
        border-top: 2px solid var(--slate);
        opacity: 0;
        animation: thumb var(--t) infinite;
      }

      /* The hot fader, the one mark that survives at this size. */
      .thumb::after {
        content: '';
        width: 1.2cqw;
        height: 0.8cqw;
        border-radius: 0.5px;
        background: var(--clay);
      }

      /* Centre of the window (50, 26) to centre of the home tile (44.5, 57.17),
         plus the dock's 1px border, which offsets every tile inside it. */
      @keyframes win-move {
        0%,
        16% {
          transform: translate(0, 0) scale(1);
          animation-timing-function: var(--ease-accent);
        }
        23.7%,
        60% {
          transform: translate(calc(-5.5cqw + 1px), calc(31.17cqw + 1px)) scale(0.0972);
          animation-timing-function: var(--ease-out);
        }
        66.15%,
        100% {
          transform: translate(0, 0) scale(1);
        }
      }

      /* Fully opaque for the first 70% of the trip: a window that fades as it
         leaves reads as closing, and this one is only going somewhere. */
      @keyframes win-fade {
        0%,
        21.5% {
          opacity: 1;
          animation-timing-function: linear;
        }
        23.7%,
        60% {
          opacity: 0;
          animation-timing-function: linear;
        }
        62.5%,
        100% {
          opacity: 1;
        }
      }

      @keyframes thumb {
        0%,
        21.5% {
          opacity: 0;
          animation-timing-function: linear;
        }
        23.7%,
        60% {
          opacity: 1;
          animation-timing-function: linear;
        }
        62%,
        100% {
          opacity: 0;
        }
      }

      @keyframes press {
        0%,
        13% {
          background: transparent;
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        14.2% {
          background: color-mix(in srgb, var(--slate) 10%, transparent);
          transform: scale(0.9);
          animation-timing-function: var(--ease-out);
        }
        16%,
        100% {
          background: transparent;
          transform: scale(1);
        }
      }

      /* The tile takes the arrival as a 6% nudge, 120ms then back over 160ms —
         the receipt that something went in, not a celebration. It also takes
         the restore tap as a 0.92 press before the window leaves it. */
      @keyframes catch {
        0%,
        23.7% {
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        26% {
          transform: scale(1.06);
          animation-timing-function: var(--ease-out);
        }
        29%,
        57.5% {
          transform: scale(1);
          animation-timing-function: var(--ease-out);
        }
        59% {
          transform: scale(0.92);
          animation-timing-function: var(--ease-out);
        }
        61.5%,
        100% {
          transform: scale(1);
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* Twice as slow and no trip: the window fades where it stands and the
           thumbnail fades in where it went. Which tile holds it is still
           said, just not shown. */
        :root {
          --t: calc(var(--cycle) * 2 / var(--speed));
        }

        .min {
          transform: none !important;
        }

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

        .tile.home {
          animation: none;
        }
      }
    </style>
  </head>
  <body>
    <div
      class="desk"
      role="img"
      aria-label="A mixer window shrinks into its own dock tile, leaving a thumbnail there, then grows back out of the tile when it is tapped"
    >
      <div class="window">
        <div class="bar">
          <span>Monitor mix</span>
          <span class="min"></span>
        </div>
        <div class="faders">
          <span class="fader" style="--_lvl: 62%"></span>
          <span class="fader" style="--_lvl: 48%"></span>
          <span class="fader hot" style="--_lvl: 78%"></span>
          <span class="fader" style="--_lvl: 40%"></span>
          <span class="fader" style="--_lvl: 55%"></span>
          <span class="fader" style="--_lvl: 30%"></span>
        </div>
      </div>
      <div class="dock">
        <span class="tile"><i></i></span>
        <span class="tile home"><span class="thumb"></span></span>
        <span class="tile"><i></i></span>
        <span class="tile"><i></i></span>
      </div>
    </div>
  </body>
</html>

The variant family

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