11const second = 1000 ,
2- minute = second * 60 ,
3- hour = minute * 60 ,
4- day = hour * 24 ;
2+ minute = second * 60 ,
3+ hour = minute * 60 ,
4+ day = hour * 24 ;
55
6- let countDown = new Date ( 'Apr 16 , 2020 23 :59:59' ) . getTime ( ) ,
7- x = setInterval ( function ( ) {
6+ let countDown = new Date ( 'Apr 17 , 2020 11 :59:59' ) . getTime ( ) ,
7+ x = setInterval ( function ( ) {
88
9- let now = new Date ( ) . getTime ( ) ,
10- distance = countDown - now ;
9+ let now = new Date ( ) . getTime ( ) ,
10+ distance = countDown - now ;
1111
1212 document . getElementsByClassName ( 'days' ) [ 0 ] . innerText = Math . floor ( distance / ( day ) ) ,
13- document . getElementsByClassName ( 'days' ) [ 1 ] . innerText = Math . floor ( distance / ( day ) ) ,
14- document . getElementsByClassName ( 'hours' ) [ 0 ] . innerText = Math . floor ( ( distance % ( day ) ) / ( hour ) ) ,
15- document . getElementsByClassName ( 'hours' ) [ 1 ] . innerText = Math . floor ( ( distance % ( day ) ) / ( hour ) ) ,
16- document . getElementsByClassName ( 'minutes' ) [ 0 ] . innerText = Math . floor ( ( distance % ( hour ) ) / ( minute ) ) ,
17- document . getElementsByClassName ( 'minutes' ) [ 1 ] . innerText = Math . floor ( ( distance % ( hour ) ) / ( minute ) ) ,
18- document . getElementsByClassName ( 'seconds' ) [ 0 ] . innerText = Math . floor ( ( distance % ( minute ) ) / second ) ,
19- document . getElementsByClassName ( 'seconds' ) [ 1 ] . innerText = Math . floor ( ( distance % ( minute ) ) / second ) ;
13+ document . getElementsByClassName ( 'days' ) [ 1 ] . innerText = Math . floor ( distance / ( day ) ) ,
14+ document . getElementsByClassName ( 'hours' ) [ 0 ] . innerText = Math . floor ( ( distance % ( day ) ) / ( hour ) ) ,
15+ document . getElementsByClassName ( 'hours' ) [ 1 ] . innerText = Math . floor ( ( distance % ( day ) ) / ( hour ) ) ,
16+ document . getElementsByClassName ( 'minutes' ) [ 0 ] . innerText = Math . floor ( ( distance % ( hour ) ) / ( minute ) ) ,
17+ document . getElementsByClassName ( 'minutes' ) [ 1 ] . innerText = Math . floor ( ( distance % ( hour ) ) / ( minute ) ) ,
18+ document . getElementsByClassName ( 'seconds' ) [ 0 ] . innerText = Math . floor ( ( distance % ( minute ) ) / second ) ,
19+ document . getElementsByClassName ( 'seconds' ) [ 1 ] . innerText = Math . floor ( ( distance % ( minute ) ) / second ) ;
2020
21- if ( distance < 0 ) {
22- clearInterval ( x ) ;
23- 'Tempo esgotado!' ;
24- }
21+ if ( distance < 0 ) {
22+ clearInterval ( x ) ;
23+ 'Tempo esgotado!' ;
24+ }
2525
26- } , second )
26+ } , second )
0 commit comments