function setup() {
let canvas = createCanvas(600, 600, WEBGL);
canvas.parent('animation-holder');
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
resizeAnimation();
}
let cubes = [];
let circles = [];
function draw() {
background(255);
strokeWeight(5);
for (let i = 0; i < 25; i++) {
let x = (i % 5) * 60 - 150;
let y = Math.floor(i / 5) * 60 - 150;
let z = noise(frameCount * 0.01 + i * 0.1) * 200 - 100;
let displacement = noise(frameCount * 0.01 + i * 0.2) * 100 - 50;
let rotationX = noise(frameCount * 0.01 + i * 0.3) * TWO_PI;
let rotationY = noise(frameCount * 0.01 + i * 0.4) * TWO_PI;
let rotationZ = noise(frameCount * 0.01 + i * 0.5) * TWO_PI;
push();
translate(x + displacement, y + displacement, z + displacement);
rotateX(rotationX);
rotateY(rotationY);
rotateZ(rotationZ);
let hue = (frameCount * 0.01 + i * 0.05) % 360;
fill(hue, 100, 100, 255);
let boxSize = 35 + noise(frameCount * 0.01 + i * 0.2) * 15 + sin(frameCount * 0.05 + i * 0.1) * 15;
box(-boxSize / 2, -boxSize / 2, boxSize * 2);
push();
hue = (frameCount * 0.01 + i * 0.07) % 360;
fill(hue, 100, 100, 255);
ellipse(0, 0, 10 + noise(frameCount * 0.01 + i * 0.1) * 20 + sin(frameCount * 0.02 + i * 0.2) * 10);
pop();
pop();
}
for (let i = 0; i < 40; i++) {
let circleX = noise(frameCount * 0.01 + i * 0.2) * 400 - 200;
let circleY = noise(frameCount * 0.01 + i * 0.3) * 400 - 200;
let circleZ = noise(frameCount * 0.01 + i * 0.4) * 400 - 200;
push();
translate(circleX, circleY, circleZ);
let hue = (frameCount * 0.01 + i * 0.03) % 360;
stroke(hue, 100, 100, 255);
fill(hue, 100, 100, 255);
ellipse(0, 0, 25 + noise(frameCount * 0.01 + i * 0.1) * 50 + sin(frameCount * 0.02 + i * 0.3) * 25);
pop();
}
}