-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclock05.html
108 lines (87 loc) · 2.23 KB
/
clock05.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
<!--
Copyright (c) 2020 mooncape
https://mooncape.net/
Copyright (c) 2018-present, iamkun
Released under the MIT license
https://github.com/iamkun/dayjs/blob/dev/LICENSE
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.10.6/dayjs.min.js"></script>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap" rel="stylesheet">
<style>
*{
margin: 0;
padding: 0;
}
body{
text-align: center;
font-family: 'Roboto', sans-serif;
/* ▼ ここでテキストの色を変更 ▼ */
color: #000;
/* ▲ ここでテキストの色を変更 ▲ */
}
.nowtime{
margin-top: 15px;
margin-left: 15px;
width:300px;
padding : 5px 0px 5px 0px;
border-radius: 10px 10px 10px 10px;
/* ▼ ここで背景の色を変更 ▼ */
background: rgba(255,255,255,1.0);
/* ▲ ここで背景の色を変更 ▲ */
}
#time{
display: inline;
line-height: 1em;/* 行間 */
letter-spacing: 3px;/* 字間 */
font-size: 60px;
}
#colon{
vertical-align: 7%;
}
#live{
display: inline;
letter-spacing: 5px;/* 字間 */
font-size: 27px;
}
#icon{
display: inline;
position: relative;
top: 5%;
left: -3px;
}
#bolt{
height: 27px;
animation: icon 5s linear infinite;
fill: currentColor;
}
@keyframes icon {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(360deg); }
}
</style>
</head>
<body>
<div class="nowtime">
<!-- ここから時刻 -->
<p id="time"/>
<script language="JavaScript">
const day = function() {
const dt = dayjs(new Date());
const element = document.getElementById("time");
element.innerHTML = `${dt.format('HH')}<span id="colon">:</span>${dt.format('mm')}`;
};
setInterval(day, 1000);
</script>
<!-- ここまで時刻 -->
<p id="icon"/>
<!-- <svg id="bolt" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 30"><polygon id="bolt-2" data-name="bolt" points="12.4 0 1 18 9.2 18 7.617 30 19 12 10.8 12 12.4 0"/></svg> -->
<p id="live">LIVE</p>
</div>
</body>
</html>