-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
594 lines (526 loc) · 31.8 KB
/
index.html
File metadata and controls
594 lines (526 loc) · 31.8 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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta lang="zh-CN">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Web技术文档 | webtech.wiki</title>
<!-- SEO优化 -->
<meta name="description"
content="专业的Web技术文档平台,提供前端、后端、数据库、DevOps等全栈开发技术文档和教程。涵盖JavaScript、Python、Go、Rust、Docker、Kubernetes等热门技术栈。">
<meta name="keywords" content="Web技术文档,前端开发,后端开发,JavaScript,Python,Go,Rust,Docker,Kubernetes,技术教程,开发者社区">
<meta name="author" content="极客开发者">
<meta name="robots" content="index, follow">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://webtech.wiki/">
<meta property="og:title" content="Web技术文档 | webtech.wiki">
<meta property="og:description" content="专业的Web技术文档平台,提供前端、后端、数据库、DevOps等全栈开发技术文档和教程">
<meta property="og:image" content="https://webtech.wiki/img/qrcode.jpg">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://webtech.wiki/">
<meta property="twitter:title" content="Web技术文档 | webtech.wiki">
<meta property="twitter:description" content="专业的Web技术文档平台,提供前端、后端、数据库、DevOps等全栈开发技术文档和教程">
<meta property="twitter:image" content="https://webtech.wiki/img/qrcode.jpg">
<!-- 网站图标 -->
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<!-- 结构化数据 -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Web技术文档",
"url": "https://webtech.wiki",
"description": "专业的Web技术文档平台,提供前端、后端、数据库、DevOps等全栈开发技术文档和教程",
"author": {
"@type": "Person",
"name": "极客开发者"
},
"potentialAction": {
"@type": "SearchAction",
"target": "https://webtech.wiki/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
</script>
<!-- 预连接优化 - 提前建立连接 -->
<link rel="preconnect" href="https://github.com" crossorigin>
<link rel="preconnect" href="https://space.bilibili.com" crossorigin>
<link rel="preconnect" href="https://juejin.cn" crossorigin>
<link rel="preconnect" href="https://www.zhihu.com" crossorigin>
<!-- 预加载关键资源 -->
<link rel="preload" href="config.js" as="script">
<link rel="preload" href="img/qrcode.webp" as="image">
<link rel="preload" href="img/icons/linux.svg" as="image">
<link rel="preload" href="img/icons/kubernetes.svg" as="image">
<link rel="preload" href="img/icons/rust.svg" as="image">
<link rel="preload" href="img/icons/docker.svg" as="image">
<!-- DNS预解析 -->
<link rel="dns-prefetch" href="//beian.miit.gov.cn">
<link rel="dns-prefetch" href="//www.beian.gov.cn">
<!-- 关键CSS内联优化 -->
<style>
/* 关键渲染路径CSS - 压缩版 */
*{margin:0;padding:0;box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;overflow-x:hidden;background:linear-gradient(135deg,#e3f2fd 0%,#f3e5f5 50%,#fff9c4 100%);color:#333;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizeLegibility}nav{position:fixed;top:0;left:0;right:0;height:70px;background:rgba(255,255,255,.95);backdrop-filter:blur(10px);z-index:1000;box-shadow:0 2px 10px rgba(0,0,0,.05);contain:layout style paint}.nav-container{max-width:1400px;margin:0 auto;height:100%;display:flex;justify-content:space-between;align-items:center;padding:0 40px}.logo{font-size:22px;font-weight:600;color:#2196F3;display:flex;align-items:center;gap:10px}.hero{position:relative;min-height:100vh;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:100px 40px 60px}
</style>
<style>
/* 非关键CSS - 优化版 */
/* 硬件加速优化 */
.floating-icon,.tech-item,.project-card,.blog-card{will-change:transform;transform:translate3d(0,0,0);backface-visibility:hidden}
/* 导航栏 */
nav{position:fixed;top:0;left:0;right:0;height:70px;background:rgba(255,255,255,.95);backdrop-filter:blur(10px);z-index:1000;box-shadow:0 2px 10px rgba(0,0,0,.05);contain:layout style paint}
.nav-container{max-width:1400px;margin:0 auto;height:100%;display:flex;justify-content:space-between;align-items:center;padding:0 40px}
.logo{font-size:22px;font-weight:600;color:#2196F3;display:flex;align-items:center;gap:10px}
.logo::before{content:'📚';font-size:28px}
.nav-links{display:flex;gap:40px;list-style:none}
.nav-links a{color:#666;text-decoration:none;font-size:15px;transition:color .3s}
.nav-links a:hover{color:#2196F3}
/* Hero区域 */
.hero{position:relative;min-height:100vh;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:100px 40px 60px}
.hero-background{position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;z-index:5}
/* 优化浮动图标动画 - 使用transform和opacity */
.floating-icon{position:absolute;z-index:15;will-change:transform;transform:translate3d(0,0,0);animation:floatOptimized 8s ease-in-out infinite}
@keyframes floatOptimized{
0%,100%{transform:translate3d(0,0,0) rotate(0deg)}
25%{transform:translate3d(0,-15px,0) rotate(5deg)}
50%{transform:translate3d(0,0,0) rotate(0deg)}
75%{transform:translate3d(0,-10px,0) rotate(-5deg)}
}
.floating-icon img{width:70px;height:70px;filter:drop-shadow(0 4px 12px rgba(0,0,0,.1));border-radius:12px}
.hero-content-wrapper{position:relative;z-index:10;max-width:1200px;width:100%;display:flex;align-items:center;gap:80px}
.hero-left{flex:1;animation:fadeInLeft 1s ease-out}
@keyframes fadeInLeft{
from{opacity:0;transform:translate3d(-50px,0,0)}
to{opacity:1;transform:translate3d(0,0,0)}
}
.hero-left h1{font-size:48px;font-weight:700;margin-bottom:20px;color:#333;line-height:1.3}
.hero-left h1 .highlight{color:#2196F3}
.hero-left p{font-size:18px;color:#666;margin-bottom:40px;line-height:1.6}
.social-links{display:flex;gap:20px;margin-bottom:40px}
.social-icon{width:40px;height:40px;border-radius:10px;background:white;display:flex;align-items:center;justify-content:center;text-decoration:none;box-shadow:0 2px 8px rgba(0,0,0,.1);transition:transform .3s,box-shadow .3s;font-size:20px;position:relative}
.social-icon:hover{transform:translate3d(0,-3px,0);box-shadow:0 4px 12px rgba(33,150,243,.3)}
/* 增强 tooltip 显示效果 */
.social-icon[title]:hover::after{
content:attr(title);
position:absolute;
bottom:-45px;
left:50%;
transform:translateX(-50%);
background:rgba(0,0,0,.8);
color:white;
padding:8px 12px;
border-radius:6px;
font-size:12px;
white-space:nowrap;
z-index:1000;
pointer-events:none;
opacity:1;
animation:tooltipFadeIn .2s ease-out;
}
.social-icon[title]:hover::before{
content:'';
position:absolute;
bottom:-35px;
left:50%;
transform:translateX(-50%);
border:5px solid transparent;
border-bottom-color:rgba(0,0,0,.8);
z-index:1001;
pointer-events:none;
opacity:1;
animation:tooltipFadeIn .2s ease-out;
}
@keyframes tooltipFadeIn{
from{opacity:0;transform:translateX(-50%) translateY(5px)}
to{opacity:1;transform:translateX(-50%) translateY(0)}
}
.wechat-section{display:flex;align-items:center;gap:20px}
.qr-code{width:160px;height:160px;background:white;border-radius:12px;padding:10px;box-shadow:0 4px 12px rgba(0,0,0,.1)}
.wechat-text{display:flex;flex-direction:column;gap:10px}
.wechat-title{display:flex;align-items:center;gap:8px;font-size:16px;color:#666}
.wechat-title::before{content:'💬';font-size:20px}
.search-button{padding:12px 30px;background:#2E7D32;color:white;border:none;border-radius:25px;font-size:16px;cursor:pointer;display:inline-flex;align-items:center;gap:8px;transition:all .3s;box-shadow:0 4px 12px rgba(46,125,50,.3)}
.search-button:hover{background:#1B5E20;transform:translate3d(0,-2px,0);box-shadow:0 6px 16px rgba(27,94,32,.4)}
.search-button::before{content:'🔍'}
.hero-right{flex:1;position:relative;animation:fadeInRight 1s ease-out}
@keyframes fadeInRight{
from{opacity:0;transform:translate3d(50px,0,0)}
to{opacity:1;transform:translate3d(0,0,0)}
}
.illustration{width:100%;max-width:600px;margin:0 auto}
.browser-window{background:white;border-radius:12px;box-shadow:0 10px 40px rgba(0,0,0,.1);overflow:hidden}
.browser-header{height:40px;background:#f5f5f5;display:flex;align-items:center;padding:0 15px;gap:8px}
.browser-dot{width:12px;height:12px;border-radius:50%}
.dot-red{background:#ff5f56}
.dot-yellow{background:#ffbd2e}
.dot-green{background:#27c93f}
.browser-content{padding:40px;min-height:300px;background:linear-gradient(135deg,#667eea20 0%,#764ba220 100%);display:flex;align-items:center;justify-content:center}
.person-illustration{width:200px;height:200px;background:#5a67d8;border-radius:50% 50% 0 0;position:relative}
.person-head{width:60px;height:60px;background:#2d3748;border-radius:50%;position:absolute;top:20px;left:70px}
.laptop{width:180px;height:100px;background:#2d3748;border-radius:8px;position:absolute;bottom:0;left:10px}
.laptop::before{content:'';position:absolute;top:10px;left:10px;right:10px;bottom:20px;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);border-radius:4px}
/* 技术栈区域 - 优化动画 */
.tech-stack-section{padding:80px 40px;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);position:relative;overflow:hidden}
.tech-stack-section::before{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');opacity:.3}
.tech-stack-container{max-width:1200px;margin:0 auto;position:relative;z-index:2}
.tech-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:30px;margin-top:40px}
/* 优化技术栈卡片动画 */
.tech-item{background:rgba(255,255,255,.1);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.2);border-radius:16px;padding:30px 20px;text-align:center;transition:transform .4s cubic-bezier(.175,.885,.32,1.275),background .4s,box-shadow .4s;position:relative;overflow:hidden;cursor:pointer;will-change:transform}
.tech-item::before{content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);transition:left .6s}
.tech-item:hover::before{left:100%}
.tech-item:hover{transform:translate3d(0,-10px,0) scale(1.05);background:rgba(255,255,255,.2);box-shadow:0 20px 40px rgba(0,0,0,.2)}
.tech-icon{width:80px;height:80px;margin:0 auto 20px;display:flex;align-items:center;justify-content:center;font-size:48px;border-radius:12px;background:rgba(255,255,255,.1);transition:transform .3s,background .3s;position:relative}
.tech-item:hover .tech-icon{transform:rotateY(360deg);background:rgba(255,255,255,.2)}
.tech-name{font-size:18px;font-weight:600;color:white;margin-bottom:8px;text-shadow:0 2px 4px rgba(0,0,0,.3)}
.tech-description{font-size:14px;color:rgba(255,255,255,.8);line-height:1.4}
.tech-stack-section .section-title{color:white;text-align:center;text-shadow:0 2px 4px rgba(0,0,0,.3)}
.tech-stack-section .section-title::before{content:'🎯'}
/* 移除可能导致性能问题的动画 */
@media (prefers-reduced-motion:no-preference){
.tech-item:nth-child(odd){animation:techFloatOptimized 4s ease-in-out infinite}
.tech-item:nth-child(even){animation:techFloatOptimized 4s ease-in-out infinite reverse}
}
@keyframes techFloatOptimized{
0%,100%{transform:translate3d(0,0,0)}
50%{transform:translate3d(0,-10px,0)}
}
/* 博客文章区域 */
.blog-section{padding:80px 40px;background:white}
.section-header{max-width:1200px;margin:0 auto 40px;display:flex;justify-content:space-between;align-items:center}
.section-title{font-size:32px;font-weight:700;color:#333;display:flex;align-items:center;gap:12px}
.section-title::before{content:'📝';font-size:36px}
.view-more{color:#0D47A1;text-decoration:none;display:flex;align-items:center;gap:5px;font-size:15px;transition:gap .3s;font-weight:500}
.view-more:hover{gap:10px;color:#0A3578}
.blog-grid{max-width:1200px;margin:0 auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:30px}
/* 优化卡片动画 */
.blog-card{background:white;border-radius:12px;padding:30px;box-shadow:0 2px 12px rgba(0,0,0,.08);transition:transform .3s,box-shadow .3s;border:1px solid #f0f0f0;will-change:transform}
.blog-card:hover{transform:translate3d(0,-5px,0);box-shadow:0 8px 24px rgba(0,0,0,.12)}
.blog-card h3{font-size:20px;margin-bottom:12px;color:#333;line-height:1.4}
.blog-card p{color:#666;line-height:1.6;font-size:14px}
/* 项目区域 */
.projects-section{padding:80px 40px;background:#fafafa}
.projects-grid{max-width:1200px;margin:0 auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:25px}
/* 优化项目卡片动画 */
.project-card{background:white;border-radius:12px;padding:30px;text-align:center;box-shadow:0 2px 12px rgba(0,0,0,.08);transition:transform .3s,box-shadow .3s;border:1px solid #f0f0f0;will-change:transform}
.project-card:hover{transform:translate3d(0,-5px,0);box-shadow:0 8px 24px rgba(33,150,243,.15)}
.project-icon{width:80px;height:80px;margin:0 auto 20px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:40px;background:linear-gradient(135deg,#e3f2fd 0%,#bbdefb 100%)}
.project-card h3{font-size:18px;margin-bottom:10px;color:#333}
.project-card p{color:#666;font-size:14px;line-height:1.6;margin-bottom:15px}
.project-link{display:inline-block;color:#0D47A1;text-decoration:none;font-size:14px;padding:8px 20px;border:1px solid #0D47A1;border-radius:20px;transition:all .3s;font-weight:500}
.project-link:hover{background:#0D47A1;color:white}
/* Footer */
footer{background:#2d3748;padding:30px 0;color:white}
.footer-bottom{text-align:center;color:rgba(255,255,255,.9);font-size:14px}
.footer-bottom a{color:rgba(255,255,255,.95);text-decoration:none;transition:color .3s}
.footer-bottom a:hover{color:#ffffff;text-decoration:underline}
/* 可访问性 */
.skip-to-content{position:absolute;top:-40px;left:0;background:#2196F3;color:white;padding:8px 16px;text-decoration:none;z-index:9999;border-radius:0 0 4px 0;transition:top .3s}
.skip-to-content:focus{top:0;outline:2px solid #FF9800;outline-offset:2px}
a:focus,button:focus,input:focus,.social-icon:focus,.project-link:focus,.search-button:focus{outline:2px solid #2196F3;outline-offset:2px}
/* 高对比度模式 */
@media (prefers-contrast:high){
body{background:#ffffff;color:#000000}
.hero-left h1 .highlight{color:#0056b3}
.social-icon{border:1px solid #000000}
}
/* 减少动画偏好 */
@media (prefers-reduced-motion:reduce){
*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
.floating-icon,.tech-item,.project-card,.blog-card{animation:none!important;transition:none!important}
}
/* 响应式 */
@media (max-width:968px){
.hero-content-wrapper{flex-direction:column;gap:40px}
.hero-left h1{font-size:36px}
.nav-links{gap:20px}
.blog-grid,.projects-grid{grid-template-columns:1fr}
.footer-bottom p{flex-direction:column!important;gap:8px!important;line-height:1.6}
.footer-bottom p span{display:none!important}
}
@media (max-width:768px){
.nav-container{padding:0 20px}
.hero{padding:100px 20px 60px}
.hero-left h1{font-size:28px}
.hero-left p{font-size:16px}
.wechat-section{flex-direction:column;align-items:center;text-align:center}
.qr-code{width:100px;height:100px}
.tech-stack-section,.blog-section,.projects-section{padding:60px 20px}
.section-title{font-size:24px}
.tech-grid{grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:20px}
.tech-item{padding:20px 15px}
.tech-icon{width:60px;height:60px}
.tech-name{font-size:16px}
.tech-description{font-size:12px}
.projects-grid{gap:20px}
.project-card{padding:20px}
.floating-icon img{width:50px;height:50px}
}
@media (max-width:480px){
.hero-left h1{font-size:24px}
.social-links{justify-content:center;flex-wrap:wrap}
.tech-grid{grid-template-columns:repeat(2,1fr)}
.nav-links{display:none}
.logo{font-size:18px}
}
</style>
</head>
<body>
<!-- 跳过导航链接(屏幕阅读器辅助功能) -->
<a href="#main-content" class="skip-to-content">跳过导航直接进入主要内容</a>
<!-- 导航栏 -->
<nav role="banner" aria-label="主导航">
<div class="nav-container">
<div class="logo">web技术文档</div>
<ul class="nav-links">
<li><a href="#home">首页</a></li>
<li><a href="#tech-stack">开发路径</a></li>
<li><a href="#projects">开源项目</a></li>
<li><a href="https://blog.algs.tech" target="_blank">博客</a></li>
</ul>
</div>
</nav>
<!-- Hero区域 -->
<main id="main-content" role="main">
<section class="hero" id="home">
<div class="hero-background" id="iconContainer"></div>
<div class="hero-content-wrapper">
<div class="hero-left">
<h1>Hi! 这里是<span class="highlight">web技术文档</span></h1>
<p>我是作者,热爱开源的开发者,欢迎一起交流学习。</p>
<div class="social-links">
<a href="https://github.com/geekdex" class="social-icon" title="GitHub - 查看我的开源项目" target="_blank"
rel="noopener" aria-label="GitHub - 查看我的开源项目">💻</a>
<a href="https://space.bilibili.com/172353353" class="social-icon" title="哔哩哔哩 - 技术视频分享" target="_blank"
rel="noopener" aria-label="哔哩哔哩 - 技术视频分享">📺</a>
<a href="https://juejin.cn/user/184373686844318" class="social-icon" title="掘金 - 技术文章分享" target="_blank"
rel="noopener" aria-label="掘金 - 技术文章分享">📘</a>
<a href="https://www.zhihu.com/people/jkdev.cn" class="social-icon" title="知乎 - 技术问答交流" target="_blank"
rel="noopener" aria-label="知乎 - 技术问答交流">📖</a>
<a href="mailto:pan.hy@foxmail.com" class="social-icon" title="邮箱 - 联系我" target="_blank"
rel="noopener" aria-label="邮箱 - 联系我">✉️</a>
</div>
<div class="wechat-section">
<div class="qr-code">
<img src="img/qrcode.webp" alt="微信二维码"
style="width: 100%; height: 100%; object-fit: cover; border-radius: 8px;"
loading="lazy">
</div>
<div class="wechat-text">
<div class="wechat-title">微信搜一搜</div>
<button class="search-button" aria-label="搜索微信公众号:极客开发者">极客开发者</button>
</div>
</div>
</div>
<div class="hero-right">
<div class="illustration">
<div class="browser-window">
<div class="browser-header">
<div class="browser-dot dot-red"></div>
<div class="browser-dot dot-yellow"></div>
<div class="browser-dot dot-green"></div>
</div>
<div class="browser-content">
<div class="person-illustration" aria-hidden="true">
<div class="person-head"></div>
<div class="laptop"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- 开发路径展示区域 -->
<section class="tech-stack-section" id="tech-stack" aria-labelledby="tech-stack-title">
<h2 id="tech-stack-title" class="section-title" style="display: none;">开发路径</h2>
<div class="section-header">
<h2 class="section-title">开发路径</h2>
</div>
<div class="tech-stack-container">
<div class="tech-grid" id="techStackContainer"></div>
</div>
</section>
<!-- 开源项目区域 -->
<section class="projects-section" id="projects" aria-labelledby="projects-title">
<h2 id="projects-title" class="section-title" style="display: none;">开源项目</h2>
<div class="section-header">
<h2 class="section-title">开源项目</h2>
<a href="#" class="view-more">查看更多 →</a>
</div>
<div class="projects-grid" id="projectsContainer"></div>
</section>
</main>
<!-- Footer -->
<footer role="contentinfo">
<div class="footer-bottom">
<p style="display: flex; align-items: center; justify-content: center; gap: 8px;">
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">黔ICP备2024030886号-2</a>
<span style="color: rgba(255, 255, 255, 0.8);">|</span>
<a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=52263202522684" target="_blank"
rel="noopener" style="display: inline-flex; align-items: center; gap: 4px;">
<img src="img/beian.png" alt="公安备案" style="width: 16px; height: 17px;" loading="lazy">
贵公网安备52263202522684号
</a>
</p>
</div>
</footer>
<script src="config.js" defer></script>
<script defer>
// 性能优化:使用requestIdleCallback和分批处理
function scheduleWork(tasks, callback) {
function runTasks(deadline) {
while (deadline.timeRemaining() > 0 && tasks.length > 0) {
const task = tasks.shift();
task();
}
if (tasks.length > 0) {
requestIdleCallback(runTasks);
} else if (callback) {
callback();
}
}
requestIdleCallback(runTasks);
}
// 可访问性增强:聚焦管理
document.addEventListener('DOMContentLoaded', function () {
// 跳过导航链接功能
const skipLink = document.querySelector('.skip-to-content');
if (skipLink) {
skipLink.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.setAttribute('tabindex', '-1');
target.focus();
setTimeout(() => target.removeAttribute('tabindex'), 1000);
}
});
}
// 为所有交互元素添加键盘导航支持
const interactiveElements = document.querySelectorAll('a, button, [tabindex]');
interactiveElements.forEach(el => {
el.addEventListener('keydown', function (e) {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
this.click();
}
});
});
});
// 延迟加载非关键功能 - 优化版本
document.addEventListener('DOMContentLoaded', function () {
const iconContainer = document.getElementById('iconContainer');
const techStackContainer = document.getElementById('techStackContainer');
const projectsContainer = document.getElementById('projectsContainer');
// 分批创建浮动图标,避免阻塞主线程
const iconTasks = CONFIG.floatingIcons.map((icon, index) => () => {
const iconEl = document.createElement('div');
iconEl.className = 'floating-icon';
// 优化位置计算
const rightAreaStart = 55;
const rightAreaWidth = 40;
let adjustedX = rightAreaStart + (icon.x / 100) * rightAreaWidth;
let adjustedY = 8 + (icon.y / 100) * 84;
// 避开插图区域
const centerX = 75, centerY = 50, avoidRadius = 18;
const distanceFromCenter = Math.sqrt(
Math.pow(adjustedX - centerX, 2) + Math.pow(adjustedY - centerY, 2)
);
if (distanceFromCenter < avoidRadius) {
const angle = Math.atan2(adjustedY - centerY, adjustedX - centerX);
adjustedX = centerX + Math.cos(angle) * avoidRadius;
adjustedY = centerY + Math.sin(angle) * avoidRadius;
adjustedX = Math.max(rightAreaStart, Math.min(95, adjustedX));
adjustedY = Math.max(8, Math.min(92, adjustedY));
}
iconEl.style.left = adjustedX + '%';
iconEl.style.top = adjustedY + '%';
iconEl.style.animationDelay = icon.delay + 's';
iconEl.innerHTML = `<img src="${icon.src}" alt="${icon.alt}" loading="lazy">`;
iconContainer.appendChild(iconEl);
});
// 分批创建技术栈
const techTasks = CONFIG.techStack.map((tech, index) => () => {
const item = document.createElement('a');
item.href = tech.link;
item.target = '_blank';
item.rel = 'noopener';
item.className = 'tech-item';
item.style.animationDelay = (index * 0.1) + 's';
item.style.textDecoration = 'none';
item.style.color = 'inherit';
item.innerHTML = `
<div class="tech-icon">${tech.icon}</div>
<div class="tech-name">${tech.name}</div>
<div class="tech-description">${tech.description}</div>
`;
techStackContainer.appendChild(item);
});
// 分批创建项目
const projectTasks = CONFIG.projects.map(project => () => {
const card = document.createElement('div');
card.className = 'project-card';
card.innerHTML = `
<div class="project-icon">${project.icon}</div>
<h3>${project.name}</h3>
<p>${project.description}</p>
<a href="${project.link}" class="project-link" target="_blank" rel="noopener">源码</a>
`;
projectsContainer.appendChild(card);
});
// 使用requestIdleCallback分批执行任务
scheduleWork([...iconTasks, ...techTasks, ...projectTasks], () => {
console.log('所有DOM元素创建完成');
});
// 优化鼠标移动视差效果
let mouseX = 0, mouseY = 0, currentX = 0, currentY = 0, animationId;
let isAnimating = false;
document.addEventListener('mousemove', (e) => {
mouseX = (e.clientX / window.innerWidth - 0.5) * 2;
mouseY = (e.clientY / window.innerHeight - 0.5) * 2;
}, { passive: true });
function animate() {
if (!isAnimating) return;
currentX += (mouseX - currentX) * 0.1;
currentY += (mouseY - currentY) * 0.1;
const floatingIcons = document.querySelectorAll('.floating-icon');
floatingIcons.forEach((icon, index) => {
const speed = (index % 3 + 1) * 10;
const x = Math.max(-15, Math.min(15, currentX * speed));
const y = Math.max(-15, Math.min(15, currentY * speed));
icon.style.transform = `translate3d(${x}px, ${y}px, 0)`;
});
animationId = requestAnimationFrame(animate);
}
// 使用Intersection Observer优化动画性能
const heroSection = document.querySelector('.hero');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
isAnimating = true;
animate();
} else {
isAnimating = false;
if (animationId) {
cancelAnimationFrame(animationId);
}
}
});
}, { threshold: 0.1 });
observer.observe(heroSection);
// 平滑滚动 - 使用passive事件监听器
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}, { passive: false });
});
});
</script>
</body>
</html>