-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime.css
170 lines (148 loc) · 3.39 KB
/
time.css
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
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
position: relative;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
background-color: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
#clock {
text-align: center;
font-size: 180px;
color: green;
font-weight: normal;
margin-top: auto;
margin-bottom: auto;
font-style: normal;
}
.time-rings {
display: flex;
justify-content: center;
align-items: center;
margin-top: 10px; /* 调整上边距,控制圆环与时间段落之间的间距 */
margin-bottom: 10px;
}
.time-ring {
width: 100px;
height: 100px;
position: relative;
margin: 0 70px; /* 调整左右间距,控制三个圆环之间的间距 */
}
.progress {
width: 100%;
height: 100%;
background-color: transparent;
border-radius: 50%;
position: absolute;
top: 0;
left: 0;
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
transform: rotate(90deg);
transform-origin: 50% 50%;
animation: progressAnimation 60s linear infinite;
}
/* @keyframes progressAnimation {
0% {
transform: rotate(90deg);
}
100% {
transform: rotate(450deg);
}
} */
@keyframes secondProgressAnimation {
0% {
transform: rotate(90deg);
}
100% {
transform: rotate(450deg);
}
}
@keyframes minuteProgressAnimation {
0% {
transform: rotate(90deg);
}
100% {
transform: rotate(450deg);
}
}
@keyframes hourProgressAnimation {
0% {
transform: rotate(90deg);
}
100% {
transform: rotate(450deg);
}
}
#second-progress {
animation: secondProgressAnimation 30s linear infinite; /* 每轮60秒 */
}
#minute-progress {
animation: minuteProgressAnimation 60s linear infinite; /* 每轮3600秒,即60分钟 */
}
#hour-progress {
animation: hourProgressAnimation 90s linear infinite; /* 每轮43200秒,即12小时 */
}
#fullscreen-button {
position: absolute;
top: 10px;
right: 10px;
}
#toggleFullscreenButton {
width: 20px;
height: 20px;
background-color: green;
border: none;
outline: none;
cursor: pointer;
border-radius: 50%;
box-shadow: 0px 0px 90px #e603078a;
color: white;
font-size: 24px;
}
#toggleFullscreenButton:hover {
background-color: yellow;
}
#darkmode-button {
position: absolute;
top: 10px;
right: 35px;
}
#toggleDarkModeButton {
width: 20px;
height: 20px;
background-color: red;
border: none;
outline: none;
cursor: pointer;
border-radius: 50%;
box-shadow: 0px 0px 90px #07e6038a;
color: white;
font-size: 24px;
}
#toggleDarkModeButton:hover {
background-color: yellow;
}
/* 深色模式样式 */
body.dark-mode {
background-color: #222; /* 修改背景颜色为深色 */
color: #fff; /* 修改文本颜色为白色 */
}
body.dark-mode .container {
background-color: #222; /* 修改 container 背景颜色为深色 */
color: #fff; /* 修改 container 文本颜色为白色 */
box-shadow: none; /* 去掉 container 阴影 */
}
/* 深色模式下的时间环样式,您可以根据需要添加 */
body.dark-mode .progress {
background-color: transparent; /* 修改时间环背景颜色 */
}