-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
247 lines (221 loc) · 8.14 KB
/
index.html
File metadata and controls
247 lines (221 loc) · 8.14 KB
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<title>小小时钟</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="index.css"/>
<style>
:root {
--primary-color: #3498db;
--secondary-color: #2980b9;
--text-color: #333;
--light-bg: #f8f9fa;
--border-color: #e0e0e0;
--success-color: #2ecc71;
}
body {
width: 360px;
padding: 16px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
margin: 0;
color: var(--text-color);
line-height: 1.5;
}
.header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
}
.theme-switch {
display: flex;
align-items: center;
}
.toggle-switch {
position: relative;
display: inline-block;
width: 46px;
height: 24px;
margin-left: 8px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 24px;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: var(--primary-color);
}
input:focus + .slider {
box-shadow: 0 0 1px var(--primary-color);
}
input:checked + .slider:before {
transform: translateX(22px);
}
.time-display {
background-color: var(--light-bg);
padding: 12px;
border-radius: 8px;
text-align: center;
margin-bottom: 16px;
font-size: 16px;
color: var(--primary-color);
font-weight: 500;
border: 1px solid var(--border-color);
}
.card {
background-color: var(--light-bg);
border-radius: 8px;
padding: 16px;
margin-bottom: 16px;
border: 1px solid var(--border-color);
}
.card-title {
font-size: 16px;
font-weight: 600;
margin: 0 0 12px 0;
color: var(--primary-color);
}
.options-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.option-item {
margin-bottom: 8px;
display: flex;
align-items: center;
}
.option-item input[type="radio"] {
margin-right: 6px;
accent-color: var(--primary-color);
}
.option-item label {
cursor: pointer;
font-size: 14px;
}
.info {
font-size: 12px;
margin-top: 8px;
color: #666;
}
.author {
font-size: 12px;
text-align: center;
margin-top: 20px;
color: #666;
}
a {
color: var(--primary-color);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div class="header">
<h2>小小时钟</h2>
<div class="theme-switch">
白色时钟
<label class="toggle-switch">
<input type="checkbox" id="bai">
<span class="slider"></span>
</label>
</div>
</div>
<div class="time-display" id="time"></div>
<div class="card">
<div class="card-title">上半部分显示内容</div>
<div class="options-grid">
<div class="option-item">
<input type="radio" class="group" id="year1" name="time1"/>
<label for="year1">年份</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="month1" name="time1"/>
<label for="month1">月份</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="date1" name="time1"/>
<label for="date1">日期</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="hour1" name="time1" checked="true"/>
<label for="hour1">小时</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="minute1" name="time1"/>
<label for="minute1">分钟</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="sec1" name="time1"/>
<label for="sec1">秒数</label>
</div>
</div>
</div>
<div class="card">
<div class="card-title">下半部分显示内容</div>
<div class="options-grid">
<div class="option-item">
<input type="radio" class="group" id="year2" name="time2"/>
<label for="year2">年份</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="month2" name="time2"/>
<label for="month2">月份</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="date2" name="time2"/>
<label for="date2">日期</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="hour2" name="time2"/>
<label for="hour2">小时</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="minute2" name="time2" checked="true"/>
<label for="minute2">分钟</label>
</div>
<div class="option-item">
<input type="radio" class="group" id="sec2" name="time2"/>
<label for="sec2">秒数</label>
</div>
</div>
<div class="info">时间显示在浏览器工具栏的图标上,上下两部分可分别设置</div>
</div>
<div class="author">
作者博客: <a href="http://www.html-js.com" target="_blank">www.html-js.com</a>
</div>
<script src="jquery.js"></script>
<script src="popup.js"></script>
</body>
</html>