effect-tricks
v0.1.0
Published
Lightweight browser animation effects
Readme
tricks
Lightweight browser animation effects. Zero runtime dependencies.
Install
npm install tricksPixel reveal
import { PixelReveal } from "tricks";
const reveal = new PixelReveal(canvas, "/logo.svg", {
colorFlash: true,
pixelCount: 30,
direction: "left", // left | right | top | bottom | center | edges | random | top-left | top-right | bottom-left | bottom-right
duration: 2800,
onComplete: () => console.log("done"),
});
reveal.play("/other.png");
reveal.destroy();direction aliases: inside/center, outside/edges, rand/shuffle → random.
All effects extend Effect with destroy() and destroyed getter.
License
MIT
