- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
Latest commit
33 lines (24 loc) · 788 Bytes
/
Copy pathscript.js
File metadata and controls
33 lines (24 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
functionload(){
varmsg=window.document.getElementById('mensagem');
varimg=window.document.getElementById('imagem');
vardata=newDate();
varhora=data.getHours()
varminuto=data.getMinutes()
msg.innerHTML=`Agora são ${hora}:${minuto} horas.`
if(hora>=0&&hora<12){
//Bom dia!
img.src='fotomanha.png'
document.body.style.background='#e0ac33'
}elseif(hora>=12&&hora<18){
//Boa tarde!
img.src='fototarde.png'
document.body.style.background='#bc4a02'
}else{
//Boa noite!
img.src='fotonoite.png'
document.body.style.background='#032e53'
}
setTimeout(function(){
document.location.reload(true);
},20000)
}