// port with some edits
// edit 1 - make small canvas
// since default is full screen
const myw = 600;
const myh = 800;
let h = 0;
function setup() {
createCanvas(myw, myh); // edit
}
function draw() {
background(0);
drawArc(0, 0, h);
noLoop(); // edit 2 - no need to draw twice
}
function drawArc(x, y, h) {
noStroke();
colorMode(HSL, 360);
fill(h, 200, 200);
ellipse(x+70, y+60, 80);
rect(x+30, y+60, 80, 60);
if (x+30 < myw) { // edit
drawArc(x+110, y, h+30);
}
if (y+30 < myh) { // edit
drawArc(x, y+140, h+30);
}
}