-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.css
303 lines (263 loc) · 6.31 KB
/
styles.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
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
/* 通用样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-image: url('background.png'); /* 背景图片路径 */
background-size: cover; /* 图片覆盖整个背景 */
background-position: center+20px;
background-repeat: no-repeat; /* 不重复背景图 */
background-attachment: fixed; /* 固定背景,页面滚动时背景不动 */
font-family: Arial, sans-serif;
background-color: #000;
color: #4caf50; /* 默认绿色文本颜色 */
display: flex;
flex-direction: column;
min-height: 100vh;
transition: background-color 0.3s, color 0.3s;
}
/* 浅色主题 */
body.light-theme {
background-image: url('background_light.png');
background-color: #f9f9f9;
color: #333;
}
/* 顶部栏样式 */
header {
width: calc(100% - 200px); /* 避开左侧边栏 */
max-width: 100%;
padding: 1rem;
background-color: #333;
color: #4caf50;
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
top: 0;
left: 200px;
z-index: 1000;
box-sizing: border-box;
}
header h1 {
margin-right: auto;
}
/* 顶部导航链接样式化为按钮 */
header nav a {
color: #4caf50; /* 链接文本颜色 */
background-color: #444; /* 链接背景色 */
padding: 0.5rem 1rem;
margin-right: 1rem;
border-radius: 5px; /* 圆角 */
text-decoration: none; /* 去除下划线 */
font-weight: bold;
transition: background-color 0.3s, color 0.3s;
}
header nav a:hover {
background-color: #4caf50;
color: #333;
}
/* 浅色主题的顶部栏 */
body.light-theme header {
background-color: #eee;
color: #333;
}
body.light-theme header h1 {
color: #333;
}
body.light-theme header nav a {
background-color: #ddd;
color: #333;
}
body.light-theme header nav a:hover {
background-color: #333;
color: #f9f9f9;
}
/* GitHub链接样式 */
.github-link {
color: #4caf50;
background-color: #fff; /* 始终保持白色背景 */
padding: 0.5rem;
border-radius: 50%; /* 圆形背景 */
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px; /* 设置图标的宽度 */
height: 40px; /* 设置图标的高度 */
transition: color 0.3s, background-color 0.3s;
margin-left: 1rem;
}
.github-link svg {
width: 40px; /* 调整SVG的大小 */
height: 40px;
fill: #333; /* 确保SVG图标颜色不被主题影响 */
}
.github-link:hover {
color: #fff;
background-color: #4caf50;
}
/* 浅色主题的GitHub链接 */
body.light-theme .github-link {
background-color: #fff; /* 始终保持白色背景 */
}
body.light-theme .github-link svg {
fill: #333; /* 浅色主题下图标颜色 */
}
/* 主题切换按钮样式 */
#theme-toggle {
background-color: #444;
color: #4caf50;
border: none;
padding: 0.5rem 1rem;
border-radius: 5px;
cursor: pointer;
margin-left: 1rem;
transition: background-color 0.3s, color 0.3s;
}
#theme-toggle:hover {
background-color: #4caf50;
color: #333;
}
/* 浅色主题的主题切换按钮 */
body.light-theme #theme-toggle {
background-color: #ddd;
color: #333;
}
body.light-theme #theme-toggle:hover {
background-color: #333;
color: #f9f9f9;
}
/* 主体布局 */
.container {
display: flex;
flex-grow: 1;
width: 100%;
max-width: 1200px;
margin: 6rem auto 0;
padding-left: 200px; /* 避开左侧边栏 */
padding-bottom: 2rem;
}
/* 左侧导航栏样式 */
.sidebar {
width: 200px;
height: 100vh;
padding: 1rem;
background-color: #222;
display: flex;
flex-direction: column;
position: fixed;
top: 0;
left: 0;
z-index: 900;
}
/* 浅色主题的侧边栏 */
body.light-theme .sidebar {
background-color: #ddd;
}
.sidebar button {
background: #333;
color: #4caf50;
border: none;
padding: 1rem;
margin-bottom: 0.5rem;
cursor: pointer;
text-align: left;
border-radius: 8px; /* 添加圆角 */
transition: background-color 0.3s;
}
.sidebar button:hover {
background: #444;
}
/* 浅色主题的侧边栏按钮 */
body.light-theme .sidebar button {
background-color: #eee;
color: #333;
}
body.light-theme .sidebar button:hover {
background-color: #ccc;
}
/* 内容区样式 */
main {
flex-grow: 1;
padding: 1rem;
}
.content-section {
display: none;
margin-bottom: 3rem;
}
.content-section.active {
display: block;
}
/* 增加资源板块标题与资源列表之间的距离 */
.content-section h2 {
margin-bottom: 2rem;
color: inherit; /* 确保标题颜色与主题切换 */
}
/* 资源卡片样式 */
.resource-list {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.resource-card {
background-color: #222;
color: #4caf50;
padding: 1.5rem;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
text-align: left;
}
/* 浅色主题的资源卡片 */
body.light-theme .resource-card {
background-color: #f4f4f4;
color: #333;
}
.icon {
width: 25px;
height: 25px;
vertical-align: middle;
margin-right: 0.5rem;
}
/* 下载按钮样式 */
.download-link {
display: inline-block;
padding: 0.6rem 1rem;
margin-top: 1rem;
background-color: #4caf50; /* 深色主题下的绿色背景 */
color: #222; /* 按钮文本颜色 */
border-radius: 5px;
font-weight: bold;
text-decoration: none;
text-align: center;
transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* 增加按钮阴影 */
}
.download-link:hover {
background-color: #333; /* 悬停时的深色背景 */
color: #4caf50; /* 悬停时的绿色文本颜色 */
}
/* 浅色主题的下载按钮 */
body.light-theme .download-link {
background-color: #333; /* 浅色主题下的深灰背景 */
color: #4caf50; /* 浅色主题下的绿色文本颜色 */
}
body.light-theme .download-link:hover {
background-color: #444;
color: #f9f9f9;
}
/* 底部栏样式 */
footer {
width: 100%;
padding: 1rem;
text-align: center;
background-color: #333;
color: #4caf50;
margin-top: auto;
padding-left: 200px; /* 避开左侧边栏 */
}
/* 浅色主题的底部栏 */
body.light-theme footer {
background-color: #ddd;
color: #333;
}