Particles & Physics
Pointer Trail
Rainbow spark particles arc off the cursor position, fading with a glow trail on near-black. Auto-orbits in a Lissajous path when the pointer leaves.
canvasmedium complexitymoderate motionpointer
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
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)
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
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. 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.