Skip to content

Cursor-lit grid background

A grid background whose cells light up around the mouse, under a blue glow that follows the pointer.

  • Tailwind
  • React
  • CSS
  • WordPress
Open in a new tab

Description

A hero section for a land surveying firm sits on a fine grid that fades towards the edges. When the mouse moves over it, the cell under the pointer and its eight neighbours light up in steps, nearby lines turn blue and a soft glow follows the cursor, like a lamp moved across a plan. About thirty lines of dependency-free JavaScript, limited to one update per frame, only set CSS variables: everything moves with transform, with no layout shift. With touch, pen, no JavaScript or prefers-reduced-motion, the effect stays off and one corner of the grid keeps a fixed light, just as polished. The decoration is hidden from screen readers; the heading, text, button and link keep AA contrast in light and dark themes, with a clear focus outline and no horizontal scrolling from 360 px. Colours, cell size, glow size and lit area are set through CSS variables prefixed efgc.

Code

Loading the code…

The code of this component in

Archive contents

effet-fond-grille-lueur-curseur-html-tailwind.zip3 files · 6 Ko

  • index.html10 Ko
  • README.md4 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