优化一些显示的细节
This commit is contained in:
1 parent
d81bb627b0
commit
fd059a6db1
5 files changed
+38
-45
No files matched your search
+19
-38
@@ -139,7 +139,7 @@ body {
|
||||
}
|
||||
|
||||
/* Language switcher specific styles */
|
||||
/* 语言切换器专用样式 */
|
||||
/* 语言切换器专用样式 */npx browserify ChatCrypt.cjs -o ChatCrypt.js
|
||||
.language-current {
|
||||
font-weight: 500;
|
||||
color: #30a8f7;
|
||||
@@ -183,7 +183,7 @@ body {
|
||||
|
||||
.language-select:focus {
|
||||
border-color: #30a8f7;
|
||||
box-shadow: 0 0 0 3px rgba(48, 168, 247, 0.1);
|
||||
box-shadow: 0 0 0 3px rgba(48,168,247,0.1);
|
||||
}
|
||||
|
||||
.language-select option {
|
||||
@@ -982,10 +982,8 @@ body {
|
||||
}
|
||||
|
||||
.rightbar-header {
|
||||
padding: 23.27px 18px 24px 18px;
|
||||
padding: 20.27px 18px 24px 18px;
|
||||
border-bottom: 1px solid #dcdcdc;
|
||||
background: #fff;
|
||||
border-radius: 0 12px 0 0;
|
||||
}
|
||||
|
||||
.rightbar-group {
|
||||
@@ -1071,6 +1069,20 @@ body {
|
||||
color: #30a8f7;
|
||||
}
|
||||
|
||||
.member-tip {
|
||||
font-size: 13px;
|
||||
color: #888;
|
||||
padding: 4px 18px 2px 18px;
|
||||
margin: 0 0 2px 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.member-tip-center {
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
background: #fff;
|
||||
@@ -1096,7 +1108,7 @@ body {
|
||||
.file-main-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 6px 6px;
|
||||
padding: 3px 3px;
|
||||
gap: 12px;
|
||||
max-width: 200px;
|
||||
}
|
||||
@@ -1619,7 +1631,7 @@ body {
|
||||
}
|
||||
|
||||
.file-main-content {
|
||||
padding: 10px 14px;
|
||||
padding: 3px 3px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
@@ -1660,37 +1672,6 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.file-message {
|
||||
max-width: 240px;
|
||||
}
|
||||
|
||||
.file-main-content {
|
||||
padding: 8px 12px;
|
||||
gap: 8px;
|
||||
/* 保持水平布局,不改为垂直 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.file-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.file-download-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
padding: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.file-download-btn svg {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
|
||||
+3
-2
@@ -361,8 +361,9 @@ function renderFileMessage(fileData, isSender) {
|
||||
// For archive files, show file count and total size
|
||||
let displayName, displayMeta;
|
||||
if (isArchive && fileCount) {
|
||||
displayName = `${fileCount} files`;
|
||||
displayMeta = `Total: ${formatFileSize(originalSize)}`;
|
||||
// 使用 i18n,保持原格式
|
||||
displayName = `${fileCount}${t('file.files', ' files')}`;
|
||||
displayMeta = `${t('file.total', 'Total')}: ${formatFileSize(originalSize)}`;
|
||||
} else {
|
||||
displayName = fileName;
|
||||
displayMeta = formatFileSize(originalSize);
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ export function handleClientLeft(idx, clientId) {
|
||||
}
|
||||
const user = rd.userMap[clientId];
|
||||
const name = user ? (user.userName || user.username || user.name || 'Anonymous') : 'Anonymous';
|
||||
const msg = `${name} left`;
|
||||
const msg = `${name} ${t('system.left', 'left the conversation')}`;
|
||||
rd.messages.push({
|
||||
type: 'system',
|
||||
text: msg
|
||||
|
||||
@@ -264,6 +264,13 @@ export function renderUserList(updateHeader = false) {
|
||||
if (!rd) return;
|
||||
const me = rd.userList.find(u => u.clientId === rd.myId);
|
||||
const others = rd.userList.filter(u => u.clientId !== rd.myId);
|
||||
// 新增:如有其他成员,顶部插入简洁提示
|
||||
if (others.length > 0) {
|
||||
const tip = document.createElement('div');
|
||||
tip.className = 'member-tip member-tip-center';
|
||||
tip.textContent = t('ui.start_private_chat', '选择用户开始私信');
|
||||
userListEl.appendChild(tip);
|
||||
}
|
||||
if (me) userListEl.appendChild(createUserItem(me, true));
|
||||
others.forEach(u => userListEl.appendChild(createUserItem(u, false)));
|
||||
if (updateHeader) {
|
||||
|
||||
@@ -24,6 +24,7 @@ const LANGUAGES = {
|
||||
'ui.private_message_to': 'Private Message to',
|
||||
'ui.me': ' (me)',
|
||||
'ui.anonymous': 'Anonymous',
|
||||
'ui.start_private_chat': 'Select for private chat',
|
||||
|
||||
// Settings panel
|
||||
'settings.title': 'Settings',
|
||||
@@ -79,6 +80,7 @@ const LANGUAGES = {
|
||||
'system.security_warning': '⚠️ This link uses an old format. Room data is not encrypted.',
|
||||
'system.file_send_failed': 'Failed to send files:',
|
||||
'system.joined': 'joined the conversation',
|
||||
'system.left': 'left the conversation',
|
||||
'system.secured': 'connection secured',
|
||||
'system.private_message_failed': 'Cannot send private message to',
|
||||
'system.private_file_failed': 'Cannot send private file to',
|
||||
@@ -91,20 +93,21 @@ const LANGUAGES = {
|
||||
flag: '🇨🇳',
|
||||
translations: {
|
||||
// Login and main UI
|
||||
'ui.enter_node': '进入节点',
|
||||
'ui.enter_node': '进入新的节点',
|
||||
'ui.username': '用户名',
|
||||
'ui.node_name': '节点名称',
|
||||
'ui.node_password': '节点密码',
|
||||
'ui.optional': '(可选)',
|
||||
'ui.enter': '进入',
|
||||
'ui.enter': '确定',
|
||||
'ui.connecting': '连接中...',
|
||||
'ui.node_exists': '节点已存在',
|
||||
'ui.node_exists': '此节点已存在',
|
||||
'ui.my_name': '我的名字',
|
||||
'ui.members': '成员',
|
||||
'ui.members': '在线成员',
|
||||
'ui.message': '消息',
|
||||
'ui.private_message_to': '私信给',
|
||||
'ui.me': '(我)',
|
||||
'ui.anonymous': '匿名用户',
|
||||
'ui.start_private_chat': '选择用户开始私信',
|
||||
|
||||
// Settings panel
|
||||
'settings.title': '设置',
|
||||
@@ -160,6 +163,7 @@ const LANGUAGES = {
|
||||
'system.security_warning': '⚠️ 此链接使用旧格式,房间数据未加密。',
|
||||
'system.file_send_failed': '文件发送失败:',
|
||||
'system.joined': '加入了对话',
|
||||
'system.left': '离开了对话',
|
||||
'system.secured': '连接已安全',
|
||||
'system.private_message_failed': '无法发送私信给',
|
||||
'system.private_file_failed': '无法发送私密文件给',
|
||||
|
||||
Reference in new issue
Block a user