forked from linthittun3/ThingyanCountdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
32 lines (25 loc) · 959 Bytes
/
script.js
File metadata and controls
32 lines (25 loc) · 959 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
let countDate = new Date('April 13, 2021 00:00:00').getTime();
function thinGyan(){
let now = new Date().getTime();
gap = countDate - now;
let second = 1000;
let minute = second * 60;
let hour = minute * 60;
let day = hour * 24;
let d = Math.floor(gap / (day));
let h = Math.floor((gap % (day)) / (hour));
let m = Math.floor((gap % (hour)) / (minute));
let s = Math.floor((gap % (minute)) / (second));
document.getElementById('day').innerText = d;
document.getElementById('hour').innerText = h;
document.getElementById('minute').innerText = m;
document.getElementById('second').innerText = s;
}
setInterval(function(){
thinGyan();
},1000)
// window.addEventListener("DOMContentLoaded", event => {
// const audio = document.querySelector("audio");
// audio.volume = 0.2;
// audio.play();
// });