markdown-css测试

ai 使用

AI-摘要
ZERONE GPT
介绍自己 🙈
生成本文简介 👋
前往主页 🏠

自建iframe

这是写个我自看的 当然hexo博客框架也能用
AI总结整体代码markdown中使用 中间不能有换行!中间不能有换行!中间不能有换行!

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

<div>
<div class="post-ai-description" id="post-ai-description">
<div class="ai-title">
<i class="anzhiyufont anzhiyu-icon-bilibili"></i>
<div class="ai-title-text">AI-摘要</div>
<i class="anzhiyufont anzhiyu-icon-arrow-rotate-right" id="arrow-rotate-right" onclick="againBlurb()"></i>
<i class="anzhiyufont anzhiyu-icon-circle-dot" title="朗读摘要"></i>
<div id="ai-tag" onclick="introHer()">ZERONE GPT</div>
</div>
<div class="ai-explanation" id="typing-effect"></div>
<div class="ai-btn-box"><div class="ai-btn-item" style="display: block;" onclick="introHer()">介绍自己 🙈</div>
<div class="ai-btn-item" style="display: block;" onclick="createBlurb()">生成本文简介 👋</div>
<div class="ai-btn-item" style="display: block;">推荐相关文章 📖</div>
<div class="ai-btn-item" style="display: block;" onclick="goHome()">前往主页 🏠</div>
<div class="ai-btn-item" id="go-tianli-blog" style="display: none;">前往爱发电购买</div>
</div>
<script>
// 初始化打字机效果
let interval;
let isClick = true;
let rotateNum = 0;
typeWriter("ai正在总结中...")
handleQianfanRequest();
function handleQianfanRequest() {
const articleUrl = "https://vvan.581801.xyz/2025/07/28/css-test/";
// 构造千帆API请求
const qianfanUrl = 'https://qianfan.baidubce.com/v2/chat/completions'
const authToken = 'token值' // 替换实际token
try {
// 获取原始请求体并添加插件配置
const enhancedBody = {
"model": "ernie-4.0-turbo-8k",
"stream_options":{
"include_usage":false
},
"messages": [{
"role": "user",
"content":"简短总结文章内容"
}],
"plugins": [
"ChatFilePlus"
],
"stream": false,
"plugin_options": {
"plugin_args": {
"ChatFilePlus": {
"body": {
"files": [
[
{
"type": "link",
"url": articleUrl ,
"name": articleUrl
}
]
]
}
}
}
}
}
// 转发到千帆API
const responseData = fetch(qianfanUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'appid': 'app-3U8nY0Ca',
'Authorization': 'Bearer ' + authToken
},
body: JSON.stringify(enhancedBody)
}).then(response => response.json())
.then(data => {
// 处理数据
const text = data.choices[0].message.content;
isClick = true;
typeWriter(text); // 速度设置为100毫秒
})
} catch (error) {
typeWriter("写的太玄幻了 ai总结不了...500");
}
}
// 介绍自己
function introHer() {
const text = "你好,我是ZERONE GPT,一个基于AI的智能助手。我可以帮助你生成文章简介、推荐相关文章,或者直接前往我的主页。请问有什么我可以帮助你的吗?";
typeWriter(text);
}
// 生成本文简介
function createBlurb() {
if (isClick) {
isClick = false;
typeWriter("请稍等,正在生成本文简介...");
handleQianfanRequest();
}
}
// 重新生成简介
function againBlurb() {
if (isClick) {
isClick = false;
rotateNum++; // 增加计数器
const rotateRight = document.getElementById('arrow-rotate-right');
rotateRight.style.opacity = "1";
rotateRight.style.transitionDuration = "1s";
rotateRight.style.transform = "rotate(" + 360 * rotateNum + "deg)";
typeWriter("请稍等,正在重新生成简介...");
handleQianfanRequest();
}
}
// 前往主页
function goHome() {
typeWriter("正在前往博客主页...");
setTimeout(() => {
window.location.href = "/"; // 替换为你的主页链接
}, 1000);
}
// 打字机效果
function typeWriter(text) {
clearInterval(interval); // 清除之前的打字效果
const element = document.getElementById('typing-effect');
element.innerHTML = "";
let speed = 100;
let i = 0;
interval = setInterval(() => {
if (i < text.length) {
element.innerHTML += text.charAt(i);
i++;
// 每次打字后滚动到底部
element.scrollTop = element.scrollHeight;
} else {
clearInterval(interval);
}
}, speed);
}
</script>
</div>