Fluid animated background renderer using WebGL, Kawase blur, and domain warping. Creates effects similar to Apple Music's album art visualization. Zero dependencies.
- @kawarp/core - Pure TypeScript WebGL renderer
- @kawarp/react - React component wrapper
npm install @kawarp/core
# or
npm install @kawarp/reactimport { Kawarp } from '@kawarp/core';
const canvas = document.querySelector('canvas');
const kawarp = new Kawarp(canvas);
await kawarp.loadImage('path/to/image.jpg');
kawarp.start();import { Kawarp } from '@kawarp/react';
function App() {
return (
<Kawarp
src="/image.jpg"
warpIntensity={0.8}
style={{ width: '100%', height: '100vh' }}
/>
);
}| Option | Type | Default | Description |
|---|---|---|---|
warpIntensity |
number | 1.0 | Warp effect strength (0-1) |
blurPasses |
number | 8 | Kawase blur passes (1-40) |
animationSpeed |
number | 1.0 | Animation speed multiplier |
transitionDuration |
number | 1000 | Crossfade duration in ms |
saturation |
number | 1.5 | Color saturation multiplier |
tintColor |
[r, g, b] | [0.16, 0.16, 0.24] | Tint color for dark areas (0-1) |
tintIntensity |
number | 0.15 | Tint effect strength (0-1) |
dithering |
number | 0.008 | Dithering strength (0-0.1) |
scale |
number | 1.0 | Overall zoom level of the effect (0.01-4) |
loadImage(url)- Load image from URLloadBlob(blob)- Load from Blob or FileloadGradient(colors, angle?)- Load gradient as sourcestart()- Start animationstop()- Stop animationresize()- Update canvas dimensionsdispose()- Clean up WebGL resources
pnpm install
pnpm devThe technique of combining Kawase blur on downscaled textures with domain warping for fluid distortion is based on this article on Diffuse by Justin Zhang.
AGPL-3.0