Sakuga VFX
Sakuga VFX is a set of ordinary UI controls that react like anime. At rest they are plain. Press the button and it squashes flat, inverts for one frame, a burst goes off behind it, clouds roll off the corners and ドン! lands on the page. No characters, just the way a key animator would sell a hit, applied to a checkbox.
- 11
- Custom elements
- 43
- Painted frames in the toggle
- 6
- Sound-effect words
- 0
- Dependencies
The idea
The set was decided on paper before any code: one concept sheet with every control caught mid-reaction, then a strip of five keyframes per control (rest, anticipation, hit, follow-through, settle). Each component was written to hit those five frames.

How it is built
Each control is one plain script that registers a custom element. Every puff, burst, chip and slash is drawn in code on a single canvas that sits over the page. Each file carries its own copy of the core, about 40 KB, and any mix of them on a page shares one canvas and one animation loop.
The lettering is the one effect that needed a real brush. Six words were painted by an image model as flat black on transparency, then traced into vector paths. All six come to about 17 KB of path data, so no image files ship.

The toggle, which I built four times
The toggle's strip asks for something code does badly: the knob melts into a smear, slams into the end, and a crown of water floods the track.
I built it in code three times. Styled HTML on springs moved well and was not the strip. Shapes drawn on a canvas had the right shapes and none of the morph. A small fluid simulation in a shader moved like liquid and was a different drawing every time. The note on the third was "It's not looking like the reference," and it was right.
So the image model drew the in-betweens, which failed three ways first. One GIF of the whole flip came back capped at 16 frames, with the switch jumping position partway through. A sprite sheet changed the switch's size from cell to cell. Interpolating extra frames gave ghosted double images. What worked was three GIFs of 16 frames, each covering a shorter stretch, aligned on the switch's navy outline and trimmed to 43.

Turning it on plays all 43 at 30 a second. Turning it off plays the 12 dash frames backwards, since a splash cannot un-splash. The price is a toggle of about 500 KB where the others are about 45 KB.
Where to try it
The live gallery has every control running, and the source is on GitHub under the MIT licence. It has been checked in headless Chromium, and not yet in Safari or Firefox, on a real phone, or with a screen reader.
- Web Components
- Canvas 2D
- Vanilla JS
- Spring physics
- potrace
- AI image generation
- shadcn registry












