From ee690530f159c734e72e135843c9d21bf82e4866 Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <17683872107czx> Date: Fri, 1 Sep 2023 17:05:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96ai=E6=91=98=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/assets/libs/gpt/post-ai.js | 73 ++++++++++++++-------------- templates/post.html | 20 ++++++++ 2 files changed, 57 insertions(+), 36 deletions(-) diff --git a/templates/assets/libs/gpt/post-ai.js b/templates/assets/libs/gpt/post-ai.js index b7d7f0b2..0088561f 100644 --- a/templates/assets/libs/gpt/post-ai.js +++ b/templates/assets/libs/gpt/post-ai.js @@ -17,43 +17,44 @@ let keys = GLOBAL_CONFIG.source.postAi.keys; let Referers = GLOBAL_CONFIG.source.postAi.Referers; - let post = document.querySelector('#post') - const interface = { - name: "AI-摘要", - aiToggle: "切换", - version: "Tianli GPT", - button: ["介绍自己", "生成本文简介", "推荐相关文章", "前往主页"], - } - // 插入html结构 - const post_ai_box = document.createElement('div'); - post_ai_box.className = 'post-ai'; - post.insertBefore(post_ai_box, post.firstChild); + // let post = document.querySelector('#post') + // const interface = { + // name: "AI-摘要", + // aiToggle: "切换", + // version: "Tianli GPT", + // button: ["介绍自己", "生成本文简介", "推荐相关文章", "前往主页"], + // } + // // 插入html结构 + // const post_ai_box = document.createElement('div'); + // post_ai_box.className = 'post-ai'; + // post.insertBefore(post_ai_box, post.firstChild); + // + // var PostAI = ` + //
+ // + //
${interface.name}
` + // if (switchBtn) { + // PostAI += `
${interface.aiToggle}
`; + // } + // PostAI += ` `; + // if (modeName == 'local') { + // PostAI += `
${gptName} GPT
`; + // } else { + // PostAI += `
${interface.version}
`; + // } + // PostAI += ` + //
+ //
AI初始化中...
+ //
+ //
${interface.button[0]}
+ //
${interface.button[1]}
+ //
${interface.button[2]}
+ //
${interface.button[3]}
+ //
前往tianli博客
+ //
`; + // + // post_ai_box.innerHTML = PostAI; - var PostAI = ` -
- -
${interface.name}
` - if (switchBtn) { - PostAI += `
${interface.aiToggle}
`; - } - PostAI += ` `; - if (modeName == 'local') { - PostAI += `
${gptName} GPT
`; - } else { - PostAI += `
${interface.version}
`; - } - PostAI += ` -
-
AI初始化中...
-
-
${interface.button[0]}
-
${interface.button[1]}
-
${interface.button[2]}
-
${interface.button[3]}
-
前往tianli博客
-
`; - - post_ai_box.innerHTML = PostAI; // 当前随机到的ai摘要到index let lastAiRandomIndex = -1; let animationRunning = true; // 标志变量,控制动画函数的运行 diff --git a/templates/post.html b/templates/post.html index ba35f422..c5cfff42 100644 --- a/templates/post.html +++ b/templates/post.html @@ -97,6 +97,26 @@
+ + +
+
+
AI-摘要
+
切换
+ +
[[${theme.config.post.aiDescription.gptName}]] GPT
+
Tianli GPT
+
+
AI初始化中...
+
+
介绍自己
+
生成本文简介
+
推荐相关文章
+
前往主页
+
前往tianli博客
+
+
+