∞ forever components

Particles & Physics

Pointer Trail

Rainbow spark particles arc off the cursor position, fading with a glow trail on near-black. Initial Lissajous demo stops after first input; manual movement emits sparks that fade without stationary emission.

canvasmedium complexitymoderate 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

Dark-background hero sections, creative portfolio landing pages, or ambient interactive demos where cursor magic adds delight.

When not to

Light backgrounds (hardcoded dark fill), content-dense layouts where cursor trails distract from reading, or reduced-motion contexts needing full animation.

Working with an AI agent

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

Change particle cap from 110 to 60, slow hue cycling by setting t*40 to t*20, and increase gravity from 0.02 to 0.06 so sparks arc downward faster. 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 cap (parts.length<110)
  • hue cycle speed (t*40)
  • gravity strength (p.vy+=0.02)
  • particle size range (1.5+Math.random()*2.5)
  • trail fade opacity (rgba 0.18)
  • auto-orbit radius (W*0.32, H*0.32)
  • theme tokens (:root dark defaults + [data-theme=light] overrides)

Keep intact

  • visibilitychange pause/resume
  • DPR-aware canvas sizing
  • auto-orbit fallback when pointer absent
  • reduced-motion guard (single-frame only)
  • 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

  • Reduced-motion guard only draws one static frame — not a true static fallback (no meaningful still state)
  • Background color hardcoded in CSS and JS fill — two places to change
  • Particle cap of 110 may still tax very low-end mobile CPUs
  • State remains local to each mounted instance; format/theme remount preserves takeover, not component values.

particlestrailpointerrainbowcanvasgenerativeambient

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.