Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
codemaniac-sahil authored Jan 24, 2022
1 parent 58a2584 commit 00b8d26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ setInterval(() => {
)
a = new Date();
s = a.getHours()
if (s > 12 && s<16) {
if (s >= 12 && s<16) {
document.getElementById('time').innerHTML = " Afternoon";
document.body.style = "background-image:linear-gradient(red,yellow);";
}else if (s > 16 && s <24) {
document.getElementById('time').innerHTML = " Evening";
document.body.style = "background-image:linear-gradient(black,gray);";
}
else if(s>=0 && s<=12){
else if(s>=0 && s<12){
document.getElementById('time').innerHTML = " Morning";
document.body.style = "background-image:linear-gradient(orange,yellow);";
}

0 comments on commit 00b8d26

Please sign in to comment.