-
Notifications
You must be signed in to change notification settings - Fork 0
/
index1.html
2037 lines (1660 loc) · 71.5 KB
/
index1.html
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 style="overflow: hidden;">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta charset="UTF-8"/>
<link rel="stylesheet" href="katex/katex.min.css">
<script src="katex/katex.min.js"></script>
<script src="katex/contrib/auto-render.js"></script>
<script>
// 弹出询问框
// var switchToFrontend = confirm("是否切换到新前端?更漂亮的界面");
// // 如果用户点击确定,则跳转到新前端页面
// if (switchToFrontend) {
// }
if (window.location.protocol === 'https:') {
// 构建HTTP的URL
// var httpUrl = 'http://' + window.location.hostname + window.location.pathname + window.location.search + window.location.hash;
// alert(`当前为https,无法正常使用,请修改浏览器地址栏为http,把s去掉。目前为${window.location.href},你需要修改为${httpUrl}`);
// 重定向到HTTP
//window.location.href = httpUrl;
}
function hasScrollbar(element) {
var sevenRemInPixels = parseFloat(getComputedStyle(document.documentElement).fontSize) * 7;
return ((element.scrollHeight - element.clientHeight) > sevenRemInPixels);
}
WIDGET = {
"CONFIG": {
"layout": "1",
"width": "350",
"height": "150",
"language": "zh",
"background": "1",
"dataColor": "FFFFFF",
"city": "",
"key": "1ae5fee1e1d84f37a143a1170f99fd12"
}
}
var isqipao = true;
const urlParams = new URLSearchParams(window.location.search);
var server = "https://phr.hcu.icu/";
var wsserver = "wss://phr.hcu.icu:8080/"
var myVariable = "1号服务器“一生一世”";
if (urlParams.get('server') == "2") {
server = "https://hcu.icu/";
wsserver = "wss://hcu.icu:8080/";
myVariable = "2号服务器“两厢情愿”";
}
let lastFrameTime = performance.now();
function checkPageCrash() {
const currentFrameTime = performance.now();
const frameDuration = currentFrameTime - lastFrameTime;
if (frameDuration > 200 && frameDuration < 500) {
// 页面崩溃,执行刷新操作
showPopup("检测到网站可能发生了错误,要是不对劲那就刷新");
} else {
// 页面正常,继续监测
lastFrameTime = currentFrameTime;
}
requestAnimationFrame(checkPageCrash);
}
// 初始调用
checkPageCrash();
let popupTimeout; // 用于存储 setTimeout 的标识符
function showPopup(text) {
// 清除之前的定时器
if (popupTimeout) {
clearTimeout(popupTimeout);
}
document.getElementById('popup').innerHTML = text;
document.getElementById('popup').style.display = 'block';
// 3秒后销毁弹出提示
popupTimeout = setTimeout(function () {
document.getElementById('popup').style.display = 'none';
}, 3000);
}
</script>
<style>
/* 样式可以根据需要进行调整 */
#popup {
user-select: none;
position: fixed;
top: 10%;
left: 50%;
transform: translate(-50%, -50%);
padding: 15px;
background-color: #ff5656;
color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
z-index: 10000;
display:none;
}
.code_copy{
display: flex;
position: absolute;
z-index: 10;
right: 0;
}
.copy_code{
flex: 10;
}
</style>
<script src="js/new.js?2bn0ds2"></script>
<link id="newcss" rel="stylesheet" href="css/new.css?23">
<script src="js/marked.min.js"></script>
<script src="js/pako_inflate.min.js"></script>
<script src="js/highlight.min.js?14"></script>
<link rel="stylesheet" href="css/if.css">
<link rel="stylesheet" href="css/github.css?l7d1">
<link id="themeStylesheet" rel="stylesheet" href="css/github.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no"/>
<script>
//newcss.href = "css/new.css?" + generateRandomString(10);
var cid = "";
var pid = "";
var model = "";
var cango = true;
if (getc("userid") == "") {
setc("userid", "匿名用户" + generateRandomString(10));
}
if (getc("fontsize1") == "") {
setc("fontsize1", "1.5");
}
var ipv6 = "";
// 定义一个辅助函数,用于发送fetch请求并返回Promise
// 初始化变量
var version, ipv4, music_list;
var succeed_get_base_info=false;
function get_base_info() {
// 使用Promise链执行fetch请求
fetch(server + 'direct1.php?version')
.then(response => response.text())
.then(data => {
version = data;
return fetch('https://phr.hcu.icu/ip')
})
.then(response => response.text())
.then(data => {
ipv4 = data;
return fetch(server + 'direct1.php?music')
})
.then(response => response.json())
.then(data => {
music_list = data.data;
succeed_get_base_info=true;
console.log("基础信息获取完毕");
})
.catch(() => get_base_info());
}
get_base_info();
fetch('https://6.hcu.icu/getip.php')
.then(response => response.text())
.then(data => {
// 在这里处理解析后的数据
ipv6 = data;
console.log(ipv6);
});
marked.use({
gfm: true,
mangle: false,
headerIds: false,
});
</script>
<style>
.katex-display {
overflow-x: auto;
overflow-y: hidden;
}
@keyframes rotateAnimation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#draggableDiv {
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(15px);
background-color: #FFF5;
position: absolute;
top: 20%;
left: 20%;
cursor: move;
border: 1px solid #ccc;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
padding: 0;
border-radius: 8px;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
user-select: none;
max-width: 350px;
/* 阻止用户选中文本 */
}
#message-input {
background-color: transparent;
flex-grow: 1;
margin-right: 10px;
border: 1px solid #ccc;
border-radius: 4px;
padding: 5px;
}
#send-button {
background-color: #4CAF50;
/* Green */
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
padding: 5px 10px;
border-radius: 4px;
}
#send-button:hover {
background-color: #45a049;
}
.unnecessary {
user-select: none;
}
img {
user-select: none;
}
/* h1,
h2,
h3,
h4,
h5 {
margin: 0 !important;
padding: 0 !important;
} */
.time,
.local {
white-space: pre-line;
overflow-x: hidden;
font-size: 0.5rem;
}
.hiscontent {
font-size: 1.2rem;
transition: none;
}
#lyrics-container {
font-weight: bold;
font-family: "Helvetica Black", sans-serif;
font-size: 1.5rem;
width: 100%;
}
a {
text-decoration: none;
/* 移除下划线 */
}
#back {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: -5;
background-size: 100% 100%;
}
.background-div {
position: absolute;
/* 绝对定位,脱离文档流 */
width: 100%;
height: 100%;
z-index: -1;
/* 将背景置于底层 */
}
.modal {
display: block;
/* 初始时隐藏弹窗 */
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
/* 背景半透明黑色 */
}
.modal-content {
user-select: none;
background-color: white;
padding: 20px;
border-radius: 5px;
color: black;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.modal-content p {
margin: 1rem;
}
.modal .button {
padding: 10px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
.modal .button:hover {
background-color: #0056b3;
}
.page-indicator {
text-align: center;
margin-top: 10px;
}
.defx {
backdrop-filter: blur(3px);
}
</style>
<style>
.button-container {
text-align: center;
}
.button-container a {
display: inline-block;
margin-bottom: 10px;
padding: 10px 20px;
color: #fff;
text-decoration: none;
border-radius: 5px;
transition: background-color 0.3s, color 0.3s;
}
.button-container a:nth-child(1) {
background-color: #FF5733;
}
.button-container a:nth-child(1):hover {
background-color: #FFC300;
}
.button-container a:nth-child(2) {
background-color: #3498DB;
}
.button-container a:nth-child(2):hover {
background-color: #85C1E9;
}
.button-container a:nth-child(3) {
background-color: #27AE60;
}
.button-container a:nth-child(3):hover {
background-color: #82E0AA;
}
.button-container a:nth-child(4) {
background-color: #E74C3C;
}
.button-container a:nth-child(4):hover {
background-color: #F1948A;
}
.button-container a:nth-child(5) {
background-color: #8E44AD;
}
.button-container a:nth-child(5):hover {
background-color: #BB8FCE;
}
.button-container a:nth-child(6) {
background-color: #F1C40F;
}
.button-container a:nth-child(6):hover {
background-color: #F7DC6F;
}
.button-container a:nth-child(7) {
background-color: #16A085;
}
.button-container a:nth-child(7):hover {
background-color: #48C9B0;
}
.button-container a:nth-child(8) {
background-color: #D35400;
}
.button-container a:nth-child(8):hover {
background-color: #EDBB99;
}
.button-container a:nth-child(9) {
background-color: #2C3E50;
}
.button-container a:nth-child(9):hover {
background-color: #5D6D7E;
}
.button-container a:nth-child(10) {
background-color: #7F8C8D;
}
.button-container a:nth-child(10):hover {
background-color: #BDC3C7;
}
</style>
<style>
.search-input {
padding: 10px 15px;
border: 3px solid #ccc;
border-radius: 1rem;
font-size: 16px;
color: inherit;
margin: 0.5rem;
background-color: #7773;
transition: all 0.3s ease-in-out;
outline: none;
}
.search-input:focus {
border-color: #3498db;
transform: scale(1.04) !important;
}
.search-input:hover {
transform: scale(1.02);
}
#draggableDiv a {
transition: all 0.3s ease-in-out;
}
#draggableDiv a:hover {
transform: scale(1.05);
}
pre code {
font-size: calc(100% - 0.3rem);
font-family: "SimHei", "Microsoft JhengHei", "PingFang SC", "Heiti SC", Arial, sans-serif !important;
}
.no_copy {
moz-user-select: -moz-none;
-moz-user-select: none;
-o-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
</style>
</head>
<body>
<div class="popup" id="popup"></div>
<!-- 弹窗内容 -->
<div class="modal" id="myModal">
<div class="modal-content" id="modal-content1">
<h2>请详细阅读使用说明书</h2>
<h3 style="color: red;">本页面已经全面弃用,仅开放给无法正常使用新页面的人用,新页面更加好看且拥有更多功能,请移步更先进的新页面使用,<a href="https://gpt.hcu.icu" style="color: blue;">点击这里跳转新版网页</a></h3>
<h3>功能讲解:</h3>
<div class="carousel-container">
<div class="carousel-slide">
<p>可以左右拖动调整聊天记录栏大小</p>
</div>
<div class="carousel-slide">
<p>Shift+滚轮调整<span style="font-size: 1.5em; font-weight: bold;">字体</span>大小,Ctrl+滚轮调整<span
style="font-size: 1.5em; font-weight: bold;">整体</span>大小</p>
</div>
<div class="carousel-slide">
<p>
回溯功能,在ai回复的消息右键选择从此处开始,当你说错了话或者想从之前的某句话开始重新往下聊的时候就能用这个功能
</p>
</div>
<!-- <div class="carousel-slide">
<div class="button-container">
<a href="https://www.doubao.com/" target="_blank">抖音大模型(抖音登录马上能用,推荐)</a>
<a href="https://yiyan.baidu.com/" target="_blank">百度大模型(申请内测就能用)</a>
<a href="https://chatglm.cn/detail" target="_blank">清华GLM大模型(应该能用)</a>
<a href="https://xinghuo.xfyun.cn/" target="_blank">讯飞大模型(不知道没用过)</a>
<a href="https://qianwen.aliyun.com/" target="_blank">淘宝大模型(不知道没用过)</a>
<a href="https://chat.360.cn/" target="_blank">360大模型(我一申请第二天就过了,很花里胡哨)</a>
<a href="https://ai.wps.cn/" target="_blank">WPS大模型(不知道没用过)</a>
<a href="https://moss.fastnlp.top/moss/" target="_blank">MOSS大模型(不知道没用过)</a>
<a href="https://neice.tiangong.cn/" target="_blank">天工大模型(不知道没用过)</a>
</div>
</div> -->
<div class="page-indicator" id="pageIndicator"></div>
<button class="button" id="closeModal" style="display: none;">关闭</button>
<button class="button" id="prevSlide">上一条</button>
<button class="button" id="nextSlide">下一条</button>
<h3 style="color: red;">特别重要的提示:</h3>
<p style="color: red;">本网站是私人网站,允许匿名使用,但是切记不能输入咨询违反中国大陆法律法规的内容</p>
<h3 style="color: red;">关于隐私:</h3>
<p style="color: red;">请注意,你的对话存在泄露的可能,本网站不对泄露负责,请注意提问内容的保密性。</p>
</div>
</div>
<div style="display: none;" id="modal-content2" class="modal-content">
<svg xmlns="http://www.w3.org/2000/svg" width="3rem" height="3rem" fill="currentColor"
class="bi bi-person-circle" viewBox="0 0 16 16">
<path d="M11 6a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/>
<path fill-rule="evenodd"
d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm8-7a7 7 0 0 0-5.468 11.37C3.242 11.226 4.805 10 8 10s4.757 1.225 5.468 2.37A7 7 0 0 0 8 1z"/>
</svg>
<div style="display: flex;flex-direction: column;">
<p>
密码就是用户名,是绑定聊天记录的,一开始我会给你生成一个随机密码,你可以自己设定一个,可以跨设备看聊天记录</p>
<div style="display: flex;"><input id="pwd" type="text" placeholder="密码"/>
<button id="submitpwd">进入</button>
</div>
</div>
</div>
</div>
<script>
document.getElementById("pwd").value = getc("userid");
document.getElementById("submitpwd").addEventListener("click", function () {
let userInput = document.getElementById("pwd").value;
if (userInput && getc("userid") !== userInput) {
setc("userid", userInput);
}
if (succeed_get_base_info){
ref1();
modal.remove();
randomMusic();
}else{
showPopup("请稍等,页面正在初始化");
}
});
var modal = document.getElementById("myModal");
var prevButton = document.getElementById("prevSlide");
var nextButton = document.getElementById("nextSlide");
var closeButton = document.getElementById("closeModal");
var pageIndicator = document.getElementById("pageIndicator");
var slideIndex = 0;
var slides = document.getElementsByClassName("carousel-slide");
showSlide(slideIndex);
prevButton.onclick = function () {
showSlide(slideIndex - 1);
}
nextButton.onclick = function () {
showSlide(slideIndex + 1);
}
closeButton.onclick = function () {
document.getElementById("modal-content1").style.display = "none";
document.getElementById("modal-content2").style.display = "flex";
}
function showSlide(index) {
if (index < 0) {
index = 0;
} else if (index >= slides.length) {
index = slides.length - 1;
}
slideIndex = index;
for (var i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slides[index].style.display = "inline-block";
if (index === 0) {
prevButton.style.display = "none";
} else {
prevButton.style.display = "inline-block";
}
if (index === slides.length - 1) {
nextButton.style.display = "none";
closeButton.style.display = "inline-block";
} else {
nextButton.style.display = "inline-block";
}
updatePageIndicator();
}
function updatePageIndicator() {
pageIndicator.textContent = (slideIndex + 1) + " / " + slides.length;
}
</script>
<div id="back" class="video-background">
<!-- <script>
const imgElement = document.getElementById('bgimg');
const adjustimgSize = () => {
// 计算视频的宽高比
const imgAspectRatio = imgElement.width / imgElement.height;
const windowAspectRatio = window.innerWidth / window.innerHeight;
if (windowAspectRatio < imgAspectRatio) {
// 如果容器比例大于视频比例
imgElement.style.width = 'auto';
imgElement.style.height = '100%';
} else {
// 如果容器比例小于等于视频比例
imgElement.style.width = '100%';
imgElement.style.height = 'auto';
}
};
adjustimgSize();light();
// // 每当窗口大小发生变化时进行调整
window.addEventListener('resize', adjustimgSize);
</script> -->
<!-- <script src="js/victor.min.js"></script>
<script src="js/chroma.min.js"></script>
<script src="js/simplex-noise.min.js"></script>
<canvas id="c" style="display: none;"></canvas>
<script src="js/main.js"></script> -->
<!-- <video id="bgVideo" playsinline autoplay muted loop playbackRate="0.5">
<source src="http://hcu.icu/bg1.mp4" type="video/mp4" >
</video>
<script src="js/video.js"></script> -->
</div>
<div class="body" style="max-width: 100%;" id="bodyx">
<div class="sidebar1" style="display: none;flex-direction: column;">
<a href="#" onclick="createFrame('chart.html','负载监控')"
style="color: inherit;margin-top: 2rem;text-align: center;">
<i class="fa-solid fa-earth-americas fa-2xl"></i>
</a>
</div>
<div class="sidebar unnecessary" id="mains1" style="width: 20%;overflow-x: hidden;">
<style>
.newcbutton {
display: block;
margin-top: 1rem;
white-space: nowrap;
margin-right: 1rem;
padding: 10px 0.5rem;
font-size: 16px;
text-align: center;
text-decoration: none;
border: none;
cursor: pointer;
transition: all 0.3s;
display: flex;
align-items: center;
justify-content: center;
}
.newcbutton.create {
background-color: #4CAF50;
color: white;
flex: 10;
border-radius: 4rem;
margin-left: 1rem;
}
.newcbutton.refresh {
background-color: #0074D9;
color: white;
border-radius: 0.5rem;
}
.create:hover {
background-color: #69ff71;
transform: scale(1.05);
}
.refresh:hover {
background-color: #0cb5ed;
transform: scale(1.05);
}
</style>
<style>
.shrink {
transform: scale(0.95) !important;
}
.expand {
transform: scale(1.05) !important;
}
</style>
<div id="sidebarhead" style="display: flex;flex-direction: column;"></div>
<div class="his" id="his">
</div>
</div>
<div id="divider" style="width: 1rem; cursor: col-resize; background: transparent;"></div>
<div class="content" id="mains2" style="flex: 3;user-select: none;">
<div class="header">
<!-- <div class="background-div"><img class="bgp1" src="7.png" /></div> -->
<div style="display:flex;justify-content: space-between;">
<div>
<h1 id="tip1" style="display: inline-block;"></h1>
<a href="#" id="tip2" style=" color: inherit;"
onclick="sendx('direct.php?message=!'+ prompt('请输入:\n注意,全部人都看得见'));"></a>
</div>
<div style="display: flex;justify-content: space-evenly;align-items: flex-end;">
<a href="#" onclick="swichtheme();"
style="color: inherit;text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="2rem" width="2rem"
class="bi bi-lightbulb-fill"
viewBox="0 0 16 16">
<path
d="M2 6a6 6 0 1 1 10.174 4.31c-.203.196-.359.4-.453.619l-.762 1.769A.5.5 0 0 1 10.5 13h-5a.5.5 0 0 1-.46-.302l-.761-1.77a1.964 1.964 0 0 0-.453-.618A5.984 5.984 0 0 1 2 6zm3 8.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1l-.224.447a1 1 0 0 1-.894.553H6.618a1 1 0 0 1-.894-.553L5.5 15a.5.5 0 0 1-.5-.5z"/>
</svg>
</a>
<a href="#" onclick="document.body.style.setProperty('--padding', '5%');"
style="color: inherit;text-align: center;">
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="2rem" width="2rem"
class="bi bi-lightbulb-fill"
viewBox="0 0 16 16">
<path fill-rule="evenodd"
d="M5.828 10.172a.5.5 0 0 0-.707 0l-4.096 4.096V11.5a.5.5 0 0 0-1 0v3.975a.5.5 0 0 0 .5.5H4.5a.5.5 0 0 0 0-1H1.732l4.096-4.096a.5.5 0 0 0 0-.707zm4.344 0a.5.5 0 0 1 .707 0l4.096 4.096V11.5a.5.5 0 1 1 1 0v3.975a.5.5 0 0 1-.5.5H11.5a.5.5 0 0 1 0-1h2.768l-4.096-4.096a.5.5 0 0 1 0-.707zm0-4.344a.5.5 0 0 0 .707 0l4.096-4.096V4.5a.5.5 0 1 0 1 0V.525a.5.5 0 0 0-.5-.5H11.5a.5.5 0 0 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 0 .707zm-4.344 0a.5.5 0 0 1-.707 0L1.025 1.732V4.5a.5.5 0 0 1-1 0V.525a.5.5 0 0 1 .5-.5H4.5a.5.5 0 0 1 0 1H1.732l4.096 4.096a.5.5 0 0 1 0 .707z"/>
</svg>
</a>
</div>
</div>
<!-- -->
<label id="tip3" style="display: block;text-align: center;background-color: #638ec082;"></label>
<style>
.tab_child> :first-child{
margin-top: 8rem !important;
}
.tab_child{
flex-direction: column;
overflow-y: auto;
max-height: 100%;
}
.tab_container{
display: flex;
justify-content: space-evenly;
height: 3rem;
}
.tab{
flex: 1;
text-align: center;
line-height: 3rem;
font-size: 1.2rem;
cursor: pointer;
transition: all 0.3s ease-in-out;
overflow: hidden;
border-left: 1px solid currentColor; /* 左边框,2像素宽,黑色 */
border-right: 1px solid currentColor; /* 右边框,2像素宽,黑色 */
}
.tab:hover{
background-color: #7775;
}
</style>
<div style="display: flex;flex-direction: row;">
<div id="tab_container" class="tab_container" style="max-width: calc( 100% - 3rem );">
</div>
<div class="tab" cid="" tabid="" onclick="newc()">+</div>
</div>
</div>
<div id="main_container" class="main_container main" style="user-select: text;">
</div>
<script>
function createTab(cid="",name="新聊天"){
const tabid=generateRandomString(10);
// 创建一个新的 div 元素
const newTab = document.createElement('div');
// 设置 id
//newTab.id = 'myDiv';
// 设置 class
newTab.className = 'tab';
newTab.textContent=name;
// 设置自定义属性(这里以 data-custom 属性为例)
newTab.setAttribute('cid', cid);
newTab.setAttribute('tabid', tabid);
// 添加 onclick 事件监听器
newTab.onclick = function() {
// 在点击 div 元素时执行的操作
switchTab(tabid);
};
// 获取父元素,假设你要将新的 div 添加到一个拥有 id 为 "parent-container" 的父元素中
const tab_container = document.getElementById('tab_container');
// 将新的 div 添加到父元素中
tab_container.appendChild(newTab);
const newMain = document.createElement('div');
newMain.setAttribute('cid', cid);
newMain.setAttribute('tabid', tabid);
newMain.className = 'tab_child';
const main_container = document.getElementById('main_container');
main_container.appendChild(newMain);
return switchTab(tabid);
}
function switchTab(tabid){
(function() {
const tab_container = document.getElementById('tab_container');
const nowMain = document.getElementById('mainTab');
if (nowMain){
nowMain.removeAttribute('id');
}
const children = tab_container.children;
if (children.length > 0) {
for (let i = 0; i < children.length; i++) {
const childElement = children[i];
childElement.style.backgroundColor="transparent";
if (childElement.getAttribute('tabid')===tabid){
cid=childElement.getAttribute('cid');
childElement.id = 'mainTab';
childElement.style.backgroundColor="#7777";
}
}
}
})();
const main_container = document.getElementById('main_container');
const nowMain = document.getElementById('main');
if (nowMain){
nowMain.removeAttribute('id');
}
const children = main_container.children;
let select;
if (children.length > 0) {
for (let i = 0; i < children.length; i++) {
const childElement = children[i];
childElement.style.display="none";
if (childElement.getAttribute('tabid')===tabid){
childElement.id = 'main';
childElement.style.display="flex";
select=childElement;
}
}
}
return select;
}
function switchTabById(cid,name=""){
const tab_container = document.getElementById('tab_container');
const children = tab_container.children;
if (children.length > 0) {
for (let i = 0; i < children.length; i++) {
const childElement = children[i];
if (childElement.getAttribute('cid')===cid){
my1(cid,switchTab(childElement.getAttribute('tabid')));
return;
}
}
}
my1(cid,createTab(cid,name));
}
</script>
<div class="footer" id="footer">
<textarea type="text" class="input-field"
placeholder="输入内容...Shift+删除键清空内容" id="mess"
onkeydown="preventNewLine(event)"></textarea>
<div id="submit">
<button id="send1" class="submit-btn">GPT</button>
</div>
<script>
var submit_btn = document.getElementById("submit");
var main_c = document.querySelector('.main_container');
// 当鼠标向下滚动时触发事件
var mess = document.getElementById("mess");
document.getElementById("send1").addEventListener("click", function () {
let data = {
ipv4: ipv4,
ipv6: ipv6,
bot: "coze_huahua",
add: "",
cid: cid,
pid: pid,
message: mess.value,
userid: getc("userid"),
version: version,
};
sendw(data);
});
function sendw(data,url = wsserver) {
if (!data.message || submit_btn.style.display == "none") {
return;
}
if((getWordCount(data.message)+getChineseCharacterCount(data.message))>2000){
addmessage("left", `<p>字数过多</p>`, false, true, false);
return;
}
submit_btn.style.display = "none";
mess.readOnly = true;