-
Notifications
You must be signed in to change notification settings - Fork 1
/
50-countdown-timer.html
104 lines (98 loc) Β· 3.03 KB
/
50-countdown-timer.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
96
97
98
99
100
101
102
103
104
<!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>50-countdown-timer</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css" />
<style>
.timer {
display: flex;
column-gap: 10px;
}
.timer__items {
display: flex;
font-size: 48px;
max-width: max-content;
margin: 0 auto;
}
.timer__item {
position: relative;
min-width: 60px;
margin-left: 10px;
margin-right: 10px;
padding-bottom: 15px;
text-align: center;
}
.timer__item::before {
content: attr(data-title);
display: block;
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
font-size: 14px;
}
.timer__item:not(:last-child)::after {
content: ':';
position: absolute;
right: -15px;
}
</style>
</head>
<body>
<input type="text" id="datetime-picker" />
<button type="button" data-start>Start</button>
<div class="timer">
<div class="field">
<span class="value" data-days>00</span>
<span class="label">Days</span>
</div>
<div class="field">
<span class="value" data-hours>00</span>
<span class="label">Hours</span>
</div>
<div class="field">
<span class="value" data-minutes>00</span>
<span class="label">Minutes</span>
</div>
<div class="field">
<span class="value" data-seconds>00</span>
<span class="label">Seconds</span>
</div>
</div>
<!-- SIMPLE COUNTER -->
<div class="timer">
<div class="timer__items">
<div class="timer__item js-timer__days" data-title="days">00</div>
<div class="timer__item js-timer__hours" data-title="hours">00</div>
<div class="timer__item js-timer__minutes" data-title="minutes">00</div>
<div class="timer__item js-timer__seconds" data-title="seconds">00</div>
</div>
</div>
<input type="text" id="datetime-picker1" />
<button type="button" data-start1>Start</button>
<div class="timer1">
<div class="field">
<span class="value" data-days1>00</span>
<span class="label">Days</span>
</div>
<div class="field">
<span class="value" data-hours1>00</span>
<span class="label">Hours</span>
</div>
<div class="field">
<span class="value" data-minutes1>00</span>
<span class="label">Minutes</span>
</div>
<div class="field">
<span class="value" data-seconds1>00</span>
<span class="label">Seconds</span>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="dist/notiflix-aio-X.X.X.min.js"></script>
<script src="./app/50-countdown-timer.js" type="module"></script>
</body>
</html>