Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/v-doom/llms.txt
Use this file to discover all available pages before exploring further.
ParticleBackground is a purely decorative, full-viewport canvas element that renders a field of softly drifting particles behind all page content. It creates the subtle atmospheric depth that gives v-doom its dark, otherworldly aesthetic — small luminous dots slowly ascending through the midnight background, like embers rising from an unseen flame.
Behavior
Particles are drawn onto an HTML5<canvas> element using a requestAnimationFrame render loop. On each frame every particle’s position is updated and repainted, producing smooth continuous motion.
Key visual properties of each particle:
| Property | Range | Notes |
|---|---|---|
| Color | rgba(237, 230, 211, opacity) | Bone/parchment white — matches the --color-bone theme token |
| Size | 0.5 – 2.5 px radius | Varied for a natural depth-of-field feel |
| Opacity | 0.1 – 0.4 | Semi-transparent; never harsh or distracting |
| Horizontal drift | ±0.25 px/frame | Gentle lateral waver |
| Vertical drift | Upward, 0.1 – 0.6 px/frame | Always rising; wraps back to bottom when off-screen |
15 000 px² of screen area, so the density stays visually consistent across screen sizes.
Positioning
The canvas is rendered with the following CSS, keeping it locked behind every other element at all times:position: fixed (not absolute), it stays anchored to the viewport even as the user scrolls — the particle field fills the entire screen at all times.
Usage
ParticleBackground is automatically mounted by Layout. You do not need to add it to individual pages.
Layout.js the render order is:
Performance Considerations
The canvas render loop runs on the main thread viarequestAnimationFrame. Modern browsers composite canvas frames on the GPU, so the animation is smooth on mid-range and high-end devices. However, on low-powered or thermal-throttled devices the continuous repaints may compete with scroll performance.
Disable entirely
Remove
<ParticleBackground /> from Layout.js. The rest of the page renders correctly without it — the midnight background colour alone still looks complete.Reduce density
In
ParticleBackground.js, change the divisor in Math.floor(width * height / 15000) to a larger number (e.g. 30000) to halve the particle count.ParticleBackground accepts no props. To change particle colors, speeds, or size ranges, edit the initialization block inside the component’s useEffect directly: