Grain
Tube noise over anything. A static filter by default, or a capped canvas loop that pauses off screen.
pulls in@afterglow/use-reduced-motion
0.13
64 KB
64 KB
The blend is screen, so the noise reads in the blacks rather than only over lit content.
Installation
npx shadcn@latest add @afterglow/grainAPI Reference
The blend is screen, so the noise reads in the blacks. Over a light surface it all but disappears; raise opacity to bring it back.
animated caps its frame rate at fps, stops painting while it is off screen, and falls back to the static filter under reduced motion.
Grain
An absolutely positioned overlay for the element it sits in. Static by default, which is one feTurbulence paint and no JavaScript.
| Prop | Type | Default |
|---|---|---|
| animated | boolean | false |
| fps | number | 24 |
| opacity | number | 0.13 |