xxxxxxxxxx
46
let a = 0;
let elldia = 50;
let inOut = true;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
noStroke();
}
function draw() {
background(220,200);
a += 1;
push();
translate (mouseX,mouseY);
rotate(a);
if(elldia > 200){
inOut = false;
}
if(elldia < 50){
inOut = true;
}
if(inOut){
elldia++
}
if(!inOut){
elldia--
}
let radius = map(sin(a*3), -1, 1, 50, 75);
fill(252,3,136,100);
ellipse(radius,0,elldia);
fill(3,223,252,100);
ellipse(0,radius,elldia);
fill(0,0,0,100);
ellipse(-radius,0,elldia);
fill(252,232,3,100);
ellipse(0,-radius,elldia);
pop();
}