-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1344 lines (1190 loc) · 37.4 KB
/
index.html
File metadata and controls
1344 lines (1190 loc) · 37.4 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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>毅阳工作室 | Yearnstudio</title>
<meta name="description" content="毅阳工作室Yearnstudio是一个成立于2022年的云工作室, 在多方面都有研究, 秉持着开源公益的精神与您共赴群星">
<meta name="keywords" content="Yearnstudio, 毅阳工作室, Scratch, 云变量, 多人联机, ShangCloud">
<meta name="author" content="Yearnstudio">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://yearn.studio/">
<meta property="og:title" content="Yearnstudio 毅阳工作室">
<meta property="og:description" content="毅阳工作室Yearnstudio是一个成立于2022年的云工作室, 在多方面都有研究, 秉持着开源公益的精神与您共赴群星">
<meta property="og:image" content="https://yearn.studio/logo.svg">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://yearn.studio/">
<meta property="twitter:title" content="Yearnstudio 毅阳工作室">
<meta property="twitter:description" content="毅阳工作室Yearnstudio是一个成立于2022年的云工作室, 在多方面都有研究, 秉持着开源公益的精神与您共赴群星">
<meta property="twitter:image" content="https://yearn.studio/logo.svg">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<script>
// 优先加载主题,避免页面闪烁
(function () {
const storedTheme = localStorage.getItem('theme') || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
if (storedTheme === 'light') {
document.documentElement.classList.add('light-mode');
}
})();
</script>
<style>
:root {
--bg-color: #000;
--text-color: #fff;
--nav-bg: rgba(0, 0, 0, 0.8);
--footer-bg: #1a1a1a;
--footer-text: #ccc;
--footer-h3: #fff;
--link-color: #fff;
--link-hover: #ccc;
--header-bg: #000;
--card-bg: #1a1a1a;
}
.light-mode {
--bg-color: #fff;
--text-color: #000;
--nav-bg: rgba(255, 255, 255, 0.8);
--footer-bg: #f8f8f8;
--footer-text: #666;
--footer-h3: #333;
--link-color: #000;
--link-hover: #555;
--header-bg: #fff;
--card-bg: #f0f0f0;
}
body {
margin: 0;
font-family: "DengXian", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: var(--bg-color);
color: var(--text-color);
overflow-x: hidden;
transition: background 0.3s, color 0.3s;
}
/* 顶部固定导航栏 */
.navbar {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 60px;
background: var(--nav-bg);
backdrop-filter: blur(10px);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
z-index: 1000;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
transition: background 0.3s;
}
.nav-title {
font-size: 1.5rem;
font-weight: bold;
color: var(--text-color);
text-decoration: none;
display: flex;
align-items: center;
gap: 10px;
}
.nav-logo {
width: 32px;
height: 32px;
display: flex;
justify-content: center;
align-items: center;
}
.nav-links {
display: flex;
gap: 15px;
/* 减小间距 */
margin-left: auto;
/* 确保链接组靠右对齐 */
padding-left: 20px;
/* 添加左边距以增加空间 */
align-items: center;
}
.nav-links a {
color: var(--link-color);
text-decoration: none;
font-size: 0.85rem;
/* 进一步减小字体大小 */
transition: color 0.3s;
white-space: nowrap;
/* 防止文字换行 */
}
/* 隐藏滚动条 */
body::-webkit-scrollbar {
display: none;
}
body {
-ms-overflow-style: none;
/* IE and Edge */
scrollbar-width: none;
/* Firefox */
overflow-x: hidden;
}
.nav-links a:hover {
color: var(--link-hover);
}
.theme-toggle {
background: none;
border: 1px solid var(--text-color);
color: var(--text-color);
padding: 4px 12px;
cursor: pointer;
border-radius: 20px;
font-size: 0.75rem;
margin-left: 10px;
transition: all 0.3s;
white-space: nowrap;
}
.theme-toggle:hover {
background: var(--text-color);
color: var(--bg-color);
}
nav {
/* 或者作用于包含这些 <li> 的 <ul> */
padding-right: 40px;
/* 增加右侧间距,预留出滚动条的空间 */
box-sizing: border-box;
/* 确保 padding 不会撑大容器总宽度 */
}
nav ul {
display: flex;
justify-content: flex-end;
list-style: none;
margin-right: 20px;
/* 使用 margin 将整个列表向左拉一点 */
}
nav li {
margin-left: 30px;
/* 保持项与项之间的间距 */
}
/* 顶部标题区域 */
.top-header {
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
background: var(--header-bg);
padding: 0;
position: relative;
overflow: hidden;
transition: background 0.3s;
}
.header-logo {
position: absolute;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
z-index: 0;
opacity: 0.5;
pointer-events: none;
}
.header-logo img {
width: 85vh;
height: 85vh;
object-fit: contain;
}
.header-content {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.top-header h1 {
font-size: 6rem;
margin: 0;
letter-spacing: -2px;
line-height: 1.1;
font-weight: 800;
}
.top-header .slogan {
font-size: 1.8rem;
margin-top: 20px;
opacity: 0.9;
letter-spacing: 12px;
text-transform: uppercase;
font-weight: 300;
}
/* 滚动轨道:根据步骤数量动态计算高度 */
.scroll-track {
height: 400vh;
}
/* 固定容器:在滚动期间一直留在屏幕上 */
.sticky-container {
position: sticky;
top: 0;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
/* 内容层:绝对定位重叠在一起 */
.content-step {
position: absolute;
opacity: 0;
transform: scale(0.8);
pointer-events: none;
display: flex;
align-items: center;
gap: 60px;
max-width: 1200px;
}
.content-step img {
width: 400px;
height: 400px;
object-fit: cover;
border-radius: 20px;
}
.step-text {
text-align: left;
}
.step-text h2 {
font-size: 3rem;
margin: 0 0 20px 0;
}
.step-text p {
font-size: 1.5rem;
opacity: 0.8;
margin: 0 0 20px 0;
/* 添加底部外边距 */
}
.step-button {
display: inline-block;
padding: 12px 25px;
background-color: #007bff;
/* 蓝色背景 */
color: #fff;
/* 白色文字 */
text-decoration: none;
border-radius: 5px;
font-size: 1rem;
transition: background-color 0.3s ease;
pointer-events: auto;
/* 允许按钮接收点击事件 */
}
.step-button:hover {
background-color: #0056b3;
/* 鼠标悬停时颜色变深 */
}
/* 隐藏标题,但保持可访问性 */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
/* 初始显示第一屏 */
.step-1 {
opacity: 1;
transform: scale(1);
}
/* 工作室成员区域 */
.members-section {
padding: 80px 40px;
background: var(--bg-color);
}
.members-section h2 {
text-align: center;
font-size: 2rem;
margin-bottom: 40px;
}
.members-grid {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 30px;
max-width: 1200px;
margin: 0 auto;
}
.member-card {
width: 220px;
padding: 25px;
background: var(--card-bg);
border-radius: 12px;
text-align: center;
transition: transform 0.3s;
cursor: default;
}
.member-card.has-url {
cursor: pointer;
}
.member-card:hover {
transform: translateY(-5px);
}
.member-card img {
width: 80px;
height: 80px;
border-radius: 8px;
object-fit: cover;
margin-bottom: 15px;
}
.member-card .name {
font-weight: bold;
font-size: 1.1rem;
margin-bottom: 5px;
}
.member-card .role {
font-size: 0.85rem;
color: #007bff;
margin-bottom: 10px;
}
/* 用户评价区域 */
.testimonials-section {
padding: 80px 40px;
background: var(--bg-color);
overflow: hidden;
}
.testimonials-section h2 {
text-align: center;
font-size: 2rem;
margin-bottom: 40px;
}
.testimonials-track {
display: flex;
gap: 20px;
will-change: transform;
}
.testimonial-card {
flex-shrink: 0;
width: 300px;
padding: 20px;
background: var(--card-bg);
border-radius: 12px;
display: flex;
flex-direction: column;
gap: 15px;
position: relative;
/* 添加相对定位 */
padding-bottom: 50px;
/* 为链接留出空间 */
}
.testimonial-card img {
width: 50px;
height: 50px;
border-radius: 50%;
object-fit: cover;
}
.testimonial-card .name {
font-weight: bold;
font-size: 1rem;
}
.testimonial-card .content {
font-size: 0.9rem;
opacity: 0.8;
line-height: 1.5;
}
.testimonial-card a {
color: #007bff;
text-decoration: none;
font-size: 0.85rem;
position: absolute;
/* 绝对定位 */
bottom: 20px;
/* 吸附到底部,与 padding 保持一致 */
left: 20px;
right: 20px;
}
/* 页脚样式 */
.footer-container {
display: flex;
/* 启用弹性布局 */
flex-direction: row;
/* 确保子项按行排列 */
justify-content: space-between;
/* 在列之间均匀分配空间 */
align-items: flex-start;
/* 顶部对齐 */
padding: 40px;
background-color: var(--footer-bg);
transition: background-color 0.3s;
}
.footer-column {
flex: 1;
/* 让每一列等宽 */
margin-right: 20px;
/* 列之间的间距 */
}
.footer-column:last-child {
margin-right: 0;
}
.footer-column h3 {
font-size: 16px;
margin-bottom: 15px;
color: var(--footer-h3);
transition: color 0.3s;
}
.footer-column ul {
list-style: none;
/* 移除列表圆点 */
padding: 0;
}
.footer-column li {
margin-bottom: 8px;
color: var(--footer-text);
transition: color 0.3s;
}
.footer-column a {
color: var(--footer-text);
text-decoration: none;
transition: color 0.3s;
}
.footer-column a:hover {
color: var(--link-hover);
}
.footer-brand-social {
display: flex;
flex-direction: column;
align-items: flex-end;
text-align: right;
}
.brand-info {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 20px;
}
.footer-logo-img {
width: 36px;
height: 36px;
transition: filter 0.3s;
}
/* 在暗色模式下(默认)反转社交图标颜色,使其在深色背景下可见 */
body:not(.light-mode) .social-links .social-icon img {
filter: brightness(0) invert(1);
}
/* 页脚 Logo 在暗色模式下可以稍微增加亮度,但不完全反转颜色以保持品牌色彩 */
body:not(.light-mode) .footer-logo-img {
filter: brightness(1.2);
}
.brand-name {
font-size: 1.5rem;
font-weight: bold;
color: var(--footer-h3);
letter-spacing: 1px;
line-height: 1.2;
}
.copyright {
font-size: 0.75rem;
color: var(--footer-text);
opacity: 0.8;
}
.social-links {
display: flex;
gap: 18px;
align-items: center;
}
.social-icon {
display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
opacity: 0.7;
transition: all 0.3s ease;
}
.social-icon:hover {
opacity: 1;
transform: translateY(-2px);
}
.social-icon img {
width: 100%;
height: 100%;
transition: filter 0.3s;
}
/* 懒加载图片样式 */
.lazy-load {
background-color: #f0f0f0;
min-height: 128px;
min-width: 128px;
display: block;
}
body.light-mode .lazy-load {
background-color: #d0d0d0;
}
/* 汉堡菜单样式 */
.burger-menu {
display: none;
/* 默认隐藏 */
flex-direction: column;
justify-content: space-around;
width: 30px;
height: 25px;
background: transparent;
border: none;
cursor: pointer;
padding: 0;
z-index: 1001;
/* 确保在导航链接之上 */
}
.burger-menu .bar {
width: 100%;
height: 3px;
background-color: var(--text-color);
border-radius: 10px;
}
/* 媒体查询:手机端适配 */
@media screen and (max-width: 768px) {
.navbar {
padding: 0 20px;
/* 增加左右内边距 */
}
.nav-title {
font-size: 1.2rem;
}
.burger-menu {
display: flex;
/* 在手机端显示 */
margin-left: auto;
/* 确保靠右 */
}
.nav-links {
display: none;
/* 默认隐藏导航链接 */
flex-direction: column;
position: absolute;
top: 60px;
left: 0;
width: 100%;
background: var(--nav-bg);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
padding: 20px 0;
gap: 10px;
align-items: center;
transition: all 0.3s ease-in-out;
}
.nav-links.active {
display: flex;
/* 汉堡菜单打开时显示 */
}
.nav-links a {
font-size: 1rem;
padding: 10px 0;
width: 100%;
text-align: center;
}
.theme-toggle {
margin-left: 0;
margin-top: 10px;
}
.top-header {
flex-direction: column;
text-align: center;
padding: 100px 5% 0;
gap: 30px;
}
.header-logo {
width: 150px;
height: 150px;
}
.top-header h1 {
font-size: 2.5rem;
}
.top-header .slogan {
font-size: 1rem;
letter-spacing: 2px;
}
.content-step {
flex-direction: column;
text-align: center;
gap: 30px;
padding: 0 20px;
}
.content-step img {
width: 250px;
height: 250px;
}
.step-text h2 {
font-size: 2rem;
}
.step-text p {
font-size: 1.1rem;
}
.members-section {
padding: 60px 20px;
}
.members-section h2 {
font-size: 1.8rem;
}
.member-card {
width: 100%;
max-width: 280px;
}
.testimonials-section {
padding: 60px 20px;
}
.testimonials-section h2 {
font-size: 1.8rem;
}
.testimonial-card {
width: 250px;
}
.footer-container {
flex-direction: column;
align-items: center;
padding: 30px 20px;
}
.footer-column {
margin-right: 0;
margin-bottom: 30px;
text-align: center;
}
.footer-column:last-child {
margin-bottom: 0;
}
.footer-brand-social {
align-items: center;
text-align: center;
margin-top: 20px;
}
}
</style>
</head>
<body>
<script src="/static/gsap.min.js"></script>
<script src="/static/ScrollTrigger.min.js"></script>
<!-- 固定顶部导航栏 -->
<nav class="navbar">
<a href="#" class="nav-title">
<div class="nav-logo">
<img src="" data-src="/logo.svg" alt="logo" width="32" height="32" class="lazy-load">
</div>
</a>
<button class="burger-menu" id="burgerMenu">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</button>
<div class="nav-links">
<a href="/">首页</a>
<a href="/projects">项目</a>
<a href="/about">关于</a>
<a href="/join">招纳贤才</a>
<button class="theme-toggle" id="themeToggle">显示模式</button>
</div>
</nav>
<!-- 顶部标题区域 -->
<div class="top-header">
<div class="header-logo">
<img src="" data-src="/logo.svg" alt="logo" class="lazy-load">
</div>
<div class="header-content">
<h1>Yearnstudio<br>毅阳工作室</h1>
<p class="slogan">ONLY TRUST HERE</p>
</div>
</div>
<h2 id="works-section" class="sr-only">项目展示列表</h2>
<div class="scroll-track">
<div class="sticky-container" id="worksContainer">
<!-- 项目将由 JS 动态渲染 -->
</div>
</div>
<!-- 工作室成员区域 -->
<section class="members-section">
<h2>工作室成员</h2>
<div class="members-grid" id="membersGrid">
<!-- 成员将由 JS 动态渲染 -->
</div>
</section>
<!-- 用户评价区域 -->
<section class="testimonials-section">
<h2>用户评价</h2>
<div class="testimonials-track" id="testimonialsTrack">
<!-- 评价将由 JS 动态渲染 -->
</div>
</section>
<!-- 页脚 -->
<footer class="footer-container">
<div class="footer-column" style="display: flex; flex-direction: column;">
<h3>产品</h3>
<ul>
<li><a href="https://api.yearnstudio.cn">ShangCloud</a></li>
<li><a href="https://sbox.yearnstudio.cn">小盒子社区</a></li>
<li><a href="https://black.yearnstudio.cn">云黑名单</a></li>
<li><a href="/projects">更多</a></li>
</ul>
</div>
<div class="footer-column" style="display: flex; flex-direction: column;">
<h3>支持</h3>
<ul>
<li><a href="/about">关于我们</a></li>
<li><a href="/join">招纳贤才</a></li>
<li><a href="/moments">风采展示</a></li>
</ul>
</div>
<div class="footer-column" style="display: flex; flex-direction: column;">
<h3>合作</h3>
<ul>
<li><a href="https://www.40code.com">40code</a></li>
<li><a href="https://zerocat.dev">ZeroCat</a></li>
<li><a href="https://houlang.cloud">厚浪云</a></li>
<li><a href="https://ling.hujiarong.site">灵阁</a></li>
</ul>
</div>
<div class="footer-column footer-brand-social">
<div class="brand-info">
<img src="" data-src="/logo.svg" alt="Yearnstudio Logo" class="footer-logo-img lazy-load">
<div style="display: flex; flex-direction: column;">
<span class="brand-name">Yearnstudio</span>
<span class="copyright">All rights reversed © 2022-<span id="currentYear"></span></span>
</div>
</div>
<div class="social-links">
<a href="https://space.bilibili.com/1128177448" class="social-icon" title="Bilibili">
<img src="" id="bilibili-icon" width="32" height="32">
</a>
<a href="https://qm.qq.com/cgi-bin/qm/qr?k=2O7iqw_PwPDCa3UmIKgbB_bE0-vKLShS&jump_from=webapi&authKey=wf7amC4VLkzkyAK4Pu4No4LFpKpnD0H9hjSMM/tO1NgiMx0DOP3TE4fUC9UPwkuY"
class="social-icon" title="QQ群">
<img src="" id="qq-icon" width="32" height="32">
</a>
<a href="https://discord.gg/A8W4jHQf4a" class="social-icon" title="Discord群组">
<img src="" id="discord-icon" width="32" height="32">
</a>
<a href="mailto:contact@yearn.studio" class="social-icon" title="官方邮箱">
<img src="" id="mail-icon" width="32" height="32">
</a>
<a href="https://github.com/YearnstudioHorizon" class="social-icon" title="GitHub">
<img src="" id="github-icon" width="32" height="32">
</a>
</div>
</div>
</footer>
<script>
gsap.registerPlugin(ScrollTrigger);
// 懒加载功能实现
const lazyLoadImages = () => {
// 社交图标不再通过此函数懒加载,它们由 applyTheme 函数直接设置 src
// 其他需要懒加载的图片(如作品图片、成员头像、评价头像)仍通过此函数处理
const images = document.querySelectorAll('.lazy-load:not(.social-icon img)'); // 排除社交图标
const imageObserver = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const img = entry.target;
if (img.dataset.src) { // 确保有 data-src 属性才进行加载
img.src = img.dataset.src;
img.classList.remove('lazy-load');
observer.unobserve(img);
}
}
});
});
images.forEach(img => imageObserver.observe(img));
// 为testimonial链接添加点击事件 (保持不变)
document.querySelectorAll('.testimonial-link').forEach(link => {
link.addEventListener('click', function (e) {
const imgSrc = this.dataset.imgSrc;
const img = document.querySelector(`img[data-src="${imgSrc}"]`); // 这里的 img 仍然是 lazy-load 的
if (img && !img.src) {
e.preventDefault();
img.addEventListener('load', () => {
window.open(this.href, '_blank');
});
img.src = img.dataset.src;
}
});
});
};
// 确保DOM加载完成后执行懒加载
document.addEventListener('DOMContentLoaded', lazyLoadImages);
// 优化手机端滚动体验,减少惯性滚动的干扰
if (window.innerWidth <= 768) {
ScrollTrigger.normalizeScroll(true);
}
// 项目列表数据
const works = [
{
name: 'ShangCloud',
desc: '全新设计的全公益Scratch云变量存储、多人联机服务提供平台',
url: 'https://api.yearnstudio.cn',
img: '/images/shangcloud.svg'
},
{
name: '小盒子社区',
desc: '新一代Scratch社区',
url: 'https://sbox.yearnstudio.cn',
// img: ''
},
{
name: 'YearnstudioBot',
desc: '一个工具向第三方/官方混合QQ机器人',
img: '/logo.svg'
}
];
// 工作室成员数据
const members = [
{
name: '阳毅',
role: '创始人 / 开发 / 运维',
img: 'https://q1.qlogo.cn/g?b=qq&nk=3303289608&s=640',
url: 'https://yangyiit.top'
},
{
name: '楼台倒影入池塘',
role: '创始人 / 美工',
img: 'https://q1.qlogo.cn/g?b=qq&nk=1040742877&s=640'
},
{
name: 'Tiger',
role: '开发 / 运维',
img: 'https://q1.qlogo.cn/g?b=qq&nk=2046056619&s=640',
url: 'https://blog.scerpark.cn/'
},
{
name: 'JadeSty1e',
role: '开发',
img: 'https://q1.qlogo.cn/g?b=qq&nk=2832017603&s=640'
},
{
name: 'TangerinePeel',
role: '开发',
img: 'https://q1.qlogo.cn/g?b=qq&nk=1694259407&s=640',
url: 'https://40code.com/#page=user&id=660'
},
{
name: '吾家小狐',
role: '开发 / 运维',
img: 'https://q1.qlogo.cn/g?b=qq&nk=399781969&s=640',
url: 'https://shunian.scerpark.cn/'
},
{
name: '陨落基围虾',
role: '开发',
img: 'https://q1.qlogo.cn/g?b=qq&nk=3161880837&s=640',
url: 'https://fshrimp.fun/'
},
{
name: '星缘',
role: '美工',
img: 'https://q1.qlogo.cn/g?b=qq&nk=2573368926&s=640'
},
{
name: '路过的小贝壳',
role: '视频剪辑',
img: 'https://q1.qlogo.cn/g?b=qq&nk=2447186401&s=640'