-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclock04.html
More file actions
86 lines (70 loc) · 1.79 KB
/
Copy pathclock04.html
File metadata and controls
86 lines (70 loc) · 1.79 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
<!--
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:240px;
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;
}
#sec{
display: inline;
line-height: 1em;/* 行間 */
letter-spacing: 1px;/* 字間 */
font-size: 36px;
}
#colon{
vertical-align: 7%;
}
</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')}<span id="sec">${dt.format('ss')}</span>`;
};
setInterval(day, 1000);
</script>
<!-- ここまで時刻 -->
</div>
</body>
</html>