forever components

Particles & Physics

Gravity Dot Rain

Multicolored dots fall under gravity with motion trails, bounce off the floor, and scatter away from the cursor on a dark navy canvas.

canvasmedium complexitymoderate motionpointer

Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited

Live demo — the real component, running in a sandbox. One self-contained HTML file, zero dependencies. Open it on the canvas →
Worth keeping? Votes steer what gets built next — sign in to cast one, free to read

When to use it

Dark-mode hero backgrounds, loading screens, ambient screensaver effects with subtle physics feel.

When not to

Light-background UIs (background hardcoded dark navy). Layouts where motion competes with legible content.

Working with an AI agent

Every component ships agent-ready metadata. An example instruction for this one:

Increase particle count by changing N cap from 90 to 150, swap pal to warm sunset tones ['#ff6b6b','#fbbf24','#f97316'], and strengthen cursor scatter by changing the repulsion multiplier from 0.02 to 0.05. Theme: dark tokens live in :root, the light variant in :root[data-theme="light"]; ?theme=light or a {type:'forever:theme'} postMessage switches at runtime.

Safe to edit

  • particle count cap (N=90 and density divisor 5200)
  • color palette (pal array)
  • gravity strength (g=0.16)
  • bounce damping (-0.62)
  • cursor scatter radius (dd<5000) and strength (0.02)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • DPR-aware canvas sizing
  • visibilitychange pause/play
  • prefers-reduced-motion single-frame guard
  • IIFE-free but scoped canvas reference
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)

Known limitations

  • Background color hardcoded in CSS — must edit to change from dark navy
  • Reduced-motion renders only one static frame with no fallback animation
  • No IIFE wrapper — globals (drops, pointer, pal) leak into page scope

particlesgravityraincanvaspointerphysicsambient

More Particles & Physics components

  • Firework BurstColorful glowing sparks burst radially, fall under gravity, and fade against a dark sky. Auto-launches bursts; click anywhere to add more.
  • Confetti CannonColored rectangles fire from bottom corners in auto-cycling bursts, tumbling with gravity and flip animation. Click anywhere to trigger a cursor burst.
  • Bouncing Balls7–14 glossy pastel balls bounce off walls and collide with elastic physics; cursor repels balls within a 70px radius.
  • Spring ChainA 16-node spring chain whips and follows the cursor in a lime-to-gold gradient; drifts in a figure-eight pattern when idle.
  • Cloth Wave GridAn 11x11 wireframe grid ripples like cloth via sine/cosine waves in cyan-to-violet hues; mesh nodes bulge away from the cursor on hover.
  • Metaball Fluid7 hot-pink blobs drift and merge via a high-contrast canvas threshold; cursor adds an attracting blob that pulls them toward the pointer.