Backgrounds
Cursor Trail
Glowing sage, tan, and stone particles trail the pointer with additive blending on a dark canvas; idle drift animation keeps the tile alive without interaction.
canvasmedium complexitymoderate 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 hero backgrounds, creative portfolio canvases, or interactive demos where pointer feedback adds ambient delight.
When not to
Light-background UIs (background hardcoded dark), content-heavy layouts where trail competes with text, or contexts without pointer input (pure touch kiosks).
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Adjust the existing palette tokens and effect parameters while preserving manual control. Arrow keys steer; first click/touch stops the attract path permanently for this mount. Keep demo-v1 lifecycle marker, __foreverPreview.demoEnabled initialization and forever:interactive handler. Preserve reduced motion, visibility suspension and theme switching.
Safe to edit
- COLORS array (iris/cyan/pink palette)
- MAX particle count (120)
- particle size range (r: 1.5–5)
- decay rate (0.012 + random*0.02)
- idle drift speed (auto.t += 0.018)
- theme tokens (:root dark defaults + [data-theme=light] overrides)
Keep intact
- precomputed sprite canvas per color (perf-critical)
- visibilitychange pause via runLoop
- prefers-reduced-motion static fallback
- IIFE wrapper
- theme hook (?theme= bootstrap + forever:theme message listener + theme tokens)
- sticky demo-v1 preview lifecycle; stop attract work, retain manual feedback and settling
- pointer/touch takeover, keyboard access and visibility suspension
- 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
- Light re-theme via the [data-theme=light] token block; catalog bg/accent describe the dark default
- Touch support uses passive touchmove so emit fires but no cursor feedback is visible on touch devices
- Control state is local to each mount; format changes preserve preview takeover but create a fresh source instance.
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
More Backgrounds components
- Aurora BorealisThree blurred, screen-blended gradient ribbons drift and skew over a near-black background, simulating northern lights in blush, cream, and rose.
- Mesh GradientFour blurred radial blobs in cream, gold, and tan drift and scale on a dark background with screen blend mode, creating a soft animated mesh gradient.
- Particle Constellation18–60 lilac/tan/mauve particles drift and bounce; nearby pairs connect with fading lines, forming a shifting constellation network on a dark background.
- Film GrainSVG feTurbulence noise jitters over a dark radial-tinted base with scrolling scanlines and a blinking magenta REC dot for an analog film look.
- Digital RainCyan katakana and hex glyphs fall in columns down a dark canvas, leaving fading trails; occasional bright white leading chars evoke the Matrix effect.
- Layered WavesThree SVG wave layers in iris, cyan, and dark slide horizontally at different speeds over a deep blue-gradient sky, creating a parallax depth effect.