
Ship something
people remember.
A button that wakes up when you reach for it.
ittybitty
North Star
Lava-lamp blobs drifting through a long-exposure light leak.
This browser cannot run WebGL2, so this is a still image. The code below works wherever WebGL2 is available.
Code
For your own build, add north-star.js, ittybitty-shader.js and runtime.js next to this page. Highlighted values follow the controls.
<!-- Quickest: one element. Size it with CSS; it fills its box. -->
<script type="module" src="./ittybitty-shader.js"></script>
<ittybitty-shader effect="north-star" style="width: 100%; height: 480px;"></ittybitty-shader>
<!-- Or with JavaScript, for full control: -->
<canvas id="north-star" aria-hidden="true" style="width: 100%; height: 480px; display: block"></canvas>
<script type="module">
import { northStar } from './north-star.js';
const canvas = document.getElementById('north-star');
const effect = northStar(canvas, {
colors: [[0, '#0b6a80'], [0.1, '#1a8fd0'], [0.2, '#2cc6e0'], [0.31, '#c7f1c5'], [0.42, '#f6f6f2'], [0.5, '#f6f4ee'], [0.56, '#f8f6ac'], [0.63, '#f9c1a0'], [0.7, '#fa915e'], [0.79, '#f7170a'], [0.88, '#f61a0a'], [0.9, '#d8e6b0'], [0.91, '#0f1f19']],
bias: 0.24,
speed: 0.5,
angle: -41,
stretch: 3.6,
blobs: 14,
size: 0.25,
wobble: 0.24,
focus: 0.45,
smear: 0.25,
glow: 0.12,
grain: 0.035,
variation: 2,
showStreaks: true,
streaks: 0.18,
showLeaks: true,
leaks: 0.2,
showLens: true,
distortion: 0.088,
showBands: true,
bend: 1,
// Performance
dpr: 1.5,
adaptive: true,
});
// Later: effect.set(…), effect.pause(), effect.resume(), effect.destroy()
</script>
Details
Soft blobs of colour rise, bud and melt into one another, smeared along a flowing direction like a long exposure, with bloom, fine light streaks and film grain. In focus a blob holds a crisp, oily edge; out of focus it melts into the gradient around it. Every colour comes from one ordered palette blended in OKLCH, so neighbours meet through light, never mud.
- Payload
- 11.5 KB brotli for north-star.js, ittybitty-shader.js and runtime.js, measured at build time.
- Resolution
- Device pixel ratio capped at 1.5. The lava renders at half resolution and redraws every other frame; grain, stipple and colour fringing stay at full resolution.
- Frame rate
- Display rate.
- When unseen
- Stops rendering when the canvas leaves the viewport or the tab is hidden, and resumes where it left off.
- Reduced motion
- Shows a single still frame. Controls still update it.
- Layers
- Up to five effects fuse into one shader and one draw call. Filters such as dithering and halftone process the layers beneath them.
- Browsers
- Any browser with WebGL2: Chrome and Edge 56+, Firefox 51+, Safari 15+.
- Licence
- MIT. Copy it, change it, ship it.