yes!, another javascript library for animating the dom,
the main purpose for this library is me been so lazy to learn the Html canvas
so I tried to imitate canvas
features using just div
basically this library contains three shapes:
- point either
Spot
ordot
Line
Triangle
and all those three elements are build on top of the atomic component DIV
which's a normal div element
import Init from "./init";
import { Spot } from "./shapes";
import Background from "./background";
import { random } from "./math";
import DIV from "./div";
import { setFrame_speed } from "./core";
let items: Spot[];
let bg: DIV;
function start() {
bg = Background();
items = new Array(100)
.fill(null)
.map(
(_) =>
new Spot(random(bg._width), random(bg._height), { r: 10, c: "red" })
);
}
function update() {
setFrame_speed(5);
items.forEach((i) => {
i.update([random(bg._width), random(bg._height)]);
});
}
Init(start, update);