Tiem Cong Nghe

Showing suggestions.

Opening the store's index…
↑↓ to move↵ to openesc to close
Tiem Cong Nghe search
Componentv1.0.0~2.6 KB gzipped

Spotlight Card

Frosted-glass cards lit by a soft light that follows the pointer — and spills across the grid

FreeFree
Format

.zip · HTML / CSS / JS · v1.0.0

Free — no account, no email. Always the newest version.

Live preview

Version
Preview width
Zoom

About

Cards that catch the light. A soft glow follows the pointer across frosted glass, and the border lights up on the side the pointer is closest to. Put a few in a grid and the light spills from one card onto the next — the polished spotlight effect you see on the best product pages, ready for your pricing tiers and feature lists.

  • One listener per grid, however many cards: the light crosses the gaps between them
  • A featured style for the plan you want people to pick, and an optional tilt toward the pointer
  • Every colour and size is a CSS custom property: accents, glass, reach of the glow, radius, timing
  • The script only writes positions; CSS draws the light, so it stays smooth and cheap
  • Nothing to install: one CSS file and one small script, or one React file

Features

  • A soft light follows the pointer inside the card
  • The border glows on the side nearest the pointer, even from the next card over
  • One listener lights a whole grid: pricing tiers, feature lists, dashboards
  • Featured style with a border that glows at rest, for the plan you recommend
  • Optional 3D tilt toward the pointer, off by default
  • Works on <article>, <a>, <li> or any element, light and dark
  • Plain HTML/CSS/JS and React (Next.js ready) builds
  • Zero dependencies, under 3 KB gzipped

How to use it

Link the stylesheet and the script once. Put cards in a data-spotlight-group so the light spills from one to the next; a card on its own takes data-spotlight:

HTML
<link rel="stylesheet" href="spotlight-card.css" />
<script src="spotlight-card.js" defer></script>

<div class="spotlight-group" data-spotlight-group>
  <article class="spotlight-card">…</article>
  <article class="spotlight-card" data-variant="featured">…</article>
  <article class="spotlight-card">…</article>
</div>

<a class="spotlight-card" href="/changelog" data-spotlight>…</a>

Every .spotlight-card inside a group is lit by the group — cards added to it later too. The spotlight-group class is an optional responsive grid; any layout works. Tilt the card under the pointer with data-spotlight-tilt (in degrees, default 0 = off; 4–8 feels right) on the group or the single card. Groups or cards added after the page loads: SpotlightCard.init(container) — it returns a function that undoes it.

Ask about this product

Not sure it fits your project? Ask — the answer comes from this page.

Answers are written by AI from this page and can be wrong. The page itself is what counts.

Changelog

  1. 1.0.0First releaseLatest

    Plain HTML/CSS/JS and React builds. Pointer-following light, spill-over grid glow, featured style, optional tilt, keyboard, touch and reduced-motion support.

  2. Fixes and new features land behind the same download, which always serves the latest version.

Reviews

No reviews yet

Used it? Be the first to say how it went.

Write a review

How did it work for you? Reviews appear once we have read them.

Your rating
Never shown. Only used if we need to reach you about your review.
0 / 2000

Your name and review are shown on this page; your email is not. See the terms.

  • ComponentCard

    Swipe Card Stack

    A Tinder-style card stack you drag, flick and throw — with stamps, undo and real physics

    Free