-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsongbaobaoshi.html
More file actions
63 lines (61 loc) · 1.8 KB
/
songbaobaoshi.html
File metadata and controls
63 lines (61 loc) · 1.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="https://tinypng.com/images/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>宋宝报时</title>
<style>
body{
background: #0d1320;
overflow: hidden;
}
#date{
text-align: center;
font-size:28vh;
font-weight: bold;
color:#e2ecfd;
}
#timer{
text-align: center;
font-size:56vh;
font-weight: bold;
line-height: 56vh;
color:#e2ecfd;
}
section{
position: absolute;
bottom: .5vh;
right:.5vh;
font-size:1.5vh;
color:#e2ecfd;
}
</style>
</head>
<body>
<div id="date">00月00日</div>
<div id="timer">06:12</div>
<section>宋宝报时</section>
<script>
let showSymbl = true
function clock(){
let now = new Date()
let hour = now.getHours()+''
let minute = now.getMinutes() + ''
let month = (now.getMonth()+1)+''
let day = now.getDate()+''
if(showSymbl){
document.getElementById('timer').innerHTML = `${hour.padStart(2,'0')}<span>:</span>${minute.padStart(2,'0')}`
}else{
document.getElementById('timer').innerHTML = `${hour.padStart(2,'0')}<span style="color:#0d1320">:</span>${minute.padStart(2,'0')}`
}
document.getElementById('date').innerHTML = `${month.padStart(2,'0')}月${day.padStart(2,'0')}日`
showSymbl = !showSymbl
}
clock()
setInterval(()=>{
clock()
},1000)
</script>
</body>
</html>