Back to the library

Audit — tampered record

Variant: Tampered

The same walk at the same pace, so the failure lands on the exact beat a tick would have, with nothing in the timing to hint it was coming. #1043 still points correctly at #1042, so that link draws olive. It is the record’s own contents that no longer hash to what was sealed: a rust cross pops in where the tick would be, and the label hands over to "Hash mismatch" — the old one gone before the new one drops in from 2px above, so the two never overlap. The read head turns rust and parks there for the rest of the loop, because that is where someone has to start reading. The link below breaks into two capped stubs, drawn at full strength because the break is the finding. The records after it dim a step further under dashed rust rings, 64ms apart down the list, so the distrust visibly travels downstream. They are marked unknowable, not bad. They may well be fine, but a chain cannot vouch for anything past its first broken link, and drawing them as failures would claim more than the audit knows. Reach for it in integrity checks, signed logs and supply-chain verification, where one bad record has to be shown with everything it puts in doubt.

statusindicatorlisterrorloop

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>Audit — tampered record</title>
    <style>
      /* One clock drives the whole walk: how many records are verified (--_c),
         how many links are proven (--_l), where the read head sits (--_k), and
         the integer the footer prints (--_n). Every row derives its own state
         from these, so no row can run ahead of the record before it. */
      @property --_c {
        syntax: '<number>';
        inherits: true;
        initial-value: 0;
      }
      @property --_l {
        syntax: '<number>';
        inherits: true;
        initial-value: 0;
      }
      @property --_k {
        syntax: '<number>';
        inherits: true;
        initial-value: 0;
      }
      @property --_n {
        syntax: '<integer>';
        inherits: true;
        initial-value: 0;
      }

      :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);
        --_head: color-mix(in srgb, var(--clay) 13%, var(--paper));
        --_clay-wash: color-mix(in srgb, var(--clay) 16%, var(--paper));
        --_olive-wash: color-mix(in srgb, var(--olive) 20%, var(--paper));
        --_rust-pill: color-mix(in srgb, var(--rust) 13%, var(--paper));

        /* Clock — 6.4s: 1% is 64ms. The walk keeps the intact chain's exact
           pace — 8.5% per record — so the failure lands on the beat where a
           tick would have, and nothing about the timing hints it was coming. */
        --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);

        --_m: 1; /* motion multiplier: 0 under reduced motion */
      }

      * {
        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(320px, calc(100vw - 32px));
        padding: 13px 14px 12px;
        display: grid;
        gap: 9px;
        border-radius: calc(12px * var(--round));
        background: var(--paper);
        border: 1px solid var(--oat);
        animation: card var(--t) linear infinite;
      }

      /* The reset hides in a dark window at the wrap. */
      @keyframes card {
        0% {
          opacity: 0;
        }
        2.5% {
          opacity: 1;
        }
        95.5% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        100% {
          opacity: 0;
        }
      }

      .head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .k {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--_muted);
        white-space: nowrap;
      }

      .pill {
        display: grid;
        font-size: 11px;
        font-weight: 600;
        flex: none;
      }

      .pill span {
        grid-area: 1 / 1;
        padding: 2px 8px;
        border-radius: 999px;
        text-align: center;
        white-space: nowrap;
      }

      .p-run {
        background: var(--_clay-wash);
        color: var(--clay-d);
        animation: p-out var(--t) linear infinite;
      }

      .p-ok {
        background: var(--_rust-pill);
        color: var(--rust);
        animation: p-in var(--t) linear infinite;
      }

      @keyframes p-out {
        0%,
        27.5% {
          opacity: 1;
          animation-timing-function: ease;
        }
        29.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes p-in {
        0%,
        27.5% {
          opacity: 0;
          animation-timing-function: ease;
        }
        29.5%,
        100% {
          opacity: 1;
        }
      }

      .rows {
        position: relative;
        list-style: none;
        animation:
          c var(--t) linear infinite,
          l var(--t) linear infinite,
          k var(--t) linear infinite,
          n var(--t) linear infinite;
      }

      /* Verified count: two records, then the walk stops. Nothing after a
         failed record is checked, because nothing after it can pass. */
      @keyframes c {
        0%,
        8% {
          --_c: 0;
          animation-timing-function: var(--ease-out);
        }
        10.5%,
        16.5% {
          --_c: 1;
          animation-timing-function: var(--ease-out);
        }
        19%,
        100% {
          --_c: 2;
        }
      }

      /* #1043 still points at #1042 correctly — that link is proven. It is
         the record's own contents that no longer hash to what was sealed. */
      @keyframes l {
        0%,
        15.5% {
          --_l: 0;
          animation-timing-function: var(--ease-out);
        }
        18%,
        24% {
          --_l: 1;
          animation-timing-function: var(--ease-out);
        }
        26.5%,
        100% {
          --_l: 2;
        }
      }

      @keyframes k {
        0%,
        10.5% {
          --_k: 0;
          animation-timing-function: var(--ease-in-out);
        }
        12.5%,
        19% {
          --_k: 1;
          animation-timing-function: var(--ease-in-out);
        }
        21%,
        100% {
          --_k: 2;
        }
      }

      @keyframes n {
        0%,
        8.4% {
          --_n: 0;
        }
        8.5%,
        16.9% {
          --_n: 1;
        }
        17%,
        100% {
          --_n: 2;
        }
      }

      .cursor {
        position: absolute;
        top: 0;
        left: -7px;
        right: -7px;
        height: 26px;
        border-radius: calc(6px * var(--round));
        background: var(--_head);
        box-shadow: inset 2px 0 0 var(--clay);
        transform: translateY(calc(var(--_k) * 100%));
        animation: cursor var(--t) linear infinite;
      }

      /* The head never moves on. It parks on the record that failed and
         stays there, because that is where someone needs to start reading. */
      @keyframes cursor {
        0%,
        3% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        5%,
        100% {
          opacity: 1;
        }
      }

      .cursor::after {
        content: '';
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: var(--_rust-pill);
        box-shadow: inset 2px 0 0 var(--rust);
        animation: flip var(--t) linear infinite;
      }

      @keyframes flip {
        0%,
        25.5% {
          opacity: 0;
          animation-timing-function: ease;
        }
        27.5%,
        100% {
          opacity: 1;
        }
      }

      .row {
        --_s: clamp(0, calc(var(--_c) - var(--_i)), 1);
        --_ls: clamp(0, calc(var(--_l) - var(--_i) + 1), 1);
        position: relative;
        height: 26px;
        display: grid;
        grid-template-columns: 12px 40px minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        font-size: 12.5px;
      }

      /* The chain: a link from the bottom of the mark above to the top of this
         one. Grey until proven, then drawn downward — from the record being
         pointed at, to the record doing the pointing. */
      .row + .row::before,
      .row + .row::after {
        content: '';
        position: absolute;
        left: 5px;
        top: -7px;
        width: 2px;
        height: 14px;
        background: var(--oat);
      }

      .row + .row::after {
        background: var(--olive);
        transform-origin: top;
        transform: scaleY(var(--_ls));
      }

      .mark {
        position: relative;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        border: 1.5px solid var(--oat);
      }

      .ok {
        position: absolute;
        inset: -1.5px;
        border-radius: 50%;
        background: var(--olive);
        display: grid;
        place-items: center;
        opacity: var(--_s);
        transform: scale(calc(1 - 0.14 * (1 - var(--_s)) * var(--_m)));
      }

      .ok svg {
        width: 8px;
        height: 8px;
        fill: none;
        stroke: var(--paper);
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
      }

      .no {
        position: absolute;
        inset: -1.5px;
        border-radius: 50%;
        background: var(--rust);
        display: grid;
        place-items: center;
        animation: no var(--t) linear infinite;
      }

      .no svg {
        width: 8px;
        height: 8px;
        fill: none;
        stroke: var(--paper);
        stroke-width: 1.8;
        stroke-linecap: round;
      }

      /* Lands on the frame a tick would have: same 160ms, same curve. */
      @keyframes no {
        0%,
        25.5% {
          opacity: 0;
          transform: scale(calc(1 - 0.14 * var(--_m)));
          animation-timing-function: var(--ease-out);
        }
        28%,
        100% {
          opacity: 1;
          transform: scale(1);
        }
      }

      .seq,
      .desc,
      .amt {
        opacity: calc(0.55 + 0.45 * var(--_s));
        white-space: nowrap;
      }

      .seq {
        font-size: 11px;
        font-weight: 700;
        color: var(--_muted);
        font-variant-numeric: tabular-nums;
      }

      .desc {
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .bad .seq,
      .bad .desc,
      .bad .amt {
        animation: legible var(--t) linear infinite;
      }

      /* The failed record comes up to full voice — it is the one to read. */
      @keyframes legible {
        0%,
        25.5% {
          opacity: 0.55;
          animation-timing-function: ease;
        }
        28%,
        100% {
          opacity: 1;
        }
      }

      .desc .swap {
        display: grid;
      }

      .swap span {
        grid-area: 1 / 1;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .swap span + span {
        color: var(--rust);
        font-weight: 600;
        animation: d-in var(--t) linear infinite;
      }

      .swap span:first-child {
        animation: d-out var(--t) linear infinite;
      }

      /* Out, then in — staggered so the two labels never sit on top of each
         other, with the new one arriving from 2px above. */
      @keyframes d-out {
        0%,
        27.5% {
          opacity: 1;
          animation-timing-function: ease;
        }
        28.5%,
        100% {
          opacity: 0;
        }
      }

      @keyframes d-in {
        0%,
        28.2% {
          opacity: 0;
          transform: translateY(calc(-2px * var(--_m)));
          animation-timing-function: var(--ease-out);
        }
        30%,
        100% {
          opacity: 1;
          transform: translateY(0);
        }
      }

      /* The link below the failure can never be proven: two rust stubs with
         the gap between them where the hash used to match. */
      .row.cut::after {
        content: none;
      }

      /* The break is the finding, so it lives outside the dimmed rows: two
         stubs with capped ends, a cut cable rather than a missing pixel. */
      .break {
        position: absolute;
        top: 71px;
        left: 3px;
        width: 6px;
        height: 14px;
        background:
          linear-gradient(var(--rust), var(--rust)) 2px 0 / 2px 3px no-repeat,
          linear-gradient(var(--rust), var(--rust)) 0 3px / 6px 1.5px no-repeat,
          linear-gradient(var(--rust), var(--rust)) 0 9.5px / 6px 1.5px no-repeat,
          linear-gradient(var(--rust), var(--rust)) 2px 11px / 2px 3px no-repeat;
        animation: cut var(--t) linear infinite;
      }

      .row.cut::before {
        animation: uncut var(--t) linear infinite;
      }

      @keyframes uncut {
        0%,
        29% {
          opacity: 1;
          animation-timing-function: ease;
        }
        31%,
        100% {
          opacity: 0;
        }
      }

      @keyframes cut {
        0%,
        29% {
          opacity: 0;
          animation-timing-function: ease;
        }
        31%,
        100% {
          opacity: 1;
        }
      }

      /* Records after the break are not marked bad — they may well be fine —
         they are marked unknowable. Distrust propagates downward 64ms a row. */
      .lost {
        animation: lost var(--t) linear infinite;
        animation-delay: calc(var(--_d) / var(--speed));
      }

      @keyframes lost {
        0%,
        31% {
          opacity: 1;
          animation-timing-function: ease;
        }
        34%,
        96% {
          opacity: 0.85;
        }
        100% {
          opacity: 1;
        }
      }

      .lost .mark::after {
        content: '';
        position: absolute;
        inset: -1.5px;
        border-radius: 50%;
        border: 1.5px dashed var(--rust);
        background: var(--paper);
        animation: cut var(--t) linear infinite;
        animation-delay: calc(var(--_d) / var(--speed));
      }

      .amt {
        font-weight: 500;
        font-variant-numeric: tabular-nums;
        text-align: right;
      }

      .foot {
        border-top: 1px solid var(--oat);
        padding-top: 8px;
        font-size: 12px;
        color: var(--_muted);
        font-variant-numeric: tabular-nums;
        counter-reset: n var(--_n);
        animation: n var(--t) linear infinite;
      }

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

      .foot b::before {
        content: counter(n);
      }

      .foot {
        display: grid;
      }

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

      .foot > span:first-child {
        animation: f-out var(--t) linear infinite;
      }

      .foot > span + span {
        color: var(--rust);
        animation: f-in var(--t) linear infinite;
      }

      /* The tally gives way to the consequence once the break is drawn. */
      @keyframes f-out {
        0%,
        34% {
          opacity: 1;
          animation-timing-function: ease;
        }
        36%,
        100% {
          opacity: 0;
        }
      }

      @keyframes f-in {
        0%,
        35% {
          opacity: 0;
          transform: translateY(calc(-3px * var(--_m)));
          animation-timing-function: var(--ease-out);
        }
        39%,
        100% {
          opacity: 1;
          transform: translateY(0);
        }
      }

      @media (prefers-reduced-motion: reduce) {
        :root {
          --_m: 0;
        }

        /* One shared 1.6x clock keeps every part in phase. */
        .card,
        .card *,
        .card *::before,
        .card *::after {
          animation-duration: calc(var(--t) * 1.6);
        }

        /* The order of the walk is the message, so it keeps every beat: the
           head jumps between records instead of gliding, and links fade in
           whole instead of drawing. */
        .cursor {
          transform: translateY(calc(round(var(--_k), 1) * 100%));
        }

        .row + .row:not(.cut)::after {
          transform: none;
          opacity: var(--_ls);
        }
      }
    </style>
  </head>
  <body>
    <div
      class="card"
      role="img"
      aria-label="A ledger audit walking a hash chain: two records verify, then record 1043 fails with hash mismatch, the read head stops on it, the link below it breaks, the two records after it dim as unverifiable, and the status reads broken at 1043"
    >
      <div class="head">
        <span class="k">Ledger · Q3</span>
        <span class="pill"><span class="p-run">Verifying</span><span class="p-ok">Broken at #1043</span></span>
      </div>
      <ol class="rows">
        <li class="cursor" aria-hidden="true"></li>
        <li class="row" style="--_i: 0">
          <span class="mark"><span class="ok"><svg viewBox="0 0 8 8"><path d="M1.6 4.2 3.3 5.8 6.4 2.4" /></svg></span></span>
          <span class="seq">#1041</span><span class="desc">Northwind Ltd</span><span class="amt">−1,240.00</span>
        </li>
        <li class="row" style="--_i: 1">
          <span class="mark"><span class="ok"><svg viewBox="0 0 8 8"><path d="M1.6 4.2 3.3 5.8 6.4 2.4" /></svg></span></span>
          <span class="seq">#1042</span><span class="desc">Payroll · Oct</span><span class="amt">−18,605.12</span>
        </li>
        <li class="row bad" style="--_i: 2">
          <span class="mark"><span class="no"><svg viewBox="0 0 8 8"><path d="M2.2 2.2 5.8 5.8M5.8 2.2 2.2 5.8" /></svg></span></span>
          <span class="seq">#1043</span><span class="desc"><span class="swap"><span>Card payout</span><span>Hash mismatch</span></span></span><span class="amt">+6,410.50</span>
        </li>
        <li class="row cut lost" style="--_i: 3; --_d: 0ms">
          <span class="mark"></span>
          <span class="seq">#1044</span><span class="desc">Office lease</span><span class="amt">−4,200.00</span>
        </li>
        <li class="row lost" style="--_i: 4; --_d: 64ms">
          <span class="mark"></span>
          <span class="seq">#1045</span><span class="desc">Refund #88</span><span class="amt">+312.40</span>
        </li>
        <li class="break" aria-hidden="true"></li>
      </ol>
      <p class="foot"><span><b></b> of 5 hashes match · sha-256</span><span>#1044–45 can’t be vouched for</span></p>
    </div>
  </body>
</html>

The variant family

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