SVG Scribble Draw-On Image Hover
What it does
A 3x2 grid of square image cards, each overlaid with two oversized scribbled SVG paths. On mouseenter the strokes draw themselves on (strokeDashoffset animated from full path length to 0 via getTotalLength) while their stroke-width swells from 200 to 700, and the card title rises word by word with a SplitText mask; on mouseleave everything reverses.
How it's built
| Category | hover |
|---|---|
| Tech | gsap, lenis |
| GSAP plugins | SplitText |
| Complexity | section |
| Performance cost | light |
| Mobile-safe | desktop-first |
| Scroll | hijacks scrolling |
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.
# SVG Scribble Draw-On Image Hover — Self-Drawing Strokes Over a Card Grid
## Goal
Build a page with a **3-row × 2-column grid of square image cards**. Each card is overlaid by **two oversized, scribbled SVG paths** (a colored one + a light-grey one) that are invisible at rest. On **mouseenter**, both scribbles **draw themselves on** (classic `strokeDasharray`/`strokeDashoffset` line-drawing trick, offset animated from full path length → 0) while simultaneously **swelling their stroke-width from 200 → 700**, and the card's title **rises in word-by-word** from behind a mask. On **mouseleave** everything reverses: the scribbles un-draw and thin back to 200, and the title drops back down word-by-word (reversed order). Smooth scroll via Lenis. The star effect is the pair of thick scribbles drawing on over the photo plus the masked word-rise on the title.
## Tech
Vanilla HTML/CSS/JS with ES module imports, in a fresh Vite + npm project. Install and import from npm:
- **`gsap`** (3.x) plus the plugin **`SplitText`** (used for the title word-mask reveal).
- **`lenis`** — smooth scroll, stepped by its own `requestAnimationFrame` loop.
```js
import gsap from "gsap";
import { SplitText } from "gsap/SplitText";
import Lenis from "lenis";
gsap.registerPlugin(SplitText);
…
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.