bnb({
w: 540,
h: 540,
numFrames: 180,
loops: 3,
fps: 30,
chromaticAberration: 0.1,
record: false,
setup: (s, g) => {
g.grid = new HexGrid(s);
g.colorFn = d3.interpolateRgb("gold", "yellow");
},
draw: (s, t, g) => {
for (let i = 0; i < 120; i++) {
const animate = ease(linearstepUpDown(t, 0.1, 0.3, 0.7, 0.9), 2);
const center = g.grid.getCenterByIdx(i);
const hex = new Hexagon(s, center, animate * 43.3);
s.beginShape();
const color = g.grid.getCol(i) / g.grid.numCols;
s.stroke(g.colorFn((1 - color) * animate));
s.strokeWeight(1 + animate);
s.fill(g.colorFn(color));
hex.vertices.forEach((v) => s.vertex(v.x, v.y));
s.endShape(s.CLOSE);
}
}
})