Back to the library

Settle — partial period

Variant: Partial period

The bar chart that does not panic at 9am. Today is drawn as two claims at once: a hatched total of what has landed so far, and a dashed outline where the run-rate says the day will end — without the outline, every open period reads as a crash. Four reports raise the hatch, each a 320ms ease-out followed by dead stillness, because data arrives in batches and a bar that creeps between them is animating a guess. It grows by a rounded clip-path inset from the top, not scaleY, so the hatch never stretches and the cut edge keeps the bar’s caps. The close is its own beat, 256ms after the last report stops moving: the outline goes, the hatch turns solid and "now" earns a name. The total lands at 94% of pace, because under is the honest default for a forecast. Reach for it on any chart whose last bucket is still open.

datachartprogressclip-pathloop

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>Settle — partial period</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)
        );

        --_muted: color-mix(in srgb, var(--slate) 52%, transparent);
        --_grid: color-mix(in srgb, var(--oat) 70%, transparent);
        --_dash: color-mix(in srgb, var(--slate) 38%, transparent);
        --_partial: color-mix(in srgb, var(--clay) 34%, var(--paper));

        /* Clock — 6.4s: 1% is 64ms. Reports land at 16/32/48/56%; the period
           closes at 66%, 256ms after the last one has settled, and the rest
           is the closed chart holding. */
        --cycle: 6.4s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 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);
      }

      .chart {
        width: min(288px, calc(100vw - 40px));
        display: grid;
        gap: 10px;
        animation: frame var(--t) linear infinite;
      }

      .label {
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: var(--_muted);
      }

      .plot {
        position: relative;
        height: clamp(92px, 27vw, 116px);
        border-bottom: 1px solid var(--oat);
        background:
          linear-gradient(var(--_grid), var(--_grid)) 0 33.3% / 100% 1px no-repeat,
          linear-gradient(var(--_grid), var(--_grid)) 0 66.6% / 100% 1px no-repeat;
      }

      .bars,
      .days {
        display: flex;
        gap: clamp(6px, 2vw, 9px);
      }

      .bars {
        position: absolute;
        inset: 0;
        align-items: flex-end;
      }

      .bar {
        flex: 1;
        height: var(--_h);
        border-radius: calc(2px * var(--round)) calc(2px * var(--round)) 0 0;
        background: var(--clay);
      }

      /* The open period is drawn as two claims at once: what has landed so far
         (hatched, because it is a running total, not a value) and where the
         run-rate says it will end (a dashed outline). Without the outline a
         partial bar is a crash at 9am every morning. */
      .today {
        position: relative;
        background: none;
      }

      .pace {
        position: absolute;
        inset: 0;
        border: 1.5px dashed var(--_dash);
        border-bottom: 0;
        border-radius: inherit;
        animation: pace var(--t) linear infinite;
      }

      /* clip-path from the top, not scaleY: the hatch would stretch and the
         rounded caps would squash, and both are lies about what changed. The
         inset carries the bar's own radius so the cut edge is a cap too. */
      .fill {
        position: absolute;
        inset: 0;
        border-radius: inherit;
        clip-path: inset(70% 0 0 0 round calc(2px * var(--round)) calc(2px * var(--round)) 0 0);
        animation: fill var(--t) linear infinite;
      }

      .hatch,
      .solid {
        position: absolute;
        inset: 0;
        border-radius: inherit;
      }

      .hatch {
        background:
          repeating-linear-gradient(-45deg, var(--clay) 0 1.5px, transparent 1.5px 5px),
          var(--_partial);
      }

      .solid {
        background: var(--clay);
        opacity: 0;
        animation: solid var(--t) linear infinite;
      }

      .days {
        font-size: 11px;
        color: var(--_muted);
        margin-top: -4px;
      }

      .days > span {
        flex: 1;
        text-align: center;
      }

      .sw {
        display: grid;
      }

      .sw > span {
        grid-area: 1 / 1;
      }

      .now {
        color: var(--clay-d);
        font-weight: 600;
        animation: out var(--t) linear infinite;
      }

      .sat {
        opacity: 0;
        animation: in var(--t) linear infinite;
      }

      .key {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 14px;
        font-size: 11px;
        color: var(--_muted);
      }

      .key span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
      }

      .key i {
        width: 10px;
        height: 10px;
        border-radius: calc(2px * var(--round));
      }

      .k-closed {
        background: var(--clay);
      }

      .k-so-far {
        background:
          repeating-linear-gradient(-45deg, var(--clay) 0 1.5px, transparent 1.5px 5px),
          var(--_partial);
      }

      .k-pace {
        border: 1.5px dashed var(--_dash);
      }

      /* Reports, not a trickle: each lands as a 320ms ease-out and then the
         bar sits dead still, because data arrives in batches and a bar that
         creeps between them is animating a guess. The last report lands at 94%
         of the outline — under pace, which is the honest default for a forecast. */
      @keyframes fill {
        0%,
        16% {
          clip-path: inset(70% 0 0 0 round calc(2px * var(--round)) calc(2px * var(--round)) 0 0);
          animation-timing-function: var(--ease-out);
        }
        21%,
        32% {
          clip-path: inset(52% 0 0 0 round calc(2px * var(--round)) calc(2px * var(--round)) 0 0);
          animation-timing-function: var(--ease-out);
        }
        37%,
        48% {
          clip-path: inset(33% 0 0 0 round calc(2px * var(--round)) calc(2px * var(--round)) 0 0);
          animation-timing-function: var(--ease-out);
        }
        53%,
        56% {
          clip-path: inset(18% 0 0 0 round calc(2px * var(--round)) calc(2px * var(--round)) 0 0);
          animation-timing-function: var(--ease-out);
        }
        61%,
        97% {
          clip-path: inset(6% 0 0 0 round calc(2px * var(--round)) calc(2px * var(--round)) 0 0);
        }
        98%,
        100% {
          clip-path: inset(70% 0 0 0 round calc(2px * var(--round)) calc(2px * var(--round)) 0 0);
        }
      }

      /* The close is its own beat, after the last report has stopped moving:
         geometry first, then the claim changes. The forecast has nothing left
         to forecast, so it goes, and the hatch turns solid on the same beat —
         a total, not a tally. */
      @keyframes pace {
        0%,
        66% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        70%,
        97% {
          opacity: 0;
        }
        98%,
        100% {
          opacity: 1;
        }
      }

      @keyframes solid {
        0%,
        66% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        70%,
        97% {
          opacity: 1;
        }
        98%,
        100% {
          opacity: 0;
        }
      }

      /* "now" is the only label without a name; a closed period earns one.
         Out, then in — two labels never share the slot. */
      @keyframes out {
        0%,
        66% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        68%,
        97% {
          opacity: 0;
        }
        98%,
        100% {
          opacity: 1;
        }
      }

      @keyframes in {
        0%,
        68% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        70%,
        97% {
          opacity: 1;
        }
        98%,
        100% {
          opacity: 0;
        }
      }

      /* The re-arm at 97–98% happens once the frame is fully dark. */
      @keyframes frame {
        0% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        3%,
        92% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        97%,
        100% {
          opacity: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* The rising total is the reading, so the reports stay — on a 1.6x
           clock shared by every part so the close still lands in phase. */
        .chart,
        .chart * {
          animation-duration: calc(var(--t) * 1.6);
        }
      }
    </style>
  </head>
  <body>
    <div
      class="chart"
      role="img"
      aria-label="A bar chart of signups per day where today's bar is hatched and partial under a dashed outline showing the projected total; four reports raise it, then the day closes, the outline disappears and the bar turns solid like the others"
    >
      <span class="label">Signups / day</span>
      <div class="plot">
        <div class="bars">
          <div class="bar" style="--_h: 58%"></div>
          <div class="bar" style="--_h: 71%"></div>
          <div class="bar" style="--_h: 64%"></div>
          <div class="bar" style="--_h: 80%"></div>
          <div class="bar" style="--_h: 74%"></div>
          <div class="bar today" style="--_h: 86%">
            <div class="fill"><span class="hatch"></span><span class="solid"></span></div>
            <div class="pace"></div>
          </div>
        </div>
      </div>
      <div class="days">
        <span>M</span><span>T</span><span>W</span><span>T</span><span>F</span>
        <span class="sw"><span class="now">now</span><span class="sat">S</span></span>
      </div>
      <div class="key">
        <span><i class="k-closed"></i>Closed</span>
        <span><i class="k-so-far"></i>So far</span>
        <span><i class="k-pace"></i>On pace</span>
      </div>
    </div>
  </body>
</html>

The variant family

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