pointer-trail-emitter

Builds cursor trail emitters that spawn particles per unit of distance travelled for constant spacing.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill pointer-trail-emitter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pointer-trail-emitter
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/pointer-trail-emitter
Command: npx skills add https://github.com/MengTo/Skills --skill pointer-trail-emitter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Timer-based cursor trails break apart at high pointer speeds: a fast flick scatters the line into dots while a resting hand piles particles on one spot. This Skill implements distance-based emission so trail spacing stays constant regardless of hand speed.

Core Features & Use Cases

  • Distance-based emission: Accumulates pointer travel distance and spends it in fixed steps, with sub-segment mote placement, a teleport guard cap, and correct ring-buffer slot ordering.
  • Motion tuning: Covers emitter damping lag, coast damping, curl, buoyancy, extent-relative scatter, and a rare idle breath so a stationary cursor keeps an aura without growing a column.
  • Accessibility and lifecycle: Handles touch devices, keyboard-driven control, prefers-reduced-motion still frames, visibility pausing, dt clamping, and DPR capping.
  • Use Case: Add a wisp, spark, ember, or comet-tail trail to a landing page hero in Vanilla JavaScript and Canvas 2D (or a camera-anchored 3-D scene) that reads as one continuous ribbon whether the user crawls or flicks the pointer.

Quick Start

Use the pointer-trail-emitter skill to add a mote trail to this hero that emits by distance travelled so spacing stays constant at any hand speed.

Frequently Asked Questions about pointer-trail-emitter

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a cursor trail with constant spacing in JavaScript?

Emit particles by distance travelled instead of on a timer: accumulate the pointer's movement each frame and spawn one mote every fixed step of distance. Place each mote at its owed position along the segment so a fast flick lays a continuous ribbon rather than scattered dots.

Why does my mouse trail break into dots when moving fast?

Timer-based emission spawns particles at fixed time intervals, so spacing equals pointer speed times interval. A fast flick covers too much distance between spawns and the line scatters. Distance-based emission fixes spacing along the path regardless of speed.

Can I build a cursor trail without WebGL or Three.js?

Yes. The bundled demo uses dependency-free Vanilla JavaScript with the Canvas 2D API, drawing a cached radial-gradient sprite with additive compositing. CSS styles only the interface, and no shaders, WebGL, or runtime dependencies are required.

How do I keep a cursor trail visible when the pointer stops moving?

Add a rare idle emission on a timer, roughly one mote every 0.4 seconds, since distance emission produces nothing for a stationary pointer. Emitting more often reintroduces the timer failure and grows a permanent column of smoke under the resting cursor.

How should a cursor trail handle touch devices and reduced motion?

Gate on matchMedia('(hover: none)') and drive the emitter only during drags or park it, since touch has no hover position. Under prefers-reduced-motion, render a designed still frame of the composed trail rather than hiding the effect entirely.