bnb({
w: 540,
h: 540,
numFrames: 180,
loops: 3,
fps: 60,
chromaticAberration: 0.1,
record: false,
setup: (s, g) => {
g.shapes = [];
const center = s.createVector(s.width / 2, s.height / 2);
for (let i = 100; i > 0; i--) {
g.shapes.push(new Hexagon(s, center, 50 + i * 2));
}
},
draw: (s, t, g) => {
const backgroundColor = colorFn(animationFn(t));
s.background(backgroundColor);
g.shapes.forEach((hex, idx) => {
s.beginShape();
const offset = idx * 10;
const hexColor = colorFn(animationFn(idx / 1000 + t));
s.fill(hexColor);
s.strokeWeight(animationFn(t) / 2);
hex.vertices.forEach((v) => s.vertex(v.x, v.y));
s.endShape(s.CLOSE);
});
}
})