55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
66 < title > 苏渡 · 弈沃 | 侠客行</ title >
77
8- <!-- 引入多款古风字体:鸿雷板书、钟齐志莽行书、思源宋体 -->
98 < link rel ="preconnect " href ="https://fonts.googleapis.com ">
109 < link href ="https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@300;500;700&family=Zhi+Mang+Xing&family=Long+Cang&display=swap " rel ="stylesheet ">
1110
1716 --ink-black : # 121212 ;
1817 --ink-light : # 454545 ;
1918 --rice-paper : # f4f1e8 ;
20- --cinnabar : # 8a2525 ; /* 朱砂红 */
21- --bamboo : # 5d6b4e ; /* 竹青 */
19+ --cinnabar : # 8a2525 ;
20+ --bamboo : # 5d6b4e ;
2221 --gold : # bfa678 ;
2322
24- --font-cursive : 'Zhi Mang Xing' , cursive; /* 狂草 */
25- --font-ink : 'Ma Shan Zheng' , cursive; /* 榜书 */
26- --font-body : 'Noto Serif SC' , serif; /* 宋体 */
23+ --font-cursive : 'Zhi Mang Xing' , cursive;
24+ --font-ink : 'Ma Shan Zheng' , cursive;
25+ --font-body : 'Noto Serif SC' , serif;
2726 }
2827
2928 * { margin : 0 ; padding : 0 ; box-sizing : border-box; cursor : none; }
3635 overflow-x : hidden;
3736 }
3837
39- /* --- 自定义毛笔光标 --- */
4038 # cursor {
4139 position : fixed; top : 0 ; left : 0 ;
4240 width : 30px ; height : 30px ;
4947 }
5048 # cursor .active { transform : translate (-50% , -50% ) scale (2.5 ); background : radial-gradient (circle, var (--cinnabar ) 0% , transparent 70% ); }
5149
52- /* --- 背景动态水墨 --- */
5350 canvas # ink-canvas {
5451 position : fixed; top : 0 ; left : 0 ; width : 100% ; height : 100% ;
5552 z-index : -1 ; opacity : 0.15 ; pointer-events : none;
5653 }
5754
58- /* --- 辅助类 --- */
5955 .v-text {
6056 writing-mode : vertical-rl;
6157 text-orientation : upright;
7167 border-radius : 4px ;
7268 }
7369
74- /* --- 导航 --- */
7570 nav {
7671 position : fixed; top : 0 ; width : 100% ; padding : 30px 50px ;
7772 display : flex; justify-content : space-between; align-items : flex-start;
8883 box-shadow : 3px 3px 5px rgba (0 , 0 , 0 , 0.2 );
8984 }
9085
91- /* --- 首页 Header --- */
9286 header {
9387 height : 100vh ;
9488 display : flex; align-items : center; justify-content : center;
122116 padding : 10px 0 ; display : inline-block;
123117 }
124118
125- /* --- 简介板块 --- */
126119 .intro-section {
127120 padding : 100px 20px ;
128121 max-width : 900px ; margin : 0 auto;
133126 margin-bottom : 40px ;
134127 }
135128
136- /* --- 战绩列表 (Projects) --- */
137129 .project-scroll {
138130 padding : 50px 0 ;
139131 }
154146 padding : 60px ;
155147 border : 1px solid # dcdcdc ;
156148 box-shadow : 0 20px 50px rgba (0 , 0 , 0 , 0.05 );
157- transform : translateY (50px ); opacity : 0 ; /* GSAP Init */
149+ transform : translateY (50px ); opacity : 0 ;
158150 }
159151
160- /* 左侧诗词与标题 */
161152 .proj-left {
162153 border-right : 1px dashed var (--ink-light );
163154 padding-right : 40px ;
175166 font-family : var (--font-ink ); font-size : 3rem ; color : var (--cinnabar );
176167 }
177168
178- /* 右侧技术详情 */
179169 .proj-right { text-align : left; }
180170 .tech-stack {
181171 font-family : monospace; color : var (--bamboo ); margin-bottom : 20px ;
195185 }
196186 .btn-view : hover { background : var (--ink-black ); color : # fff ; }
197187
198- /* 装饰性墨迹 */
199188 .ink-splash {
200189 position : absolute; z-index : -1 ; pointer-events : none;
201190 opacity : 0.1 ; width : 400px ;
202191 }
203192
204- /* --- Footer --- */
205193 footer {
206194 height : 50vh ; display : flex; flex-direction : column; justify-content : center; align-items : center;
207195 background : var (--ink-black ); color : # 888 ;
211199 font-family : var (--font-cursive ); font-size : 2.5rem ; color : # ccc ; margin-bottom : 30px ;
212200 }
213201
214- /* 移动端适配 */
215202 @media (max-width : 768px ) {
216203 .project-content { grid-template-columns : 1fr ; text-align : center; }
217204 .proj-left { border-right : none; border-bottom : 1px dashed # ccc ; padding-bottom : 30px ; padding-right : 0 ; text-align : center; }
218205 .hero-title { font-size : 4rem ; }
219- .poem-intro { display : none; } /* 手机端隐藏竖排诗 */
206+ .poem-intro { display : none; }
220207 }
221208
222209 </ style >
223210</ head >
224211< body >
225212
226- <!-- 鼠标光标 -->
227213 < div id ="cursor "> </ div >
228- <!-- 背景画布 -->
229214 < canvas id ="ink-canvas "> </ canvas >
230215
231216 < nav >
236221 </ nav >
237222
238223 < header >
239- <!-- 开场诗 (竖排) -->
240224 < div class ="poem-intro v-text ">
241225 十步杀一人 · 千里不留行< br >
242226 事了拂衣去 · 深藏身与名
@@ -253,7 +237,6 @@ <h1 class="hero-title">苏渡 · 弈沃</h1>
253237 </ div >
254238 </ header >
255239
256- <!-- 简介 -->
257240 < section class ="intro-section ">
258241 < div class ="intro-quote ">
259242 " 满堂花醉三千客,一剑霜寒十四州 "
@@ -266,10 +249,8 @@ <h1 class="hero-title">苏渡 · 弈沃</h1>
266249 </ p >
267250 </ section >
268251
269- <!-- 项目画卷 -->
270252 < div class ="project-scroll ">
271253
272- <!-- 项目 1: Eideo -->
273254 < div class ="project-item ">
274255 < img src ="https://www.transparenttextures.com/patterns/shattered-island.png " class ="ink-splash " style ="top:10%; left:10%; ">
275256 < div class ="project-content ">
@@ -296,7 +277,6 @@ <h2 class="proj-title">幻影留声</h2>
296277 </ div >
297278 </ div >
298279
299- <!-- 项目 2: EvolveUI -->
300280 < div class ="project-item ">
301281 < img src ="https://www.transparenttextures.com/patterns/shattered-island.png " class ="ink-splash " style ="bottom:10%; right:10%; ">
302282 < div class ="project-content ">
@@ -323,7 +303,6 @@ <h2 class="proj-title">玲珑机枢</h2>
323303 </ div >
324304 </ div >
325305
326- <!-- 项目 3: Shader Renderer -->
327306 < div class ="project-item ">
328307 < img src ="https://www.transparenttextures.com/patterns/shattered-island.png " class ="ink-splash " style ="top:20%; right:20%; ">
329308 < div class ="project-content ">
@@ -350,7 +329,6 @@ <h2 class="proj-title">炼虚化实</h2>
350329 </ div >
351330 </ div >
352331
353- <!-- 项目 4: Monitor -->
354332 < div class ="project-item ">
355333 < div class ="project-content ">
356334 < div class ="proj-left ">
@@ -376,7 +354,6 @@ <h2 class="proj-title">天眼观气</h2>
376354 </ div >
377355 </ div >
378356
379- <!-- 项目 5: Handwriting -->
380357 < div class ="project-item ">
381358 < div class ="project-content ">
382359 < div class ="proj-left ">
@@ -404,7 +381,6 @@ <h2 class="proj-title">笔墨问道</h2>
404381
405382 </ div >
406383
407- <!-- 尾声 -->
408384 < footer >
409385 < div class ="footer-poem v-text " style ="height: 200px; ">
410386 相忘于江湖< br > 不如相濡以沫
@@ -416,18 +392,15 @@ <h2 class="proj-title">笔墨问道</h2>
416392 </ footer >
417393
418394 < script >
419- // --- 1. GSAP 卷轴动画 ---
420395 gsap . registerPlugin ( ScrollTrigger ) ;
421396
422- // 开场诗词淡入
423397 gsap . to ( ".poem-intro" , {
424398 opacity : 1 ,
425399 duration : 2 ,
426400 delay : 0.5 ,
427401 ease : "power2.out"
428402 } ) ;
429403
430- // 标题淡入
431404 gsap . from ( ".hero-title" , {
432405 y : 100 ,
433406 opacity : 0 ,
@@ -436,23 +409,22 @@ <h2 class="proj-title">笔墨问道</h2>
436409 ease : "power3.out"
437410 } ) ;
438411
439- // 项目卷轴展开效果
440412 const projects = document . querySelectorAll ( '.project-content' ) ;
441413 projects . forEach ( ( proj , index ) => {
442- const direction = index % 2 === 0 ? - 50 : 50 ; // 左右交替入场
414+ const direction = index % 2 === 0 ? - 50 : 50 ;
443415
444416 gsap . fromTo ( proj ,
445417 {
446418 opacity : 0 ,
447419 y : 100 ,
448- rotation : 2 // 轻微旋转增加纸张感
420+ rotation : 2
449421 } ,
450422 {
451423 scrollTrigger : {
452424 trigger : proj ,
453425 start : "top 80%" ,
454426 end : "top 30%" ,
455- scrub : 1 , // 随滚动条平滑播放
427+ scrub : 1 ,
456428 } ,
457429 opacity : 1 ,
458430 y : 0 ,
@@ -462,13 +434,12 @@ <h2 class="proj-title">笔墨问道</h2>
462434 ) ;
463435 } ) ;
464436
465- // --- 2. 水墨背景 (Canvas) ---
466- // 模拟墨汁滴入水中的扩散效果
467437 const canvas = document . getElementById ( 'ink-canvas' ) ;
468438 const ctx = canvas . getContext ( '2d' ) ;
469439
470440 let w , h ;
471441 let inks = [ ] ;
442+ const MAX_INKS = 15 ;
472443
473444 function resize ( ) {
474445 w = canvas . width = window . innerWidth ;
@@ -479,28 +450,34 @@ <h2 class="proj-title">笔墨问道</h2>
479450
480451 class InkDrop {
481452 constructor ( x , y ) {
482- this . x = x ;
483- this . y = y ;
453+ this . x = x || Math . random ( ) * w ;
454+ this . y = y || Math . random ( ) * h ;
484455 this . radius = 0 ;
485- this . maxRadius = Math . random ( ) * 100 + 50 ;
486- this . opacity = 1 ;
487- this . speed = Math . random ( ) * 2 + 1 ;
488- this . color = Math . random ( ) > 0.9 ? '#8a2525' : '#222' ; // 偶尔出现朱砂红
456+ this . maxRadius = Math . random ( ) * 80 + 40 ;
457+ this . opacity = 0.8 ;
458+ this . speed = Math . random ( ) * 1.2 + 0.8 ;
459+ this . color = Math . random ( ) > 0.85 ? '#8a2525' : '#1a1a1a' ;
460+ this . alive = true ;
489461 }
462+
490463 update ( ) {
491464 if ( this . radius < this . maxRadius ) {
492465 this . radius += this . speed ;
493466 } else {
494- this . opacity -= 0.005 ;
467+ this . opacity -= 0.003 ;
468+ if ( this . opacity <= 0.02 ) {
469+ this . alive = false ;
470+ }
495471 }
496472 }
473+
497474 draw ( ) {
475+ if ( ! this . alive ) return ;
498476 ctx . beginPath ( ) ;
499477 ctx . arc ( this . x , this . y , this . radius , 0 , Math . PI * 2 ) ;
500478 ctx . fillStyle = this . color ;
501- ctx . globalAlpha = this . opacity * 0.1 ; // 非常淡
502- // 模拟边缘粗糙
503- ctx . shadowBlur = 20 ;
479+ ctx . globalAlpha = this . opacity * 0.15 ;
480+ ctx . shadowBlur = 25 ;
504481 ctx . shadowColor = this . color ;
505482 ctx . fill ( ) ;
506483 ctx . globalAlpha = 1 ;
@@ -510,36 +487,37 @@ <h2 class="proj-title">笔墨问道</h2>
510487
511488 function animate ( ) {
512489 ctx . clearRect ( 0 , 0 , w , h ) ;
513- // 随机生成墨点
514- if ( Math . random ( ) < 0.02 ) {
515- inks . push ( new InkDrop ( Math . random ( ) * w , Math . random ( ) * h ) ) ;
490+
491+ if ( inks . length < MAX_INKS && Math . random ( ) < 0.01 ) {
492+ inks . push ( new InkDrop ( ) ) ;
516493 }
517494
518495 for ( let i = 0 ; i < inks . length ; i ++ ) {
519496 inks [ i ] . update ( ) ;
520497 inks [ i ] . draw ( ) ;
521- if ( inks [ i ] . opacity <= 0 ) {
498+ }
499+
500+ for ( let i = inks . length - 1 ; i >= 0 ; i -- ) {
501+ if ( ! inks [ i ] . alive ) {
522502 inks . splice ( i , 1 ) ;
523- i -- ;
524503 }
525504 }
505+
526506 requestAnimationFrame ( animate ) ;
527507 }
528508 animate ( ) ;
529509
530- // --- 3. 自定义光标 ---
531510 const cursor = document . getElementById ( 'cursor' ) ;
532511 window . addEventListener ( 'mousemove' , ( e ) => {
533512 cursor . style . left = e . clientX + 'px' ;
534513 cursor . style . top = e . clientY + 'px' ;
535514 } ) ;
536515
537- // Hover 交互
538516 document . querySelectorAll ( 'a, .project-content' ) . forEach ( el => {
539517 el . addEventListener ( 'mouseenter' , ( ) => cursor . classList . add ( 'active' ) ) ;
540518 el . addEventListener ( 'mouseleave' , ( ) => cursor . classList . remove ( 'active' ) ) ;
541519 } ) ;
542520
543521 </ script >
544522</ body >
545- </ html >
523+ </ html >
0 commit comments