xxxxxxxxxx
55
function setup() {
createCanvas(windowWidth, windowHeight);
angleMode(DEGREES);
noFill();
bg = color('#151440');
a = 30;
c = [color(8, 217, 214, a), color(255, 46, 99, a), color(252, 245, 106, a)];
c2 = [color(8, 217, 214), color(255, 46, 99), color(252, 245, 106)];
n=12
length = 10
}
function draw() {
background(bg);
fill(220);
stroke(220);
strokeWeight(1);
textFont('Nunito', 30);
text('@URBANOXYGEN_', width-290, height-20);
translate(width/2, height/2);
for(j=0;j<n;j++) {
push();
for(i=1;i<length;i++) {
rotate(pow(-1, i)*frameCount);
noFill();
stroke(c2[(i+j)%3]);
strokeWeight(4);
ellipse(0, 0, i*10);
rotate(pow(-1, i)*frameCount*2);
strokeWeight(1);
fill(c[(i+j)%3]);
polygon(0, 0, i*3, i+1);
rotate(-pow(-1, i)*frameCount*2);
translate(0, (i+1)*20)
}
pop();
rotate(360/n);
}
}
function polygon(x, y, radius, npoints) {
angleMode(RADIANS);
let angle = TWO_PI / npoints;
beginShape();
for (let a = 0; a < TWO_PI; a += angle) {
let sx = x + cos(a) * radius;
let sy = y + sin(a) * radius;
vertex(sx, sy);
}
endShape(CLOSE);
angleMode(DEGREES);
}