fix: 恢复原始input输入框风格,文件上传改为轻量适配

This commit is contained in:
root
2026-04-29 10:17:13 +08:00
parent df156ba840
commit 64b31bbf4f

View File

@ -298,10 +298,10 @@
text-align: right; text-align: right;
} }
.chat-input-area { .chat-input-area {
padding: 12px 16px; padding: 10px 12px;
border-top: 1px solid rgba(100, 100, 255, 0.15); border-top: 1px solid rgba(100, 100, 255, 0.15);
display: flex; display: flex;
gap: 8px; gap: 6px;
flex-shrink: 0; flex-shrink: 0;
} }
.chat-input-area input { .chat-input-area input {
@ -331,23 +331,6 @@
.chat-input-area button:hover { .chat-input-area button:hover {
background: rgba(68, 136, 255, 0.5); background: rgba(68, 136, 255, 0.5);
} }
.chat-input-area textarea {
flex: 1;
background: rgba(20, 20, 40, 0.9);
border: 1px solid rgba(100, 100, 255, 0.2);
color: #eee;
padding: 10px 14px;
border-radius: 6px;
font-family: 'Courier New', monospace;
font-size: 13px;
outline: none;
resize: none;
min-height: 40px;
max-height: 120px;
}
.chat-input-area textarea:focus {
border-color: rgba(68, 136, 255, 0.5);
}
.attach-btn { .attach-btn {
background: rgba(68, 136, 255, 0.2); background: rgba(68, 136, 255, 0.2);
border: 1px solid rgba(68, 136, 255, 0.3); border: 1px solid rgba(68, 136, 255, 0.3);
@ -369,42 +352,44 @@
.chat-files-container { .chat-files-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 6px; gap: 3px;
padding: 8px 16px; padding: 2px 12px 6px;
border-top: 1px solid rgba(100, 100, 255, 0.1); min-height: 0;
background: rgba(10, 10, 25, 0.5);
} }
.chat-file-chip { .chat-file-chip {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 6px; gap: 4px;
background: rgba(40, 40, 80, 0.8); background: rgba(40, 40, 80, 0.7);
border: 1px solid rgba(100, 100, 255, 0.25); border: 1px solid rgba(100, 100, 255, 0.2);
border-radius: 4px; border-radius: 3px;
padding: 4px 8px; padding: 2px 6px;
font-size: 12px; font-size: 11px;
color: #dde; color: #dde;
max-width: 200px; max-width: 160px;
cursor: default;
} }
.chat-file-chip .file-icon { .chat-file-chip .file-icon {
color: #7af; color: #7af;
flex-shrink: 0; flex-shrink: 0;
font-size: 10px;
} }
.chat-file-chip .file-name { .chat-file-chip .file-name {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
flex: 1; flex: 1;
font-size: 11px;
} }
.chat-file-chip .file-size { .chat-file-chip .file-size {
color: #889; color: #667;
font-size: 10px; font-size: 9px;
flex-shrink: 0; flex-shrink: 0;
} }
.chat-file-chip .file-remove { .chat-file-chip .file-remove {
color: #f66; color: #f66;
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 12px;
line-height: 1; line-height: 1;
flex-shrink: 0; flex-shrink: 0;
} }
@ -412,22 +397,8 @@
color: #f33; color: #f33;
} }
.chat-messages.drag-over { .chat-messages.drag-over {
background: rgba(68, 136, 255, 0.15); background: rgba(68, 136, 255, 0.12);
border: 2px dashed rgba(68, 136, 255, 0.6);
}
.chat-messages.drag-over::after {
content: '📄 松开以上传文件';
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
background: rgba(10, 10, 40, 0.9);
border: 2px dashed rgba(68, 136, 255, 0.5); border: 2px dashed rgba(68, 136, 255, 0.5);
color: #4488ff;
padding: 20px 40px;
border-radius: 12px;
font-size: 18px;
z-index: 10;
pointer-events: none;
} }
.chat-status { .chat-status {
padding: 8px 16px; padding: 8px 16px;
@ -533,7 +504,7 @@
<div class="chat-welcome">你好!我是 TrulyMEM你的图记忆助手~</div> <div class="chat-welcome">你好!我是 TrulyMEM你的图记忆助手~</div>
</div> </div>
<div class="chat-input-area"> <div class="chat-input-area">
<textarea id="chatInput" placeholder="输入消息..." autocomplete="off" rows="1"></textarea> <input type="text" id="chatInput" placeholder="输入消息..." autocomplete="off">
<button class="attach-btn" id="attachBtn" title="添加文件">📎</button> <button class="attach-btn" id="attachBtn" title="添加文件">📎</button>
<button id="chatSendBtn">发送</button> <button id="chatSendBtn">发送</button>
</div> </div>
@ -1916,12 +1887,6 @@ function smoothReposition() {
}); });
} }
// 输入框自适应高度
chatInput.addEventListener('input', () => {
chatInput.style.height = 'auto';
chatInput.style.height = Math.min(chatInput.scrollHeight, 120) + 'px';
});
attachBtn.addEventListener('click', () => fileInput.click()); attachBtn.addEventListener('click', () => fileInput.click());
fileInput.addEventListener('change', () => { fileInput.addEventListener('change', () => {