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: Parallax Depth-of-Field README excerpt keeps the previous frame time

matin8944a9090c07
diff --git a/animations/01-scroll-based/parallax-depth-of-field/README.md b/animations/01-scroll-based/parallax-depth-of-field/README.md
index c4e65900..85f03e36 100644
--- a/animations/01-scroll-based/parallax-depth-of-field/README.md
+++ b/animations/01-scroll-based/parallax-depth-of-field/README.md
@@ -43,6 +43,7 @@ it a fraction at a time, which turns those discrete steps into continuous motion
```js
const dt = last ? Math.min(now - last, 50) : FRAME; // FRAME = 1000 / 60; time since the last frame
+last = now;
current += (target - current) * (1 - Math.pow(1 - EASE, dt / FRAME)); // inside a requestAnimationFrame loop
```