xxxxxxxxxx
60
let t = 0;
function setup() {
createCanvas(600, 600);
colorMode(HSB, 360, 100, 100, 100);
background(360, 0, 100, 100);
// noLoop();
createLoop({ duration: 5, gif: true });
}
function draw() {
let backcolor = color(179, 100, 70);
background(backcolor);
// fill(color(47, 32, 95));
fill(color(37, 86, 98));
noStroke();
let rSun = 300;
circle(width/2, -50, rSun);
let i = 0;
for(let y = 150; y < height-120; y += 80) {
points = [];
points.push({ x: width, y: y });
points.push({ x: width, y: height});
points.push({ x: 0, y: height});
for(let x = 0; x < width; x += 30) {
let noiz = noise(x * 0.01, y * 0.01, t);
let vy = y + map(noiz, 0, 1, -50, 50);
points.push({ x: x, y: vy});
}
// fill(backcolor);
// beginShape();
// points.forEach(p => vertex(p.x, p.y));
// endShape();
i += 1;
// let c = color(37, 86, 98);
let c = color(47, 32, 95);
c.setAlpha(i * 26);
fill(c);
beginShape();
points.forEach(p => vertex(p.x, p.y));
endShape();
if (i < 7) {
let sunColor = color(37, 86, 98);
sunColor.setAlpha(i * 16);
fill(sunColor);
noStroke();
circle(width/2, y+120, rSun);
}
}
// save("looking.jpg");
t += 0.01;
}