-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
55 lines (53 loc) · 1.9 KB
/
Copy pathindex.html
File metadata and controls
55 lines (53 loc) · 1.9 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Countdown...</title>
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<header></header>
<div class="container">
<h2>Always Be Coding</h2>
<p>(Session in progress)</p>
<div id="timer-background">
<span id="form">
<input id="txtTime" type="number" step="1" min="0" max="100" list="defaultNumbers" />
<datalist id="defaultNumbers">
<option value="1">
<option value="5">
<option value="10">
<option value="15">
<option value="20">
<option value="25">
<option value="30">
<option value="35">
</datalist>
<a href="#" id="startCountdown">Start</a>
</span>
<h2 id="timesup"></h2>
<div>
<h1 id="countdown"></h1>
</div>
</div>
</div>
<script src="javascript/Timer.js"></script>
<script>
const form = document.getElementById("form");
const input = document.getElementById("txtTime");
const startBtn = document.getElementById("startCountdown");
// Desktop & Mobile Events
startBtn.onclick = () => startTimer();
startBtn.addEventListener("touchend", startTimer, false);
// Start Event Handler
function startTimer() {
const time = input.value;
const timer = new Timer(time);
timer.countDown();
form.style.setProperty('display', 'none');
}
</script>
</body>
</html>