-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
449 lines (394 loc) · 14.3 KB
/
index.html
File metadata and controls
449 lines (394 loc) · 14.3 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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CoccusQ</title>
<style>
html {
scroll-behavior: smooth;
}
:root {
--primary-color: #2e8555; /* 主色保留用于交互元素 */
--secondary-color: #2b3137; /* 改为深色用于文字 */
--footer-color: #303846;
--text-color: #24292e;
--bg-color: #ffffff;
--nav-shadow: 0 2px 8px rgba(0,0,0,0.1); /* 新增导航栏阴影 */
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
body {
background-color: var(--bg-color);
color: var(--text-color);
line-height: 1.6;
}
/* 修改后的导航栏样式 */
.navbar {
position: fixed; /* 改为固定定位 */
top: 0;
width: 100%;
background-color: var(--bg-color);
box-shadow: var(--nav-shadow);
padding: 0.5rem 0;
z-index: 1000; /* 确保导航栏在最上层 */
transition: all 0.3s ease; /* 添加过渡动画 */
}
/* 新增滚动状态样式 */
.navbar.scrolled {
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
padding: 0.8rem 0;
}
/* 调整主内容区域间距 */
.main-content {
margin-top: 140px; /* 增加顶部间距 */
}
@media (max-width: 768px) {
.main-content {
margin-top: 100px; /* 移动端间距调整 */
}
}
/* 修改后的导航栏Logo样式 */
.navbar-logo {
color: var(--secondary-color) !important;
font-weight: 700;
letter-spacing: -0.5px;
text-decoration: none;
font-size: larger;
transition: all 0.3s ease; /* 改为all属性过渡 */
}
/* 新增悬停效果 */
.navbar-logo:hover {
color: var(--primary-color) !important; /* 悬停时使用主色 */
transform: scale(1.05); /* 悬停时轻微放大 */
}
/* 在导航栏容器中添加指示线 */
.navbar-links a.active::after {
width: 100% !important;
}
/* 修改后的导航栏链接样式 */
.navbar-links {
display: flex;
gap: 0rem; /* 新增链接间距 */
}
.navbar-links a {
color: var(--text-color) !important;
position: relative;
padding: 0.6rem 1rem; /* 增加内边距 */
text-decoration: none;
font-weight: 600;
transition: color 0.3s ease; /* 新增颜色过渡 */
}
.navbar-links a::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background-color: var(--primary-color);
transition: width 0.3s ease;
}
.navbar-links a:hover::after {
width: 100%;
}
.navbar-container {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
/* 主内容 */
.main-content {
max-width: 1200px;
margin: 80px auto 0;
padding: 2rem;
padding-top: 0;
}
/* 修改后的欢迎语样式 */
.hero {
text-align: center;
padding: 8rem 0; /* 增加内边距 */
padding-bottom: 4rem;
background-color: var(--primary-color); /* 使用深色背景 */
color: white; /* 设置文字为白色 */
margin-bottom: 2rem; /* 增加与下方内容的间距 */
}
.hero h1 {
font-size: 3rem;
margin-bottom: 1rem;
color: white; /* 修改标题颜色为白色 */
}
.hero p {
font-size: 1.2rem;
color: rgba(255,255,255,0.9); /* 设置半透明白色 */
max-width: 800px;
margin: 0 auto;
}
/* 新增按钮样式 */
.hero-cta {
display: inline-block;
margin-top: 2rem;
padding: 12px 24px;
background-color: var(--bg-color);
color: black;
text-decoration: none;
border-radius: 6px;
font-weight: 650;
transition: all 0.3s ease;
border: 2px solid transparent;
}
.hero-cta:hover {
background-color: #11574a; /* 主色深10% */
color: white;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hero-cta:active {
transform: translateY(0);
}
/* 博客列表 */
.blog-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
margin-top: 3rem;
}
.blog-card {
border: 1px solid #eee;
border-radius: 8px;
padding: 1.5rem;
transition: transform 0.3s, box-shadow 0.3s;
}
.blog-card:hover {
transform: translateY(-5px);
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
border-color: var(--primary-color);
}
.blog-date {
color: #666;
font-size: 0.9rem;
}
.blog-title {
color: var(--secondary-color);
margin: 1rem 0;
}
.blog-title-link {
text-decoration: none;
color: inherit;
}
/* 新增的CSS代码 */
.blog-card-link {
display: block;
text-decoration: none;
color: inherit;
}
.blog-card-link:hover .blog-title {
color: var(--secondary-color);
text-decoration: underline;
}
.blog-card-link:focus {
outline: 2px solid var(--secondary-color);
outline-offset: 2px;
}
/* 页脚 */
/* 修改后的页脚样式 */
.footer {
background-color: var(--footer-color);
color: white;
padding: 4rem 2rem 2rem; /* 下内边距减小 */
margin-top: 4rem;
}
/* 修改后的页脚容器 */
.footer-container {
max-width: 1200px;
margin: 0 auto;
display: flex;
justify-content: center; /* 新增居中属性 */
gap: 3rem;
flex-wrap: wrap;
}
/* 调整栏位宽度 */
.footer-column {
flex: 0 1 280px; /* 改为固定基础宽度 */
text-align: left; /* 内容保持左对齐 */
padding: 0 1rem; /* 增加内边距 */
}
/* 移动端适配调整 */
@media (max-width: 768px) {
.footer-container {
justify-content: flex-start; /* 移动端恢复左对齐 */
padding: 0 2rem;
}
.footer-column {
flex: 0 1 100%;
text-align: center; /* 移动端内容居中 */
}
}
.footer-title {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 1.5rem;
letter-spacing: 0.5px;
}
.footer-links {
display: flex;
flex-direction: column;
gap: 0.8rem;
}
.footer-links a {
color: white;
text-decoration: none;
transition: opacity 0.3s ease;
}
.footer-links a:hover {
color: var(--primary-color);
text-decoration: underline;
}
/* 新增分隔线样式 */
.footer-divider {
width: 100%;
margin: 2rem 0;
transition: opacity 0.3s ease;
background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
height: 2px;
position: relative;
}
.footer-divider::after {
content: "✦";
position: absolute;
left: 50%;
top: -10px;
transform: translateX(-50%);
color: rgba(255,255,255,0.5);
}
.footer:hover .footer-divider {
opacity: 0.8;
}
/* 修改后的版权信息样式 */
.footer-copyright {
text-align: center;
padding-top: 1.5rem;
color: rgba(255,255,255,0.8);
font-size: 0.9rem;
}
@media (max-width: 768px) {
.navbar-links {
display: none;
}
.hero h1 {
font-size: 2rem;
}
.footer-column {
flex: 100%;
text-align: center;
}
}
</style>
</head>
<body>
<!-- 新增JavaScript -->
<script>
// 滚动监听
window.addEventListener('scroll', function() {
const navbar = document.querySelector('.navbar');
if (window.scrollY > 50) {
navbar.classList.add('scrolled');
} else {
navbar.classList.remove('scrolled');
}
});
</script>
<nav class="navbar">
<div class="navbar-container">
<a href="https://coccusq.github.io" class="navbar-logo">CoccusQ</a>
<div class="navbar-links">
<a href="https://coccusq.github.io/about">关于本站✓</a>
<a href="https://github.com/CoccusQ/coccusq.github.io">GitHub↗</a>
</div>
</div>
</nav>
<section class="hero">
<h1>📣Welcome!🫵</h1>
<p>CoccusQ的个人博客网站</p>
<a href="https://coccusq.github.io/about" class="hero-cta">🥰 关于本站 👉 →</a>
</section>
<main class="main-content">
<div class="blog-grid">
<!-- 博客文章示例 -->
<article class="blog-card">
<span class="blog-date">🔝 2025年3月1日</span>
<a href="https://coccusq.github.io/build-tools" class="blog-title-link">
<h2 class="blog-title">模板化网页生成工具:MarkdownConverter & BlogGenerator——原理、功能与使用方法详解</h2>
</a>
<p>这是一个将Markdown格式文档转换为结构化JSON配置,并最终生成HTML博客页面的工具链。</p>
</article>
<article class="blog-card">
<span class="blog-date">2025年3月10日</span>
<a href="https://coccusq.github.io/autoplayer" class="blog-title-link">
<h2 class="blog-title">Python音乐播放器:AutoPlayer</h2>
<p>自动连播b站音乐视频的音乐播放器。</p>
</a>
<p></p>
</article>
<article class="blog-card">
<span class="blog-date">2024年10月31日</span>
<a href="https://coccusq.github.io/c-stl-list" class="blog-title-link">
<h2 class="blog-title">C语言实现STL:list 双向循环链表</h2>
</a>
<p>有了之前使用C语言实现动态数组的经验,实现双向循环链表就变得简单了很多,重点不再是实现任意类型数据的存储,而是双向循环链表的设计...</p>
</article>
<article class="blog-card">
<span class="blog-date">2024年10月24日</span>
<a href="https://coccusq.github.io/c-stl-vector" class="blog-title-link">
<h2 class="blog-title">C语言实现STL:vector 动态数组</h2>
</a>
<p>C语言实现动态数组的原理并不复杂,只需要实现数组元素的插入和删除、随机访问以及根据当前数组内元素数量自动调整数组占用内存大小的功能即可...</p>
</article>
<article class="blog-card">
<span class="blog-date">In the future</span>
<a href="#" class="blog-title-link">
<h2 class="blog-title">To be continued...✍️</h2>
</a>
<p></p>
</article>
</div>
</main>
<!-- 页脚内容 -->
<footer class="footer">
<div class="footer-container">
<div class="footer-column">
<h4 class="footer-title">About us</h4>
<div class="footer-links">
<a href="https://coccusq.github.io/about">✒️Learn More</a>
<a href="https://coccusq.github.io/build-tools">🛠️Build-tools</a>
</div>
</div>
<div class="footer-column">
<h4 class="footer-title">Useful Tools</h4>
<div class="footer-links">
<a href="https://chat.deepseek.com">🤖DeepSeek</a>
<a href="https://github.com/cayxc/Mdtht">📑Mdtht</a>
<a href="https://www.emojiall.com">😄EMOJIALL</a>
</div>
</div>
<div class="footer-column">
<h4 class="footer-title">Social</h4>
<div class="footer-links">
<a href="mailto:king_crab_cn@outlook.com">Email</a>
<a href="https://github.com/CoccusQ/coccusq.github.io">GitHub↗</a>
</div>
</div>
</div>
<div class="footer-divider"></div>
<div class="footer-copyright">
<p>© 2025 CoccusQ 🇨🇳. All rights reserved.</p>
</div>
</footer>
</body>
</html>