Scribble Cursor
- group .........
- Cursor and hover effects
- source ........
- https://ui.aryank.space/components/scribble-cursor
- markdown ......
- /lab/scribble-cursor.md
- human .........
- /lab/scribble-cursor
── WHAT_IT_IS ────────────────────────────────────────────────────────────────────────────────
A blue pen line that chases the pointer and redraws itself every frame with random control points, so it reads as a hand-drawn scribble. A chain of spring points follows the cursor and the line clears 100ms after the pointer stops. Tracks the whole page or only a hovered element. Canvas 2D, no dependencies.
── BEHAVIOUR ────────────────────────────────────────────────────────────────────────────────
* Redrawn every frame
Nothing is kept between frames. The canvas clears, the spring chain steps once, and each segment is drawn as a quadratic curve whose control point lands at a new random offset, so the line wobbles in place even while the cursor holds a straight path.
* Only while moving
Each pointer move restarts a 100ms timer. When it runs out the canvas clears, so the scribble exists only during motion and never leaves a trail behind.