Spaces:
Runtime error
Runtime error
feat: move chatlog panel to right side with mobile responsive layout
Browse files
frontend/electron-standalone.html
CHANGED
|
@@ -400,10 +400,17 @@
|
|
| 400 |
body.desktop-shell #asset-drawer {
|
| 401 |
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
|
| 402 |
}
|
| 403 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
#main-stage {
|
| 405 |
position: relative;
|
| 406 |
width: 1280px;
|
|
|
|
| 407 |
transition: margin-left .25s ease;
|
| 408 |
will-change: margin-left;
|
| 409 |
}
|
|
@@ -420,8 +427,9 @@
|
|
| 420 |
flex-wrap: wrap;
|
| 421 |
}
|
| 422 |
#chatlog-panel {
|
| 423 |
-
width:
|
| 424 |
-
|
|
|
|
| 425 |
background: #1a1d27;
|
| 426 |
border: 4px solid #0e1119;
|
| 427 |
padding: 12px 16px;
|
|
@@ -1493,12 +1501,26 @@
|
|
| 1493 |
overflow: hidden;
|
| 1494 |
}
|
| 1495 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1496 |
#main-stage {
|
| 1497 |
width: 100vw;
|
| 1498 |
min-width: 0;
|
| 1499 |
margin-left: 0 !important;
|
| 1500 |
}
|
| 1501 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1502 |
#bottom-panels {
|
| 1503 |
width: 100vw;
|
| 1504 |
max-width: 100vw;
|
|
@@ -1641,6 +1663,7 @@
|
|
| 1641 |
</div>
|
| 1642 |
</div>
|
| 1643 |
|
|
|
|
| 1644 |
<div id="main-stage">
|
| 1645 |
<div id="game-container">
|
| 1646 |
<div id="status-text">加载中...</div>
|
|
@@ -1650,24 +1673,27 @@
|
|
| 1650 |
<span class="office-plaque-star">⭐</span>
|
| 1651 |
</div>
|
| 1652 |
</div>
|
| 1653 |
-
|
| 1654 |
<!-- 底部面板容器 -->
|
| 1655 |
<div id="bottom-panels">
|
| 1656 |
-
|
| 1657 |
-
|
| 1658 |
-
|
| 1659 |
-
|
| 1660 |
-
|
| 1661 |
-
|
| 1662 |
-
|
| 1663 |
-
|
| 1664 |
-
</span>
|
| 1665 |
-
|
| 1666 |
-
|
| 1667 |
-
|
| 1668 |
-
|
|
|
|
|
|
|
| 1669 |
</div>
|
| 1670 |
</div>
|
|
|
|
| 1671 |
|
| 1672 |
<div id="asset-highlight"></div>
|
| 1673 |
<div id="room-loading-overlay" aria-live="polite" aria-busy="true">
|
|
@@ -5553,12 +5579,12 @@ function toggleBrokerPanel() {
|
|
| 5553 |
function renderChatlog() {
|
| 5554 |
const el = document.getElementById('chatlog-content');
|
| 5555 |
if (!el || chatlogCache.length === 0) return;
|
| 5556 |
-
el.innerHTML = chatlogCache.map(m => {
|
| 5557 |
const cls = (m.speaker || '').toLowerCase();
|
| 5558 |
const text = chatLang === 'zh' ? (m.text_zh || m.text || '') : (m.text || '');
|
| 5559 |
return `<div class="chat-msg"><span class="chat-speaker ${cls}">${m.speaker}:</span> ${text}</div>`;
|
| 5560 |
}).join('');
|
| 5561 |
-
el.scrollTop =
|
| 5562 |
}
|
| 5563 |
function fetchChatlog() {
|
| 5564 |
fetch('/api/chatlog?t=' + Date.now(), { cache: 'no-store' })
|
|
|
|
| 400 |
body.desktop-shell #asset-drawer {
|
| 401 |
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
|
| 402 |
}
|
| 403 |
+
/* 主舞台 + 右侧对话布局 */
|
| 404 |
+
#stage-row {
|
| 405 |
+
display: flex;
|
| 406 |
+
flex-direction: row;
|
| 407 |
+
align-items: flex-start;
|
| 408 |
+
gap: 16px;
|
| 409 |
+
}
|
| 410 |
#main-stage {
|
| 411 |
position: relative;
|
| 412 |
width: 1280px;
|
| 413 |
+
flex-shrink: 0;
|
| 414 |
transition: margin-left .25s ease;
|
| 415 |
will-change: margin-left;
|
| 416 |
}
|
|
|
|
| 427 |
flex-wrap: wrap;
|
| 428 |
}
|
| 429 |
#chatlog-panel {
|
| 430 |
+
width: 340px;
|
| 431 |
+
flex-shrink: 0;
|
| 432 |
+
height: 720px;
|
| 433 |
background: #1a1d27;
|
| 434 |
border: 4px solid #0e1119;
|
| 435 |
padding: 12px 16px;
|
|
|
|
| 1501 |
overflow: hidden;
|
| 1502 |
}
|
| 1503 |
|
| 1504 |
+
#stage-row {
|
| 1505 |
+
flex-direction: column;
|
| 1506 |
+
gap: 0;
|
| 1507 |
+
}
|
| 1508 |
+
|
| 1509 |
#main-stage {
|
| 1510 |
width: 100vw;
|
| 1511 |
min-width: 0;
|
| 1512 |
margin-left: 0 !important;
|
| 1513 |
}
|
| 1514 |
|
| 1515 |
+
#chatlog-panel {
|
| 1516 |
+
width: 100vw;
|
| 1517 |
+
height: auto;
|
| 1518 |
+
max-height: 33vh;
|
| 1519 |
+
border-left: 0;
|
| 1520 |
+
border-right: 0;
|
| 1521 |
+
border-radius: 0;
|
| 1522 |
+
}
|
| 1523 |
+
|
| 1524 |
#bottom-panels {
|
| 1525 |
width: 100vw;
|
| 1526 |
max-width: 100vw;
|
|
|
|
| 1663 |
</div>
|
| 1664 |
</div>
|
| 1665 |
|
| 1666 |
+
<div id="stage-row">
|
| 1667 |
<div id="main-stage">
|
| 1668 |
<div id="game-container">
|
| 1669 |
<div id="status-text">加载中...</div>
|
|
|
|
| 1673 |
<span class="office-plaque-star">⭐</span>
|
| 1674 |
</div>
|
| 1675 |
</div>
|
| 1676 |
+
|
| 1677 |
<!-- 底部面板容器 -->
|
| 1678 |
<div id="bottom-panels">
|
| 1679 |
+
</div>
|
| 1680 |
+
</div><!-- /main-stage -->
|
| 1681 |
+
|
| 1682 |
+
<!-- 右侧对话面板 -->
|
| 1683 |
+
<div id="chatlog-panel">
|
| 1684 |
+
<div id="chatlog-title">
|
| 1685 |
+
🦞 Adam ↔ Eve
|
| 1686 |
+
<span id="chatlog-lang-toggle" style="float:right;font-size:12px;cursor:pointer;">
|
| 1687 |
+
<span id="chatlog-lang-en" onclick="setChatLang('en')" style="opacity:1;">EN</span>
|
| 1688 |
+
<span style="margin:0 4px;color:#555;">|</span>
|
| 1689 |
+
<span id="chatlog-lang-zh" onclick="setChatLang('zh')" style="opacity:0.4;">中文</span>
|
| 1690 |
+
</span>
|
| 1691 |
+
</div>
|
| 1692 |
+
<div id="chatlog-content">
|
| 1693 |
+
<div style="color:#9ca3af;font-size:12px;text-align:center;padding:20px 0;">Waiting for conversation to start...</div>
|
| 1694 |
</div>
|
| 1695 |
</div>
|
| 1696 |
+
</div><!-- /stage-row -->
|
| 1697 |
|
| 1698 |
<div id="asset-highlight"></div>
|
| 1699 |
<div id="room-loading-overlay" aria-live="polite" aria-busy="true">
|
|
|
|
| 5579 |
function renderChatlog() {
|
| 5580 |
const el = document.getElementById('chatlog-content');
|
| 5581 |
if (!el || chatlogCache.length === 0) return;
|
| 5582 |
+
el.innerHTML = chatlogCache.slice().reverse().map(m => {
|
| 5583 |
const cls = (m.speaker || '').toLowerCase();
|
| 5584 |
const text = chatLang === 'zh' ? (m.text_zh || m.text || '') : (m.text || '');
|
| 5585 |
return `<div class="chat-msg"><span class="chat-speaker ${cls}">${m.speaker}:</span> ${text}</div>`;
|
| 5586 |
}).join('');
|
| 5587 |
+
el.scrollTop = 0;
|
| 5588 |
}
|
| 5589 |
function fetchChatlog() {
|
| 5590 |
fetch('/api/chatlog?t=' + Date.now(), { cache: 'no-store' })
|