Repository navigation
Expand file tree
/
Copy pathstyles.css
More file actions
248 lines (212 loc) · 4.69 KB
/
Copy pathstyles.css
File metadata and controls
248 lines (212 loc) · 4.69 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
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
/* MD3 风格的基本样式 */
body {
font-family: Roboto, sans-serif;
background-color: #f9fafb;
color: #1f2937;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
transition: background-color 0.3s ease, color 0.3s ease;
}
.container {
background-color: #ffffff;
border-radius: 12px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
padding: 24px;
width: 100%;
max-width: 600px;
margin-bottom: 20px;
transition: background-color 0.3s ease;
}
h1 {
font-size: 24px;
font-weight: 500;
margin-bottom: 24px;
text-align: center;
}
#question {
font-size: 18px;
font-weight: 400;
margin-bottom: 16px;
}
.option {
background-color: #e5e7eb;
color: #1f2937;
padding: 12px 24px;
border: none;
border-radius: 6px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
width: 100%;
margin-bottom: 12px;
position: relative;
overflow: hidden;
transition: background-color 0.3s ease;
}
.option:hover {
background-color: #d1d5db;
}
.ripple {
position: absolute;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.3);
transform: scale(0);
animation: ripple-animation 0.6s linear;
}
@keyframes ripple-animation {
to {
transform: scale(4);
opacity: 0;
}
}
#result {
margin-top: 16px;
font-size: 16px;
font-weight: 400;
text-align: center;
}
.footer {
font-size: 14px;
color: #6b7280;
text-align: center;
}
/* 暗色模式样式 */
body.dark-mode {
background-color: #121212;
color: #e5e5e5;
}
.dark-mode .container {
background-color: #1e1e1e;
}
.dark-mode .option {
background-color: #2b2b2b;
color: #e5e5e5;
}
.dark-mode .option:hover {
background-color: #383838;
}
.dark-mode .footer {
color: #a0a0a0;
}
.toggle-mode {
position: fixed;
top: 20px;
right: 20px;
background-color: #e5e7eb;
color: #1f2937;
padding: 8px 16px;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: background-color 0.3s ease;
}
.toggle-mode:hover {
background-color: #d1d5db;
}
.dark-mode .toggle-mode {
background-color: #2b2b2b;
color: #e5e5e5;
}
.dark-mode .toggle-mode:hover {
background-color: #383838;
}
/* 进度条样式 */
.progress-container {
width: 100%;
max-width: 600px;
background-color: #ddd;
margin-bottom: 20px;
border-radius: 6px;
position: relative;
height: 30px;
overflow: hidden;
}
/* 答题后进度条容器背景颜色 */
.progress-container.has-answered {
background-color: #ff0000;
}
.progress-bar {
width: 0%;
height: 100%;
background-color: #4CAF50;
text-align: center;
line-height: 30px;
color: white;
transition: width 0.3s ease;
border-radius: 6px;
}
.progress-text-correct {
position: absolute;
top: 0;
left: 10px;
line-height: 30px;
color: white;
}
.progress-text-wrong {
position: absolute;
top: 0;
right: 10px;
line-height: 30px;
color: white;
}
.dark-mode .progress-container {
background-color: #333;
}
.dark-mode .progress-container.has-answered {
background-color: #8b0000;
}
.dark-mode .progress-text-correct,
.dark-mode .progress-text-wrong {
color: #e5e5e5;
}
/* 手机端样式优化 */
@media (max-width: 600px) {
h1 {
font-size: 20px;
}
#question {
font-size: 16px;
}
.option {
padding: 10px 20px;
font-size: 14px;
}
#result {
font-size: 14px;
}
.footer {
font-size: 12px;
}
.toggle-mode {
top: 10px;
right: 10px;
padding: 6px 12px;
font-size: 12px;
}
/* 让答题框变窄一点并与手机边框保持更大距离 */
.container {
width: 80%; /* 进一步缩小宽度 */
padding: 20px; /* 适当增加内边距 */
}
/* 进度框与手机边框保持更大距离 */
.progress-container {
width: 80%; /* 与答题框宽度一致 */
}
/* 一行显示两个选项 */
#options-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
#options-container .option {
width: calc(50% - 6px); /* 每个选项宽度为 50% 减去间距 */
margin-bottom: 12px;
}
}