diff --git a/channel/web/chat.html b/channel/web/chat.html index 73881ca..5186a80 100644 --- a/channel/web/chat.html +++ b/channel/web/chat.html @@ -190,12 +190,19 @@ .bot-container { background-color: var(--bot-msg-bg); - border-bottom: 1px solid var(--border-color); + /* border-bottom: 1px solid var(--border-color); */ width: 100%; - margin: 0 -20px; + margin: 0; padding: 20px; } + .user-container { + width: 100%; + margin: 0; + padding: 20px; + border-bottom: 1px solid var(--border-color); + } + .avatar { width: 30px; height: 30px; @@ -222,12 +229,30 @@ flex: 1; line-height: 1.6; padding-top: 2px; + text-align: left; } .message { width: 100%; word-wrap: break-word; white-space: pre-wrap; + line-height: 1.3; + } + + .message p { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + .message p:empty { + margin: 0; + line-height: 0.7em; + } + + .message p:empty::before { + content: ""; + display: inline-block; + height: 0.7em; } .message pre { @@ -319,8 +344,9 @@ #send { position: absolute; + top: 0; right: 10px; - bottom: 10px; + height: 100%; background-color: transparent; border: none; color: var(--primary-color); @@ -330,7 +356,6 @@ align-items: center; justify-content: center; width: 32px; - height: 32px; border-radius: 4px; transition: background-color 0.2s; } @@ -484,6 +509,68 @@ color: #d4d4d4 !important; } } + + .typing-indicator { + display: inline-flex; + align-items: center; + margin-left: 0; + justify-content: flex-start; + width: auto; + position: relative; + top: -5px; + left: -10px; + } + + .typing-indicator span { + height: 8px; + width: 8px; + margin: 0 2px; + background-color: var(--text-light); + border-radius: 50%; + display: inline-block; + opacity: 0.4; + } + + .typing-indicator span:nth-child(1) { + animation: pulse 1s infinite; + } + + .typing-indicator span:nth-child(2) { + animation: pulse 1s infinite 0.2s; + } + + .typing-indicator span:nth-child(3) { + animation: pulse 1s infinite 0.4s; + } + + @keyframes pulse { + 0% { + opacity: 0.4; + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(1.2); + } + 100% { + opacity: 0.4; + transform: scale(1); + } + } + + .history-divider { + padding: 10px; + color: var(--text-light); + font-size: 0.8rem; + text-transform: uppercase; + letter-spacing: 1px; + margin-top: 10px; + } + + .history-item.active { + background-color: rgba(255, 255, 255, 0.1); + font-weight: bold; + }
@@ -530,12 +617,12 @@我可以回答问题、提供信息或者帮助您完成各种任务
+ +${content.replace(/\n/g, '
')}
${content.replace(/\n/g, '
')}