forked from simranlotey/Hacktoberfest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alarmclock.html
92 lines (84 loc) · 2.05 KB
/
alarmclock.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
<!DOCTYPE html>
<html>
<head>
<title>Digital Clock and Alarm using JavaScript</title>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Orbitron&display=swap"
rel="stylesheet"
/>
<style>
body,
html {
margin: 0;
padding: 0;
background-color: #012d42;
}
.container {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#clock {
font-family: "Orbitron", sans-serif;
font-size: 15vw;
background-image: linear-gradient(
180deg,
rgb(243 207 30) 0%,
rgb(183 172 39) 50%,
rgb(120 118 40) 100%
);
background-clip: text;
-webkit-background-clip: text;
-moz-background-clip: text;
-webkit-text-fill-color: transparent;
-moz-text-fill-color: transparent;
}
input {
border: 2px solid #f0f0f0;
border-radius: 4px;
display: block;
font-size: 14px;
padding: 10px 15px;
}
.controls {
margin-top: 16px;
}
.button {
font-weight: bold;
border-radius: 5px;
border: none;
color: white;
padding: 8px 20px;
margin-left: 4px;
cursor: pointer;
font-size: 15px;
}
.set-alarm {
background-color: green;
}
.clear-alarm {
background-color: #ff3860;
}
</style>
</head>
<body>
<div class="container">
<div id="clock"></div>
<input
onchange="setAlarmTime(this.value)"
name="alarmTime"
type="datetime-local"
/>
<div class="controls">
<button onclick="setAlarm()" class="button set-alarm">Set alarm</button>
<button onclick="clearAlarm()" class="button clear-alarm">
Clear alarm
</button>
</div>
</div>
<script src="alarmclock.js"></script>
</body>
</html>