From 05e900c5afb727ce19f38709d4ff441efd3ff032 Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Sun, 26 Apr 2026 17:16:38 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=BD=AE=E9=A1=B6?= =?UTF-8?q?=E7=BD=AE=E5=BA=95=E5=AF=BC=E8=88=AA=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- www/app.js | 52 ++++++++++++++++++++++++++++++++++++++++++-------- www/index.html | 6 +++--- www/style.css | 24 +++++++++++++++++++++++ 3 files changed, 71 insertions(+), 11 deletions(-) diff --git a/www/app.js b/www/app.js index d8520c0..0a0fdfa 100644 --- a/www/app.js +++ b/www/app.js @@ -179,14 +179,24 @@ function openConversation(id) {
- - +
+ + +
+
+ + +
@@ -264,6 +274,32 @@ function openConversation(id) { }); } + // 绑定置顶置底按钮事件 + const scrollTopBtn = document.getElementById('scrollTopBtn'); + const scrollBottomBtn = document.getElementById('scrollBottomBtn'); + + if (scrollTopBtn) { + scrollTopBtn.addEventListener('click', () => { + if (messagesContainer) { + messagesContainer.scrollTo({ + top: 0, + behavior: 'smooth' + }); + } + }); + } + + if (scrollBottomBtn) { + scrollBottomBtn.addEventListener('click', () => { + if (messagesContainer) { + messagesContainer.scrollTo({ + top: messagesContainer.scrollHeight, + behavior: 'smooth' + }); + } + }); + } + // 绑定输入事件 userInput.addEventListener('keydown', handleKeyDown); userInput.addEventListener('input', (e) => autoResize(e.target)); diff --git a/www/index.html b/www/index.html index 9fce4f5..f511bc8 100644 --- a/www/index.html +++ b/www/index.html @@ -8,12 +8,12 @@ AI助手 - +
- - + + \ No newline at end of file diff --git a/www/style.css b/www/style.css index 1d0a5c4..828c3cb 100644 --- a/www/style.css +++ b/www/style.css @@ -585,12 +585,24 @@ body { /* 功能开关栏 */ .feature-bar { display: flex; + justify-content: space-between; + align-items: center; gap: 8px; padding: 8px 16px; background: rgba(255,255,255,0.95); border-top: 1px solid var(--border-color); } +.feature-left { + display: flex; + gap: 8px; +} + +.feature-right { + display: flex; + gap: 4px; +} + .feature-btn { display: flex; align-items: center; @@ -620,6 +632,18 @@ body { flex-shrink: 0; } +/* 导航按钮样式 */ +.nav-btn { + padding: 6px 8px; + min-width: 32px; +} + +.nav-btn:hover { + background: var(--primary); + border-color: var(--primary); + color: white; +} + /* 思考内容块 */ .thinking-block { margin-bottom: 12px;