Add files via upload
parent
780d5ae093
commit
a073141ebb
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,198 @@
|
||||
.logo-title {
|
||||
line-height:50px;
|
||||
color:#fff;
|
||||
text-decoration:none
|
||||
}
|
||||
.layout-header .logo .links {
|
||||
text-decoration:none;
|
||||
}
|
||||
.layout-header {
|
||||
background:#202123;
|
||||
}
|
||||
.layout-header .nav .list .links {
|
||||
color:#fff;
|
||||
}
|
||||
.xiezuo-header {
|
||||
max-height:calc(100vh - 30px);
|
||||
overflow-y:auto;
|
||||
min-height:200px;
|
||||
}
|
||||
#article-wrapper {
|
||||
min-height:calc(100vh - 320px);
|
||||
border:1px solid;
|
||||
border-radius:var(--zhuluan-primary-border-radius);
|
||||
}
|
||||
.article-box {
|
||||
min-height:calc(100vh - 50px) !important;
|
||||
position:relative;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
justify-content:space-around;
|
||||
}
|
||||
#fixed-block {
|
||||
background-color:#40414F;
|
||||
bottom:20px;
|
||||
}
|
||||
#kw-target-box {
|
||||
border-radius:var(--zhuluan-primary-border-radius);
|
||||
-webkit-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-moz-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-ms-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-o-border-radius:var(--zhuluan-primary-border-radius);
|
||||
}
|
||||
#popup {
|
||||
display:none;
|
||||
position:absolute;
|
||||
top:50%;
|
||||
left:50%;
|
||||
transform:translate(-50%, -50%);
|
||||
-webkit-transform:translate(-50%, -50%);
|
||||
-moz-transform:translate(-50%, -50%);
|
||||
-ms-transform:translate(-50%, -50%);
|
||||
-o-transform:translate(-50%, -50%);
|
||||
background-color:#fff;
|
||||
padding:20px;
|
||||
border:1px solid var(--zhuluan-border-color);
|
||||
width:70%;
|
||||
border-radius:var(--zhuluan-primary-border-radius);
|
||||
-webkit-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-moz-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-ms-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-o-border-radius:var(--zhuluan-primary-border-radius);
|
||||
}
|
||||
#popup-close {
|
||||
font-size:24px;
|
||||
color:#666;
|
||||
float:right;
|
||||
cursor:pointer;
|
||||
}
|
||||
.popup-header {
|
||||
height:30px;
|
||||
}
|
||||
.pop-title {
|
||||
font-size:24px;
|
||||
}
|
||||
.popup-content {
|
||||
margin-top:20px;
|
||||
}
|
||||
.image-wrapper {
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
justify-content:space-around;
|
||||
}
|
||||
.image-wrapper img {
|
||||
width:40%;
|
||||
}
|
||||
.popup-footer {
|
||||
margin-top:10px;
|
||||
text-align:center;
|
||||
}
|
||||
#count-down {
|
||||
font-size:20px;
|
||||
color:red;
|
||||
}
|
||||
#sure-pay {
|
||||
margin-top:10px;
|
||||
display:block;
|
||||
width:120px;
|
||||
height:40px;
|
||||
line-height:40px;
|
||||
border:1px solid var(--zhuluan-border-color);
|
||||
border-radius:var(--zhuluan-primary-border-radius);
|
||||
background-color:#0188fb;
|
||||
color:#fff;
|
||||
-webkit-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-moz-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-ms-border-radius:var(--zhuluan-primary-border-radius);
|
||||
-o-border-radius:var(--zhuluan-primary-border-radius);
|
||||
margin-left:50%;
|
||||
transform:translateX(-50%);
|
||||
-webkit-transform:translateX(-50%);
|
||||
-moz-transform:translateX(-50%);
|
||||
-ms-transform:translateX(-50%);
|
||||
-o-transform:translateX(-50%);
|
||||
cursor:pointer;
|
||||
}
|
||||
li.article-title {
|
||||
background:#343541;
|
||||
padding:14px;
|
||||
color:#fff;
|
||||
font-size:15px;
|
||||
}
|
||||
li.article-content {
|
||||
background:#434654;
|
||||
padding:14px;
|
||||
color:#fff;
|
||||
font-size:15px;
|
||||
}
|
||||
.article .creating-loading {
|
||||
display:none;
|
||||
position:absolute;
|
||||
z-index:10008;
|
||||
left:0;
|
||||
top:0;
|
||||
right:0;
|
||||
bottom:0;
|
||||
background-color:rgba(52, 53, 65, .68);
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
.layout-content {
|
||||
padding:0 !important;
|
||||
}
|
||||
@media screen and (max-width:768px) {
|
||||
#popup {
|
||||
height:350px;
|
||||
}
|
||||
.image-wrapper img {
|
||||
width:92px;
|
||||
height:139px;
|
||||
}
|
||||
}
|
||||
pre {
|
||||
word-break:break-all;
|
||||
word-wrap:break-word;
|
||||
white-space:pre-wrap;
|
||||
}
|
||||
input {
|
||||
display:none;
|
||||
}
|
||||
label {
|
||||
display:block;
|
||||
width:40px;
|
||||
height:20px;
|
||||
border-radius:20px;
|
||||
background:rgb(164, 165, 179);
|
||||
border:1px solid #A4A5B3;
|
||||
cursor:pointer;
|
||||
position:relative;
|
||||
overflow:hidden;
|
||||
}
|
||||
label::before {
|
||||
display:block;
|
||||
content:'';
|
||||
width:16px;
|
||||
height:16px;
|
||||
border-radius:50%;
|
||||
background:white;
|
||||
position:absolute;
|
||||
left:1px;
|
||||
top:50%;
|
||||
transform:translateY(-50%);
|
||||
transition:all .3s;
|
||||
}
|
||||
label::after {
|
||||
display:block;
|
||||
content:'';
|
||||
width:0;
|
||||
height:100%;
|
||||
background:#202123;
|
||||
transition:all .3s;
|
||||
border-radius:10px;
|
||||
}
|
||||
input:checked + label::before {
|
||||
left:20px;
|
||||
}
|
||||
input:checked + label::after {
|
||||
width:100%;
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
|
||||
/*
|
||||
//定时器*/
|
||||
var contextarray = [];
|
||||
$(document).ready(function () {
|
||||
|
||||
$("#kw-target").on('keydown', function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
send_post();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$("#ai-btn").click(function () {
|
||||
send_post();
|
||||
return false;
|
||||
});
|
||||
$("#clean").click(function () {
|
||||
$("#article-wrapper").html("");
|
||||
contextarray = [];
|
||||
layer.msg("清理完毕!");
|
||||
return false;
|
||||
});
|
||||
$("#showlog").click(function () {
|
||||
let btnArry = ['已阅'];
|
||||
layer.open({<!-- -->
|
||||
type: 1
|
||||
,title: '全部对话日志'
|
||||
,area: ['80%', '80%']
|
||||
,shade: 0.5
|
||||
,scrollbar: true
|
||||
,offset: [
|
||||
($(window).height() * 0.1)
|
||||
,($(window).width() * 0.1)
|
||||
]
|
||||
,content: '<iframe src="chat.txt?' + new Date().getTime()+ '" style="width: 100%; height: 100%;"></iframe>'
|
||||
,btn: btnArry
|
||||
});
|
||||
return false;
|
||||
});
|
||||
function articlewrapper(answer,str){
|
||||
$("#article-wrapper").append('<li class="article-content" id="'+answer+'"><pre></pre></li>');
|
||||
if(str == null || str == ""){
|
||||
str="服务器响应超时,您可以更换词语再试试或过会儿再试。";
|
||||
}
|
||||
let str_ = ''
|
||||
let i = 0
|
||||
let timer = setInterval(()=>{
|
||||
if(str_.length<str.length){
|
||||
str_ += str[i++]
|
||||
$("#"+answer).children('pre').text(str_+'_')//打印时加光标
|
||||
}else{
|
||||
clearInterval(timer)
|
||||
$("#"+answer).children('pre').text(str_)//打印时加光标
|
||||
}
|
||||
},5)
|
||||
}
|
||||
|
||||
function send_post() {
|
||||
|
||||
var prompt = $("#kw-target").val();
|
||||
if (prompt == "") {
|
||||
layer.msg("请输入您的问题", { icon: 5 });
|
||||
return;
|
||||
}
|
||||
|
||||
var loading = layer.msg('正在组织语言,请稍等片刻...', {
|
||||
icon: 16,
|
||||
shade: 0.4,
|
||||
time:false //取消自动关闭
|
||||
});
|
||||
$.ajax({
|
||||
cache: true,
|
||||
type: "POST",
|
||||
url: "message.php",
|
||||
data: {
|
||||
message: prompt,
|
||||
context:$("#keep").prop("checked")?JSON.stringify(contextarray):'[]',
|
||||
},
|
||||
dataType: "json",
|
||||
success: function (results) {
|
||||
layer.close(loading);
|
||||
$("#kw-target").val("");
|
||||
layer.msg("处理成功!");
|
||||
contextarray.push([prompt, results.raw_message]);
|
||||
$("#article-wrapper").append('<li class="article-title">问:'+prompt+'</li>');
|
||||
articlewrapper(randomString(16),"答:"+results.raw_message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function randomString(len) {
|
||||
len = len || 32;
|
||||
var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678'; /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
|
||||
var maxPos = $chars.length;
|
||||
var pwd = '';
|
||||
for (i = 0; i < len; i++) {
|
||||
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
|
||||
}
|
||||
return pwd;
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,2 @@
|
||||
/*! jquery.cookie v1.4.1 | MIT */
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue