🔬 Stars currently fade out over the first half of the animation (map's 0.5 endpoint). What happens if you change that 0.5 to 1, so stars fade out gradually across the ENTIRE sunrise instead of disappearing quickly?
let sa = map(progress, 0, 0.5, 255, 0, true); fill(255, sa); noStroke();
for (let i = 0; i < 50; i++) circle(random(width), random(height / 2), 2);
🔬 Each vertex's y-value (like height * 0.6) sets a mountain peak's height. What happens if you change height * 0.55 to height * 0.2 to create one dramatically tall peak in the middle?
vertex(0, height); vertex(width * 0.2, height * 0.6); vertex(width * 0.4, height * 0.8); vertex(width * 0.6, height * 0.55); vertex(width * 0.8, height * 0.7); vertex(width, height * 0.9); vertex(width, height);
function draw() {
let progress = constrain(frameCount / 600, 0, 1), sunY = lerp(height, height / 4, progress);
let nightTop = color(20, 0, 50), nightBottom = color(50, 0, 100), dawnTop = color(255, 100, 100), dawnBottom = color(255, 200, 100), dayTop = color(100, 150, 255), dayBottom = color(200, 220, 255);
let dawnP = constrain(progress * 2, 0, 1), dayP = constrain((progress - 0.5) * 2, 0, 1);
let topC = lerpColor(lerpColor(nightTop, dawnTop, dawnP), dayTop, dayP), bottomC = lerpColor(lerpColor(nightBottom, dawnBottom, dawnP), dayBottom, dayP);
for (let i = 0; i < height; i++) { stroke(lerpColor(topC, bottomC, i / height)); line(0, i, width, i); }
let sa = map(progress, 0, 0.5, 255, 0, true); fill(255, sa); noStroke();
for (let i = 0; i < 50; i++) circle(random(width), random(height / 2), 2);
if (progress > 0.2 && progress < 0.7) { fill(lerpColor(dawnTop, dayTop, map(progress, 0.2, 0.7, 0, 1, true)), 100); rect(0, height * 0.3, width, height * 0.05); rect(width*0.1, height*0.45, width*0.8, height*0.03); }
fill(255, 160, 0); drawingContext.shadowBlur = width / 20; drawingContext.shadowColor = color(255, 200, 0, 150); circle(width / 2, sunY, width / 10); drawingContext.shadowBlur = 0;
fill(0); beginShape();
vertex(0, height); vertex(width * 0.2, height * 0.6); vertex(width * 0.4, height * 0.8); vertex(width * 0.6, height * 0.55); vertex(width * 0.8, height * 0.7); vertex(width, height * 0.9); vertex(width, height);
endShape(CLOSE);
}