Back to the library

Link — degraded

Variant: Degraded

A link that is still up but no longer healthy, told with the line itself: solid goes dotted, olive goes clay, and the readout swaps 42 ms for 380 ms. The texture is the point — a dotted line still reads as degraded in a greyscale screenshot or to anyone who cannot separate the two accents. The packets carry the rest. They slow on a curve whose starting slope matches the healthy rate, so there is no kink, and then they hitch on steps() rather than crawl, because a link dropping packets stutters; a smooth slow glide would read as throttling. The texture trails the slowdown by 120ms — the line admits it once the flow has shown it — and recovers with no lag. On recovery the backlog flushes at 1.5x the steady rate and eases back to it over the last 480ms, which is what a real queue does — and why the loop seam has no kink either. Use it for connection-quality indicators, service maps and network panels.

svgstatusdiagraminfrastructureloop

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>Link — degraded</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;
        --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);

        /* Clock — 6s: 2.4s healthy, a 300ms slowdown, 2.1s degraded, then a
           1.2s recovery in which the backlog flushes at 1.5x steady state and
           eases back to it over the last 480ms. */
        --cycle: 6s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        /* Decelerates from exactly the healthy flow rate: its start slope
           (1/0.576) times 18 units over 300ms is the 104 units a second the
           packets were already moving at, so the slowdown has no kink. */
        --ease-accent: cubic-bezier(0.576, 1, 0.89, 1);
        /* The flush's tail: leaves at the flush rate (156 u/s) and arrives at
           the healthy one (104 u/s), so the loop seam has no kink either. */
        --_ease-settle: cubic-bezier(0.333, 0.286, 0.667, 0.81);
      }

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

      .link {
        width: min(280px, 86vw);
        height: auto;
        display: block;
      }

      /* Solid for healthy, dotted for degraded — the line's texture is the
         status, so it still reads in a screenshot or to someone who cannot
         tell olive from clay. */
      .solid {
        fill: none;
        stroke: var(--olive);
        stroke-width: 3;
        animation: solid var(--t) infinite;
      }

      .dotted {
        fill: none;
        stroke: var(--clay);
        stroke-width: 3;
        stroke-linecap: round;
        stroke-dasharray: 0 7;
        animation: dotted var(--t) infinite;
      }

      /* Packets run centre to centre, under the nodes, so each one surfaces
         from the sender and sinks into the receiver instead of popping into
         existence at the rim. */
      .packets {
        fill: none;
        stroke: var(--slate);
        stroke-width: 6;
        stroke-linecap: round;
        stroke-dasharray: 0 25;
        animation: flow var(--t) infinite;
      }

      .node {
        fill: var(--paper);
        stroke: var(--slate);
        stroke-width: 2;
      }

      .name {
        fill: var(--_muted);
        font-family: inherit;
        font-size: 12px;
        font-weight: 500;
      }

      .readout {
        font-family: inherit;
        font-size: 15px;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
      }

      .ok {
        fill: var(--olive);
        animation: ok var(--t) infinite;
      }

      .slow {
        fill: var(--clay-d);
        animation: slow var(--t) infinite;
      }

      .caption {
        fill: var(--_muted);
        font-family: inherit;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.14em;
      }

      /* One period of the packet pattern is 25 units and the cycle covers
         twenty of them, so the loop seam is invisible: healthy covers ten,
         degraded barely more than one, and the recovery eight — the queue
         that built up while the link was slow drains before steady state
         resumes. The degraded phase is stepped, not slow: a link that
         is dropping packets hitches, it does not glide at a lower speed. */
      @keyframes flow {
        0% {
          stroke-dashoffset: 0;
          animation-timing-function: linear;
        }
        40% {
          stroke-dashoffset: -250;
          animation-timing-function: var(--ease-accent);
        }
        45% {
          stroke-dashoffset: -268;
          animation-timing-function: steps(8, end);
        }
        80% {
          stroke-dashoffset: -300;
          animation-timing-function: linear;
        }
        92% {
          stroke-dashoffset: -412.6;
          animation-timing-function: var(--_ease-settle);
        }
        100% {
          stroke-dashoffset: -500;
        }
      }

      /* The texture change trails the slowdown by 120ms and leads the recovery
         by none: the line admits it is degraded once the flow has shown it,
         and drops the warning the moment traffic is moving again. */
      @keyframes solid {
        0%,
        42% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        46%,
        80% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        84%,
        100% {
          opacity: 1;
        }
      }

      @keyframes dotted {
        0%,
        42% {
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        46%,
        80% {
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        84%,
        100% {
          opacity: 0;
        }
      }

      /* The two readouts are different widths on one centre, so they never
         share a frame: the old value leaves, then the new one arrives. */
      @keyframes ok {
        0%,
        42% {
          opacity: 1;
        }
        43.5%,
        81.5% {
          opacity: 0;
        }
        83%,
        100% {
          opacity: 1;
        }
      }

      @keyframes slow {
        0%,
        43.5% {
          opacity: 0;
        }
        45%,
        80% {
          opacity: 1;
        }
        81.5%,
        100% {
          opacity: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* The flow rate is the claim, so the packets keep moving — at half
           speed, with every ratio intact. */
        .solid,
        .dotted,
        .packets,
        .ok,
        .slow {
          animation-duration: calc(var(--t) * 2);
        }
      }
    </style>
  </head>
  <body>
    <svg
      class="link"
      viewBox="0 0 280 136"
      role="img"
      aria-label="Packets flow steadily along a solid link between edge and origin. The link turns dotted and the packets slow to a stuttering crawl as latency rises from 42 to 380 milliseconds, then the line goes solid again and the backlog flushes through."
    >
      <text class="caption" x="140" y="20" text-anchor="middle">P95 LATENCY</text>
      <text class="readout ok" x="140" y="42" text-anchor="middle">42 ms</text>
      <text class="readout slow" x="140" y="42" text-anchor="middle">380 ms</text>

      <path class="solid" d="M 52 72 H 228" />
      <path class="dotted" d="M 54 72 H 226" />
      <path class="packets" d="M 40 72 H 240" />

      <circle class="node" cx="40" cy="72" r="12" />
      <circle class="node" cx="240" cy="72" r="12" />

      <text class="name" x="40" y="106" text-anchor="middle">edge</text>
      <text class="name" x="240" y="106" text-anchor="middle">origin</text>
    </svg>
  </body>
</html>

The variant family

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