Cursor-following spotlight
A soft glow follows the mouse over a grid of dark cards and lights up their borders wherever it passes.
- Tailwind
- React
- CSS
- WordPress
Description
A dark section shows three services as cards; when the mouse moves over it, an amber glow follows and reveals each card’s edge closest to the pointer, like a torch swept across a wall. About thirty lines of dependency-free JavaScript, limited to one update per frame, only set two CSS variables; the glow moves with transform. The effect never turns on for touch or pen input, nor with prefers-reduced-motion: the section then keeps a fixed light from above, just as polished, which is also the no-JavaScript rendering. With the keyboard, the focused card lights up and its link shows a clear outline. Text keeps AA contrast over the glow in light and dark themes, with no horizontal scrolling from 360 px. Colours, card radius and glow size are set through CSS variables prefixed efsp.
Code
Loading the code…
The code of this component in
Reviews
No reviews yet.
In the same spirit

A large heading whose words turn from grey to ink as the page scrolls, then whose key phrases get a marker stroke, in pure CSS with a readable fallback.
- Tailwind
- React
- CSS
- WordPress

Cards that fade in as they enter the screen, one after another in each row, without a line of JavaScript and with a static fallback.
- Tailwind
- React
- CSS
- WordPress

A translucent card with a saturated blur whose sharper edge refracts the colourful shapes drifting behind it, with an opaque fallback when transparency is reduced.
- Tailwind
- React
- CSS
- WordPress

A help block shaped like a conversation: bubbles, three animated typing dots and clickable quick replies that show your answers to frequent questions, frozen under prefers-reduced-motion.
- Tailwind
- React
- CSS
- WordPress