viewof canvasGrid = {
const q5 = new Q5();
q5.createCanvas(width, height);
const el = html`${q5.canvas}`;
el.value = q5;
yield el;
q5.colorMode(q5.HSB, 100);
q5.noStroke();
while (true) {
const osc = 0.5 + 0.5 * Math.sin(Date.now() / 1000);
q5.background(100 * osc, 10, 100);
q5.fill(0, 100, 0);
q5.textSize(Math.sin(osc * Math.PI) * 200);
q5.textAlign(q5.CENTER, q5.CENTER);
q5.text("q5.js", width / 2, height / 2);
q5.rect((width - w) * osc, 0, w, height);
q5.rect((width - w) * (1 - osc), 0, w, height);
q5.rect(0, osc * (height - w), width, w);
q5.rect(0, (1 - osc) * (height - w), width, w);
yield el;
}
}