Micro-interactions
Intro Animation
A wind front sweeps the wordmark right to left. The instant it reaches a glyph the text hands off to a baseline-aligned field of GPU grain — same pixels, same colour, no seam — which peels crown-first and drifts away as smoke through a curl field. The backdrop opens behind it to reveal the page. Mount it over your app and unmount on onDone.
Install
bun add oglThen copy 3 files into your project:
- components/registry/intro-animation/intro-animation.tsx
- components/registry/intro-animation/dust-gl.ts
- hooks/use-animation-loop.ts
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| sweepDuration | number | 1.9 | Time the wind front takes to cross the wordmark. Everything downstream is derived from it — the reveal fires at 93.7% of the sweep, so shortening it tightens the whole sequence rather than leaving the plume stranded after a fast wipe. |
| grainDensity | number | 2500 | Grains sampled per glyph. The sampling stride adapts to font size, so this is a count and not a spacing — a glyph holds roughly this many points whether it renders at 28px or 112px. The performance knob: every grain is one point in a single draw call, and changing it re-rasterizes the word. |
| windSpeed | number | 1 | How hard the wind carries released grains downstream. Each grain keeps its own speed rank, so the motion-blur ghosting on the fastest ones survives turning the wind down — the plume slows without flattening into a uniform sheet. |
| buoyancy | number | 1 | How fast the plume climbs. Lift also feeds the wind shear, so raising it does not just push the dust up — it rakes the risen grains further ahead and bends the plume into a curve instead of a diagonal. |
| turbulence | number | 1 | Amplitude of the divergence-free curl field the grains are advected through. The field is sampled at each grain's travelling position, so grains meet new eddies as they fly — that is the difference between smoke and shimmer. At zero the dust is pure ballistics. |
| grainSize | number | 1 | Size of an individual grain. The base covers the sampling stride so the held letter reads as solid ink; push it far below 1 and the handoff starts to show the lattice underneath. |
| splitIndex | number | 6 | How many characters carry the ink colour before the accent takes over. The tint travels with each grain, so the dust keeps the colour of the letter it came from all the way out. |
| reveal | "split" | "fade" | "none" | "split" | How the backdrop leaves. Split slides two halves apart from the centre line; fade dissolves it in place; none draws no backdrop at all, so the wordmark erodes over whatever is already behind it. |
| autoplay | boolean | true | Replay the sequence on a loop. Off is the real thing: the intro plays once, calls onDone, and returns false to the loop host so it stops costing frames for good. |
| replayDelay | number | 1.2 | Pause between the plume clearing and the wordmark reassembling. Long enough to read as a fresh entrance rather than a stutter. |
| inkColor | string (hex) | "#e9e7ef" | Colour of the leading characters and the dust that comes off them. |
| accentColor | string (hex) | "#a855f7" | Amethyst on the characters from the split onward. A uniform, not baked into the grain buffer, so dragging it never re-rasterizes the word. |
| backgroundColor | string (hex) | "#08050e" | The field the wordmark sits on and the thing the reveal opens. Its own material rather than a themed surface — an intro that flashes white in a light theme defeats the point of covering the page. |
What It Demonstrates
- Reveal
- Content is uncovered gradually, often by animating a clip-path or mask.
- Enter / Exit
- The animation an element plays when it's added to or removed from the screen.
- Stagger
- Animate several items one after another with a small delay between each, creating a cascade.
- Page transition
- An animation that plays when navigating from one page or route to another.
- Perceived performance
- The right animation makes an interface feel faster, even when it isn't.
- Hardware acceleration
- Animating transform and opacity lets the GPU keep motion smooth.
- Linear
- Constant speed. Avoid for UI; reserve for spinners or marquees.
- Reduced motion
- Respecting the user's prefers-reduced-motion setting by toning down or removing motion.
Related Components
Stagger Menu
A menu overlay that blooms open as a clip-path circle spring while items stagger in with blur and rotation, then collapses back to its pill.
Dissolve
An element disintegrates into drifting shadow-motes on dismiss, and reforms on command.
Sigil
An SVG crest that traces itself in when it scrolls into view, stroke by stroke.
Blueprint Card
A technical-drawing card. Dashed envelope, accent rules, corner nodes, and a soft glow that draw in on mount.
Corner Letters
Four glyphs pinned to the container corners that blur-and-scale in on mount and dissolve out on exit.
Radial Menu
Press and hold anywhere and the options fan out from the point you pressed. Selection is resolved from the pointer's angle rather than by hit-testing the options, so every target is an infinite wedge — commit to a direction and you can throw the pointer as hard as you like and still land it.