-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
28 lines (24 loc) · 813 Bytes
/
script.js
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
/*
© (copyright) 2021. Available under the GPLv3. See LICENSE for details.
*/
window.onload = function () {
var counter = document.getElementById('count');
var starter = document.getElementById('start');
var audio = document.getElementById('audio');
starter.onclick = function () {
// let's go!
audio.play();
starter.disabled = true;
document.title = ("The News at " + new Date().getHours() + ":" + (new Date().getMinutes() + 1));
};
audio.onended = function () {
starter.disabled = false;
document.title = "The News at X";
};
setInterval(function () {
counter.innerHTML = 60 - new Date().getSeconds();
if (audio.paused == true) {
audio.currentTime = new Date().getSeconds();
}
}, 10);
};