From aab2100e19509c19a1f9fafba49b48df7487afde Mon Sep 17 00:00:00 2001 From: t11003 Date: Wed, 25 Mar 2026 02:10:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=A8=8A?= =?UTF-8?q?=E6=81=AF=E6=99=82=E9=96=93=E6=88=B3=E9=A1=AF=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 9 +++++++++ style.css | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/index.html b/index.html index 31ae3b4..01c1a9d 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,7 @@

🤖 PR 練習 Chatbot

W5 Pull Request 練習

+
@@ -35,12 +36,20 @@

🤖 PR 練習 Chatbot

const userDiv = document.createElement('div'); userDiv.className = 'message user'; + const timeUser = document.createElement('span'); + timeUser.className = 'timestamp'; + timeUser.textContent = new Date().toLocaleTimeString('zh-TW', {hour:'2-digit', minute:'2-digit'}); userDiv.textContent = text; + userDiv.appendChild(timeUser); chatBox.appendChild(userDiv); const botDiv = document.createElement('div'); botDiv.className = 'message bot'; + const timeBot = document.createElement('span'); + timeBot.className = 'timestamp'; + timeBot.textContent = new Date().toLocaleTimeString('zh-TW', {hour:'2-digit', minute:'2-digit'}); botDiv.textContent = `你說了「${text}」!`; + botDiv.appendChild(timeBot); chatBox.appendChild(botDiv); input.value = ''; diff --git a/style.css b/style.css index 1401ed5..3b45d73 100644 --- a/style.css +++ b/style.css @@ -87,3 +87,26 @@ header .subtitle { font-size: 13px; opacity: 0.85; margin-top: 4px; } } .input-area button:hover { opacity: 0.85; } + +/* feature/add-search 新增 */ +header input { + margin-top: 8px; + width: 100%; + padding: 6px 10px; + border: none; + border-radius: 6px; + font-size: 13px; + background: rgba(255,255,255,0.25); + color: white; +} +header input::placeholder { color: rgba(255,255,255,0.7); } +.message.hidden { display: none; } + +/* feature/add-timestamp 新增 */ +.timestamp { + display: block; + font-size: 10px; + opacity: 0.6; + text-align: right; + margin-top: 4px; +} From 21a0f7f077720ef0f0938dc269b4d1d1faefa110 Mon Sep 17 00:00:00 2001 From: BobJu0721 Date: Wed, 25 Mar 2026 09:44:52 +0800 Subject: [PATCH 2/3] feat: D1257081 change title, theme color and button text --- index.html | 8 ++++---- style.css | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 31ae3b4..ff29217 100644 --- a/index.html +++ b/index.html @@ -2,15 +2,15 @@ - W5 PR 練習 Chatbot + D1257081 的 PR 練習 Chatbot
-

🤖 PR 練習 Chatbot

-

W5 Pull Request 練習

+

💬 D1257081 的 Chatbot

+

W5 Pull Request 練習 — by D1257081

@@ -21,7 +21,7 @@

🤖 PR 練習 Chatbot

- +
diff --git a/style.css b/style.css index 1401ed5..fcce22b 100644 --- a/style.css +++ b/style.css @@ -21,7 +21,7 @@ body { } header { - background: #4f8ef7; + background: linear-gradient(135deg, #00b894, #00cec9); color: white; padding: 20px 24px; } @@ -53,7 +53,7 @@ header .subtitle { font-size: 13px; opacity: 0.85; margin-top: 4px; } } .message.user { - background: #4f8ef7; + background: #00b894; color: white; align-self: flex-end; } @@ -74,10 +74,10 @@ header .subtitle { font-size: 13px; opacity: 0.85; margin-top: 4px; } outline: none; } -.input-area input:focus { border-color: #4f8ef7; } +.input-area input:focus { border-color: #00b894; } .input-area button { - background: #4f8ef7; + background: #00b894; color: white; border: none; padding: 10px 20px; From f89c952e41b0de6933800bdd5564f9f72a3eede5 Mon Sep 17 00:00:00 2001 From: BobJu0721 Date: Wed, 25 Mar 2026 10:05:24 +0800 Subject: [PATCH 3/3] feat: add searchMessages function for chat history search --- index.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.html b/index.html index e97bbc0..68a4f3a 100644 --- a/index.html +++ b/index.html @@ -27,6 +27,19 @@

💬 D1257081 的 Chatbot