p5((s) => {
let w = 23.4 * 30;
let h = 33.1 * 30;
let cw = 20;
let ch = 20;
let noiseScaleSpace = 0.0003
let noiseScaleTime = 0.0009
s.setup = function () {
s.createCanvas(w, h);
};
s.draw = function () {
s.clear()
s.background(15,60,60)
s.strokeWeight(5)
s.strokeCap(s.SQUARE)
s.stroke(30,120,120)
for (let x = 0; x < w; x += cw) {
for (let y = 0; y < h; y += ch) {
s.translate(x, y)
s.rotate(s.noise(x * noiseScaleSpace, y * noiseScaleSpace, s.frameCount * noiseScaleTime) * 180)
s.line(5, ch / 2, cw - 5, ch / 2)
s.resetMatrix()
}
}
};
s.keyPressed = function ({key}) {
if (key === 's') {
s.pixelDensity(10)
s.draw()
s.saveCanvas('image', 'png')
s.pixelDensity(s.displayDensity())
}
}
})