Skip to content

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
Open in a new tab

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

Archive contents

effet-spotlight-curseur-html-tailwind.zip3 files · 5 Ko

  • index.html8 Ko
  • README.md3 Ko
  • LICENSE.md1 Ko

Tags

Updated on December 2, 2026.

Reviews

No reviews yet.

In the same spirit

  • 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
    Component
  • 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
    Component
  • 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
    Component