-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstyles.css
More file actions
367 lines (320 loc) · 7.13 KB
/
styles.css
File metadata and controls
367 lines (320 loc) · 7.13 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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
/* 全局样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: sans-serif;
line-height: 1.6;
margin: 0;
background-color: #f4f4f4;
}
#data-count {
font-size: 14px; /* 增加字体大小 */
font-weight: bold; /* 字体加粗 */
color: #ffffff; /* 使用绿色表示加载成功 */
#background-color: #007bff; /* 设置浅色背景 */
#border-radius: 4px; /* 圆角边框 */
padding: 8px 20px; /* 内边距 */
text-align: center; /* 水平居中 */
margin-top: auto; /* 与上一个元素的间距 */
transition: opacity 0.5s ease; /* 渐变显示动画 */
opacity: 0; /* 默认透明 */
}
/* 当数据加载完成时,添加一个类来显示文本 */
#data-count.loaded {
opacity: 1; /* 渐变显示 */
}
/* 加载遮罩层样式 */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.loading-overlay.visible {
opacity: 1;
visibility: visible;
}
.loading-spinner {
width: 40px;
height: 40px;
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 10px;
}
#loading-text {
color: #333;
font-size: 16px;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* 背景容器 */
.wrapper {
height: 100vh;
width: 100%;
background: linear-gradient(180deg, #04fafd 5%, #119dff 50%, #030423);
position: fixed;
z-index: -1;
overflow: hidden;
}
/* 气泡容器 */
#bubbles-container {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
/* 气泡样式 */
.bubble {
position: absolute;
border: 2px solid rgba(255, 255, 255, 0.7);
border-radius: 50%;
animation: float-up var(--duration) linear infinite;
opacity: var(--opacity);
}
/* 气泡上升动画 */
@keyframes float-up {
0% {
transform: translateY(100vh) scale(0) rotate(0deg);
opacity: var(--opacity);
}
50% {
opacity: var(--opacity);
}
100% {
transform: translateY(-100px) scale(1) rotate(360deg);
opacity: 0;
}
}
/* 内容容器 */
.content {
position: relative;
z-index: 1;
padding: 20px;
max-width: 992px; /* 限制最大宽度 */
margin: 0 auto;
}
/* 标题样式 */
h1 {
font-size: 32px;
text-align: center;
color: #333;
margin-bottom: 10px;
}
h2 {
font-size: 18px;
text-align: center;
color: #555;
margin-bottom: 20px;
}
/* 筛选按钮 */
.filters {
display: flex;
flex-wrap: wrap; /* 允许换行 */
justify-content: center;
gap: 10px;
margin-bottom: 20px;
}
.filters button {
flex: 1; /* 每个按钮均分可用空间 */
min-width: 60px; /* 设置按钮最小宽度,确保按钮在小屏幕上不太窄 */
max-width: 120px; /* 设置按钮最大宽度 */
padding: 10px 15px;
background-color: #f9f9f9;
border: 1px solid #ddd;
cursor: pointer;
transition: background-color 0.3s ease;
text-align: center;
white-space: nowrap; /* 防止按钮文字换行 */
border-radius: 4px;
}
.filters button:hover {
background-color: #ddd;
}
.filters button.active {
background-color: #007bff;
color: white;
}
/* 搜索框 */
#search-input {
width: 100%;
max-width: 100%; /* 确保搜索框不超过容器宽度 */
padding: 10px;
margin: 10px 0;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
/* 操作按钮区域样式 */
.action-buttons {
display: flex;
justify-content: space-between; /* 在PC端两端对齐 */
align-items: center;
gap: 15px;
margin-bottom: 20px;
flex-wrap: wrap;
}
.action-buttons button {
padding: 10px 15px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
white-space: nowrap;
flex: 1 1 auto;
max-width: 200px;
}
.action-buttons button:hover {
background-color: #0056b3;
}
/* 每页显示数量设置样式 */
.items-per-page {
display: flex;
align-items: center;
gap: 8px;
font-size: 14px;
flex: 1 1 auto;
justify-content: flex-end; /* 在PC端靠右对齐 */
}
.items-per-page label {
color: #333;
white-space: nowrap;
}
.items-per-page select {
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
background-color: white;
cursor: pointer;
}
/* 资源卡片列表 */
.resource-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-top: 20px;
max-width: 992px;
margin-left: auto;
margin-right: auto;
}
/* 修改为最多3列 */
@media (min-width: 992px) {
.resource-list {
grid-template-columns: repeat(3, 1fr);
}
}
/* 平板设备显示2列 */
@media (max-width: 991px) and (min-width: 768px) {
.resource-list {
grid-template-columns: repeat(2, 1fr);
}
}
/* 手机设备显示1列 */
@media (max-width: 767px) {
.resource-list {
grid-template-columns: 1fr;
}
}
.resource-card {
background-color: #fff;
border: 1px solid #ddd;
border-radius: 8px;
padding: 15px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
height: 100%;
display: flex;
flex-direction: column;
}
.resource-card h3 {
font-size: 18px;
margin-bottom: 10px;
flex-grow: 1;
}
.resource-card p {
font-size: 14px;
color: #666;
margin-bottom: 10px;
}
.resource-card .source-link {
display: inline-block;
margin-top: auto;
padding: 5px 10px;
background-color: #007bff;
color: white;
text-decoration: none;
border-radius: 4px;
text-align: center;
}
/* 分页区域样式 */
.pagination {
display: flex;
justify-content: center;
align-items: center;
gap: 8px;
margin-top: 20px;
}
.pagination button {
padding: 8px 12px;
background-color: #f9f9f9;
border: 1px solid #ddd;
border-radius: 4px;
cursor: pointer;
transition: all 0.3s ease;
white-space: nowrap; /* 添加防止文字换行的样式 */
}
.pagination button:hover:not(:disabled) {
background-color: #e9ecef;
}
.pagination button.active {
background-color: #007bff;
color: white;
border-color: #007bff;
}
.pagination button:disabled {
cursor: not-allowed;
opacity: 0.6;
}
.pagination .ellipsis {
padding: 0 8px;
color: #6c757d;
}
/* 响应式设计 */
@media (max-width: 768px) {
.filters {
gap: 5px; /* 缩小间距,适配小屏幕 */
}
.filters button {
flex: 1; /* 均分宽度,确保按钮在一行显示 */
}
.action-buttons {
justify-content: space-between;
}
.items-per-page {
justify-content: flex-end;
}
h1 {
font-size: 24px;
}
h2 {
font-size: 16px;
}
}