Skip to content
motionprompts motionprompts

Guiding Light Cursor Spotlight

JavaScript animation component · Published 2026-07-21 · by vanguardia.dev

Open live demo ↗ Download source

What it does

Cursor-following spotlight: a dark full-section mask with a radial-gradient cutout reveals content around the pointer while a Lottie fire flame with a pulsing glow trails the cursor via lerped rAF transforms. Activates on mousemove inside the spotlight section.

How it's built

Categoryinteractive
Techlenis, lottie-web
Complexitysection
Performance costlight
Mobile-safedesktop-first
Scrollhijacks scrolling

spotlight cursor mask lottie mousemove lenis

Rebuild it with AI

This component's prompt is part of the paid library. Below you can read how it starts; the full prompt, the exact structure, timing and easing an AI agent needs to rebuild the effect, unlocks with any paid plan, yearly or lifetime.

# Guiding Light — Cursor Spotlight with Trailing Flame
## Goal
Build a three-section scrolling page. The middle section is the star: a **cursor-driven spotlight**. When the pointer enters that section a **dark veil drops over the whole section**, punched through by a soft circular hole that follows the cursor — so content (heading + paragraph) is dimmed everywhere except a moving "flashlight" window around the pointer. Inside that section a small **animated flame (Lottie) with a pulsing warm glow trails the cursor with a smooth lag**, drifting from its home position toward wherever you point and easing back to center when the pointer leaves the section. Both the spotlight hole and the flame move with lerped smoothing, not snapping. The other two sections (before/after) are plain full-screen headings you scroll past with Lenis smooth scroll.
## Tech
Vanilla HTML/CSS/JS with ES module imports. **No GSAP is used at all.** The only runtime dependencies are:
- `lenis` (npm) — page-wide smooth scroll, started with `new Lenis({ autoRaf: true })`.
- `lottie-web` (npm) — loads and plays the flame animation JSON, `renderer: "svg"`, `loop: true`, `autoplay: true`.
All motion of the spotlight and flame is produced by a single hand-rolled `requestAnimationFrame` loop that linearly interpolates (lerps) values into CSS custom properties and a `transform`. Do not reach for any tween library.
## Layout / HTML
Three stacked full-viewport `<section>`s. The middle one holds the spotlight machinery.
```html
<section class="intro">
…

Premium prompt

Unlock this prompt, and every other one

From $99/year, or $139 once for lifetime access. Commercial license included.

See pricing Or start with the free set Already bought? Sign in

New components in your inbox

One email a week, only when new components ship, each with its live demo and prompt.