File tree 3 files changed +10
-2
lines changed
3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
function carregar ( ) {
2
2
var msg = window . document . getElementById ( 'msg' ) ;
3
3
var img = window . document . getElementById ( 'imagem' ) ;
4
+ var titulo = window . document . querySelector ( 'h1' ) ;
4
5
5
6
var data = new Date ( ) ;
6
7
var hora = data . getHours ( ) ;
7
8
8
9
msg . innerHTML = `Agora são ${ hora } horas!` ;
9
10
10
- if ( hora > 0 ) {
11
+ if ( hora >= 6 && hora <= 11 ) {
11
12
//BOM DIA
12
13
img . src = "manha.png"
13
14
document . body . style . background = '#cbdde5'
14
- } else if ( hora > 11 && hora <= 18 ) {
15
+ } else if ( hora >= 12 && hora <= 18 ) {
15
16
//BOA TARDE
16
17
img . src = "tarde.png"
17
18
document . body . style . background = '#805f49'
19
+ } else if ( hora >= 1 && hora < 6 ) {
20
+ //BOA MADRUGADA
21
+ titulo . innerHTML = 'FELIZ HALLOWEEN'
22
+ titulo . style . color = '#ea670a'
23
+ msg . innerHTML = 'A madrugada não assusta, as <strong>Bruxas</strong> sim!'
24
+ img . src = "halloween.png"
25
+ document . body . style . background = '#000000'
18
26
} else {
19
27
// BOA NOITE
20
28
img . src = "noite.png"
You can’t perform that action at this time.
0 commit comments