-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
39 lines (31 loc) · 969 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
29
30
31
32
33
34
35
36
37
38
39
//LogIn section to dissapear after submitting password
const logIn = document.querySelector('.logIn');
const submitLogIn = document.querySelector('.submit');
submitLogIn.onclick = function(){
logIn.style.display = "none";
}
//Making it possible to display and hide the start bar
function myFunction() {
var start = document.querySelector('.startUi');
if (start.style.display === 'none') {
start.style.display = 'block';
} else {
start.style.display = 'none';
}
}
//Setting up the clock
function startTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
m = checkTime(m);
document.getElementById('time').innerHTML =
h + ":" + m ;
var t = setTimeout(startTime, 500);
}
function checkTime(i) {
if (i < 10) {i = "0" + i}; // add zero in front of numbers < 10
return i;
}
var d = new Date();
document.getElementById("date").innerHTML = d.toDateString();