1
I have this script that changes the background color of the site as the page is updated.
<script>
function random_bg_color() {
var x = Math.floor(Math.random() * 256);
var y = Math.floor(Math.random() * 256);
var z = Math.floor(Math.random() * 256);
var bgColor = "rgb(" + x + "," + y + "," + z + ")";
console.log(bgColor);
document.body.style.background = bgColor;
}
random_bg_color();
</script>
It would be possible to modify it to show only specific colors in a given time ?
Example in the morning a lighter color, the afternoon a slightly dark color, and the evening a totally dark color.
Or add an image instead of the color, or 2, when you don’t have a color shows an image.
Very good, would add an image, like the sunset at dusk?
– Endou
The idea is to darken the bottom of the site as the day goes by.
– Endou
@Endou, I edited the answer. If you solved your problem mark it as accepted.
– user60252
I’m sorry, I love your answer, I’ll start taking some tests. Thank you
– Endou