diff --git a/Build_God_Game/src/components/ChatBox.vue b/Build_God_Game/src/components/ChatBox.vue index 78d5c63..c240697 100644 --- a/Build_God_Game/src/components/ChatBox.vue +++ b/Build_God_Game/src/components/ChatBox.vue @@ -1,21 +1,28 @@ - - - 聊天 + + + {{ embedded ? '聊天大厅' : '聊天' }} - {{ isConnected ? '●' : '○' }} + {{ isConnected ? '已连接' : '未连接' }} - {{ isExpanded ? '▼' : '▲' }} + {{ isExpanded ? '▼' : '▲' }} - - + + { z-index: 100; } +.chat-box--embedded { + position: relative; + max-width: none; + width: 100%; + margin: 0; + border: 1px solid rgba(255, 255, 255, 0.12); + border-radius: 14px; + background: rgba(12, 14, 20, 0.92); + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45); + z-index: 5; + display: flex; + flex-direction: column; + min-height: 0; + flex: 1; +} + .chat-header { display: flex; align-items: center; @@ -153,6 +199,13 @@ const toggleExpand = () => { background: rgba(255, 255, 255, 0.03); } +.chat-header--static { + cursor: default; + border-radius: 14px 14px 0 0; + border-bottom: 1px solid rgba(255, 255, 255, 0.08); + background: rgba(255, 255, 255, 0.05); +} + .chat-title { color: #aaaaaa; font-size: 0.85rem; @@ -160,13 +213,13 @@ const toggleExpand = () => { } .chat-status { - font-size: 0.6rem; + font-size: 0.72rem; color: #666666; margin-right: 8px; } .chat-status.connected { - color: #44ff44; + color: #4ade80; } .expand-icon { @@ -180,6 +233,12 @@ const toggleExpand = () => { max-height: 250px; } +.chat-content--embedded { + max-height: none; + flex: 1; + min-height: 0; +} + .messages-container { flex: 1; overflow-y: auto; @@ -187,7 +246,18 @@ const toggleExpand = () => { max-height: 180px; } -/* 自定义滚动条 */ +.chat-box--embedded .messages-container { + max-height: none; + min-height: 220px; + flex: 1; +} + +@media (min-width: 900px) { + .chat-box--embedded .messages-container { + min-height: 320px; + } +} + .messages-container::-webkit-scrollbar { width: 6px; } @@ -207,12 +277,16 @@ const toggleExpand = () => { } .message { - font-size: 0.75rem; + font-size: 0.8rem; line-height: 1.6; padding: 2px 0; word-break: break-all; } +.chat-box--embedded .message { + font-size: 0.85rem; +} + .message-time { color: #555555; margin-right: 6px; diff --git a/Build_God_Game/src/views/GameView.vue b/Build_God_Game/src/views/GameView.vue index eda4a1c..89d0449 100644 --- a/Build_God_Game/src/views/GameView.vue +++ b/Build_God_Game/src/views/GameView.vue @@ -1,5 +1,5 @@ - - - - - - {{ characterStore.currentCharacter?.name || '未选择角色' }} - {{ characterStore.currentCharacter?.levelName || '' }} + +