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.
HTML ai-promptsanimationcss-animationsfrontendgithub-pagesjavascriptmicrointeractionsmotion-designno-dependenciesreferencescroll-animationui-animationweb-animationweb-developmentwebgl
fix: draw all seven stripes on Synthwave's sun and correct its CSS alternative note
matin78c425a5e0d2
diff --git a/animations/07-ambient-background/synthwave-grid/README.md b/animations/07-ambient-background/synthwave-grid/README.mdindex adb19cb3..b6f3d01b 100644--- a/animations/07-ambient-background/synthwave-grid/README.md+++ b/animations/07-ambient-background/synthwave-grid/README.md@@ -35,7 +35,7 @@ The glow is a canvas `shadowBlur` set to the grid colour; the sun is a clipped s- **`shadowBlur` is expensive**: canvas shadow-based glow is one of the heavier 2D operations. It is fine for this line count, but if you raise density substantially, drop the shadow and fake the glow with a second, thicker, low-alpha pass of each line.- **The modulo seam**: fading lines in as `p` approaches 0 hides the pop where a new line spawns at the horizon. Without the alpha ramp you would see it flicker into existence.- **Reduced motion**: the demo starts paused, showing the grid, sky and sun still, until the visitor presses Play. In production, show these visitors the still scene.-- **CSS alternative**: this can also be built with a `transform: perspective()` plane and an animated `background-position` on a repeating linear-gradient, which offloads to the compositor. The canvas version wins on control over per-line fade and glow.+- **CSS alternative**: this can also be built with a `transform: perspective()` plane and a repeating linear-gradient scrolled toward the viewer. Scrolling it with `background-position` repaints every frame; sliding an oversized plane one grid square with `transform: translateY()` and jumping back lets the compositor run it. The canvas version wins on control over per-line fade and glow.- **Library equivalents**: for a true 3D floor with camera moves and bloom, use [three.js](https://threejs.org) — a `PlaneGeometry` with a wireframe material and an `UnrealBloomPass` gives the authentic glow. [tsParticles](https://github.com/matteobruni/tsparticles) is not suited to structured grids.## See alsodiff --git a/animations/07-ambient-background/synthwave-grid/index.html b/animations/07-ambient-background/synthwave-grid/index.htmlindex 8f2699da..64756903 100644--- a/animations/07-ambient-background/synthwave-grid/index.html+++ b/animations/07-ambient-background/synthwave-grid/index.html@@ -143,7 +143,7 @@const sky=ctx.createLinearGradient(0,0,0,hz);sky.addColorStop(0,'#1a0b2e');sky.addColorStop(.55,'#3d1152');sky.addColorStop(1,'#8a2160');ctx.fillStyle=sky;ctx.fillRect(0,0,W,hz);- // glowing sun with retro scanline gaps+ // glowing sun striped with seven gaps in its lower half, wider toward the horizonconst cx=W/2,cy=hz-6,rad=Math.min(W,H)*0.18;const sun=ctx.createLinearGradient(0,cy-rad,0,cy+rad);sun.addColorStop(0,'#ffe15a');sun.addColorStop(.5,'#ff8a3d');sun.addColorStop(1,'#ff2fb0');@@ -151,7 +151,7 @@ctx.beginPath();ctx.arc(cx,cy,rad,Math.PI,0);ctx.closePath();ctx.clip();ctx.fillStyle=sun;ctx.fillRect(cx-rad,cy-rad,rad*2,rad*2);ctx.fillStyle='#1a0b2e';- for(let i=0;i<7;i++){const y=cy-rad*.15+i*(rad*.16);ctx.fillRect(cx-rad,y+i*1.5,rad*2,Math.max(1,3-i*.3));}+ for(let i=0;i<7;i++)ctx.fillRect(cx-rad,cy-rad*.55+i*rad*.08,rad*2,rad*(.015+i*.009));ctx.restore();// floorconst flr=ctx.createLinearGradient(0,hz,0,H);