№ 019

Drop Loader

A download card whose progress is a string of glass beads: the front bead stretches a liquid bridge to the next, and cancelling bursts the string into droplets.

♪ Plays sound — click inside to start
Version
1.0.0
Download
167 KB · 10 files
Added
Oct 26, 2026
Built with
HTML, CSS, JS
Needs
Google Fonts
Tags
progress, download, glass, liquid, loader, web audio

Usage

Copy drop-loader.css and drop-loader.js (and assets/, if there is one) into your project, then:

  const dl = new DropLoader(element, {
    file: { name: 'Lake_Moments.mp4', size: '1.8 GB', thumb: 'url' },   // thumb optional (a lake is drawn)
    beads: 14,
    sound: true,                    // water drops while loading, glass shattering on cancel (Web Audio, synthesised)
    assets: 'assets/',              // folder of the glass images, or a map { 'emerald-1.webp': url, ... }
    onPause() {}, onResume() {}, onCancel() {}, onRestart() {}, onOpen() {},
  })
  dl.set(0.67)                      // 0..1; reaching 1 completes
  dl.set(0.67, { instant: true })   // jump without animating
  dl.pause(); dl.resume(); dl.cancel(); dl.restart(); dl.setSound(false)
  dl.state                          // 'active' | 'paused' | 'cancelled' | 'complete'

A download card whose progress is a string of glass beads. Filled beads are emerald, ripening from
citron at the front. The front bead stretches a liquid bridge across to the next empty one; when the
liquid reaches it, it fills with a small plop and springs into line, and the next bridge starts.
Cancelling bursts the string into a spray of droplets; restarting pulls them back together.

Everything moves from one clock (step(now)), never from timers, so the card can be replayed frame by frame.

Source

/* Drop Loader — a download card whose progress is a string of glass beads. */

.dl {
  --dl-ink: #16261b;
  --dl-muted: #5c655d;
  --dl-line: rgba(22, 38, 27, 0.14);
  --dl-serif: "Playfair Display", "Bodoni Moda", Georgia, serif;
  --dl-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  position: relative;
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  max-width: 680px;
  padding: clamp(20px, 6cqw, 48px) clamp(18px, 5.5cqw, 44px) clamp(18px, 5cqw, 38px);
  border-radius: clamp(18px, 4.5cqw, 30px);
  color: var(--dl-ink);
  font-family: var(--dl-sans);
  /* a pane of frosted glass: mostly see-through, brighter along the top-left edge where the light catches it */
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.1) 38%, rgba(255, 255, 255, 0.04) 62%, rgba(255, 255, 255, 0.2) 100%),
    rgba(232, 238, 228, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),          /* lit top edge */
    inset 1px 0 0 rgba(255, 255, 255, 0.55),          /* lit left edge */
    inset 0 -1px 0 rgba(255, 255, 255, 0.25),
    inset 0 0 32px rgba(255, 255, 255, 0.22),         /* the glass's own thickness, glowing at the rim */
    0 1px 2px rgba(30, 45, 30, 0.08),
    0 26px 60px -24px rgba(30, 45, 30, 0.38);
  -webkit-backdrop-filter: blur(14px) saturate(1.5) brightness(1.05);
  backdrop-filter: blur(14px) saturate(1.5) brightness(1.05);
  isolation: isolate;
}

/* a soft diagonal reflection across the pane, behind the content */
.dl::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 18%, rgba(255, 255, 255, 0.4) 26%, rgba(255, 255, 255, 0.08) 34%, transparent 40%),
    linear-gradient(118deg, transparent 58%, rgba(255, 255, 255, 0.14) 63%, transparent 68%);
}

/* fine frost on the glass */
.dl::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.dl *, .dl *::before, .dl *::after { box-sizing: border-box; }

/* ── heading ── */

.dl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dl-titles { flex: 1; min-width: 0; }

