Particles & Physics
Charged Plasma Lattice
Charged particles attract/repel via Coulomb forces; teal bonds crystallize between opposite charges as temperature pulses between order and chaos.
canvasheavy complexityintense motionpointermobile-ready
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Dark-mode hero backgrounds, science/tech themes, ambient visualizations where dynamic structure formation adds interest.
When not to
Low-end devices — O(N²) force loop is CPU-heavy. Light backgrounds (hardcoded dark). Contexts needing legible text overlaid.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change positive charge color from '#C0B459' to '#ffaa00' and negative from '#1DACC9' to '#00ffaa', then cap particle count to 40 by editing Math.min(64,...). 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 range (Math.min(64, Math.max(34, ...)))
- charge colors (POS='#C0B459', NEG='#1DACC9')
- bond color ('rgba(29,172,201,...)')
- temperature pulse speed (t*0.55)
- pointer charge strength (9000)
- Coulomb force strength (1400)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- IIFE wrapper
- prefers-reduced-motion static fallback
- visibilitychange pause/start
- DPR-aware canvas sizing
- 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
- O(N²) force calculation — CPU-bound on low-end devices at N=64
- Reduced-motion shows only a static snapshot, no fallback animation
- Background color hardcoded in CSS (#0b0014)
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
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.