-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
95 lines (78 loc) · 3.76 KB
/
index.html
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Count Down</title>
<link rel="stylesheet" href="style.css">
</head>
<body class="alaska">
<header>
<!-- create a background changer / style changer -->
<h1>Eternity</h1>
<div class="dropDown">
<button class="dropBtn">Background</button>
<div class="dropdown-Content">
<div id="forest" onclick="backgroundValue(event)">Forest</div>
<div id="alaska" onclick="backgroundValue(event)">Alaska</div>
</div>
</div>
</header>
<div id="container">
<!-- Input Count Down Date -->
<div class="box">
<div class="clockTitle" id="dateCountTitle">Input Time</div>
<!-- input -->
<div class="inputContainer">
<label for="inputName">Set your date:</label>
<input type="text" id="inputName" placeholder="Example: Jan 01, 2023" >
<button onclick="setCount()">Submit</button>
</div>
<div id="clock">
<span id="inputDate"></span>
</div>
</div>
<!-- Preset Count Down Date -->
<div class="box">
<div class="clockTitle" id="newYear"></div>
<div id="clock">
<span id="date"></span>
</div>
</div>
<!-- current time -->
<div class="box">
<div class="clockTitle">Current Time</div>
<div id="clock">
<span id="currentT"></span>
</div>
</div>
<!-- Count Down Timer -->
<div class="box">
<div class="clockTitle">Count Down</div>
<!-- input -->
<div class="inputContainer">
<label for="inputName">Set Count Down:</label>
<!-- check if the value of the first character is greater than 6, if so prevent the input -->
<input type="number" id="inputHours" value="0" min="0" max="99" class="timerStyle" placeholder="Hours"
onkeydown="if(event.key==='.' || event.key==='-' || event.key==='+'){event.preventDefault();}"
oninput="if(this.value.length > this.maxLength) {this.value = this.value.slice(0, this.maxLength);}" maxlength="2">
<input type="number" id="inputMinutes" value="0" min="0" max="59" class="timerStyle" placeholder="Minutes" onkeydown="if(event.key==='.' || event.key==='-' || event.key==='+'){event.preventDefault();}"
onkeypress="if(event.key >= 6 && this.value.length === 0){event.preventDefault();}"
oninput="if(this.value.length > this.maxLength) {this.value = this.value.slice(0, this.maxLength);}" maxlength="2">
<input type="number" id="inputSeconds" value="0" min="0" max="59" class="timerStyle" placeholder="Seconds" onkeydown="if(event.key==='.' || event.key==='-' || event.key==='+'){event.preventDefault();}"
onkeypress="if(event.key >= 6 && this.value.length === 0){event.preventDefault();}"
oninput="if(this.value.length > this.maxLength) {this.value = this.value.slice(0, this.maxLength);}" maxlength="2">
<button id="start" onclick="clockDown(event); hideBtn(event);">Start</button>
<button id="reset" onclick="reset(); hideBtn(event)">Restart</button>
</div>
<div id="clock">
<span id="hoursDown"></span>
<span id="minutesDown"></span>
<span id="secondsDown"></span>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>