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: say in the Plasma README which sines are computed each frame

matin18f448d13f5c
diff --git a/animations/07-ambient-background/plasma/README.md b/animations/07-ambient-background/plasma/README.md
index 6e3db624..752a71e4 100644
--- a/animations/07-ambient-background/plasma/README.md
+++ b/animations/07-ambient-background/plasma/README.md
@@ -58,9 +58,10 @@ maths.
- On phone-sized screens (up to 600px wide, or up to 500px tall for a phone held
sideways) the demo caps the buffer at 140 pixels wide; a phone's stage is small
enough that it looks the same.
-- Precompute what you can: the radial distance of each pixel and the per-row and
- per-column sines only need recomputing when size or zoom changes, leaving one
- sine per pixel in the inner loop.
+- Precompute what you can: the radial distance of each pixel only changes with
+ the size, so it is computed once; the row, column and diagonal sines change
+ with time, so they are computed once per frame for each row and column rather
+ than for every pixel, leaving one sine per pixel in the inner loop.
- Do colour through a palette lookup table, not live RGB maths per pixel.
- Pause the `requestAnimationFrame` loop on `visibilitychange` when the tab is
hidden so a background tab does no work.