-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
147 lines (125 loc) · 2.78 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>高考倒计时</title>
<script src="https://v1.hitokoto.cn/?encode=js&select=%23hitokoto" defer></script>
<link rel="shortcut icon" href="https://cdn.xsiy.ltd/photo/ico.png">
<link rel="bookmark" href="https://cdn.xsiy.ltd/photo/ico.png">
<style>
@import url("https://fonts.googleapis.com/css?family=Lato:400,700|Montserrat:900");
html {
display: grid;
min-height: 100%;
}
body {
display: grid;
background: #183059;
}
.container {
position: relative;
margin: auto;
overflow: hidden;
width: 650px;
height: 180px;
}
h1 {
font-family: "Lato", sans-serif;
text-align: center;
margin-top: 2em;
font-size: 1em;
text-transform: uppercase;
letter-spacing: 5px;
color: #F6F4F3;
}
#timer {
color: #F6F4F3;
text-align: center;
text-transform: uppercase;
font-family: "Lato", sans-serif;
font-size: .7em;
letter-spacing: 5px;
}
.days, .hours, .minutes, .seconds {
display: inline-block;
padding: 20px;
width: 100px;
border-radius: 5px;
}
.days {
background: #EF2F3C;
}
.hours {
background: #F6F4F3;
color: #183059;
}
.minutes {
background: #276FBF;
}
.seconds {
background: #F0A202;
}
.numbers {
font-family: "Montserrat", sans-serif;
color: #183059;
font-size: 5em;
}
footer {
position: absolute;
bottom: 0;
right: 0;
text-transform: uppercase;
padding: 10px;
font-family: "Lato", sans-serif;
font-size: 0.7em;
}
footer p {
letter-spacing: 3px;
color: #EF2F3C;
}
footer a {
color: #F6F4F3;
text-decoration: none;
}
footer a:hover {
color: #276FBF;
}
</style>
</head>
<body>
<br><br><br>
<div class="container">
<div id="timer"></div>
<h1>Time is running short.</h1>
</div>
<script>
const fourthOfJuly = new Date("June 7, 2022 8:00:00").getTime();
// countdown
let timer = setInterval(function() {
// get today's date
const today = new Date().getTime();
// get the difference
const diff = fourthOfJuly - today;
// math
let days = Math.floor(diff / (1000 * 60 * 60 * 24));
let hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((diff % (1000 * 60)) / 1000);
// display
document.getElementById("timer").innerHTML =
"<div class=\"days\"> \
<div class=\"numbers\">" + days + "</div>days</div> \
<div class=\"hours\"> \
<div class=\"numbers\">" + hours + "</div>hours</div> \
<div class=\"minutes\"> \
<div class=\"numbers\">" + minutes + "</div>minutes</div> \
<div class=\"seconds\"> \
<div class=\"numbers\">" + seconds + "</div>seconds</div> \
</div>";
}, 1000);
</script>
<div style="text-align:center;margin:10px 0; font:normal 14px/24px 'MicroSoft YaHei';color:#ffffff">
<p id="hitokoto">:D 获取中...</p>
</div>
</body>
</html>