No.116 · Backgrounds
Spotlight Grid
Faint graph-paper dots on black, with a brighter grid revealed by a soft torch that eases after your cursor.
The prompt
Written for the variant you picked above: Phosphor
Create a section background of faint dots on pure black: a 1px white dot at 5% opacity tiled every 28px. Stack a second, identical grid on top whose dots are the accent colour at 38%, and reveal it only through a 450px circular mask — solid at the centre, 50% at 38% of the radius, gone by 72% — positioned at CSS variables for x and y. The effect is a torch sweeping across graph paper. Drive the variables with a tiny rAF loop that lerps the spotlight position toward the pointer (factor 0.15) and its opacity toward 1 on enter / 0 on leave (factor 0.12). The loop runs only while there's something to animate and stops itself once the light has faded out and settled (<0.5px and <0.008 opacity). On first entry, snap the position to the pointer so the light fades in where you are instead of sliding in from a corner. On touch devices, show a resting pool of light at (50%, 40%). Under reduced motion, show a very soft (18%) fixed glow at (50%, 38%) and skip the loop. Selected variant — Phosphor: Accent #86efac (phosphor green): the revealed dots glow terminal-green; the eyebrow label uses the same green.
Notes
- Interaction
- The lit grid fades in under the cursor and trails it smoothly; it fades out when the pointer leaves.
- Motion
- Position lerp 0.15/frame, opacity lerp 0.12/frame; the rAF loop self-terminates once settled.
- Accessibility
- Decorative layer is aria-hidden; children render above it at z-index 1. Reduced motion shows a static glow.
- Responsive
- Fills its container; grid gap and spotlight radius are props.
- On touch
- A static pool of light at (50%, 40%) replaces cursor tracking.