∞ forever components

Particles & Physics

Liquid Pour SPH

200 SPH fluid particles pour into a basin, slosh, and drain on a slow cycle with additive-blend cyan glow; pointer move tilts the fluid sideways.

canvasheavy complexityintense motionpointermobile-ready

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 →
1

When to use it

Ambient hero backgrounds for tech/creative sites, loading screens, interactive art installations requiring realistic-feeling fluid.

When not to

Low-end mobile or battery-sensitive contexts — double-density SPH relaxation loop runs 2 substeps per frame. Avoid where text legibility over the background matters.

Working with an AI agent

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

Change the fluid color to molten orange by replacing the glow stops to 'rgba(255,140,30,0.26)' and 'rgba(255,100,10,0.182)', and set REST=3.0 to make the fluid less compressed. 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 (N=200)
  • SPH stiffness (STIFF=0.55) and rest density (REST=2.6)
  • glow color stops in buildGlow()
  • basin proportions (bx0=W*0.30, bx1=W*0.70, floorY=H*0.82)
  • pour oscillation amplitude (*(bx1-bx0)*0.22)
  • gravity strength (GRAV=0.30)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • precomputed glow sprite pattern (buildGlow) — avoids per-particle gradient cost
  • double-substep loop (2 × dt*0.5) for stability
  • visibilitychange pause/resume
  • reduced-motion static pool fallback
  • theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
  • demo-v1 preview lifecycle: initialize demoEnabled from window.__foreverPreview and stop attract work on the window forever:interactive event; retain manual feedback, settling, cleanup and explicit sessions

Known limitations

  • Spatial hash uses string keys — allocation pressure at high N; switch to integer keys for >300 particles
  • Particle recycling uses Array.indexOf + splice inside tight loop — O(n) per removed particle
  • No reduced-motion animation — shows a static settled pool only
  • State remains local to each mounted instance; format/theme remount preserves takeover, not component values.

sphfluidparticlesphysicscanvasmetaballgenerative

More Particles & Physics components

  • Gravity Dot RainMulticolored dots fall under gravity with motion trails, bounce off the floor, and scatter away from the cursor on a dark navy canvas.
  • Firework BurstColorful glowing sparks burst radially, fall under gravity, and fade against a dark sky. Initial automatic launches stop after first input; canvas clicks…
  • Confetti CannonOchre festival-paper palette: broad confetti rectangles fire from bottom corners, tumble and flip. First input stops automatic launches; a manual 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; initial figure-eight attract motion stops after first input; manual chain…
  • 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.