Skip to content

Cards with a following halo

A row of cards where the hovered card lights up with a halo that follows the mouse and brightens its edge closest to the pointer.

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

Description

A Saumur wine estate presents three visits as side-by-side cards. When the mouse moves over a card, a rosy halo follows the pointer inside that card only, its edge lights up where the cursor passes, the card lifts slightly and the edges of the neighbouring cards dim to guide the eye. The edge is a thin ring cut out by a CSS mask, lit by a spot of light moved with transform: no layout shift, and about thirty lines of dependency-free JavaScript, limited to one update per frame, only set two CSS variables. With touch, pen, no JavaScript or prefers-reduced-motion, nothing moves: each card keeps a fixed glint on its top corner, just as polished. With the keyboard, the card holding focus lights up and its link shows a clear focus outline. The decoration is hidden from screen readers, text keeps AA contrast in light and dark themes, with no horizontal scrolling from 360 px. Three looks are ready through the data-ehs-style attribute (net, doux, relief), and colours, radius or halo size are set through CSS variables prefixed ehs.

Code

Loading the code…

The code of this component in

Archive contents

effet-cartes-survol-halo-suiveur-html-tailwind.zip3 files · 6 Ko

  • index.html11 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