bnb({
draw: (s, t, g) => {
const scalar_field_offset = (x, y) => {
const distance = s.dist(x, y, s.width / 2, s.height / 2)
const perlin_noise_intensity = ease(s.constrain(s.map(distance, 0, 0.7 * s.height, 1, 0), 0, 1), 2)
const scale = 0.012
const result = - 0.01 * (y + x) + 30 * (s.noise(scale * x, scale * y) - 0.5) * perlin_noise_intensity
return result
}
const pixel_color = (x, y, t) => {
const result = ease(s.map(s.sin(s.TWO_PI * (t + scalar_field_offset(x, y))), -1, 1, 0, 1), 3)
return scales.viridis(result)
}
for(let i = 0; i < s.width; i++) {
for(let j = 0; j < s.height; j++) {
s.stroke(pixel_color(i, j, t))
s.point(i, j)
}
}
},
numFrames: 20,
w: 540,
h: 540,
record: true,
gifDelay: 30,
shutterAngle: 0,
samplesPerFrame: 1,
chromaticAberration: 2.5,
})