Spotlight cursor

Mood track «Mirage» · Kevin MacLeod incompetech.com · licensed under Creative Commons BY 4.0
Example image of the style Spotlight cursor
Preview built in HTML and CSS in this style

Foco que sigue el cursor · Spotlight cursor · Cursor glow · Spotlight hover · Bordo luminoso al passaggio

A soft light follows the cursor across a dark grid and lights up the borders and surfaces of nearby cards, like a torch in a dark room. It is the visual signature of many developer-tool websites.

Era
2020 – today
Use
Mainstream
Domain
Web / UIMotion
Mood
futuristicsubtleimmersive
Explore

Live demo

View code
<main class="grid">
  <article><b>⚡</b><h3>Deploy istantanei</h3><p>Online in pochi secondi.</p></article>
  <article><b>◎</b><h3>Analisi in tempo reale</h3><p>Ogni visita, ogni clic.</p></article>
  <article><b>⌘</b><h3>Scorciatoie</h3><p>Tutto da tastiera.</p></article>
  <article><b>☁</b><h3>Edge globale</h3><p>Vicino a ogni utente.</p></article>
</main>
<script>
if(matchMedia('(prefers-reduced-motion: no-preference)').matches){
  const cards=[...document.querySelectorAll('article')],g=document.querySelector('.grid');let mx=null,my=null,t=0;
  addEventListener('pointermove',e=>{mx=e.clientX;my=e.clientY});document.addEventListener('pointerleave',()=>{mx=null});
  const loop=()=>{t+=.012;const r=g.getBoundingClientRect();
    const x=mx??r.left+r.width*(.5+.45*Math.sin(t)),y=my??r.top+r.height*(.5+.42*Math.sin(t*1.7+1));
    cards.forEach(c=>{const b=c.getBoundingClientRect();c.style.setProperty('--x',x-b.left+'px');c.style.setProperty('--y',y-b.top+'px')});
    requestAnimationFrame(loop)};loop();
}
</script>
body{margin:0;height:100vh;display:grid;place-items:center;background:#08090C;font-family:Geist,system-ui,sans-serif;color:#E6E8EE}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:440px;max-width:92vw}
article{--x:-999px;--y:-999px;position:relative;padding:18px;border-radius:14px;background:#14161C;isolation:isolate}
article::before{content:"";position:absolute;inset:0;border-radius:inherit;padding:1px;background:radial-gradient(180px circle at var(--x) var(--y),#B98CFF,#7C9CFF 40%,#ffffff14 70%);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;z-index:-1}
article::after{content:"";position:absolute;inset:0;border-radius:inherit;background:radial-gradient(240px circle at var(--x) var(--y),#7C9CFF1f,transparent 60%);z-index:-1}
b{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:#ffffff0d;border:1px solid #ffffff1a;font-size:14px}
h3{font-size:14px;font-weight:600;margin:12px 0 4px}
p{margin:0;font-size:12.5px;color:#8B93A7}
@media (prefers-reduced-motion:reduce){article:hover{--x:50%;--y:0px}}

Characteristics

  • Radial gradient positioned with CSS variables
  • Borders lighting up only near the cursor
  • One halo shared across neighbouring cards
  • Dark, near-monochrome background
  • No effect on touch where there is no cursor

Palette

Click a swatch to copy it

Typography

Headings · Geist Spotlight cursor

Body · Geist A soft light follows the cursor across a dark grid and lights up the borders and surfaces of nearby cards, like a torch in a dark room. It is the visual signature of many developer-tool websites.

Motion

Easing
segue il puntatore, eventuale lerp 0.1–0.2
Typical duration
continua; dissolvenza 200–300 ms all'uscita
Techniques
pointermove con variabili CSS --x e --y, radial-gradient su bordo con background-clip o mask, mix-blend-mode, requestAnimationFrame, @property per transizioni morbide

Accessibility (reduced motion)

A fixed, faint glow on hovered cards without tracking the cursor.

Prompt for your agent

Copy and paste into your prompt to have an agent or image generator reproduce this style.

For web pages and UI

Design the web page or interface in this style: Spotlight cursor (Foco que sigue el cursor).
A soft light follows the cursor across a dark grid and lights up the borders and surfaces of nearby cards, like a torch in a dark room. It is the visual signature of many developer-tool websites.
Characteristics: Radial gradient positioned with CSS variables, Borders lighting up only near the cursor, One halo shared across neighbouring cards, Dark, near-monochrome background, No effect on touch where there is no cursor.
Palette: #08090C, #14161C, #E6E8EE, #8B93A7, #7C9CFF, #B98CFF.
Typography: headings in Geist, body text in Geist (Google Fonts or equivalents).
Mood: futuristic, subtle, immersive.
Motion: easing segue il puntatore, eventuale lerp 0.1–0.2, typical duration continua; dissolvenza 200–300 ms all'uscita; techniques: pointermove con variabili CSS --x e --y, radial-gradient su bordo con background-clip o mask, mix-blend-mode, requestAnimationFrame, @property per transizioni morbide.
With prefers-reduced-motion: A fixed, faint glow on hovered cards without tracking the cursor.
References: Landing page di strumenti per sviluppatori (anni 2020), tutorial di Codrops sui bordi luminosi, effetto spotlight di Aceternity UI, Magic UI.

Relations

Similar to: Reactive dot gridReactive dot gridSimilar to: Custom CursorCustom CursorSimilar to: Mouse TrailMouse TrailSimilar to: SaaS darkSaaS darkSpotlight cursor
Similar toSee in the graph →

References

  • Landing page di strumenti per sviluppatori (anni 2020)
  • tutorial di Codrops sui bordi luminosi
  • effetto spotlight di Aceternity UI
  • Magic UI