-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
7765 lines (6855 loc) · 319 KB
/
index.html
File metadata and controls
7765 lines (6855 loc) · 319 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>AI智能模型聚合平台</title>
<!-- 外部资源 -->
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Markdown支持和代码高亮 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.3.0/marked.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/github-dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<!-- MathJax支持数学公式 - 使用更稳定的cdnjs CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js" integrity="sha512-jLi06pRmlzJmhBg4Gr/xFpma/lttqYfH7mk883d+082+1OZf3lA1xRQnCxiF8wxoFbUxX4oWdVFR5qQzb1J4g==" crossorigin="anonymous" referrerpolicy="no-referrer" onerror="console.warn('MathJax加载失败,尝试备用源'); document.write('<script src=\'https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/tex-mml-chtml.min.js\'><\/script>');"></script>
<!-- KaTeX支持带框公式 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" integrity="sha512-SQM9srqVQJZF8SPDp63sj3Z/uW6Y9EuLjXn1Juxi8J7Xw72JQbI5S4nJrK/s22pzAXdCxVG7Qo139VnEeSW3eA==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.js" integrity="sha512-lHtKpAv9uV1e36RQJx9U+ZQ27jXp264i8fKc+0T9vRJYt2+3q54gXxY+5M8Wq19nWgKqf+10O6X4uQw0J0XUQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- 公式渲染增强器 -->
<script src="formula-enhancer.js"></script>
<!-- 公式样式 -->
<style>
/* 全局样式重置,确保背景能完整覆盖浏览器窗口 */
html, body {
margin: 0;
padding: 0;
height: 100%;
min-height: 100vh;
overflow-x: hidden;
}
/* 确保公式前后有空行 */
.katex-display {
margin: 1rem 0 !important;
}
/* 列表项内的公式特殊处理,确保前后有足够的空白 */
li .katex-display,
.list-item .katex-display {
margin: 1rem 0 !important;
display: block;
}
/* 防止公式嵌套HTML标签导致的渲染问题 */
.katex-display * {
all: revert;
}
/* 增强公式可读性 */
.katex {
font-size: 1.1em !important;
}
/* 增强带框公式的显示效果 */
.katex .mord.boxed {
border: 1px solid #333;
background-color: #f8f8f8;
padding: 0.1em 0.3em;
border-radius: 3px;
}
/* 确保带框公式在不同上下文中都有良好的显示效果 */
.inline-block.mx-1 .katex-display {
display: inline-block;
margin: 0 !important;
}
/* 毛玻璃效果样式 */
:root {
--header-opacity: 0.2;
--bottom-opacity: var(--header-opacity); /* 底部栏透明度与顶部栏保持一致 */
--glass-blur: 8px; /* 默认值与背景模糊度滑块初始值一致 */
}
#app-header {
background-color: rgba(255, 255, 255, var(--header-opacity));
backdrop-filter: blur(var(--glass-blur));
-webkit-backdrop-filter: blur(var(--glass-blur));
border-bottom: 1px solid rgba(255, 255, 255, 0.18);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
background-image: none;
}
#app-bottom-area {
background-color: rgba(255, 255, 255, var(--bottom-opacity));
backdrop-filter: blur(var(--glass-blur));
-webkit-backdrop-filter: blur(var(--glass-blur));
border-top: 1px solid rgba(255, 255, 255, 0.18);
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
background-image: none;
}
</style>
<!-- Chart.js 用于数据可视化 -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.3.0/chart.umd.min.js"></script>
<!-- Tailwind配置 -->
<script>
tailwind.config = {
theme: {
extend: {
colors: {
kimi: {
blue: '#3B82F6', // Kimi主色调
light: '#EFF6FF', // 浅色背景
dark: '#1E40AF' // 深色文本
},
doubao: {
blue: '#00A0E9', // 豆包主色调
light: '#E8F4FC', // 浅色背景
dark: '#0066B3' // 深色文本
},
tongyi: {
green: '#10B981', // 通义主色调
light: '#D1FAE5', // 浅色背景
dark: '#059669' // 深色文本
},
deepseek: {
purple: '#8B5CF6', // DeepSeek主色调
light: '#EDE9FE', // 浅色背景
dark: '#7C3AED' // 深色文本
},
hunyuan: {
orange: '#FF7A45', // 混元主色调
light: '#FFF1E6', // 浅色背景
dark: '#CF5A27' // 深色文本
}
},
fontFamily: {
sans: ['Inter', 'system-ui', 'sans-serif']
}
}
}
}
</script>
<!-- 自定义样式 -->
<style type="text/tailwindcss">
@layer utilities {
.chat-bubble-user {
@apply bg-blue-500 text-white rounded-lg rounded-tr-none p-4 max-w-[85%] shadow-sm relative;
}
.chat-bubble-ai {
@apply bg-white border border-gray-200 text-gray-800 rounded-lg rounded-tl-none p-4 max-w-[85%] shadow-sm relative;
}
.group:hover .opacity-0 {
opacity: 1;
}
.typing-indicator {
@apply flex space-x-1.5;
}
.typing-indicator span {
@apply h-2.5 w-2.5 rounded-full bg-gray-400 animate-bounce;
}
.typing-indicator span:nth-child(2) {
animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
animation-delay: 0.4s;
}
.chat-container,
.custom-scrollbar {
scrollbar-width: thin;
scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}
/* 阅读模式样式 */
.reading-mode {
background-color: #f8f9fa !important;
color: #333 !important;
}
.reading-mode.dark {
background-color: #000000 !important; /* 纯黑色背景 */
color: #e0e0e0 !important;
}
.reading-mode #app-header,
.reading-mode #app-bottom-area {
background-color: rgba(255, 255, 255, 0.95) !important;
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
}
.reading-mode.dark #app-header,
.reading-mode.dark #app-bottom-area {
background-color: rgba(15, 15, 15, 0.95) !important; /* 深色背景栏 */
}
/* 暗黑模式下header图标亮色 */
.dark #app-header .fa,
.reading-mode.dark #app-header .fa {
color: #f0f0f0 !important; /* 亮色图标 */
}
/* 暗黑模式下header按钮悬停效果 */
.dark #app-header button:hover,
.reading-mode.dark #app-header button:hover {
background-color: rgba(255, 255, 255, 0.15) !important;
}
/* 手机模式下隐藏标题文本,只保留图标 */
@media (max-width: 768px) {
#app-header h1 {
display: none;
}
/* 调整图标的大小以适应手机屏幕 */
#app-header .w-10.h-10 {
width: 36px;
height: 36px;
margin-left: 0;
}
#app-header .fa-bolt {
font-size: 18px;
}
/* 手机模式下调整底部栏图标选择框对齐 */
.flex.flex-wrap.gap-2 {
justify-content: center;
}
.flex.flex-wrap.gap-2 label {
flex: 0 0 calc(50% - 4px); /* 每行显示两个选择框 */
justify-content: center;
text-align: center;
}
}
.reading-mode .model-card {
background-color: white !important;
border: 1px solid #e9ecef;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.reading-mode.dark .model-card {
background-color: #121212 !important; /* 深灰色卡片背景,与黑色形成对比 */
border: 1px solid #222;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.reading-mode .model-content {
font-size: 16px;
line-height: 1.6;
max-height: none !important;
}
.reading-mode.dark .model-content {
color: #e0e0e0;
}
.reading-mode .chat-bubble-ai {
background-color: white !important;
border: 1px solid #e9ecef;
}
.reading-mode.dark .chat-bubble-ai {
background-color: #121212 !important; /* 与卡片背景保持一致 */
border: 1px solid #222;
}
/* 移动端响应式调整 */
@media (max-width: 768px) {
.reading-mode .model-content {
font-size: 18px;
line-height: 1.7;
padding: 1rem;
}
.reading-mode .model-card {
margin: 0.5rem;
border-radius: 12px;
}
}
.chat-container::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
@apply w-2;
}
.chat-container::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
@apply bg-gray-400 rounded-full hover:bg-gray-500 transition-colors;
}
.chat-container::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
@apply bg-gray-100 rounded-full;
}
/* 响应式网格布局 - 自动适应选中的模型数量 */
.model-grid {
@apply grid gap-4 transition-all duration-300;
}
.model-grid.cols-1 {
@apply grid-cols-1;
}
.model-grid.cols-2 {
@apply grid-cols-1 md:grid-cols-2;
}
.model-grid.cols-3 {
@apply grid-cols-1 md:grid-cols-3;
}
.model-grid.cols-4 {
@apply grid-cols-1 md:grid-cols-4;
}
/* 模型卡片样式 */
.model-card {
@apply bg-white rounded-xl shadow-md overflow-hidden transition-all duration-300 hover:shadow-lg;
}
/* 模型头部样式 */
.model-header {
@apply px-4 py-3 flex justify-between items-center border-b border-gray-100;
transition: background-color 0.3s ease;
}
/* 暗黑模式下标题栏卡片颜色 - 在原基础上变深色 */
.dark .model-header {
background-color: rgba(15, 15, 15, 0.8) !important;
border-b-color: rgba(255, 255, 255, 0.1);
}
/* 修复豆包等特定模型在暗黑模式下的标题栏颜色 */
.dark .model-header[style*="background-color"] {
background-color: rgba(15, 15, 15, 0.8) !important;
}
/* 阅读模式下顶部栏按钮样式 */
.reading-mode #app-header button {
color: #333 !important;
}
/* 阅读模式下顶部栏按钮悬停效果 */
.reading-mode #app-header button:hover {
background-color: rgba(0, 0, 0, 0.1) !important;
}
/* 阅读模式暗黑模式下顶部栏按钮样式 */
.reading-mode.dark #app-header button {
color: #f0f0f0 !important;
}
/* 模型内容样式 */
.model-content {
@apply p-4 max-h-[400px] overflow-y-auto custom-scrollbar;
}
/* 模型底部操作栏 */
.model-actions {
@apply px-4 py-3 flex justify-between items-center border-t border-gray-100 bg-gray-50;
}
/* 代码块样式增强 */
.bg-gray-900 {
background-color: #1e293b;
}
.bg-gray-800 {
background-color: #334155;
}
.text-gray-300 {
color: #e2e8f0;
}
/* 代码高亮主题调整 */
pre code.hljs {
padding: 0;
background: transparent;
}
/* 加载动画 */
@keyframes fadeIn {
0% { opacity: 0; transform: scale(0.95); }
100% { opacity: 1; transform: scale(1); }
}
.animate-fadeIn {
animation: fadeIn 0.3s ease-out forwards;
}
/* 引导弹窗样式 */
.guide-modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: white;
border-radius: 16px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
width: 90%;
max-width: 500px;
z-index: 1000;
transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.guide-modal.hidden {
opacity: 0;
transform: translate(-50%, -50%) scale(0.8);
pointer-events: none;
}
.guide-modal-content {
padding: 2rem;
}
.guide-modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
.guide-modal-title {
font-size: 1.5rem;
font-weight: 600;
color: #1f2937;
}
.guide-close-btn {
background: none;
border: none;
color: #6b7280;
font-size: 1.5rem;
cursor: pointer;
padding: 0.25rem;
border-radius: 50%;
transition: all 0.2s;
}
.guide-close-btn:hover {
background-color: #f3f4f6;
color: #374151;
}
.guide-content {
line-height: 1.6;
color: #4b5563;
}
.guide-content h4 {
font-weight: 600;
color: #1f2937;
margin-top: 1rem;
margin-bottom: 0.5rem;
}
.guide-content ul {
padding-left: 1.5rem;
margin-bottom: 1rem;
}
.guide-content li {
margin-bottom: 0.5rem;
}
.guide-content i {
color: #3b82f6;
margin-right: 0.5rem;
}
/* 问号图标样式 */
.help-button {
position: fixed;
bottom: 2rem;
right: 2rem;
width: 60px;
height: 60px;
background-color: #3b82f6;
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
cursor: pointer;
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
transition: all 0.3s ease;
opacity: 0;
transform: scale(0) translate(50%, 50%);
z-index: 999;
}
.help-button.visible {
opacity: 1;
transform: scale(1) translate(0, 0);
}
.help-button:hover {
background-color: #2563eb;
transform: scale(1.1);
box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}
/* 关闭动画 */
@keyframes minimizeToQuestion {
0% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
width: 500px;
height: auto;
border-radius: 16px;
}
70% {
opacity: 0.8;
transform: translate(calc(100vw - 5rem), calc(100vh - 5rem)) scale(0.3);
width: 200px;
height: 200px;
border-radius: 50%;
}
100% {
opacity: 0;
transform: translate(calc(100vw - 3rem), calc(100vh - 3rem)) scale(0);
width: 60px;
height: 60px;
border-radius: 50%;
}
}
.guide-modal.closing {
animation: minimizeToQuestion 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
/* 打开动画 */
@keyframes expandFromQuestion {
0% {
opacity: 0;
transform: translate(calc(100vw - 3rem), calc(100vh - 3rem)) scale(0);
width: 60px;
height: 60px;
border-radius: 50%;
}
30% {
opacity: 0.8;
transform: translate(calc(50vw - 100px), calc(50vh - 100px)) scale(0.3);
width: 200px;
height: 200px;
border-radius: 50%;
}
100% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
width: 500px;
height: auto;
border-radius: 16px;
}
}
.guide-modal.opening {
animation: expandFromQuestion 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
/* 半透明背景 */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
z-index: 998;
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none;
}
.modal-overlay.visible {
opacity: 1;
pointer-events: auto;
}
}
</style>
</head>
<body class="font-sans text-gray-800 min-h-screen flex flex-col">
<!-- 顶部导航栏 -->
<header id="app-header" class="sticky top-0 z-30">
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-lg bg-gradient-to-r from-kimi-blue to-doubao-blue flex items-center justify-center">
<i class="fa fa-bolt text-white text-xl"></i>
</div>
<h1 class="text-xl font-bold bg-gradient-to-r from-kimi-dark to-doubao-dark bg-clip-text text-transparent">AI智能模型聚合平台</h1>
</div>
<div class="flex items-center space-x-4">
<button id="toggle-performance-chart" class="p-2 rounded-full hover:bg-gray-100 transition-colors relative" title="显示/隐藏模型性能对比">
<i class="fa fa-bar-chart text-gray-600"></i>
</button>
<button id="theme-toggle" class="p-2 rounded-full hover:bg-gray-100 transition-colors">
<i class="fa fa-moon-o text-gray-600"></i>
</button>
<button id="reading-mode-btn" class="p-2 rounded-full hover:bg-gray-100 transition-colors" title="阅读模式">
<i class="fa fa-book text-gray-600"></i>
</button>
<button id="history-btn" class="p-2 rounded-full hover:bg-gray-100 transition-colors">
<i class="fa fa-history text-gray-600"></i>
</button>
<button id="background-btn" class="p-2 rounded-full hover:bg-gray-100 transition-colors" title="修改背景">
<i class="fa fa-picture-o text-gray-600"></i>
</button>
<button id="settings-btn" class="p-2 rounded-full hover:bg-gray-100 transition-colors">
<i class="fa fa-cog text-gray-600"></i>
</button>
<div class="w-10 h-10 rounded-full bg-gray-200 overflow-hidden user-avatar-container">
<img id="top-nav-avatar" src="https://picsum.photos/id/64/200/200" alt="用户头像" class="w-full h-full object-cover">
</div>
</div>
</div>
</header>
<!-- 主内容区 -->
<main class="flex-1 flex flex-col pb-24">
<!-- 对话区域 -->
<div id="chat-container" class="flex-1 overflow-y-auto p-4 md:p-6 chat-container">
<!-- 欢迎消息 -->
<div id="welcome-message" class="text-center py-12">
<div class="w-20 h-20 mx-auto rounded-full bg-gradient-to-r from-kimi-blue/10 via-tongyi-green/10 to-deepseek-purple/10 flex items-center justify-center mb-4">
<i class="fa fa-bolt text-blue-500 text-3xl"></i>
</div>
<h2 class="text-2xl font-bold mb-2 bg-clip-text text-transparent bg-gradient-to-r from-blue-600 via-purple-500 to-amber-400" style="animation: gradientMove 4s linear infinite; text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);">欢迎使用 AI 智能模型聚合平台</h2>
<style>
@keyframes gradientMove {
0% { background-position: 0% 50%; }
100% { background-position: 200% 50%; }
}
.bg-gradient-to-r {
background-size: 300% 300%;
background-image: linear-gradient(90deg, #4f46e5, #a855f7, #fbbf24, #4f46e5);
}
</style>
<p id="typing-text" class="text-gray-300 max-w-md mx-auto mb-6 typing-animation">
<span class="typing-cursor">|</span>
</p>
<script>
// 打字效果实现 - 10秒循环一次
document.addEventListener('DOMContentLoaded', function() {
const fullText = '一站式访问多个顶尖AI模型,勾选选择你需要的模型,提交问题后即可同时查看不同模型的回答';
const typingElement = document.getElementById('typing-text');
let cursorElement;
// 检测是否使用了特定的白色背景
function isWhiteBackgroundActive() {
// 获取body的背景样式
const computedStyle = window.getComputedStyle(document.body);
const backgroundColor = computedStyle.backgroundColor;
// 检查是否为白色背景
return backgroundColor === 'rgb(255, 255, 255)' ||
backgroundColor === 'rgba(255, 255, 255, 1)' ||
backgroundColor === '#ffffff' ||
backgroundColor === '#fff';
}
// 更新文本颜色函数
function updateTextColor() {
// 初始化时,字体为深灰色
const textColor = '#4B5563'; // 深灰色
// 更新主元素颜色
typingElement.style.color = textColor;
// 更新光标颜色
if (cursorElement) {
cursorElement.style.color = textColor;
}
// 更新已创建的字符span的颜色
const charSpans = typingElement.querySelectorAll('span:not(.typing-cursor)');
charSpans.forEach(span => {
span.style.color = textColor;
});
}
// 初始化函数
function initTyping() {
// 清空现有内容
typingElement.innerHTML = '<span class="typing-cursor">|</span>';
cursorElement = typingElement.querySelector('.typing-cursor');
// 设置光标闪烁效果
cursorElement.style.animation = 'blink 1s infinite';
// 更新文本颜色
updateTextColor();
// 开始打字
typeText(0);
}
// 打字函数
function typeText(index) {
if (index < fullText.length) {
// 创建一个新的span元素来包含当前字符
const charSpan = document.createElement('span');
charSpan.textContent = fullText.charAt(index);
// 应用当前文本颜色
charSpan.style.color = typingElement.style.color;
// 在光标前插入字符
typingElement.insertBefore(charSpan, cursorElement);
// 设置打字速度(适当加快以适应10秒循环)
const typeSpeed = Math.random() * 30 + 20;
setTimeout(() => typeText(index + 1), typeSpeed);
} else {
// 打字完成后保持光标显示,准备下一次循环
// 计算剩余等待时间,确保总循环时间为10秒
// 假设打字约需要3秒,等待7秒后开始下一次循环
setTimeout(initTyping, 7000);
}
}
// 添加光标闪烁的CSS动画
const style = document.createElement('style');
style.textContent = `
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
.typing-cursor {
display: inline-block;
margin-left: 2px;
color: inherit;
}
`;
document.head.appendChild(style);
// 监听背景设置按钮点击事件
document.addEventListener('click', function(e) {
// 检查是否点击了背景设置按钮
if (e.target.closest('.bg-setting-btn')) {
// 延迟更新,确保背景已经应用
setTimeout(updateTextColor, 100);
}
});
// 开始打字效果
setTimeout(initTyping, 500);
});
</script>
<div class="flex flex-wrap justify-center gap-3">
<span class="px-3 py-1 bg-kimi-blue/10 text-kimi-blue rounded-full text-sm">
<i class="fa fa-check mr-1"></i>Kimi 模型
</span>
<span class="px-3 py-1 bg-doubao-blue/10 text-doubao-blue rounded-full text-sm">
<i class="fa fa-check mr-1"></i>豆包模型
</span>
<span class="px-3 py-1 bg-tongyi-green/10 text-tongyi-green rounded-full text-sm">
<i class="fa fa-check mr-1"></i>通义模型
</span>
<span class="px-3 py-1 bg-deepseek-purple/10 text-deepseek-purple rounded-full text-sm">
<i class="fa fa-check mr-1"></i>DeepSeek 模型
</span>
<span class="px-3 py-1 bg-hunyuan-orange/10 text-hunyuan-orange rounded-full text-sm">
<i class="fa fa-check mr-1"></i>混元模型
</span>
</div>
</div>
<!-- 对话消息将通过JS动态添加到这里 -->
<div id="messages-container" class="space-y-6"></div>
<!-- 模型响应区域 - 自适应列数 -->
<div id="model-responses" class="mt-8 hidden">
<h3 class="text-lg font-semibold mb-4 flex items-center">
<i class="fa fa-bar-chart text-gray-500 mr-2"></i>模型响应对比
</h3>
<div id="responses-grid" class="model-grid cols-2"></div>
</div>
<!-- 底部空白区域 - 占视口高度的1/3 -->
<div class="bottom-spacer" style="height: 33.333vh;"></div>
</div>
</main>
<!-- 底部提问栏 - 参考autorolltobottom.html的隐藏逻辑 -->
<div id="bottomBar" class="fixed bottom-0 left-0 right-0 z-40 transition-transform duration-300 ease-in-out transform translate-y-[calc(100%-40px)]" style="background-color: rgba(255, 255, 255, var(--header-opacity)); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border-top: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);">
<!-- 底部栏触发器(始终可见的部分) -->
<div id="bottomTrigger" class="h-10 flex items-center justify-center cursor-pointer" style="background-color: rgba(255, 255, 255, var(--header-opacity)); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border-top: 1px solid rgba(255, 255, 255, 0.18);">
<i class="fa fa-chevron-up text-gray-500 transition-transform duration-300" id="triggerIcon"></i>
</div>
<!-- 提问框区域 -->
<div id="inputArea" class="p-4" style="background-color: rgba(255, 255, 255, var(--header-opacity)); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border-top: 1px solid rgba(255, 255, 255, 0.18);">
<div class="max-w-4xl mx-auto">
<div class="relative">
<textarea
id="prompt-input"
placeholder="请输入你的问题..."
class="w-full px-4 py-3 pr-48 rounded-xl border border-gray-200 focus:border-kimi-blue focus:ring-2 focus:ring-kimi-blue/20 outline-none transition-all resize-none min-h-[100px]"
></textarea>
<!-- 模型选择下拉框 -->
<div class="absolute right-36 bottom-3 flex space-x-2">
<button id="select-all-models" class="px-3 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors text-sm flex items-center">
<i class="fa fa-check-square-o mr-1"></i>全部
</button>
<button id="deselect-all-models" class="px-3 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors text-sm flex items-center">
<i class="fa fa-square-o mr-1"></i>清空
</button>
</div>
<!-- 上传图片按钮 -->
<button
id="upload-image-btn"
class="absolute right-28 bottom-3 text-gray-500 hover:text-kimi-blue p-2 rounded-full transition-colors"
title="上传图片"
>
<i class="fa fa-image"></i>
</button>
<input
type="file"
id="image-input"
accept="image/*"
class="hidden"
>
<!-- 中断按钮 -->
<button
id="cancel-btn"
class="absolute right-16 bottom-3 bg-red-500 text-white p-2 rounded-full hover:bg-red-600 transition-colors hidden"
title="中断回答"
>
<i class="fa fa-stop"></i>
</button>
<!-- 发送按钮 -->
<button
id="send-btn"
class="absolute right-8 bottom-3 bg-kimi-blue text-white px-4 py-2 rounded-full hover:bg-kimi-dark transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center"
disabled
>
<i class="fa fa-paper-plane mr-1"></i>发送
</button>
<!-- 回到底部按钮已移至引导按钮旁 -->
</div>
<!-- 已上传图片预览区域 -->
<div id="image-preview-container" class="flex flex-wrap gap-2 mt-2 hidden">
<!-- 图片预览将在这里动态生成 -->
</div>
<!-- 模型选择区域 - 添加自动隐藏底部栏复选框和清空对话按钮 -->
<div class="flex flex-wrap justify-between items-center gap-2 mt-3">
<div class="flex flex-wrap gap-2">
<label class="flex items-center px-3 py-1.5 bg-gray-100 rounded-lg cursor-pointer transition-colors hover:bg-gray-200">
<input type="checkbox" id="model-kimi" class="form-checkbox h-4 w-4 text-kimi-blue rounded" checked>
<span class="ml-2 text-sm font-medium">
<i class="fa fa-comment text-kimi-blue mr-1"></i>Kimi
</span>
</label>
<label class="flex items-center px-3 py-1.5 bg-gray-100 rounded-lg cursor-pointer transition-colors hover:bg-gray-200">
<input type="checkbox" id="model-doubao" class="form-checkbox h-4 w-4 text-doubao-blue rounded" checked>
<span class="ml-2 text-sm font-medium">
<i class="fa fa-comment-o text-doubao-blue mr-1"></i>豆包
</span>
</label>
<label class="flex items-center px-3 py-1.5 bg-gray-100 rounded-lg cursor-pointer transition-colors hover:bg-gray-200">
<input type="checkbox" id="model-tongyi" class="form-checkbox h-4 w-4 text-tongyi-green rounded" checked>
<span class="ml-2 text-sm font-medium">
<i class="fa fa-comments text-tongyi-green mr-1"></i>通义
</span>
</label>
<label class="flex items-center px-3 py-1.5 bg-gray-100 rounded-lg cursor-pointer transition-colors hover:bg-gray-200">
<input type="checkbox" id="model-deepseek" class="form-checkbox h-4 w-4 text-deepseek-purple rounded" checked>
<span class="ml-2 text-sm font-medium">
<i class="fa fa-rocket text-deepseek-purple mr-1"></i>DeepSeek
</span>
</label>
<label class="flex items-center px-3 py-1.5 bg-gray-100 rounded-lg cursor-pointer transition-colors hover:bg-gray-200">
<input type="checkbox" id="model-hunyuan" class="form-checkbox h-4 w-4 text-hunyuan-orange rounded" checked>
<span class="ml-2 text-sm font-medium">
<i class="fa fa-fire text-hunyuan-orange mr-1"></i>混元
</span>
</label>
</div>
<div class="flex items-center gap-3">
<!-- 自动隐藏底部栏复选框 -->
<label class="flex items-center text-sm">
<input type="checkbox" id="autoHideCheckbox" class="form-checkbox h-4 w-4 text-kimi-blue rounded" checked>
<span class="ml-2 text-gray-600">自动隐藏底部栏</span>
</label>
<!-- 清空对话按钮 -->
<button id="clear-chat-btn" class="text-sm hover:text-kimi-blue transition-colors">
<i class="fa fa-trash-o mr-1"></i>清空对话
</button>
</div>
</div>
</div>
</div>
</div>
</main>
<!-- 配置模态框 -->
<div id="settings-modal" class="fixed inset-0 bg-black/50 z-50 flex items-center justify-center hidden">
<div class="bg-white rounded-xl shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] flex flex-col transform transition-all">
<div class="p-6 border-b border-gray-200">
<div class="flex justify-between items-center">
<h3 class="text-xl font-bold">AI模型配置</h3>
<button id="close-settings" class="text-gray-500 hover:text-gray-700">
<i class="fa fa-times text-xl"></i>
</button>
</div>
</div>
<div class="p-6 space-y-6 overflow-y-auto flex-1" style="scrollbar-width: thin; scrollbar-color: #e5e7eb transparent;">
<!-- 添加自定义滚动条样式 -->
<style>
.overflow-y-auto::-webkit-scrollbar {
width: 6px;
}
.overflow-y-auto::-webkit-scrollbar-track {
background: transparent;
}
.overflow-y-auto::-webkit-scrollbar-thumb {
background-color: #e5e7eb;
border-radius: 3px;
}
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
background-color: #d1d5db;
}
</style>
<!-- 用户头像设置 -->
<div class="p-4 border border-gray-200 rounded-lg bg-gray-50">
<h4 class="text-lg font-semibold mb-3 text-gray-800 flex items-center">
<i class="fa fa-user text-blue-500 mr-2"></i>用户头像
</h4>
<div style="display: flex; align-items: center;">
<div class="w-14 h-14 rounded-full overflow-hidden mr-4 border-2 border-gray-200">
<img id="settings-avatar" src="https://picsum.photos/id/64/200/200" alt="当前头像" class="w-full h-full object-cover">
</div>
<div>
<p class="text-sm text-gray-600 mb-2">点击更换头像,可以上传自己的照片或使用默认头像</p>
<button id="change-avatar-btn" class="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition-colors">
更换头像
</button>
</div>
</div>
</div>
<!-- Kimi 配置 -->
<div class="p-4 border border-kimi-blue/20 rounded-lg bg-kimi-blue/5">
<h4 class="text-lg font-semibold mb-3 text-kimi-dark flex items-center">
<i class="fa fa-comment text-kimi-blue mr-2"></i>Kimi API 配置
</h4>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">API 密钥</label>
<div class="relative">
<input
type="password"
id="kimi-api-key-input"
class="w-full px-4 py-2.5 rounded-lg border border-gray-200 focus:border-kimi-blue focus:ring-2 focus:ring-kimi-blue/20 outline-none transition-all"
placeholder="sk-..."
>
<button id="toggle-kimi-api-visibility" class="absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition-colors">
<i class="fa fa-eye-slash"></i>
</button>
</div>
<p class="text-xs text-gray-500 mt-1">
请从 <a href="https://platform.moonshot.cn" target="_blank" class="text-kimi-blue hover:underline">Moonshot AI 平台</a> 获取你的 API 密钥
</p>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">模型版本</label>
<select
id="kimi-model-select"
class="w-full px-4 py-2.5 rounded-lg border border-gray-200 focus:border-kimi-blue focus:ring-2 focus:ring-kimi-blue/20 outline-none transition-all bg-white"
>
<option value="kimi-k2-0905-preview">kimi-k2-0905-preview</option>
<option value="kimi-k2-0711-preview">kimi-k2-0711-preview</option>
<option value="kimi-k2-turbo-preview">kimi-k2-turbo-preview</option>
<option value="moonshot-v1-8k">moonshot-v1-8k</option>
<option value="moonshot-v1-32k">moonshot-v1-32k</option>
<option value="moonshot-v1-128k">moonshot-v1-128k</option>
<option value="moonshot-v1-8k-vision-preview">moonshot-v1-8k-vision-preview (视觉模型)</option>
<option value="moonshot-v1-32k-vision-preview">moonshot-v1-32k-vision-preview (视觉模型)</option>
<option value="moonshot-v1-128k-vision-preview">moonshot-v1-128k-vision-preview (视觉模型)</option>
<option value="kimi-latest">kimi-latest</option>
</select>
</div>
</div>
</div>
<!-- 豆包配置 -->
<div class="p-4 border border-doubao-blue/20 rounded-lg bg-doubao-blue/5">
<h4 class="text-lg font-semibold mb-3 text-doubao-dark flex items-center">
<i class="fa fa-comment-o text-doubao-blue mr-2"></i>豆包 API 配置
</h4>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">API 密钥</label>
<div class="relative">
<input
type="password"
id="doubao-api-key-input"
class="w-full px-4 py-2.5 rounded-lg border border-gray-200 focus:border-doubao-blue focus:ring-2 focus:ring-doubao-blue/20 outline-none transition-all"