// ==UserScript==
// @name 咽沙学习小助手测试版V0.98 已加入七个记忆功能(未完善) 页面答题 AI对话
// @namespace http://tampermonkey.net/
// @version 0.98
// @description 创建一个明显可见的聊天窗口,集成 DeepSeek API 互动,新增更多助记功能
// @author Your Name
// @match *://*/*
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
'use strict';
// 定义API密钥和基础URL
const API_SECRET_KEY = "sk-e9e32530533e43229bb66519577e57d3";
const BASE_URL = "https://api.deepseek.com/v1/";
// 添加CSS样式
GM_addStyle(`
/* 按钮容器样式 */
#button-container {
width: 250px;
height: 60px;
border-radius: 15px;
font-size: 18px;
position: fixed;
right: 20px;
bottom: 180px;
z-index: 10000;
cursor: pointer;
font-family: "STKaiti", "华文楷体", "Kaiti", serif;
overflow: visible;
color: black;
background: radial-gradient(circle, #ffecb3, #ffdead);
background-size: 200% 200%;
animation: gradientAnimation 4s ease infinite;
transition: all 0.3s ease-in-out;
}
@keyframes gradientAnimation {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
/* 子按钮样式 */
.option-button {
width: 250px;
height: 60px;
border-radius: 15px;
border: none;
background-color: #fff9db;
cursor: pointer;
font-family: "STKaiti", "华文楷体", "Kaiti", serif;
opacity: 0;
pointer-events: none;
text-align: left;
position: absolute;
left: 0;
top: -60px;
transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out;
}
/* 聊天窗口样式 */
#chat-window, #auto-answer-chat-window, #quiz-memory-chat-window, #fill-in-memory-chat-window, #question-memory-chat-window, #palace-memory-chat-window, #compare-memory-chat-window, #understand-memory-chat-window, #mindmap-memory-chat-window {
width: 400px;
height: 400px;
background-color: #e6e6fa;
border: 1px solid #ccc;
position: fixed;
bottom: 60px;
z-index: 9999;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
padding: 10px;
border-radius: 5px;
overflow: hidden;
display: none;
}
/* 聊天内容样式 */
#chat-window-content, #auto-answer-chat-window-content, #quiz-memory-chat-window-content, #fill-in-memory-chat-window-content, #question-memory-chat-window-content, #palace-memory-chat-window-content, #compare-memory-chat-window-content, #understand-memory-chat-window-content, #mindmap-memory-chat-window-content {
height: calc(100% - 60px);
overflow-y: auto;
overflow-x: hidden;
padding-right: 10px;
position: relative;
}
/* 自定义滚动条样式 */
#chat-window-content::-webkit-scrollbar, #auto-answer-chat-window-content::-webkit-scrollbar, #quiz-memory-chat-window-content::-webkit-scrollbar, #fill-in-memory-chat-window-content::-webkit-scrollbar, #question-memory-chat-window-content::-webkit-scrollbar, #palace-memory-chat-window-content::-webkit-scrollbar, #compare-memory-chat-window-content::-webkit-scrollbar, #understand-memory-chat-window-content::-webkit-scrollbar, #mindmap-memory-chat-window-content::-webkit-scrollbar {
width: 10px;
}
/* 修改滚动条滑块颜色和不透明度 */
#chat-window-content::-webkit-scrollbar-thumb, #quiz-memory-chat-window-content::-webkit-scrollbar-thumb, #fill-in-memory-chat-window-content::-webkit-scrollbar-thumb, #question-memory-chat-window-content::-webkit-scrollbar-thumb, #palace-memory-chat-window-content::-webkit-scrollbar-thumb, #compare-memory-chat-window-content::-webkit-scrollbar-thumb, #understand-memory-chat-window-content::-webkit-scrollbar-thumb, #mindmap-memory-chat-window-content::-webkit-scrollbar-thumb {
background-image: linear-gradient(to bottom, rgba(180, 120, 242, 0.8), rgba(84, 110, 122, 0.8));
background-color: transparent !important;
border-radius: 5px;
}
#auto-answer-chat-window-content::-webkit-scrollbar-thumb {
background-image: linear-gradient(to bottom, rgba(180, 120, 242, 0.8), rgba(84, 110, 122, 0.8));
background-color: transparent !important;
}
#chat-window-content::-webkit-scrollbar-thumb:hover, #auto-answer-chat-window-content::-webkit-scrollbar-thumb:hover, #quiz-memory-chat-window-content::-webkit-scrollbar-thumb:hover, #fill-in-memory-chat-window-content::-webkit-scrollbar-thumb:hover, #question-memory-chat-window-content::-webkit-scrollbar-thumb:hover, #palace-memory-chat-window-content::-webkit-scrollbar-thumb:hover, #compare-memory-chat-window-content::-webkit-scrollbar-thumb:hover, #understand-memory-chat-window-content::-webkit-scrollbar-thumb:hover, #mindmap-memory-chat-window-content::-webkit-scrollbar-thumb:hover {
background-color: rgba(88, 88, 88, 0.8);
}
/* 输入容器样式 */
#input-container {
position: absolute;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
border-top: 1px solid #ccc;
}
/* 输入框样式 */
#chat-input, #quiz-memory-input, #fill-in-memory-input, #question-memory-input, #palace-memory-input, #compare-memory-input, #understand-memory-input, #mindmap-memory-input {
width: calc(100% - 70px);
height: 30px;
margin: 5px;
box-sizing: border-box;
}
/* 发送按钮样式 */
#send-button {
width: 50px;
height: 30px;
margin: 5px;
box-sizing: border-box;
}
/* 复制按钮样式 */
.copy-button {
width: 100%;
height: 30px;
margin: 5px 0;
background-color: #f0f0f0;
border: 1px solid #ccc;
cursor: pointer;
text-align: center;
line-height: 30px;
}
/* 按钮聚焦样式 */
.option-button:focus {
outline: 2px solid #ffffff;
}
/* 加载提示样式 */
.loading-message {
color: #888;
font-style: italic;
}
/* 挖空助记窗口的textarea样式 */
#fill-in-memory-chat-window #input-container textarea, #question-memory-chat-window #input-container textarea, #palace-memory-chat-window #input-container textarea, #compare-memory-chat-window #input-container textarea, #understand-memory-chat-window #input-container textarea, #mindmap-memory-chat-window #input-container textarea {
width: calc(100% - 70px);
height: 50px;
margin: 5px;
box-sizing: border-box;
resize: none;
}
/* 拖动区域样式 */
.drag-area {
position: absolute;
top: 0;
left: 0;
width: 50px;
height: 50px;
background-color: rgba(224, 224, 224, 0.5); /* 浅灰色,不透明度50% */
border-radius: 5px;
cursor: move;
z-index: 10001;
}
.drag-area .inner-drag-area {
position: absolute;
top: 10px;
left: 10px;
width: 30px;
height: 30px;
background-color: rgba(128, 128, 128, 0.5); /* 深灰色,不透明度50% */
border-radius: 5px;
}
`);
// 创建按钮容器
function createButtonContainer() {
const buttonContainer = document.createElement('div');
buttonContainer.id = 'button-container';
buttonContainer.style.cursor = 'move'; // 设置为可拖动光标
return buttonContainer;
}
// 创建父按钮
function createParentButton(buttonContainer) {
const parentButton = document.createElement('button');
parentButton.textContent = '咽沙学习小助手测试版 V0.98';
parentButton.style.width = '100%';
parentButton.style.height = '100%';
parentButton.style.border = 'none';
parentButton.style.backgroundColor = 'transparent';
parentButton.style.fontFamily = '"STKaiti", "华文楷体", "Kaiti", serif';
parentButton.style.fontSize = '18px';
buttonContainer.appendChild(parentButton);
return parentButton;
}
// 创建子按钮
function createOptionButtons(buttonContainer) {
const buttonLabels = [
'-对话DeepSeek 【本按钮可切换窗口显示、隐藏】',
'-获取页面自动解答',
'-出题助记【共18题】',
'-挖空助记',
'-提问助记',
'-宫殿记忆',
'-对比助记',
'-理解助记',
'-思维导图结构助记'
];
buttonLabels.forEach((label, index) => {
const optionButton = document.createElement('button');
optionButton.className = 'option-button';
optionButton.textContent = label;
if (index === 0) {
optionButton.onclick = () => toggleChatWindowVisibility('chat-window');
} else if (index === 1) {
optionButton.onclick = () => {
toggleChatWindowVisibility('auto-answer-chat-window');
generateAutoAnswer();
};
} else if (index === 2) {
optionButton.onclick = () => toggleChatWindowVisibility('quiz-memory-chat-window');
} else if (index === 3) {
optionButton.onclick = () => toggleChatWindowVisibility('fill-in-memory-chat-window');
} else if (index === 4) {
optionButton.onclick = () => toggleChatWindowVisibility('question-memory-chat-window');
} else if (index === 5) {
optionButton.onclick = () => toggleChatWindowVisibility('palace-memory-chat-window');
} else if (index === 6) {
optionButton.onclick = () => toggleChatWindowVisibility('compare-memory-chat-window');
} else if (index === 7) {
optionButton.onclick = () => toggleChatWindowVisibility('understand-memory-chat-window');
} else {
optionButton.onclick = () => toggleChatWindowVisibility('mindmap-memory-chat-window');
}
buttonContainer.appendChild(optionButton);
});
}
// 切换聊天窗口的显示状态
function toggleChatWindowVisibility(chatWindowId) {
const chatWindow = document.getElementById(chatWindowId);
chatWindow.style.display = chatWindow.style.display === 'none' ? 'block' : 'none';
}
// 获取页面文本
function getPageText() {
let allText = '';
const texts = [];
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);
while (walker.nextNode()) {
const node = walker.currentNode;
if (node.parentElement.tagName !== 'SCRIPT' && node.parentElement.tagName !== 'STYLE') {
texts.push(node.nodeValue.trim());
}
}
return texts.filter(text => text).join(' ');
}
// 发送消息到DeepSeek
async function sendMessageToAI(message, isQuizMemory = false, isFillInMemory = false, isQuestionMemory = false, isPalaceMemory = false, isCompareMemory = false, isUnderstandMemory = false, isMindmapMemory = false) {
try {
const systemMessage = isQuestionMemory
? "请根据用户提供的知识内容,生成5到30个问题,覆盖尽可能多的知识点,确保问题的准确性和完整性。"
: isPalaceMemory
? "请根据用户提供的知识内容,使用记忆宫殿法将其与熟悉的空间环境关联,生成记忆路径和视觉联想。"
: isCompareMemory
? "请根据用户提供的知识内容,进行对比分析,找出相同点和不同点,并分析原因和影响。"
: isUnderstandMemory
? "请根据用户提供的知识内容,进行深入的分析和理解,确保知识点的准确性和科学性,并提供相关的拓展阅读材料。"
: isMindmapMemory
? "请根据用户提供的知识内容,生成思维导图结构,帮助用户更好地理解和记忆知识点。"
: "您是一位乐于助人的助手。";
const response = await fetch(`${BASE_URL}chat/completions`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${API_SECRET_KEY}`
},
body: JSON.stringify({
model: "deepseek-chat",
messages: [
{ role: "system", content: systemMessage },
{ role: "user", content: message },
...(isQuizMemory ? [{ role: "assistant", content: "请根据以上信息生成18道选择题,帮助我更好地记住这些知识点。" }] : []),
...(isFillInMemory ? [{ role: "assistant", content: "请对以下知识点进行分点,并在每个知识点中挖空重要的内容。" }] : []),
...(isPalaceMemory ? [{ role: "assistant", content: "请使用记忆宫殿法将以下知识点与熟悉的空间环境关联,生成记忆路径和视觉联想。" }] : []),
...(isCompareMemory ? [{ role: "assistant", content: "请对以下知识点进行对比分析,找出相同点和不同点,并分析原因和影响。" }] : []),
...(isUnderstandMemory ? [{ role: "assistant", content: "请对以下知识点进行深入的分析和理解,确保知识点的准确性和科学性,并提供相关的拓展阅读材料。" }] : []),
...(isMindmapMemory ? [{ role: "assistant", content: "请根据以下知识点生成思维导图结构,帮助用户更好地理解和记忆知识点。" }] : [])
],
max_tokens: 3500,
temperature: 0.7
})
});
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
const data = await response.json();
if (!data.choices || !data.choices.length) throw new Error('来自AI服务的回答无效。');
return data.choices[0].message.content;
} catch (error) {
console.error("获取AI回答时出错:", error);
throw error;
}
}
// 创建聊天窗口
function createChatWindow(isAutoAnswer = false, isQuizMemory = false, isFillInMemory = false, isQuestionMemory = false, isPalaceMemory = false, isCompareMemory = false, isUnderstandMemory = false, isMindmapMemory = false) {
let chatWindowId;
if (isFillInMemory) {
chatWindowId = 'fill-in-memory-chat-window';
} else if (isQuizMemory) {
chatWindowId = 'quiz-memory-chat-window';
} else if (isAutoAnswer) {
chatWindowId = 'auto-answer-chat-window';
} else if (isQuestionMemory) {
chatWindowId = 'question-memory-chat-window';
} else if (isPalaceMemory) {
chatWindowId = 'palace-memory-chat-window';
} else if (isCompareMemory) {
chatWindowId = 'compare-memory-chat-window';
} else if (isUnderstandMemory) {
chatWindowId = 'understand-memory-chat-window';
} else if (isMindmapMemory) {
chatWindowId = 'mindmap-memory-chat-window';
} else {
chatWindowId = 'chat-window';
}
const chatWindow = document.createElement('div');
chatWindow.id = chatWindowId;
// 设置不同的bottom值以避免重叠
switch (chatWindowId) {
case 'chat-window':
chatWindow.style.bottom = '60px';
chatWindow.style.right = '20px';
break;
case 'auto-answer-chat-window':
chatWindow.style.bottom = '180px';
chatWindow.style.right = '20px';
break;
case 'quiz-memory-chat-window':
chatWindow.style.bottom = '300px';
chatWindow.style.right = '20px';
break;
case 'fill-in-memory-chat-window':
chatWindow.style.bottom = '420px';
chatWindow.style.right = '20px';
break;
case 'question-memory-chat-window':
chatWindow.style.bottom = '540px';
chatWindow.style.right = '20px';
break;
case 'palace-memory-chat-window':
chatWindow.style.bottom = '60px';
chatWindow.style.left = '20px'; // 宫殿记忆窗口放在左侧下部
break;
case 'compare-memory-chat-window':
chatWindow.style.bottom = '180px';
chatWindow.style.left = '20px'; // 对比助记窗口放在左侧下部
break;
case 'understand-memory-chat-window':
chatWindow.style.top = '20px'; // 理解助记窗口放在左侧上部
chatWindow.style.left = '20px';
break;
case 'mindmap-memory-chat-window':
chatWindow.style.top = '20px'; // 思维导图助记窗口放在左侧上部
chatWindow.style.left = '20px';
break;
}
// 创建内容容器
const chatContent = document.createElement('div');
chatContent.id = `${chatWindowId}-content`;
chatContent.className = 'chat-content';
chatWindow.appendChild(chatContent);
// 添加拖动区域
const dragArea = document.createElement('div');
dragArea.className = 'drag-area';
const innerDragArea = document.createElement('div');
innerDragArea.className = 'inner-drag-area';
dragArea.appendChild(innerDragArea);
chatWindow.appendChild(dragArea);
if (isFillInMemory || isQuestionMemory || isPalaceMemory || isCompareMemory || isUnderstandMemory || isMindmapMemory) {
// 挖空助记、提问助记、宫殿记忆、对比助记、理解助记和思维导图助记专属逻辑
const inputContainer = document.createElement('div');
inputContainer.id = 'input-container';
const userInput = document.createElement('textarea');
userInput.placeholder = '在此输入你想记忆的知识...';
userInput.style.height = '50px'; // 减半高度
inputContainer.appendChild(userInput);
const sendButton = document.createElement('button');
sendButton.textContent = '发送';
sendButton.onclick = async function() {
const userMessage = userInput.value.trim();
if (userMessage) {
userInput.value = '';
const loadingMessage = document.createElement('div');
loadingMessage.className = 'loading-message';
loadingMessage.textContent = '正在加载中…请耐心等待';
chatContent.appendChild(loadingMessage);
chatContent.scrollTop = chatContent.scrollHeight;
try {
const apiResponse = await sendMessageToAI(userMessage, isQuizMemory, isFillInMemory, isQuestionMemory, isPalaceMemory, isCompareMemory, isUnderstandMemory, isMindmapMemory);
chatContent.removeChild(loadingMessage);
appendChatMessage(chatContent, 'DeepSeek', apiResponse);
addCopyButton(chatContent, apiResponse);
} catch (error) {
chatContent.removeChild(loadingMessage);
const errorMessage = document.createElement('div');
errorMessage.textContent = '获取解答时出错,请稍后再试。';
chatContent.appendChild(errorMessage);
chatContent.scrollTop = chatContent.scrollHeight;
}
}
};
inputContainer.appendChild(sendButton);
chatWindow.appendChild(inputContainer);
} else if (isQuizMemory) {
// 出题助记专属逻辑
const inputContainer = document.createElement('div');
inputContainer.id = 'input-container';
const userInput = document.createElement('input');
userInput.type = 'text';
userInput.placeholder = '在此输入你想记忆的知识...';
inputContainer.appendChild(userInput);
const sendButton = document.createElement('button');
sendButton.textContent = '发送';
sendButton.onclick = async function() {
const userMessage = userInput.value.trim();
if (userMessage) {
userInput.value = '';
const loadingMessage = document.createElement('div');
loadingMessage.className = 'loading-message';
loadingMessage.textContent = '正在加载中…请耐心等待';
chatContent.appendChild(loadingMessage);
chatContent.scrollTop = chatContent.scrollHeight;
try {
const apiResponse = await sendMessageToAI(userMessage, true);
chatContent.removeChild(loadingMessage);
appendChatMessage(chatContent, 'DeepSeek', apiResponse);
addCopyButton(chatContent, apiResponse);
} catch (error) {
chatContent.removeChild(loadingMessage);
const errorMessage = document.createElement('div');
errorMessage.textContent = '获取解答时出错,请稍后再试。';
chatContent.appendChild(errorMessage);
chatContent.scrollTop = chatContent.scrollHeight;
}
}
};
inputContainer.appendChild(sendButton);
chatWindow.appendChild(inputContainer);
} else if (isAutoAnswer) {
// 获取页面自动解答窗口逻辑
const instruction = document.createElement('div');
instruction.id = 'auto-answer-instruction';
instruction.textContent = '按下下方按钮,获取页面解答。(仅支持可被选中的文本)';
chatWindow.appendChild(instruction);
const generateAnswerButton = document.createElement('button');
generateAnswerButton.id = 'generate-answer-button';
generateAnswerButton.textContent = '点击生成页面解答';
generateAnswerButton.onclick = async function() {
generateAutoAnswer(chatContent);
};
chatWindow.appendChild(generateAnswerButton);
} else {
// 对话DeepSeek窗口逻辑
const inputContainer = document.createElement('div');
inputContainer.id = 'input-container';
const userInput = document.createElement('input');
userInput.type = 'text';
userInput.placeholder = '在这里输入你的问题...';
inputContainer.appendChild(userInput);
const sendButton = document.createElement('button');
sendButton.textContent = '发送';
sendButton.onclick = async function() {
const userMessage = userInput.value.trim();
if (userMessage) {
userInput.value = '';
const loadingMessage = document.createElement('div');
loadingMessage.className = 'loading-message';
loadingMessage.textContent = '正在加载中…请耐心等待';
chatContent.appendChild(loadingMessage);
chatContent.scrollTop = chatContent.scrollHeight;
try {
const apiResponse = await sendMessageToAI(userMessage);
chatContent.removeChild(loadingMessage);
appendChatMessage(chatContent, '用户', userMessage);
appendChatMessage(chatContent, 'DeepSeek', apiResponse);
addCopyButton(chatContent, apiResponse);
} catch (error) {
chatContent.removeChild(loadingMessage);
const errorMessage = document.createElement('div');
errorMessage.textContent = '获取解答时出错,请稍后再试。';
chatContent.appendChild(errorMessage);
chatContent.scrollTop = chatContent.scrollHeight;
}
}
};
inputContainer.appendChild(sendButton);
chatWindow.appendChild(inputContainer);
}
// 添加拖动功能
let isDragging = false;
let offsetX = 0, offsetY = 0;
dragArea.addEventListener('mousedown', (e) => {
isDragging = true;
offsetX = e.clientX - chatWindow.offsetLeft;
offsetY = e.clientY - chatWindow.offsetTop;
});
document.addEventListener('mousemove', (e) => {
if (isDragging) {
chatWindow.style.left = `${e.clientX - offsetX}px`;
chatWindow.style.top = `${e.clientY - offsetY}px`;
}
});
document.addEventListener('mouseup', () => {
isDragging = false;
});
document.body.appendChild(chatWindow);
}
// 追加聊天消息
function appendChatMessage(container, label, message) {
const messageDiv = document.createElement('div');
messageDiv.innerHTML = `${label}
${message.replace(/\n/g, '
')}`;
container.appendChild(messageDiv);
container.scrollTop = container.scrollHeight;
}
// 添加复制按钮
function addCopyButton(container, content) {
const copyButton = document.createElement('div');
copyButton.className = 'copy-button';
copyButton.textContent = '点击复制此次回答';
copyButton.onclick = () => {
const textarea = document.createElement('textarea');
textarea.value = content;
document.body.appendChild(textarea);
textarea.select();
try {
document.execCommand('copy');
console.log('回答已复制到剪贴板');
} catch (err) {
console.error('无法复制回答:', err);
}
document.body.removeChild(textarea);
};
container.appendChild(copyButton);
container.scrollTop = container.scrollHeight;
}
// 生成自动解答
async function generateAutoAnswer(chatContent) {
const pageText = getPageText();
const prompt = `提供一段包含问题及其选项的文本,请为每个问题进行编号,并组织成清晰的问题集。然后对每道题的每个选项进行详细解答,包括知识点分析、正确答案推导及错误选项解释。请使用中文整理并输出。
—— ${pageText};`;
try {
const loadingMessage = document.createElement('div');
loadingMessage.className = 'loading-message';
loadingMessage.textContent = '正在加载中…请耐心等待';
chatContent.appendChild(loadingMessage);
chatContent.scrollTop = chatContent.scrollHeight;
const apiResponse = await sendMessageToAI(prompt);
chatContent.removeChild(loadingMessage);
appendChatMessage(chatContent, 'DeepSeek 回答:', apiResponse);
addCopyButton(chatContent, apiResponse);
} catch (error) {
const errorMessage = document.createElement('div');
errorMessage.textContent = '获取解答时出错,请稍后再试。';
chatContent.appendChild(errorMessage);
chatContent.scrollTop = chatContent.scrollHeight;
}
}
// 初始化按钮容器和父按钮
const buttonContainer = createButtonContainer();
document.body.appendChild(buttonContainer);
const parentButton = createParentButton(buttonContainer);
let isExpanded = false;
// 父按钮点击事件
parentButton.onclick = function(event) {
if (isExpanded) {
hideButtons();
} else {
showButtons();
}
isExpanded = !isExpanded;
};
// 拖动功能
let isDragging = false;
let initialY = 0;
let initialTop = 0;
buttonContainer.addEventListener('mousedown', (e) => {
isDragging = true;
initialY = e.clientY;
initialTop = parseInt(buttonContainer.style.bottom) || 180;
});
document.addEventListener('mousemove', (e) => {
if (isDragging) {
const dy = e.clientY - initialY;
const newBottom = initialTop - dy;
buttonContainer.style.bottom = `${newBottom}px`;
}
});
document.addEventListener('mouseup', () => {
isDragging = false;
});
// 强制重绘元素
function forceRedraw(element) {
element.style.zIndex = 1;
void element.offsetWidth;
element.style.zIndex = '';
}
// 显示子按钮
function showButtons() {
const buttons = Array.from(buttonContainer.querySelectorAll('.option-button'));
const initialTopOffset = -60;
buttons.forEach((button, index) => {
setTimeout(() => {
button.style.top = `${initialTopOffset - index * 60}px`;
button.style.opacity = '1';
button.style.pointerEvents = 'auto';
forceRedraw(button);
}, index * 200);
});
}
// 隐藏子按钮
function hideButtons() {
const buttons = Array.from(buttonContainer.querySelectorAll('.option-button')).reverse();
buttons.forEach((button, index) => {
setTimeout(() => {
button.style.opacity = '0';
button.style.pointerEvents = 'none';
setTimeout(() => {
button.style.top = '';
forceRedraw(button);
}, 200);
}, index * 200);
});
}
// 创建子按钮和聊天窗口
createOptionButtons(buttonContainer);
createChatWindow(false); // 对话DeepSeek窗口
createChatWindow(true); // 获取页面自动解答窗口
createChatWindow(false, true); // 出题助记窗口
createChatWindow(false, false, true); // 挖空助记窗口
createChatWindow(false, false, false, true); // 提问助记窗口
createChatWindow(false, false, false, false, true); // 宫殿记忆窗口
createChatWindow(false, false, false, false, false, true); // 对比助记窗口
createChatWindow(false, false, false, false, false, false, true); // 理解助记窗口
createChatWindow(false, false, false, false, false, false, false, true); // 思维导图助记窗口
})();