Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1034 lines (915 loc) · 58.7 KB
/
Copy pathindex.html
File metadata and controls
1034 lines (915 loc) · 58.7 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" class="scroll-smooth">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LearnWord - 轻量级英语词汇高效学习工具</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<!-- 引入 AOS 动画库 -->
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<!-- 引入 Typed.js 库用于打字效果 -->
<script src="https://unpkg.com/typed.js@2.0.16/dist/typed.umd.js"></script>
<!-- 引入 Marked.js 用于解析 Markdown 更新日志 -->
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<!-- 引入 LeanCloud JS SDK -->
<script src="https://cdn.jsdelivr.net/npm/leancloud-storage@4.12.0/dist/av-min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
:root {
--primary: #0078d7;
--primary-hover: #339af0;
--bg-body: #050811;
--text-title: #ffffff;
--text-nav: #94a3b8;
--text-main: #94a3b8;
--text-muted: #64748b;
--glass-bg: rgba(255, 255, 255, 0.02);
--glass-border: rgba(255, 255, 255, 0.08);
--grid-color: rgba(255, 255, 255, 0.03);
--nav-bg: rgba(5, 8, 17, 0.7);
--mock-bg: rgba(15, 23, 42, 0.65);
--input-bg: rgba(255, 255, 255, 0.05);
}
/* 设置全局平滑滚动边距 */
html {
scroll-padding-top: 80px;
}
.light-theme {
--bg-body: #f8fafc;
--text-title: #0f172a;
--text-nav: #1e293b;
--text-main: #0f172a;
--text-muted: #334155;
--glass-bg: rgba(255, 255, 255, 0.85);
--glass-border: rgba(0, 120, 215, 0.15);
--grid-color: rgba(0, 120, 215, 0.08);
--nav-bg: rgba(248, 250, 252, 0.95);
--mock-bg: #ffffff;
--input-bg: #f1f5f9;
}
body {
font-family: 'Inter', 'MiSans', -apple-system, sans-serif;
overflow-x: hidden;
background-color: var(--bg-body);
color: var(--text-main);
transition: background-color 0.5s ease, color 0.5s ease;
}
h1, h2, h3, h4 { color: var(--text-title); transition: color 0.5s ease; }
b { color: var(--text-title); transition: color 0.5s ease; }
.typed-cursor {
color: var(--primary);
font-size: 0.9em;
margin-left: 5px;
}
@keyframes float {
0% { transform: translateY(0px) rotate(1deg); }
50% { transform: translateY(-15px) rotate(0deg); }
100% { transform: translateY(0px) rotate(1deg); }
}
.animate-float {
animation: float 6s ease-in-out infinite;
}
.hero-gradient {
background: radial-gradient(circle at center, rgba(30, 41, 59, 0.5) 0%, var(--bg-body) 70%);
transition: background 0.5s ease;
}
.light-theme .hero-gradient {
background: radial-gradient(circle at center, rgba(0, 120, 215, 0.05) 0%, var(--bg-body) 80%);
}
.glass-card {
background: var(--glass-bg);
backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
transition: all 0.3s ease;
}
.grid-pattern {
background-image: radial-gradient(var(--grid-color) 1px, transparent 0);
background-size: 50px 50px;
}
.software-btn-blue { background-color: var(--primary); color: white !important; }
.software-btn-blue:hover { background-color: var(--primary-hover); transform: scale(1.02); }
.nav-blur {
background: var(--nav-bg);
backdrop-filter: blur(15px);
border-bottom: 1px solid var(--glass-border);
transition: background 0.5s ease;
}
.btn-shine {
position: relative;
overflow: hidden;
}
.btn-shine::after {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
transform: rotate(45deg);
transition: 0.5s;
}
.btn-shine:hover::after {
left: 100%;
}
.progress-mock {
height: 6px;
background: var(--glass-border);
border-radius: 3px;
overflow: hidden;
}
.progress-inner { height: 100%; border-radius: 4px; }
.content-container {
max-width: 72rem;
margin-left: auto;
margin-right: auto;
padding-left: 1.5rem;
padding-right: 1.5rem;
}
#mobile-menu {
background: var(--nav-bg);
transition: all 0.3s ease-in-out;
transform: translateY(-20px);
opacity: 0;
pointer-events: none;
}
#mobile-menu.active {
transform: translateY(0);
opacity: 1;
pointer-events: auto;
}
.markdown-body { color: var(--text-main); }
.markdown-body ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.markdown-body p { margin-bottom: 0.75rem; }
.markdown-body code { background: rgba(128,128,128,0.1); padding: 0.2rem 0.4rem; border-radius: 4px; font-family: monospace; }
#theme-guide {
animation: bounceLeft 2s infinite;
}
@keyframes bounceLeft {
0%, 20%, 50%, 80%, 100% {transform: translateX(0);}
40% {transform: translateX(-10px);}
60% {transform: translateX(-5px);}
}
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }
/* 可复用的文本和元素类 */
.text-title { color: var(--text-title); }
.text-nav { color: var(--text-nav); }
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.nav-link-text { color: var(--text-nav); }
.nav-link-text:hover { color: #3b82f6; }
.mock-input { background: var(--input-bg); border-color: var(--glass-border); }
.mock-bg { background: var(--mock-bg); }
.feature-card {
padding: 2rem;
background: var(--glass-bg);
backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
border-radius: 1.5rem;
transition: all 0.3s ease;
}
/* 神经网络背景画布样式 */
#neural-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: none;
filter: blur(0.5px);
opacity: 0.8;
transform: translateZ(0);
}
</style>
</head>
<body class="text-slate-200">
<!-- Header -->
<header class="fixed w-full z-50 nav-blur">
<nav class="content-container py-4 lg:py-5 flex justify-between items-center">
<div class="flex items-center space-x-3 group cursor-pointer" id="logo-btn">
<div class="bg-blue-600 p-2 rounded-xl group-hover:rotate-12 transition-transform shadow-lg shadow-blue-500/20 text-white">
<i class="fas fa-book-open text-lg lg:text-xl"></i>
</div>
<span class="text-xl lg:text-2xl font-bold tracking-tighter transition-colors text-title">LearnWord</span>
</div>
<!-- Desktop Links -->
<div class="hidden md:flex space-x-10 text-sm font-medium items-center">
<a href="#methodology" class="nav-link nav-link-text transition-colors">核心逻辑</a>
<a href="#detailed-features" class="nav-link nav-link-text transition-colors">模块详解</a>
<a href="#update-mechanism" class="nav-link nav-link-text transition-colors">更新机制</a>
<a href="#changelog" class="nav-link nav-link-text transition-colors">版本记录</a>
<a id="nav-auth-link" href="./register.html" class="nav-link nav-link-text transition-colors font-bold flex items-center">
<i class="fas fa-user-circle mr-2"></i>注册/登录
</a>
</div>
<div class="flex items-center space-x-3 lg:space-x-5">
<div class="relative flex items-center">
<div id="theme-guide" class="hidden absolute right-12 bg-blue-600 text-white text-[10px] px-2 py-1 rounded whitespace-nowrap after:content-[''] after:absolute after:top-1/2 after:left-full after:-translate-y-1/2 after:border-8 after:border-y-transparent after:border-r-transparent after:border-l-blue-600">
点击切换模式
</div>
<button id="theme-toggle" class="p-2.5 rounded-xl glass-card hover:bg-blue-600/10 transition-colors text-blue-500" title="切换主题">
<i class="fas fa-moon"></i>
</button>
</div>
<a href="https://github.com/Junpgle/LearnWord/releases" id="nav-download-btn" class="download-link btn-shine hidden sm:block bg-blue-600 hover:bg-blue-500 text-white px-5 lg:px-7 py-2 lg:py-2.5 rounded-full text-xs lg:text-sm font-bold transition-all shadow-lg shadow-blue-600/30">
Windows 下载
</a>
<button id="menu-toggle" class="md:hidden p-2 focus:outline-none transition-colors text-title" title="打开菜单">
<i class="fas fa-bars text-xl"></i>
</button>
</div>
</nav>
<!-- Mobile Menu -->
<div id="mobile-menu" class="absolute top-full left-0 w-full border-b border-white/5 py-6 flex flex-col items-center space-y-6 md:hidden">
<a href="#methodology" class="mobile-link nav-link-text">核心逻辑</a>
<a href="#detailed-features" class="mobile-link nav-link-text">模块详解</a>
<a href="#update-mechanism" class="mobile-link nav-link-text">更新机制</a>
<a href="#changelog" class="mobile-link nav-link-text">版本记录</a>
<a id="mobile-auth-link" href="./register.html" class="mobile-link font-bold text-blue-400">账号同步(登录/注册)</a>
<a href="https://github.com/Junpgle/LearnWord/releases" class="download-link bg-blue-600 text-white px-8 py-2.5 rounded-full text-sm font-bold">Windows 下载</a>
</div>
</header>
<!-- Hero Section -->
<section class="hero-gradient pt-32 lg:pt-56 pb-20 lg:pb-40 relative grid-pattern overflow-hidden">
<!-- 神经网络背景画布 -->
<canvas id="neural-bg"></canvas>
<div class="content-container flex flex-col lg:flex-row items-center relative z-10">
<div class="lg:w-1/2 mb-16 lg:mb-0 text-center lg:text-left" data-aos="fade-right">
<div id="version-badge" class="inline-block px-4 py-1.5 mb-6 lg:mb-8 rounded-full bg-blue-500/10 border border-blue-500/20 text-blue-500 text-[10px] lg:text-xs font-bold tracking-widest uppercase">
Loading version...
</div>
<h1 class="text-4xl sm:text-5xl lg:text-7xl font-extrabold leading-[1.15] mb-8 tracking-tight">
掌握单词<br><span id="typed-text" class="text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-indigo-500"></span>
</h1>
<p class="text-base lg:text-xl mb-10 lg:mb-12 max-w-md mx-auto lg:mx-0 leading-relaxed text-main">
基于科学的三阶段记忆法,将繁琐的背词过程转化为阶段式的成就挑战。轻量、纯净、开源。
</p>
<!-- 按钮排版 -->
<div class="flex flex-col sm:flex-row flex-wrap items-center lg:items-stretch justify-center lg:justify-start gap-4 lg:gap-5">
<a href="https://github.com/Junpgle/LearnWord/releases" id="hero-download-btn" class="download-link btn-shine w-full sm:w-auto bg-blue-600 text-white px-8 lg:px-10 py-4 rounded-2xl font-bold hover:bg-blue-700 transition shadow-2xl shadow-blue-600/20 flex items-center justify-center group">
<i class="fab fa-windows mr-3 text-lg lg:text-xl group-hover:scale-110 transition-transform"></i>Windows 下载
</a>
<div class="flex items-center gap-3 w-full sm:w-auto">
<!-- 注册/同步按钮 (会被脚本动态替换) -->
<a id="hero-auth-btn" href="./register.html" class="glass-card flex-1 sm:flex-none px-6 lg:px-8 py-4 rounded-2xl font-bold hover:bg-blue-600/10 transition flex items-center justify-center border-white/10 text-title">
<i class="fas fa-sync-alt mr-2 text-lg"></i>云端注册/同步
</a>
<a href="https://github.com/Junpgle/LearnWord" target="_blank" class="glass-card flex-1 sm:flex-none px-6 lg:px-8 py-4 rounded-2xl font-bold hover:opacity-80 transition flex items-center justify-center border-white/10 text-title">
<i class="fab fa-github mr-2 text-lg"></i>GitHub
</a>
</div>
</div>
</div>
<div class="lg:w-1/2 relative flex justify-center lg:justify-end" data-aos="zoom-in" data-aos-delay="200">
<div class="absolute -inset-10 bg-blue-500/10 blur-[120px] rounded-full hidden lg:block"></div>
<!-- 模拟学习界面 -->
<div class="relative w-full max-w-[320px] sm:max-w-md glass-card rounded-3xl p-4 sm:p-6 animate-float shadow-2xl scale-90 sm:scale-100 border-white/20">
<div class="flex space-x-2 mb-6" id="mock-indicators">
<span class="w-2 h-2 sm:w-2.5 sm:h-2.5 rounded-full border border-slate-700 transition-colors duration-500"></span>
<span class="w-2 h-2 sm:w-2.5 sm:h-2.5 rounded-full border border-slate-700 transition-colors duration-500"></span>
<span class="w-2 h-2 sm:w-2.5 sm:h-2.5 rounded-full border border-slate-700 transition-colors duration-500"></span>
</div>
<div id="mock-content" class="h-64 sm:h-80 rounded-2xl flex flex-col items-center justify-center p-6 sm:p-8 text-center border border-white/5 relative overflow-hidden shadow-inner mock-bg">
<span id="mock-phase-label" class="text-blue-500 text-[9px] sm:text-[10px] font-black tracking-[0.2em] uppercase mb-4">Phase 1: Recognition</span>
<div class="flex flex-col items-center justify-center w-full transition-all duration-500" id="mock-stage-body">
<h2 id="mock-main-word" class="text-2xl sm:text-3xl font-black mb-6 tracking-widest min-h-[40px] text-title">Announcement</h2>
<div id="mock-ui-p1" class="grid grid-cols-2 gap-2 sm:gap-3 w-full mt-2 opacity-0 hidden transition-opacity duration-300">
<div class="bg-slate-800/30 border border-white/5 h-9 sm:h-10 rounded-xl flex items-center justify-center text-[9px] sm:text-[10px] text-slate-500 text-center px-1 overflow-hidden"></div>
<div class="bg-slate-800/30 border border-white/5 h-9 sm:h-10 rounded-xl flex items-center justify-center text-[9px] sm:text-[10px] text-slate-500 text-center px-1 overflow-hidden"></div>
<div class="bg-slate-800/30 border border-white/5 h-9 sm:h-10 rounded-xl flex items-center justify-center text-[9px] sm:text-[10px] text-slate-500 text-center px-1 overflow-hidden"></div>
<div class="bg-slate-800/30 border border-white/5 h-9 sm:h-10 rounded-xl flex items-center justify-center text-[9px] sm:text-[10px] text-slate-500 text-center px-1 overflow-hidden"></div>
</div>
<div id="mock-ui-p2" class="flex gap-3 w-full justify-center mt-4 opacity-0 hidden transition-opacity duration-300">
<div class="px-5 py-1.5 bg-blue-600 text-white rounded-lg text-[10px] sm:text-xs font-bold shadow-md" id="mock-btn-know">认识</div>
<div class="px-5 py-1.5 bg-slate-700 text-slate-300 rounded-lg text-[10px] sm:text-xs shadow-md">不认识</div>
</div>
<div id="mock-ui-p3" class="w-full flex flex-col items-center opacity-0 hidden transition-opacity duration-300">
<p id="mock-def" class="text-slate-500 text-[10px] sm:text-sm italic mb-6 sm:mb-8 h-8 overflow-hidden leading-snug">n. 公告,宣告;发表;判决</p>
<div class="w-full max-w-[180px] sm:max-w-[220px] h-10 sm:h-11 rounded-xl border flex items-center px-4 shadow-inner relative transition-all duration-500 mock-input">
<span id="mock-input-text" class="font-mono text-sm sm:text-lg tracking-wide text-title"></span>
<div id="mock-cursor" class="w-0.5 h-4 sm:h-5 bg-blue-500 animate-pulse ml-0.5"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Methodology Section -->
<section id="methodology" class="py-24 lg:py-40 relative overflow-hidden">
<div class="content-container text-center">
<h2 class="text-3xl lg:text-4xl font-bold mb-6" data-aos="fade-up">科学阶梯记忆逻辑</h2>
<p class="mb-16 lg:mb-24 max-w-xl mx-auto leading-relaxed text-sm lg:text-base text-main" data-aos="fade-up" data-aos-delay="100">核心采用"三阶段学习法",针对单词在大脑中从"眼熟"到"反射"的演变过程设计。</p>
<div class="grid md:grid-cols-3 gap-6 lg:gap-8">
<div class="feature-card rounded-[2rem] lg:rounded-[2.5rem] text-left group hover:shadow-xl transition-all" data-aos="fade-up" data-aos-delay="200">
<div class="w-12 h-12 lg:w-14 lg:h-14 bg-blue-500/10 rounded-2xl flex items-center justify-center mb-8 lg:mb-10 group-hover:scale-110 transition-transform">
<i class="fas fa-eye text-lg lg:text-xl text-blue-500"></i>
</div>
<h3 class="text-base lg:text-lg font-bold mb-4 tracking-tight">1. 认知激活 (Phase 1)</h3>
<p class="leading-relaxed text-xs lg:text-sm text-main">通过 2x2 网格呈现释义,在干扰项中快速定位正确含义,降低初识单词的挫败感。</p>
</div>
<div class="feature-card rounded-[2rem] lg:rounded-[2.5rem] text-left group hover:shadow-xl transition-all" data-aos="fade-up" data-aos-delay="300">
<div class="w-12 h-12 lg:w-14 lg:h-14 bg-indigo-500/10 rounded-2xl flex items-center justify-center mb-8 lg:mb-10 group-hover:scale-110 transition-transform">
<i class="fas fa-brain text-lg lg:text-xl text-indigo-500"></i>
</div>
<h3 class="text-base lg:text-lg font-bold mb-4 tracking-tight">2. 记忆自测 (Phase 2)</h3>
<p class="leading-relaxed text-xs lg:text-sm text-main">强制闭卷自测。仅凭单词外观回忆释义。记错将直接退回阶段 1 重修,确保记忆真实性。</p>
</div>
<div class="feature-card rounded-[2rem] lg:rounded-[2.5rem] text-left group hover:shadow-xl transition-all" data-aos="fade-up" data-aos-delay="400">
<div class="w-12 h-12 lg:w-14 lg:h-14 bg-emerald-500/10 rounded-2xl flex items-center justify-center mb-8 lg:mb-10 group-hover:scale-110 transition-transform">
<i class="fas fa-keyboard text-lg lg:text-xl text-emerald-500"></i>
</div>
<h3 class="text-base lg:text-lg font-bold mb-4 tracking-tight">3. 拼写精通 (Phase 3)</h3>
<p class="leading-relaxed text-xs lg:text-sm text-main">系统随机隐藏关键字母。只有完成正确拼写输出,才判定该单词为"已学会"。</p>
</div>
</div>
</div>
</section>
<!-- Detailed Features Section -->
<section id="detailed-features" class="py-24 lg:py-40 bg-slate-900/5 dark:bg-slate-900/10">
<div class="content-container">
<div class="text-center mb-20 lg:mb-32">
<h2 class="text-3xl lg:text-4xl font-bold mb-6" data-aos="fade-up">深度功能解析</h2>
<p class="text-sm lg:text-base text-main" data-aos="fade-up" data-aos-delay="100">为您量身定制的四个核心交互模块</p>
</div>
<div class="space-y-32 lg:space-y-48">
<!-- 模块1 -->
<div class="flex flex-col lg:flex-row items-center gap-12 lg:gap-20">
<div class="lg:w-1/2 text-center lg:text-left" data-aos="fade-right">
<h3 class="text-xl lg:text-2xl font-bold mb-6 lg:mb-8 flex items-center justify-center lg:justify-start">
<span class="w-10 h-10 bg-blue-500/20 text-blue-500 rounded-lg flex items-center justify-center mr-4 text-sm"><i class="fas fa-graduation-cap"></i></span>
沉浸式学习界面
</h3>
<p class="mb-8 leading-relaxed text-sm lg:text-base text-main">
左上角配备三颗"认知指示灯",代表单词的三个掌握阶段。通过 QGridLayout 实现的 2x2 释义布局,让您在大面积的可选区域内快速建立语感。
</p>
<div class="grid grid-cols-2 gap-4">
<div class="glass-card p-4 rounded-xl text-left border-blue-500/10">
<span class="text-blue-500 text-[10px] lg:text-xs font-bold block mb-1">指示灯</span>
<p class="text-[9px] lg:text-[10px] leading-tight text-muted">蓝灯代表阶段,透明代表未完成</p>
</div>
<div class="glass-card p-4 rounded-xl text-left border-blue-500/10">
<span class="text-blue-500 text-[10px] lg:text-xs font-bold block mb-1">防错机制</span>
<p class="text-[9px] lg:text-[10px] leading-tight text-muted">错误点击将展示正确释义并退回进度</p>
</div>
</div>
</div>
<div class="lg:w-1/2 w-full" data-aos="fade-left">
<div class="glass-card p-4 rounded-3xl shadow-lg">
<div class="rounded-2xl p-6 sm:p-8 h-56 sm:h-64 flex flex-col shadow-inner mock-bg">
<div class="flex space-x-2 mb-6">
<span class="w-3 h-3 rounded-full bg-blue-600"></span>
<span class="w-3 h-3 rounded-full bg-blue-600"></span>
<span class="w-3 h-3 rounded-full border border-slate-700"></span>
</div>
<div class="flex-grow flex flex-col items-center justify-center">
<h4 class="text-xl sm:text-2xl font-bold mb-6 sm:mb-8 text-title">Vocabulary</h4>
<div class="grid grid-cols-2 gap-2 sm:gap-3 w-full max-w-sm">
<div class="bg-blue-600/90 h-9 sm:h-10 rounded-xl flex items-center justify-center text-[9px] sm:text-[10px] font-bold text-white">n. 词汇量</div>
<div class="bg-slate-800/20 h-9 sm:h-10 rounded-xl flex items-center justify-center text-[9px] sm:text-[10px] text-slate-500">v. 改变</div>
<div class="bg-slate-800/20 h-9 sm:h-10 rounded-xl flex items-center justify-center text-[9px] sm:text-[10px] text-slate-500">adj. 复杂的</div>
<div class="bg-slate-800/20 h-9 sm:h-10 rounded-xl flex items-center justify-center text-[9px] sm:text-[10px] text-slate-500">n. 结果</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- 模块2 -->
<div class="flex flex-col lg:flex-row-reverse items-center gap-12 lg:gap-20">
<div class="lg:w-1/2 text-center lg:text-left" data-aos="fade-left">
<h3 class="text-xl lg:text-2xl font-bold mb-6 lg:mb-8 flex items-center justify-center lg:justify-start">
<span class="w-10 h-10 bg-emerald-500/20 text-emerald-500 rounded-lg flex items-center justify-center mr-4 text-sm"><i class="fas fa-vial"></i></span>
高压测试系统
</h3>
<p class="mb-8 leading-relaxed text-sm lg:text-base text-main">
模拟考场真实体验。独有的"计分板"实时计算正确率,精确至 0.00%。配备"下一题"与"提交"双触发逻辑,防止误点。
</p>
<ul class="space-y-4 text-xs lg:text-sm text-left inline-block lg:block text-main">
<li class="flex items-center"><i class="fas fa-check text-emerald-500 mr-3"></i> <b>实时计分</b>:正确 / 总数 (百分比)</li>
<li class="flex items-center"><i class="fas fa-check text-emerald-500 mr-3"></i> <b>填空提示</b>:基于 wordWrap 优化的提示展示</li>
</ul>
</div>
<div class="lg:w-1/2 w-full" data-aos="fade-right">
<div class="glass-card p-4 rounded-3xl shadow-lg">
<div class="rounded-2xl p-6 lg:p-8 h-56 sm:h-64 flex flex-col text-center shadow-inner mock-bg">
<div class="flex-grow flex flex-col items-center justify-center">
<h4 class="text-xl sm:text-2xl font-bold text-blue-500 mb-3 tracking-[0.2em]">S _ e _ i _ i c</h4>
<p class="text-[10px] mb-6 sm:mb-8 leading-tight text-muted">adj. 具体的,明确的</p>
<div class="w-full max-w-[150px] sm:max-w-[180px] h-9 sm:h-10 border rounded-xl mb-6 sm:mb-8 flex items-center justify-center shadow-inner mock-input"><span class="animate-pulse text-white">|</span></div>
<div class="text-emerald-500 text-[11px] sm:text-sm font-bold tracking-tight">Score: 8 / 10 (80.00%)</div>
</div>
</div>
</div>
</div>
</div>
<!-- 模块3 -->
<div class="flex flex-col lg:flex-row items-center gap-12 lg:gap-20">
<div class="lg:w-1/2 text-center lg:text-left" data-aos="fade-right">
<h3 class="text-xl lg:text-2xl font-bold mb-6 lg:mb-8 flex items-center justify-center lg:justify-start">
<span class="w-10 h-10 bg-amber-500/20 text-amber-500 rounded-lg flex items-center justify-center mr-4 text-sm"><i class="fas fa-cog"></i></span>
设置与数据管理
</h3>
<p class="mb-8 leading-relaxed text-sm lg:text-base text-main">
支持 AppData 分离式存储,完美解决权限问题。集成的"下载中心"拥有动态 GIF 加载动画,支持从 GitHub 仓库自动更新最新版本词库。
</p>
<div class="flex flex-col gap-3 max-w-xs mx-auto lg:mx-0 text-left">
<div class="flex items-center text-xs text-main"><i class="fas fa-check text-amber-500 mr-3"></i> 彩色统计:蓝(学)、橙(复)、绿(测)</div>
<div class="flex items-center text-xs text-main"><i class="fas fa-check text-amber-500 mr-3"></i> AppData 架构完美隔离系统资源</div>
</div>
</div>
<div class="lg:w-1/2 w-full" data-aos="fade-left">
<div class="glass-card p-6 sm:p-10 rounded-3xl shadow-2xl">
<div class="space-y-6 sm:space-y-8 text-left">
<div class="space-y-2 sm:space-y-3">
<div class="flex justify-between text-[9px] sm:text-[10px] font-bold uppercase tracking-wider text-muted"><span>Learning Progress</span><span>85%</span></div>
<div class="progress-mock"><div class="progress-inner bg-blue-600 w-[85%]"></div></div>
</div>
<div class="space-y-2 sm:space-y-3">
<div class="flex justify-between text-[9px] sm:text-[10px] font-bold uppercase tracking-wider text-muted"><span>Review Rate</span><span>42%</span></div>
<div class="progress-mock"><div class="progress-inner bg-amber-600 w-[42%]"></div></div>
</div>
<div class="space-y-2 sm:space-y-3">
<div class="flex justify-between text-[9px] sm:text-[10px] font-bold uppercase tracking-wider text-muted"><span>Test Accuracy</span><span>10%</span></div>
<div class="progress-mock"><div class="progress-inner bg-emerald-600 w-[10%]"></div></div>
</div>
<div class="flex gap-2 sm:gap-3 mt-8 lg:mt-10">
<div class="flex-1 bg-slate-400/20 p-2 sm:p-3 rounded-xl text-center text-[9px] sm:text-[10px] text-main">导入 CSV/JSON</div>
<div class="flex-1 bg-blue-600 p-2 sm:p-3 rounded-xl text-center text-[9px] sm:text-[10px] font-bold text-white shadow-lg">云端下载词库</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- OTA 更新 -->
<section id="update-mechanism" class="py-24 lg:py-40 relative">
<div class="content-container">
<div class="text-center mb-16 lg:mb-24">
<h2 class="text-3xl lg:text-4xl font-bold mb-6" data-aos="fade-up">始终保持最新状态</h2>
<p class="text-sm lg:text-base max-w-2xl mx-auto text-main" data-aos="fade-up" data-aos-delay="100">
LearnWord 内置智能更新引擎,基于云端 Manifest 校验,无需手动重新下载安装包,即可享受最新特性。
</p>
</div>
<div class="grid md:grid-cols-3 gap-8 relative">
<!-- Step 1 -->
<div class="glass-card p-8 rounded-3xl relative z-10" data-aos="fade-up" data-aos-delay="200">
<div class="w-14 h-14 bg-blue-600/20 text-blue-500 rounded-2xl flex items-center justify-center mb-6 text-xl"><i class="fas fa-search"></i></div>
<h3 class="text-lg font-bold mb-3">1. 启动即检测</h3>
<p class="text-xs leading-relaxed text-muted">每次启动时,程序会自动请求 GitHub 上的 <code>update_manifest.json</code> 配置文件。</p>
</div>
<!-- Step 2 -->
<div class="glass-card p-8 rounded-3xl relative z-10" data-aos="fade-up" data-aos-delay="300">
<div class="w-14 h-14 bg-indigo-600/20 text-indigo-500 rounded-2xl flex items-center justify-center mb-6 text-xl"><i class="fas fa-cloud-download-alt"></i></div>
<h3 class="text-lg font-bold mb-3">2. 智能差分对比</h3>
<p class="text-xs leading-relaxed text-muted">对比本地版本号。若有新版本,将展示更新公告,并从安全 CDN 节点获取最新构建。</p>
</div>
<!-- Step 3 -->
<div class="glass-card p-8 rounded-3xl relative z-10" data-aos="fade-up" data-aos-delay="400">
<div class="w-14 h-14 bg-emerald-600/20 text-emerald-500 rounded-2xl flex items-center justify-center mb-6 text-xl"><i class="fas fa-magic"></i></div>
<h3 class="text-lg font-bold mb-3">3. 一键无缝覆盖</h3>
<p class="text-xs leading-relaxed text-muted">自动替换核心可执行文件并保留所有学习数据。整个过程无需繁琐的"下一步"安装流程。</p>
</div>
<!-- 装饰背景线条 -->
<div class="hidden md:block absolute top-1/2 left-0 w-full h-px bg-gradient-to-r from-transparent via-blue-500/20 to-transparent -translate-y-1/2 z-0"></div>
</div>
<!-- 数据安全提示 - 优化了日间模式配色 -->
<div class="mt-12 p-6 glass-card rounded-2xl border-emerald-500/10 flex items-start gap-4 max-w-3xl mx-auto shadow-sm shadow-emerald-500/5" data-aos="fade-up">
<i class="fas fa-shield-alt text-emerald-500 mt-1 flex-shrink-0"></i>
<div class="text-xs leading-relaxed text-main">
<b class="text-emerald-500 block mb-1 font-bold">学习数据安全:</b>
更新仅针对软件核心组件。您的所有学习进度、收藏词库均存储在独立的数据目录(AppData)中,更新过程中绝不会被篡改或丢失。
</div>
</div>
</div>
</section>
<!-- 版本记录 -->
<section id="changelog" class="py-24 lg:py-40 relative bg-slate-900/5 dark:bg-slate-900/10">
<div class="content-container">
<div class="text-center mb-16 lg:mb-24">
<h2 class="text-3xl lg:text-4xl font-bold mb-6" data-aos="fade-up">最新版本特性</h2>
<p class="text-sm lg:text-base text-main" data-aos="fade-up" data-aos-delay="100">实时从 GitHub Release 自动同步更新记录</p>
</div>
<div class="max-w-4xl mx-auto glass-card rounded-[2rem] p-8 lg:p-12 shadow-2xl relative overflow-hidden" data-aos="fade-up">
<div class="absolute top-0 right-0 p-6 opacity-[0.03] pointer-events-none"><i class="fab fa-github text-9xl" style="color: var(--text-title)"></i></div>
<div id="changelog-loading" class="py-20 text-center">
<div class="inline-block w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mb-4"></div>
<p class="text-sm" style="color: var(--text-muted)">正在获取更新日志...</p>
</div>
<div id="changelog-content" class="opacity-0 transition-opacity duration-700 hidden">
<div class="flex flex-col sm:flex-row sm:items-center justify-between mb-10 pb-6 border-b border-slate-200 dark:border-white/5">
<div class="mb-4 sm:mb-0 text-left">
<span id="release-tag" class="bg-blue-600 text-white px-3 py-1 rounded-lg text-xs font-bold mr-3 shadow-md">v1.1.0</span>
<span id="release-date" class="text-sm tracking-tight" style="color: var(--text-muted)">Released on 2025-12-27</span>
</div>
<a id="release-url" href="#" target="_blank" class="text-blue-500 hover:text-blue-600 text-sm font-semibold flex items-center transition-colors">在 GitHub 上查看 <i class="fas fa-external-link-alt ml-2 text-xs"></i></a>
</div>
<div id="release-body" class="markdown-body leading-relaxed text-sm sm:text-base text-left overflow-y-auto max-h-[400px] pr-4 custom-scrollbar"></div>
</div>
<div id="changelog-error" class="py-20 text-center hidden">
<p class="text-rose-500 mb-6" id="changelog-error-msg">无法获取更新日志</p>
<a href="https://github.com/Junpgle/LearnWord/releases" target="_blank" class="bg-blue-600 text-white px-6 py-2.5 rounded-xl text-sm font-bold shadow-lg hover:bg-blue-500 transition-colors inline-block">手动查看 GitHub Releases</a>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="py-16 lg:py-24 border-t border-slate-200 dark:border-white/5 relative z-10 bg-slate-50 dark:bg-transparent">
<div class="content-container text-center">
<div class="flex justify-center space-x-8 lg:space-x-12 mb-10 lg:mb-14">
<a href="https://github.com/Junpgle/LearnWord" target="_blank" class="hover:text-blue-500 transition-colors text-muted"><i class="fab fa-github text-xl lg:text-2xl"></i></a>
<a href="https://github.com/Junpgle/LearnWord/releases" target="_blank" class="hover:text-blue-500 transition-colors text-[10px] lg:text-xs font-bold tracking-widest uppercase text-muted">Releases</a>
<a href="./register.html" class="hover:text-blue-500 transition-colors text-[10px] lg:text-xs font-bold tracking-widest uppercase text-muted">Web Console</a>
</div>
<p class="text-[10px] lg:text-xs tracking-wide text-muted">© 2025 LearnWord Project. Designed by Junpgle.</p>
</div>
</footer>
<script>
// --- 1. 配置信息 (请确保这里与 register.html 一致) ---
const APP_ID = "5wPsbnakcoOjfaPzfC44vfW5-gzGzoHsz";
const APP_KEY = "j9qbdfjiJAPsqbGUy04COFTD";
const SERVER_URL = "https://5wpsbnak.lc-cn-n1-shared.com";
// 初始化 SDK
AV.init({ appId: APP_ID, appKey: APP_KEY, serverURL: SERVER_URL });
// --- 2. 核心状态同步逻辑 ---
function syncLoginStatus() {
const currentUser = AV.User.current();
if (currentUser) {
// 1. 同步桌面导航栏
const navAuthBtn = document.getElementById('nav-auth-link');
if (navAuthBtn) {
navAuthBtn.innerHTML = `
<div class="flex items-center space-x-2 bg-blue-600/10 px-3 py-1.5 rounded-lg border border-blue-500/20 text-blue-500">
<i class="fas fa-user-circle"></i>
<span>${currentUser.getUsername()}</span>
</div>
`;
}
// 2. 同步 Hero 区域大按钮
const heroAuthBtn = document.getElementById('hero-auth-btn');
if (heroAuthBtn) {
heroAuthBtn.innerHTML = '<i class="fas fa-chart-line mr-2 text-lg"></i>查看学习进度';
heroAuthBtn.classList.add('bg-blue-600', 'text-white');
heroAuthBtn.classList.remove('border-white/10', 'hover:bg-blue-600/10');
heroAuthBtn.style.color = 'white';
}
// 3. 同步移动端菜单
const mobileAuthLink = document.getElementById('mobile-auth-link');
if (mobileAuthLink) {
mobileAuthLink.innerHTML = `<i class="fas fa-user-circle mr-2"></i>我的控制台`;
}
}
}
// --- 3. 原有 UI 交互逻辑 (AOS, Typed, etc.) ---
document.addEventListener('DOMContentLoaded', () => {
AOS.init({ duration: 1000, once: true, offset: 30, easing: 'ease-out-expo' });
// 初始化背景
initNeuralBg();
animateNeuralBg();
checkPlatform();
// 执行登录同步
syncLoginStatus();
new Typed('#typed-text', {
strings: ['从未如此高效', '竟然如此简单', '只需三个阶段', '支持离线使用'],
typeSpeed: 80, backSpeed: 50, backDelay: 2000, loop: true
});
// 获取版本号并更新下载链接
fetch('https://raw.githubusercontent.com/Junpgle/LearnWord/refs/heads/master/update_manifest.json')
.then(r => r.json())
.then(d => {
if(d.latest_version) document.getElementById('version-badge').innerText = `${d.latest_version} STABLE NOW AVAILABLE`;
if (d.download_url) {
document.querySelectorAll('.download-link').forEach(link => {
if (!link.classList.contains('cursor-not-allowed')) link.href = d.download_url;
});
}
}).catch(() => {});
});
// 神经网络背景引擎 (省略重复的绘图代码块,实际代码应包含之前的完整逻辑)
// ... 此处保留你 index.html 中 Particle 类和 initNeuralBg 函数 ...
const canvas = document.getElementById('neural-bg');
const ctx = canvas.getContext('2d', { alpha: true });
let particles = [];
const words = ['Cognition', 'Neural', 'Language', 'Memorize', 'Efficiency', 'Pattern', 'Knowledge', 'Brain', 'Mastery', 'Logic', 'Sync', 'Data', 'Structure', 'Lexicon', 'Fluent', 'Syntax'];
// 逻辑宽高(用于计算位置),与物理宽高分离,防止拉伸
let logicalWidth, logicalHeight;
class Particle {
constructor() {
this.word = words[Math.floor(Math.random() * words.length)];
this.size = Math.random() * 10 + 35;
this.padding = 20;
this.alpha = Math.random() * 0.15 + 0.02;
// 使用逻辑字体大小进行测量,因为 ctx 已被缩放
ctx.font = `700 ${this.size}px Inter, sans-serif`;
this.textWidth = ctx.measureText(this.word).width;
this.boxW = this.textWidth + this.padding * 2.5;
this.boxH = this.size + this.padding * 1.5;
this.findSafePosition();
this.angle = Math.random() * Math.PI * 2;
this.speed = Math.random() * 0.003 + 0.002;
this.range = Math.random() * 6 + 2;
}
findSafePosition() {
let attempts = 0;
let found = false;
const margin = 20;
while (attempts < 100 && !found) {
const edgePadding = 50;
// 使用 logicalWidth/Height 生成位置,确保在可见区域内
this.baseX = edgePadding + Math.random() * (logicalWidth - edgePadding * 2);
this.baseY = edgePadding + Math.random() * (logicalHeight - edgePadding * 2);
let overlap = false;
for (let p of particles) {
const dx = Math.abs(this.baseX - p.baseX);
const dy = Math.abs(this.baseY - p.baseY);
const minDx = (this.boxW + p.boxW) / 2 + margin;
const minDy = (this.boxH + p.boxH) / 2 + margin;
if (dx < minDx && dy < minDy) {
overlap = true;
break;
}
}
if (!overlap) found = true;
attempts++;
}
this.x = this.baseX;
this.y = this.baseY;
}
update() {
this.angle += this.speed;
this.x = this.baseX + Math.cos(this.angle) * this.range;
this.y = this.baseY + Math.sin(this.angle * 0.8) * this.range;
}
draw() {
const isLight = document.body.classList.contains('light-theme');
const dxFromCenter = Math.abs(this.x - logicalWidth / 2) / (logicalWidth / 2);
const spatialAlpha = Math.max(0.2, Math.pow(dxFromCenter, 0.5));
ctx.save();
ctx.translate(this.x, this.y);
ctx.beginPath();
ctx.roundRect(-this.boxW/2, -this.boxH/2, this.boxW, this.boxH, this.boxH/2);
ctx.fillStyle = isLight ? `rgba(255, 255, 255, ${this.alpha * 0.6 * spatialAlpha})` : `rgba(255, 255, 255, 0.05 * spatialAlpha)`;
ctx.fill();
ctx.strokeStyle = isLight ? `rgba(0, 120, 215, ${this.alpha * 1.2 * spatialAlpha})` : `rgba(255, 255, 255, ${this.alpha * 0.5 * spatialAlpha})`;
ctx.lineWidth = 1;
ctx.stroke();
ctx.font = `700 ${this.size}px Inter, sans-serif`;
ctx.fillStyle = isLight ? `rgba(0, 120, 215, ${this.alpha * 2.5 * spatialAlpha})` : `rgba(148, 163, 184, ${this.alpha * 2.5 * spatialAlpha})`;
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.fillText(this.word, 0, 3);
ctx.restore();
}
}
function initNeuralBg() {
// 获取设备像素比,处理高清屏模糊
const dpr = window.devicePixelRatio || 1;
// 记录逻辑宽高(CSS像素)
logicalWidth = window.innerWidth;
logicalHeight = window.innerHeight;
// 设置画布的物理像素大小
canvas.width = logicalWidth * dpr;
canvas.height = logicalHeight * dpr;
// 强制设置 CSS 大小,防止拉伸变形
canvas.style.width = `${logicalWidth}px`;
canvas.style.height = `${logicalHeight}px`;
// 缩放绘图上下文,使绘图操作只需关注逻辑坐标
ctx.scale(dpr, dpr);
particles = [];
// 基于逻辑面积计算粒子数量
const count = Math.floor((logicalWidth * logicalHeight) / 130000);
for (let i = 0; i < Math.max(count, 8); i++) {
particles.push(new Particle());
}
}
function animateNeuralBg() {
// 清除逻辑区域
ctx.clearRect(0, 0, logicalWidth, logicalHeight);
const isLight = document.body.classList.contains('light-theme');
ctx.lineCap = 'round';
ctx.lineWidth = 6;
for (let i = 0; i < particles.length; i++) {
let connections = 0;
for (let j = i + 1; j < particles.length && connections < 2; j++) {
const dx = particles[i].x - particles[j].x;
const dy = particles[i].y - particles[j].y;
const distSq = dx * dx + dy * dy;
const maxDist = 350;
if (distSq < maxDist * maxDist) {
const dist = Math.sqrt(distSq);
const alpha = (1 - dist / maxDist) * 0.2 * Math.min(particles[i].alpha, particles[j].alpha);
const centerWeight = (Math.abs(particles[i].x + particles[j].x - logicalWidth) / logicalWidth);
ctx.beginPath();
ctx.strokeStyle = isLight ? `rgba(0, 120, 215, ${alpha * 2 * centerWeight})` : `rgba(255, 255, 255, ${alpha * 1.5 * centerWeight})`;
ctx.moveTo(particles[i].x, particles[i].y);
ctx.lineTo(particles[j].x, particles[j].y);
ctx.stroke();
connections++;
}
}
}
particles.forEach(p => { p.update(); p.draw(); });
requestAnimationFrame(animateNeuralBg);
}
// 平台检测函数
function checkPlatform() {
const isWindows = navigator.platform.indexOf('Win') > -1 || /Windows/i.test(navigator.userAgent);
if (!isWindows) {
document.querySelectorAll('.download-link').forEach(btn => {
// 移除链接,防止跳转
btn.removeAttribute('href');
// 样式变更:灰色、禁用光标
btn.classList.replace('bg-blue-600', 'bg-slate-700');
btn.classList.replace('hover:bg-blue-700', 'hover:bg-slate-600'); // 移除原有 hover
btn.classList.replace('hover:bg-blue-500', 'hover:bg-slate-600');
btn.classList.remove('shadow-blue-600/30'); // 移除蓝色阴影
btn.classList.add('cursor-not-allowed', 'opacity-80', 'shadow-none');
// 覆盖文字内容时,只在 download-link 上覆盖
const text = btn.id.includes('hero') ? ' Windows 下载' : 'Windows 下载';
btn.innerHTML = `<i class="fas fa-clock mr-2"></i> 敬请期待 (${text})`;
// 添加点击提示
btn.onclick = (e) => {
e.preventDefault();
};
});
}
}
window.addEventListener('resize', initNeuralBg);
// UI 交互
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
const href = this.getAttribute('href');
if (href === '#') return;
e.preventDefault();
const target = document.getElementById(href.substring(1));
if (target) {
window.scrollTo({ top: target.offsetTop - 80, behavior: 'smooth' });
document.getElementById('mobile-menu').classList.remove('active');
}
});
});
document.getElementById('logo-btn').addEventListener('click', () => window.scrollTo({ top: 0, behavior: 'smooth' }));
document.getElementById('menu-toggle').addEventListener('click', () => document.getElementById('mobile-menu').classList.toggle('active'));
const themeToggle = document.getElementById('theme-toggle');
function setTheme(isLight) {
const icon = themeToggle.querySelector('i');
if (isLight) {
document.body.classList.add('light-theme');
icon.classList.replace('fa-moon', 'fa-sun');
localStorage.setItem('theme', 'light');
} else {
document.body.classList.remove('light-theme');
icon.classList.replace('fa-sun', 'fa-moon');
localStorage.setItem('theme', 'dark');
}
}
themeToggle.addEventListener('click', () => setTheme(!document.body.classList.contains('light-theme')));
new Typed('#typed-text', {
strings: ['从未如此高效', '竟然如此简单', '只需三个阶段', '支持离线使用'],
typeSpeed: 80, backSpeed: 50, backDelay: 2000, loop: true
});
const mockWords = [
{ word: 'Announcement', cloze: 'A_an_o_ment', def: 'n. 公告,宣告;发表;判决' },
{ word: 'Accomplish', cloze: 'A_c_o_pl_sh', def: 'v. 完成,实现;达到' },
{ word: 'Vocabulary', cloze: 'V_c_b_u_ary', def: 'n. 词汇,词汇量' }
];
const distractors = ["v. 实现,完成", "n. 架构,框架", "adj. 神经的", "n. 词汇量", "v. 同步数据", "n. 逻辑分析"];
let wordIdx = 0;
async function runMockSimulation() {
const item = mockWords[wordIdx];
const indicators = document.querySelectorAll('#mock-indicators span');
const phaseLabel = document.getElementById('mock-phase-label');
const mainWord = document.getElementById('mock-main-word');
const p1 = document.getElementById('mock-ui-p1');
const p2 = document.getElementById('mock-ui-p2');
const p3 = document.getElementById('mock-ui-p3');
const inputText = document.getElementById('mock-input-text');
const mockDef = document.getElementById('mock-def');
const sleep = ms => new Promise(res => setTimeout(res, ms));
const showUI = (el) => {
[p1, p2, p3].forEach(u => { u.classList.add('hidden'); u.classList.remove('opacity-100'); });
el.classList.remove('hidden');
setTimeout(() => el.classList.add('opacity-100'), 50);
};
// Phase 1: Recognition
indicators.forEach((s, i) => s.style.backgroundColor = i < 1 ? 'var(--primary)' : 'transparent');
phaseLabel.innerText = "Phase 1: Recognition";
mainWord.innerText = item.word;
const p1Options = document.querySelectorAll('#mock-ui-p1 > div');
const correctIdx = Math.floor(Math.random() * 4);
p1Options.forEach((opt, i) => {
opt.classList.remove('text-blue-500', 'bg-blue-600/20', 'border-blue-500/30');
if (i === correctIdx) {
opt.innerText = item.def.split(';')[0].split(',')[0];
} else {
opt.innerText = distractors[Math.floor(Math.random() * distractors.length)];
}
});
showUI(p1);
await sleep(1800);
p1Options[correctIdx].classList.add('text-blue-500', 'bg-blue-600/20', 'border-blue-500/30');
await sleep(700);
// Phase 2: Self-Test
indicators.forEach((s, i) => s.style.backgroundColor = i < 2 ? 'var(--primary)' : 'transparent');
phaseLabel.innerText = "Phase 2: Self-Test";
showUI(p2);
await sleep(1500);
// Phase 3: Output
indicators.forEach((s, i) => s.style.backgroundColor = i < 3 ? 'var(--primary)' : 'transparent');
phaseLabel.innerText = "Phase 3: Output";
mainWord.innerText = item.cloze;
mockDef.innerText = item.def;
showUI(p3);
inputText.innerText = '';
await sleep(800);
for (let char of item.word) { inputText.innerText += char; await sleep(150); }
await sleep(3000);
wordIdx = (wordIdx + 1) % mockWords.length;
runMockSimulation();
}
async function fetchLatestChangelog() {
const loading = document.getElementById('changelog-loading');
const content = document.getElementById('changelog-content');
try {
const response = await fetch(`https://api.github.com/repos/Junpgle/LearnWord/releases/latest`);
if (!response.ok) throw new Error();
const data = await response.json();
document.getElementById('release-tag').innerText = data.tag_name;
document.getElementById('release-date').innerText = `Released on ${new Date(data.published_at).toLocaleDateString()}`;
document.getElementById('release-url').href = data.html_url;
document.getElementById('release-body').innerHTML = marked.parse(data.body || "暂无描述");
loading.classList.add('hidden'); content.classList.remove('hidden');
setTimeout(() => content.classList.add('opacity-100'), 50);
} catch (err) {
loading.classList.add('hidden'); document.getElementById('changelog-error').classList.remove('hidden');
}
}
document.addEventListener('DOMContentLoaded', () => {
const savedTheme = localStorage.getItem('theme');
if (savedTheme) setTheme(savedTheme === 'light');
else setTheme(new Date().getHours() >= 6 && new Date().getHours() < 18);
// 初始化背景
initNeuralBg();
animateNeuralBg();
// 执行平台检测
checkPlatform();
runMockSimulation();
fetchLatestChangelog();
fetch('https://raw.githubusercontent.com/Junpgle/LearnWord/refs/heads/master/update_manifest.json')
.then(r => r.json())
.then(d => {
if(d.latest_version) document.getElementById('version-badge').innerText = `${d.latest_version} STABLE NOW AVAILABLE`;
// 修复:同步解析下载链接到所有下载按钮
if (d.download_url) {
document.querySelectorAll('.download-link').forEach(link => {
// 仅当按钮未被禁用时更新链接(避免覆盖“敬请期待”逻辑)
if (!link.classList.contains('cursor-not-allowed')) {
link.href = d.download_url;
}
});
}
})
.catch(() => {});
});
// 在 index.html 的脚本中加入
document.addEventListener('DOMContentLoaded', () => {
// 确保 LeanCloud SDK 已初始化
const currentUser = AV.User.current();
if (currentUser) {