.dl-title {
  margin: 0;
  font: 500 clamp(24px, 8.6cqw, 64px) / 1.02 var(--dl-serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.dl-sub {
  margin: clamp(6px, 2cqw, 14px) 0 0;
  font-size: clamp(9px, 1.95cqw, 14px);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--dl-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dl-pct {
  flex: none;
  font: 500 clamp(28px, 13cqw, 100px) / 0.9 var(--dl-serif);
  letter-spacing: -0.04em;
  font-variant-numeric: lining-nums tabular-nums;
  transition: opacity 240ms ease;
}

.dl-sign { font-size: 0.62em; letter-spacing: 0; margin-left: 0.02em; }

/* cancelled or complete: the title says it, and gets the full width */
.dl[data-state="cancelled"] .dl-pct,
.dl[data-state="complete"] .dl-pct { display: none; }

/* ── the string of beads ── */

.dl-track {
  position: relative;
  height: calc(var(--d, 30px) * 1.4);
  margin: clamp(16px, 6cqw, 40px) 0 clamp(16px, 5.5cqw, 36px);
}

.dl-thread {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: rgba(160, 166, 160, 0.55);
}

.dl-thread-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f6b33, #5c9a2c 70%, #a9b827);
}

.dl-beads,
.dl-spray {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dl-bead {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--d, 30px);
  height: var(--d, 30px);
  border-radius: 50%;
  will-change: transform;
  /* soft contact shadow, down and to the right */
  box-shadow: calc(var(--d, 30px) * 0.04) calc(var(--d, 30px) * 0.09) calc(var(--d, 30px) * 0.16) rgba(30, 50, 30, 0.16);
}

.dl-bead img,
.dl-bridge img,
.dl-drop {
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.dl-bead img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dl-bridge {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform;
}

.dl-bridge img { width: 100%; height: 100%; }

.dl-pour {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--d, 30px);
  height: var(--d, 30px);
  opacity: 0;
}

.dl-drop {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

/* ── the file ── */

.dl-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 3.6cqw, 24px);
}

.dl-thumb {
  width: clamp(44px, 13.5cqw, 104px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: clamp(8px, 2.6cqw, 16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 6px 16px -6px rgba(30, 50, 30, 0.35);
}

.dl-thumb svg,
.dl-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.dl-name {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(12px, 3cqw, 24px);
  font-weight: 500;
}

.dl-meta {
  display: flex;
  gap: 0.7em;
  margin: 0.35em 0 0;
  font-size: clamp(10px, 2.2cqw, 17px);
  letter-spacing: 0.08em;
  color: var(--dl-muted);
  white-space: nowrap;
  overflow: hidden;
}

.dl-meta > :last-child { overflow: hidden; text-overflow: ellipsis; }

.dl-actions { display: flex; gap: clamp(8px, 2cqw, 14px); }

.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  height: clamp(34px, 8cqw, 60px);
  padding: 0 clamp(12px, 3cqw, 26px);
  border: 1px solid rgba(22, 38, 27, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--dl-ink);
  font: 500 clamp(12px, 2.5cqw, 18px) / 1 var(--dl-sans);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease;
}

.dl-btn svg { width: 1.25em; height: 1.25em; flex: none; }

.dl-btn:hover { background: rgba(255, 255, 255, 0.62); border-color: rgba(22, 38, 27, 0.32); }
.dl-btn:active { transform: scale(0.97); }
.dl-btn:focus-visible { outline: 2px solid var(--dl-ink); outline-offset: 3px; }
.dl-btn[hidden] { display: none; }

.dl-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* narrow cards: round icon buttons, as on a phone */
@container (max-width: 540px) {
  .dl-btn { width: clamp(34px, 10.5cqw, 48px); height: clamp(34px, 10.5cqw, 48px); padding: 0; }
  .dl-btn .dl-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .dl-btn svg { width: 42%; height: 42%; }
}

@media (prefers-reduced-motion: reduce) {
  .dl-btn, .dl-pct { transition: none; }
}
All 10 files in the zip
  • assets/bridge.webp
  • assets/citron-1.webp
  • assets/citron-2.webp
  • assets/clear-1.webp
  • assets/clear-2.webp
  • assets/emerald-1.webp
  • assets/emerald-2.webp
  • drop-loader.css
  • drop-loader.js
  • index.html