Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/dev-nexus/llms.txt
Use this file to discover all available pages before exploring further.
ParticleField is a full-screen animated background component that paints a constellation-like particle system onto an HTML <canvas> element. Hundreds of small particles in the site’s four neon colors drift slowly across the void with a subtle upward bias. The canvas sits behind all page content at z-index: 0 and ignores pointer events entirely so it never interferes with interactive elements above it.
Props
ParticleField accepts no props. All particle behavior — density, speed, and colors — is controlled by constants and calculations defined inside the component source (components/ParticleField.js).
Usage
MountParticleField once at the application shell level, before any page content, so it underlies the entire layout:
Ensure page content containers carry
position: relative and a z-index higher than 0 (e.g., z-10) so they render above the canvas layer. Without this, interactive elements may appear behind the particle field in some browsers.Visual Behavior
| Property | Detail |
|---|---|
| Position | position: fixed, covers 100vw × 100vh via inset-0 |
| Z-index | 0 — behind all page content |
| Canvas background | Transparent — the site’s dark void background shows through |
| Canvas opacity | opacity-60 applied via Tailwind class on the <canvas> element |
| Particle colors | Four neon hues drawn randomly per particle: electric-violet #9d4dff, neon-lime #9eff5b, ghost-mint #6dffc7, hot-magenta #ff4ad8 |
| Particle appearance | Small filled circles with a matching shadowBlur glow; radius between 0.5 px and 2 px |
| Particle density | Dynamic: floor(canvasWidth × canvasHeight / 15 000) — scales automatically with viewport size |
| Particle motion | Randomized horizontal drift with a slight upward bias; each particle wraps to the opposite edge when it exits the canvas |
| Pointer events | pointer-events: none — fully non-interactive |
| Animation loop | Driven by requestAnimationFrame for smooth, CPU-efficient rendering; canvas is cleared with clearRect each frame |
How the Animation Loop Works
On mount, the component:- Sets the canvas size to
window.innerWidth × window.innerHeightand adds aresizelistener to recalculate on viewport changes. - Initializes an array of particle objects, each with a random
(x, y)position, velocity(vx, vy), radius, alpha, and one of the four palette colors. - Starts a
requestAnimationFrameloop that on every tick:- Clears the canvas with
clearRect(preserving the transparent background). - Updates each particle’s position by its velocity.
- Wraps particles that drift off any edge back to the opposite edge.
- Draws each particle as a filled circle with a colored
shadowBlurglow.
- Clears the canvas with
- On unmount, cancels the animation frame and removes the resize listener via the cleanup function returned from
useEffect.
Particles do not draw connection lines between each other. The field is purely a drifting particle system — no proximity-based line drawing occurs.
Customization Tips
All tunable values are insidecomponents/ParticleField.js:
10000 instead of 15000) to spawn more particles per viewport area. Note that rendering many particles can impact frame rate on low-end devices.
Speed up the field: Increase the multiplier on vx/vy from 0.3 for a more energetic feel, or decrease it toward 0.1 for an almost static starfield.
Change particle colors: Find the color array and replace or extend the hex values with any colors from your Tailwind theme: