Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

fix: word Shimmer's timing as it runs and centre the Spinner grid on small phones

matin8b48c397dd6e
diff --git a/animations/04-micro-interactions/loading-spinner/index.html b/animations/04-micro-interactions/loading-spinner/index.html
index 6a78ae28..dadfa124 100644
--- a/animations/04-micro-interactions/loading-spinner/index.html
+++ b/animations/04-micro-interactions/loading-spinner/index.html
@@ -24,7 +24,7 @@
:root{--ui-accent:#ff9d5c;--ui-bg:#111114;--ui-border:rgba(255,255,255,.09);--ui-muted:#8a8a92;--spd:800ms;--clr:#58a6ff;--sz:40px}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
.stage{display:flex;align-items:center;justify-content:center;padding:16px;background:#0b0b0d}
- .grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;width:100%;max-width:380px}
+ .grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;width:100%;max-width:380px}
.spin-cell{display:flex;flex-direction:column;align-items:center;gap:10px;padding:12px;background:var(--ui-bg);border:1px solid var(--ui-border);border-radius:8px}
.spin-label{font-size:11px;text-transform:uppercase;letter-spacing:1px;color:var(--ui-muted);text-align:center}
/* 1. Ring */
diff --git a/animations/04-micro-interactions/shimmer-effect/README.md b/animations/04-micro-interactions/shimmer-effect/README.md
index c15419d5..1f99fc32 100644
--- a/animations/04-micro-interactions/shimmer-effect/README.md
+++ b/animations/04-micro-interactions/shimmer-effect/README.md
@@ -42,12 +42,12 @@ A `::after` pseudo-element holding a translucent gradient covers each skeleton b
}
```
-The `background-size: 200% 100%` and position animation gives more control over the highlight width than `translateX` alone.
+The `background-size: 200% 100%` and position animation gives more control over the highlight width than `translateX` alone. The tile is twice as wide as the block and its position travels four block widths per cycle, so the band crosses twice in each `--shim-dur`: every 0.75s at the default 1.5s.
## Key parameters
| Parameter | Default | Effect |
|-----------|---------|--------|
-| Speed | Normal | How long one sweep takes: slow is 2.4s, normal 1.5s and fast 0.9s; under about 0.8s it feels frantic |
+| Speed | Normal | How often the light crosses: slow every 1.2s, normal every 0.75s and fast every 0.45s; more often than about every 0.4s it feels frantic |
| Brightness | Medium | How strong the band of light is: soft, medium or bright; soft is subtle, bright suits a branded screen |
| Highlight angle | Upright | Upright sweeps a straight band; Slanted and Diagonal tilt it; keep one angle across the whole page |
| Highlight color | White | White works on any placeholder; blue or gold suit branded screens |
diff --git a/animations/04-micro-interactions/shimmer-effect/index.html b/animations/04-micro-interactions/shimmer-effect/index.html
index 977a1d63..006f047e 100644
--- a/animations/04-micro-interactions/shimmer-effect/index.html
+++ b/animations/04-micro-interactions/shimmer-effect/index.html
@@ -105,7 +105,7 @@
<button type="button" data-ms="1500" class="on" aria-pressed="true">Normal</button>
<button type="button" data-ms="900" aria-pressed="false">Fast</button>
</div>
- <p class="hb-hint">One sweep every one or two seconds feels calm.</p>
+ <p class="hb-hint">One sweep every half second to a second feels calm.</p>
</div>
<div class="hb-setting">
<p class="hb-setting-name" id="bright-lbl">Brightness</p>
@@ -191,7 +191,7 @@
pick(b.dataset);
}));
}
- // A new --shim-dur keeps the time already played, so the band would jump to another point of its sweep.
+ // A new --shim-dur keeps the time already played, so the band would jump to another point of its cycle.
// Scaling each animation's time by the same factor as its length keeps the band where it is, moving or paused.
choices('speed-seg',d=>{
const next=+d.ms;