Back to the library

Snow-block dome cache loader

Variant: Ease-out

A progress loader for saving or caching something for offline use. Snow blocks set into a dome one course at a time, and the label changes to the done state when the last key block goes in. The courses build in a serpentine order (left to right, then right to left) so the build reads as a spiral. Each block uses a strong ease-out, so it arrives almost at once and spends most of its 400ms settling onto the course below. That keeps the build feeling quick even with 15 staggered blocks.

loaderprogressofflinestaggersvg

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>Snow-block dome cache loader — ease-out</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; /* include ONLY if at least one border-radius is wrapped below */
  --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
     (#d97757 / #b85c3e / #788c5d / #b04a3f). */
  --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 — every duration in the document runs off --t. */
  --cycle: 3.2s; /* the authored master loop */
  --t: calc(var(--cycle) / var(--speed));

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); /* include only if used */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); /* include only if used */

  --_twilight: oklch(calc(0.3 + var(--lift)) calc(0.055 * var(--chroma)) calc(var(--hue) + 220));
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--ivory);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.card {
  width: min(320px, 88vw);
  padding: clamp(16px, 5vw, 26px) clamp(16px, 5vw, 26px) clamp(14px, 4vw, 20px);
  background: var(--_twilight);
  border-radius: calc(18px * var(--round));
  display: grid;
  justify-items: center;
  gap: clamp(10px, 3vw, 16px);
}

svg {
  display: block;
  width: 100%;
  max-width: 236px;
  height: auto;
  overflow: visible;
}

.ground {
  stroke: var(--ivory);
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.28;
}

/* The whole dome clears at once so the exit stays shorter than the build. */
.dome {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: clear var(--t) var(--ease-out) infinite;
}

/* Blocks scale from their bottom edge: each one lands on the course beneath it. */
.b {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  opacity: 0;
  animation: lay var(--t) var(--ease-out) infinite;
  animation-delay: calc(var(--_i) * 60ms / var(--speed));
}

.s {
  fill: var(--ivory);
  rx: calc(2.5px * var(--round));
}
.key .s { fill: var(--clay); }
.door { fill: var(--_twilight); }

.status {
  display: grid;
  color: var(--ivory);
  font-size: clamp(13px, 3.6vw, 15px);
  letter-spacing: 0.01em;
}
.status span {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.status .a { animation: say-a var(--t) var(--ease-in-out) infinite; }
.status .done { opacity: 0; animation: say-b var(--t) var(--ease-in-out) infinite; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay);
}

/* 12.5% of 3.2s = 400ms per block; 14 x 60ms stagger lands the key block at ~39%. */
@keyframes lay {
  0% { opacity: 0; transform: translateY(-10px) scale(0.94); }
  12.5%, 70% { opacity: 1; transform: none; }
  71%, 100% { opacity: 0; transform: translateY(-10px) scale(0.94); }
}

/* Hidden from 66% so every staggered block resets out of sight. */
@keyframes clear {
  0%, 60% { opacity: 1; transform: none; }
  66%, 100% { opacity: 0; transform: scale(0.97); }
}

@keyframes say-a {
  0%, 36% { opacity: 0.72; }
  40%, 72% { opacity: 0; }
  80%, 100% { opacity: 0.72; }
}

@keyframes say-b {
  0%, 38% { opacity: 0; }
  44%, 60% { opacity: 1; }
  66%, 100% { opacity: 0; }
}

@keyframes lay-calm {
  0% { opacity: 0.22; }
  12.5%, 66% { opacity: 0.95; }
  76%, 100% { opacity: 0.22; }
}

@media (max-width: 380px) {
  .card { gap: 10px; }
  svg { max-width: 210px; }
}

@media (prefers-reduced-motion: reduce) {
  .dome { animation: none; }
  .b {
    opacity: 0.22;
    animation-name: lay-calm;
    animation-duration: calc(var(--t) * 2);
    animation-delay: calc(var(--_i) * 120ms / var(--speed));
  }
  .status .a,
  .status .done { animation-duration: calc(var(--t) * 2); }
}
</style>
</head>
<body>
<div class="card">
  <svg viewBox="0 0 200 120" role="img" aria-label="Snow-block dome assembling">
    <defs>
      <clipPath id="dome"><path d="M18 112 A82 82 0 0 1 182 112 Z" /></clipPath>
    </defs>
    <line class="ground" x1="6" y1="113.5" x2="194" y2="113.5" />
    <g class="dome">
      <g class="b" style="--_i:0"><rect class="s" x="18" y="94" width="30.4" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:1"><rect class="s" x="51.4" y="94" width="30.4" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:2"><rect class="s" x="84.8" y="94" width="30.4" height="18" clip-path="url(#dome)" /><path class="door" d="M92 112 V104 A8 8 0 0 1 108 104 V112 Z" /></g>
      <g class="b" style="--_i:3"><rect class="s" x="118.2" y="94" width="30.4" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:4"><rect class="s" x="151.6" y="94" width="30.4" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:5"><rect class="s" x="143.25" y="73" width="38.75" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:6"><rect class="s" x="101.5" y="73" width="38.75" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:7"><rect class="s" x="59.75" y="73" width="38.75" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:8"><rect class="s" x="18" y="73" width="38.75" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:9"><rect class="s" x="28" y="52" width="46" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:10"><rect class="s" x="77" y="52" width="46" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:11"><rect class="s" x="126" y="52" width="46" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:12"><rect class="s" x="118" y="31" width="36" height="18" clip-path="url(#dome)" /></g>
      <g class="b" style="--_i:13"><rect class="s" x="46" y="31" width="36" height="18" clip-path="url(#dome)" /></g>
      <g class="b key" style="--_i:14"><rect class="s" x="85" y="31" width="30" height="18" clip-path="url(#dome)" /></g>
    </g>
  </svg>
  <div class="status">
    <span class="a">Caching for offline</span>
    <span class="done"><i class="dot"></i>Ready offline</span>
  </div>
</div>
</body>
</html>