xxxxxxxxxx
73
let circs;
let main_r;
let paused = false;
let vaporwave = ["#ff71ce", "#01cdfe", "#05ffa1", "#b967ff", "#fffb96"];
function setup() {
createCanvas(1000, 1000);
angleMode(RADIANS);
circs = [];
main_r = width/8;
for (let _ = 0; _ < 500; _++) {
circs.push({
main_t: random(0, TWO_PI),
circ_t: random(0,TWO_PI),
circ_r: random(50,width/4),
circ_step: random(PI/162,PI/1024),
main_step: random(PI/512,PI/1024),
})
}
frameRate(60);
let c = color(random(vaporwave));
c.setAlpha(5);
stroke(c);//color(20,20,20,5));
noFill();
background(20);
// noStroke();
}
function changeColor() {
let c = color(random(vaporwave));
c.setAlpha(5);
stroke(c);//color(20,20,20,5));
noFill();
}
function draw() {
// background(220);
if (!paused) {
let jitter = random(-30,30);
translate(jitter+width/2,jitter+height/2);
// circle(0,0,main_r*2);
for (let c of circs) {
push();
let cx = main_r * cos(c.main_t);
let cy = main_r * sin(c.main_t);
c.main_t += c.main_step;
translate(cx, cy);
// circle(0, 0, c.circ_r*2);
let cx2 = c.circ_r * cos(c.circ_t);
let cy2 = c.circ_r * sin(c.circ_t);
c.circ_t += c.circ_step;
translate(cx2, cy2);
circle(0, 0, c.circ_r);
pop();
}
}
if (frameCount % 100 == 0) changeColor();
}
function keyPressed() {
if (key == " ") paused = !paused;
// if (key == "s") {
// paused = true;
// saveGif("rotator.gif", 3);
// }
}