bnb({
w,
h: w,
numFrames: 60,
fps,
record: true,
chromaticAberration: .5,
shutterAngle: .2,
samplesPerFrame: 4,
setupOnce: true,
preload: (s, g) => {
g.pg = s.createGraphics(w, w)
},
draw: (s, t, g) => {
s.background(255)
g.pg.clear()
g.pg.drawingContext.globalCompositeOperation = 'xor'
g.pg.push()
g.pg.translate(w/2, w/2)
g.pg.fill(22)
g.pg.noStroke()
const m = 30
for(let i = 0; i < m; i ++) {
const angle = s.TAU / m * i
const cx = s.cos(angle) * w/3
const cy = s.sin(angle) * w/3
const radius = 105 + s.sin(angle + t * s.TAU ) * 70
g.pg.circle(cx, cy, radius)
g.pg.beginShape()
const n = 6
for(let j = 0; j < n; j ++) {
const anglej = s.TAU / n * j + angle
const x = cx + s.cos(anglej) * (radius/2)
const y = cy + s.sin(anglej) * (radius/2)
g.pg.vertex(x, y)
}
g.pg.endShape(s.CLOSE)
g.pg.beginShape()
for(let j = 0; j < n; j ++) {
const anglej = s.TAU / n * j + angle
const x = cx + s.cos(anglej) * (radius/4)
const y = cy + s.sin(anglej) * (radius/4)
g.pg.vertex(x, y)
}
g.pg.endShape(s.CLOSE)
}
g.pg.pop()
s.image(g.pg, 0, 0)
s.filter(s.INVERT)
}
})