From 72743e2809aeb98774c2fccfe39f91b7a6a87c68 Mon Sep 17 00:00:00 2001 From: gfjz-ruijun <994923161@qq.com> Date: Fri, 28 Feb 2025 20:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EAI=E5=8F=8D=E8=AF=88=E5=8A=A9?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E5=92=8C=E8=BD=AF=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 15 ++++++ web/ai-assistant.css | 108 ++++++++++++++++++++++++++++++++++++++++++ web/ai-assistant.html | 30 ++++++++++++ web/ai-assistant.js | 69 +++++++++++++++++++++++++++ web/index.html | 6 +-- web/settings.css | 99 ++++++++++++++++++++++++++++++++++++++ web/settings.html | 42 ++++++++++++++++ web/settings.js | 51 ++++++++++++++++++++ 8 files changed, 417 insertions(+), 3 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 web/ai-assistant.css create mode 100644 web/ai-assistant.html create mode 100644 web/ai-assistant.js create mode 100644 web/settings.css create mode 100644 web/settings.html create mode 100644 web/settings.js diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..39a8bad --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "针对 localhost 启动 Chrome", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/web/ai-assistant.css b/web/ai-assistant.css new file mode 100644 index 0000000..0f8f2c4 --- /dev/null +++ b/web/ai-assistant.css @@ -0,0 +1,108 @@ + /* 全局样式 */ + body { + font-family: Arial, sans-serif; + background-color: #f5f5f5; /* 浅灰色背景 */ + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + } + + /* 容器样式 */ + .chat-container { + background-color: #ffffff; /* 白色背景 */ + border-radius: 15px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + width: 90%; + max-width: 500px; + height: 80vh; + display: flex; + flex-direction: column; + overflow: hidden; + } + + /* 标题栏样式 */ + .header { + background-color: #000000; /* 蓝色标题栏 */ + color: #ffffff; + text-align: center; + padding: 15px; + font-size: 20px; + font-weight: bold; + border-top-left-radius: 15px; + border-top-right-radius: 15px; + } + + /* 对话内容区域样式 */ + .chat-box { + flex: 1; + padding: 15px; + overflow-y: auto; + border-bottom: 1px solid #ddd; + } + + /* 用户消息样式 */ + .user-message { + text-align: right; + margin-bottom: 10px; + } + + .user-message .message { + display: inline-block; + background-color: #cad4ff; /* 绿色背景 */ + color: #000; + padding: 10px 15px; + border-radius: 15px; + max-width: 70%; + } + + /* AI消息样式 */ + .ai-message { + text-align: left; + margin-bottom: 10px; + } + + .ai-message .message { + display: inline-block; + background-color: #ececec; /* 灰色背景 */ + color: #000; + padding: 10px 15px; + border-radius: 15px; + max-width: 70%; + } + + /* 输入区域样式 */ + .input-area { + display: flex; + padding: 10px; + background-color: #f9f9f9; + border-bottom-left-radius: 15px; + border-bottom-right-radius: 15px; + } + + .input-area input { + flex: 1; + padding: 10px; + border: 1px solid #ddd; + border-radius: 25px; + font-size: 16px; + outline: none; + } + + .input-area button { + background-color: #000000; /* 蓝色按钮 */ + color: #ffffff; + border: none; + padding: 10px 15px; + margin-left: 10px; + border-radius: 25px; + cursor: pointer; + font-size: 16px; + transition: background-color 0.3s ease; + } + + .input-area button:hover { + background-color: #0d47a1; /* 深蓝色按钮 */ + } \ No newline at end of file diff --git a/web/ai-assistant.html b/web/ai-assistant.html new file mode 100644 index 0000000..7fec89b --- /dev/null +++ b/web/ai-assistant.html @@ -0,0 +1,30 @@ + + +
+ + +