xxxxxxxxxx
let timer;
let interval = 1000;
let growing = true;
let w = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
timer = millis() + interval;
}
function draw() {
background(100);
if (growing) {
w = map(timer - millis(), 0, 1000, 0, width);
} else {
w = map(timer - millis(), 0, 1000, width, 0);
}
noStroke();
fill("blue");
ellipse(width/2, height/2, w, w);
if (timer < millis()) {
growing = !growing;
timer = millis() + interval;
}
}