-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
182 lines (182 loc) · 5.83 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>时间戳转换工具</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background-color: #f0f0f0;
margin: 0;
}
.container {
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
width: 90%;
max-width: 600px;
}
.row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.row .input-group {
flex: 1;
margin: 0 10px;
display: flex;
flex-direction: column;
}
.input-group label {
margin-bottom: 5px;
}
.input-group input, .input-group select {
width: calc(100% - 20px);
padding: 8px;
margin: 0;
box-sizing: border-box;
}
.input-group {
flex: 1;
}
.description {
margin-bottom: 20px;
font-size: 14px;
color: grey;
line-height: 1.5;
}
.timezone {
margin: 0 10px;
display: flex;
flex-direction: column;
flex: 1;
}
.timezone label {
margin-bottom: 5px;
}
.timezone select {
width: calc(100% - 20px);
padding: 8px;
margin: 0;
box-sizing: border-box;
}
.countdown {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 30px;
}
.countdown-group {
margin-right: 10px;
}
.countdown-group label {
margin-right: 5px;
}
.countdown-group select {
padding: 8px;
}
#days-count {
font-size: 16px;
margin-left: 10px;
}
.progress-bar {
width: 100%;
background-color: #e0e0e0;
border-radius: 5px;
margin-top: 20px;
overflow: hidden;
}
.progress-bar-fill {
height: 20px;
background-color: #4caf50;
transition: width 0.5s ease-in-out;
}
.progress-bar-text {
color: #000;
text-align: center;
line-height: 20px;
font-size: 14px;
}
.footer {
text-align: center;
margin-top: 20px;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/luxon/2.0.2/luxon.min.js"></script>
</head>
<body>
<div class="container">
<div class="description">
<p>时间戳(timestamp)是自1970年1月1日 00:00:00 UTC 以来经过的秒数,这一时间点被称为 Unix Epoch 或 Unix 时间的起点。时间戳广泛用于计算机系统中,因为它提供了一种简单且一致的方式来表示和计算时间。</p>
</div>
<div class="row">
<div class="input-group">
<label for="current-time">当前时间:</label>
<input type="text" id="current-time" readonly>
</div>
<div class="input-group">
<label for="current-timestamp">当前时间戳:</label>
<input type="text" id="current-timestamp" readonly>
</div>
<div class="input-group">
<label for="current-timezone">当前时区:</label>
<input type="text" id="current-timezone" readonly>
</div>
</div>
<div class="row">
<div class="input-group">
<label for="datetime-input">输入日期时间:</label>
<input type="text" id="datetime-input" placeholder="1970-01-01 00:00:00">
</div>
<div class="input-group">
<label for="timestamp-input">输入时间戳:</label>
<input type="text" id="timestamp-input" placeholder="0">
</div>
<div class="timezone">
<label for="timezone-select">时区:</label>
<select id="timezone-select">
<!-- 时区选项将动态生成 -->
</select>
</div>
</div>
<div class="countdown">
<div class="row">
<div class="countdown-group">
<select id="year-select"></select>
<label for="year-select">年</label>
</div>
<div class="countdown-group">
<select id="month-select"></select>
<label for="month-select">月</label>
</div>
<div class="countdown-group">
<select id="day-select"></select>
<label for="day-select">日</label>
</div>
<div class="countdown-group">
<label>距离今天:<span id="days-count"></span> 天</label>
</div>
</div>
</div>
<div class="progress-bar">
<div class="progress-bar-fill" id="progress-bar-fill"></div>
</div>
<div class="progress-bar-text">
今年已过去 <span id="progress-bar-text"></span>
</div>
</div>
<footer>
<div class="footer">
<a href="https://github.com/luhuadong/timestamp"><img src="https://cdn.jsdelivr.net/gh/Closty/duanwangzhi/github.png" style="width:50px;"> </a>
</div>
</footer>
<script src="script.js"></script>
</body>
</html>