-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
457 lines (377 loc) · 8.47 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
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
<!doctype html>
<html lang="zh-CN" id="all">
<head>
<meta charset="utf-8">
<title>时钟</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>
/*全局字体设置*/
html {
background-color: black;
color: #ffffff;
font-family: 微软雅黑, Helvetica, Arial, sans-serif;
}
/*上方时分秒时间样式*/
#hours {
/*line-height: 250px;*/
text-align: center;
padding: 0px 0px 0px;
margin: 0px;
/*font-size: 250px;*/
}
/*日期样式*/
#days {
/*font-size: 150px;
line-height: 230px;*/
text-align: center;
padding: 0px 0px 0px;
margin: 0px;
font-family: 微软雅黑, Arial, Helvetica, sans-serif;
color: white;
}
/* 考试倒计时部分*/
/*#exam{
font-size:90px;
text-align:center;
padding: 0px 0px 0px;
margin: 0px;
font-family:微软雅黑,Arial, Helvetica, sans-serif;
color: #f9f900;;
}
*/
/*今日诗词部分*/
#jinrishici-sentence {
/*font-size: 50px;*/
text-align: center;
margin-top: 10px;
}
/*右下角的小时钟*/
#teachertime {
display: inline;
position: absolute;
right: 10px;
bottom: 10px;
}
/*Dev模式下的开门按钮*/
#devdoor {
position: absolute;
height: 50px;
width: 100px;
border-radius: 25px;
left: 10px;
bottom: 10px;
background-color: #ffffff15;
}
/*开门按钮的icon*/
.icon {
margin: 7px;
margin-left: 30px;
width: 36px;
height: 36px;
padding: 0;
}
#card {
justify-content: center;
align-items: center;
background: rgba(255, 255, 255, 0.15);
border-radius: 10px;
color: #fff;
}
#notice {
margin-top: 10px;
color: #f9f900;
}
/* 缩放后的手表*/
@media(min-width: 160px) {
#hours {
font-size: 30px;
line-height: 30px;
}
/*日期样式*/
#days {
font-size: 25px;
line-height: 40px;
}
#jinrishici-sentence {
font-size: 15px;
}
#notice {
font-size: 15px;
}
}
/* 极小设备 (手表, 320px 以下屏幕设备) */
@media(min-width: 320px) {
#hours {
font-size: 68px;
line-height: 68px;
}
/*日期样式*/
#days {
font-size: 40px;
line-height: 55px;
}
#jinrishici-sentence {
font-size: 25px;
}
#notice {
font-size: 25px;
}
}
/* 450px*/
@media(min-width: 350px) {
#hours {
font-size: 76px;
line-height: 76px;
}
/*日期样式*/
#days {
font-size: 50px;
line-height: 65px;
}
#jinrishici-sentence {
font-size: 25px;
}
#notice {
font-size: 25px;
}
}
/* 小设备 (平板电脑和大型手机,600 像素及以上) */
@media(min-width: 600px) {
/*上方时分秒时间样式*/
#hours {
font-size: 130px;
line-height: 130px;
}
/*日期样式*/
#days {
font-size: 85px;
line-height: 115px;
}
#jinrishici-sentence {
font-size: 25px;
}
#notice {
font-size: 25px;
}
}
/* 中型设备(平板电脑,768 像素及以上) */
@media (min-width: 768px) {
/*上方时分秒时间样式*/
#hours {
font-size: 170px;
line-height: 170px;
}
/*日期样式*/
#days {
font-size: 90px;
line-height: 108px;
}
#jinrishici-sentence {
font-size: 25px;
}
#notice {
font-size: 25px;
}
}
/* 大型设备(笔记本电脑/台式机,992 像素及以上) */
@media (min-width: 992px) {
/*上方时分秒时间样式*/
#hours {
font-size: 215px;
line-height: 215px;
}
/*日期样式*/
#days {
font-size: 100px;
line-height: 130px;
}
#jinrishici-sentence {
font-size: 40px;
}
#notice {
font-size: 40px;
}
}
/* 超大型设备(大型笔记本电脑和台式机,1200 像素及以上) */
@media(min-width: 1200px) {
/*上方时分秒时间样式*/
#hours {
font-size: 250px;
line-height: 250px;
}
/*日期样式*/
#days {
font-size: 150px;
line-height: 230px;
}
#jinrishici-sentence {
font-size: 40px;
}
#notice {
font-size: 40px;
}
}
/* 2000以上 */
@media(min-width: 2000px) {
/*上方时分秒时间样式*/
#hours {
font-size: 260px;
line-height: 260px;
}
/*日期样式*/
#days {
font-size: 140px;
line-height: 161px;
}
#jinrishici-sentence {
font-size: 50px;
}
#notice {
font-size: 50px;
}
}
/* 3800以上 */
@media(min-width: 3800px) {
/*上方时分秒时间样式*/
#hours {
font-size: 700px;
line-height: 700px;
}
/*日期样式*/
#days {
font-size: 540px;
line-height: 630px;
}
#jinrishici-sentence {
font-size: 150px;
}
#notice {
font-size: 150px;
}
}
#card {
color: white;
border-radius: 20px;
padding: 5px;
box-shadow: rgba(0, 235, 208, 0.25) 0 10px 30px -5px;
background-image: linear-gradient(144deg, #00ebcf, #00ebcf 50%, #00ebcf);
}
#card_content {
background: rgb(1, 10, 9);
border-radius: 17px;
width: 100%;
height: 100%;
}
</style>
<div id="card">
<div id="card_content">
<!--时分秒容器-->
<h3 id="hours"></h3>
<!--日期容器-->
<h3 id="days"></h3>
</div>
</div>
<!--考试倒计时-->
<!--<div id="exam"></div>-->
<!--<marquee id="notice">滚动内容</marquee>-->
<!--今日诗词容器-->
<div id="jinrishici-sentence"></div>
<!--右下角小时钟容器-->
<div id="teachertime"></div>
<!--Dev模式下开门按钮-->
<botton id="devdoor" onclick="doorcolor()">
<svg t="1673053509631" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="4208" width="200" height="200">
<path
d="M426.276571 574.829714l0 372.004571-389.705143-53.686857 0-318.317714 389.705143 0zM426.276571 150.308571l0 376.539429-389.705143 0 0-322.852571zM987.428571 574.829714l0 449.170286-518.290286-71.460571 0-377.709714 518.290286 0zM987.428571 73.142857l0 453.705143-518.290286 0 0-382.317714z"
fill="#cdcdcd40" p-id="4209"></path>
</svg>
</botton>
<script>
//主时间初始化
var t = new Date,
e = t.getMonth() + 1,
n = t.getDate(),
s = t.getHours() < 10 ? "0" + t.getHours() : t.getHours(),
i = t.getMinutes() < 10 ? "0" + t.getMinutes() : t.getMinutes(),
a = t.getSeconds() < 10 ? "0" + t.getSeconds() : t.getSeconds();
var htmlhours = document.getElementById("hours");
htmlhours.innerHTML = s + ":" + i + ":" + a;
var htmldays = document.getElementById("days");
htmldays.innerHTML = e + "月" + n + "日";
//教师时间初始化
var htmlteachertime = document.getElementById("teachertime");
htmlteachertime.innerHTML = s + ":" + i + ":" + a;
//考试倒计时部分
/*var htmlexam = document.getElementById("exam");
var ex=23-n;
if(ex<=0){
htmlexam.style.display="none";
}
htmlexam.innerHTML = "距离期末考试还有<b style='color:red;'>"+ex+"</b>天";*/
//每秒刷新部分
setInterval(function () {
var t = new Date,
e = t.getMonth() + 1,
n = t.getDate(),
s = t.getHours() < 10 ? "0" + t.getHours() : t.getHours(),
i = t.getMinutes() < 10 ? "0" + t.getMinutes() : t.getMinutes(),
a = t.getSeconds() < 10 ? "0" + t.getSeconds() : t.getSeconds();
htmlhours.innerHTML = s + ":" + i + ":" + a;
htmlteachertime.innerHTML = s + ":" + i + ":" + a;
}, 1000);
//去除右键
document.oncontextmenu = function () {
event.returnValue = false;
}
console.log("输入 hide() 来隐藏今日诗词");
var htmlshici = document.getElementById("jinrishici-sentence");
function hide() {
htmlshici.style.display = "none";
return "隐藏成功!";
}
//左下角按钮部分
function doorcolor() {
const page = document.getElementById("all");
toggleFullScreen(page);
}
//全屏部分
window.addEventListener("load", startup, false);
function startup() {
// Get the reference to video
const page = document.getElementById("all");
// On pressing ENTER call toggleFullScreen method
document.addEventListener("keypress", function (e) {
if (e.key === 'Enter') {
toggleFullScreen(page);
}
}, false);
}
function toggleFullScreen(page) {
if (!document.fullscreenElement) {
// If the document is not in full screen mode
// make the video full screen
page.requestFullscreen();
} else {
// Otherwise exit the full screen
if (document.exitFullscreen) {
document.exitFullscreen();
}
}
}
</script>
<!--<script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>-->
<script>
var xhr = new XMLHttpRequest();
xhr.open('get', 'https://v1.jinrishici.com/all.json');
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
var data = JSON.parse(xhr.responseText);
var gushici = document.getElementById('jinrishici-sentence');
gushici.innerText = data.content;
}
};
xhr.send();
</script>
</html>