Layout (after iterative feedback): - Two columns: board+eval (left, square) | chat full-height (right). - Moves row floats just under the board as a compact one-row strip with the controls (new game / settings) — replaces the old right sidebar. - Board sized imperatively via fitBoard + ResizeObserver; eval bar height matches the board exactly (no overflow into neighbours). Eval bar: - 36px wide (was 28); text fits without pill background. - System sans-serif, 10.5px / 700 weight, tabular-nums. - Text positioned on whichever side is winning (bottom-white-half when white ahead → dark text; top-black-half when black ahead → light). - Sign now correct: backend stores raw cp from side-to-move; frontend flips when FEN says "b" so the bar always reflects white POV. Replay: - evalByFen on the client gets backfilled from /api/state's new `evals` list (backend keeps state.eval_cache per game). Clicking past bubbles now restores the stockfish eval for that ply. - renderBoard clears stockfish arrow when no eval is known yet for the shown FEN, so the arrow no longer 'lags' onto the next position. Auto-focus: - Latest played move is highlighted in both the chat bubble list and the moves strip when in live mode (viewPly === null). - scrollIntoView keeps the active bubble/SAN visible after each move.
172 lines
5.5 KiB
CSS
172 lines
5.5 KiB
CSS
* { box-sizing: border-box; }
|
|
html, body { height: 100%; margin: 0; }
|
|
body {
|
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
background: #0f0f12;
|
|
color: #e7e5e4;
|
|
font-size: 13px;
|
|
}
|
|
|
|
/* ============ layout: 2 columns ============ */
|
|
#layout {
|
|
display: grid;
|
|
grid-template-columns: minmax(440px, min(900px, 60vw)) minmax(380px, 1fr);
|
|
grid-template-rows: 1fr;
|
|
grid-template-areas: "board chat";
|
|
height: 100vh;
|
|
width: 100vw;
|
|
gap: 20px;
|
|
padding: 14px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#board-col { grid-area: board; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
|
|
#chat-col { grid-area: chat; min-width: 0; min-height: 0; overflow: hidden; }
|
|
|
|
/* ============ board area ============ */
|
|
#board-row {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-start;
|
|
gap: 12px;
|
|
flex: 1 1 auto;
|
|
min-height: 0;
|
|
min-width: 0;
|
|
}
|
|
#board {
|
|
/* size set imperatively by fitBoard() */
|
|
background: #444;
|
|
border-radius: 4px;
|
|
overflow: hidden;
|
|
flex: 0 0 auto;
|
|
}
|
|
#board cg-container { width: 100% !important; height: 100% !important; }
|
|
|
|
#board-footer {
|
|
display: flex; gap: 10px; align-items: center;
|
|
padding: 4px 2px;
|
|
font-size: 12.5px;
|
|
}
|
|
#status-line { flex: 0 0 auto; opacity: 0.85; }
|
|
#sf-pv { flex: 1; opacity: 0.5; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
|
|
/* ============ eval bar ============ */
|
|
#eval-col {
|
|
position: relative;
|
|
width: 36px;
|
|
flex: 0 0 36px;
|
|
background: #2a2a30; /* BLACK half on top */
|
|
border-radius: 4px;
|
|
overflow: hidden;
|
|
box-shadow: inset 0 0 0 1px #3a3a40;
|
|
}
|
|
#eval-col::after { /* 50/50 reference line */
|
|
content: "";
|
|
position: absolute;
|
|
left: 0; right: 0; top: 50%;
|
|
height: 1px; background: rgba(255,255,255,0.12);
|
|
pointer-events: none; z-index: 2;
|
|
}
|
|
#eval-fill { /* WHITE half from bottom */
|
|
position: absolute;
|
|
left: 0; right: 0; bottom: 0;
|
|
height: 50%;
|
|
background: linear-gradient(180deg, #fafafa 0%, #e0ddd5 100%);
|
|
transition: height 0.4s ease;
|
|
z-index: 1;
|
|
}
|
|
#eval-text {
|
|
position: absolute;
|
|
left: 0; right: 0;
|
|
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
font-size: 10.5px;
|
|
font-weight: 700;
|
|
letter-spacing: -0.03em;
|
|
text-align: center;
|
|
font-variant-numeric: tabular-nums;
|
|
pointer-events: none; z-index: 3;
|
|
transition: color 0.2s, top 0.4s, bottom 0.4s;
|
|
/* default — slight white or even: text near bottom on white half, dark */
|
|
bottom: 4px; top: auto;
|
|
color: #1a1a1a;
|
|
}
|
|
#eval-col.advantage-black #eval-text {
|
|
bottom: auto; top: 4px;
|
|
color: #e7e5e4;
|
|
}
|
|
|
|
/* ============ floating moves panel (below board) ============ */
|
|
#moves-floating {
|
|
display: flex; align-items: flex-start; gap: 8px;
|
|
background: #15151a;
|
|
border: 1px solid #2a2a30;
|
|
border-radius: 8px;
|
|
padding: 6px 10px;
|
|
max-height: 84px;
|
|
overflow: hidden;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
|
|
}
|
|
.moves-label {
|
|
font-size: 10px; opacity: 0.45; text-transform: uppercase;
|
|
letter-spacing: 0.1em; padding-top: 2px; flex: 0 0 auto;
|
|
}
|
|
#history-list {
|
|
list-style: none; padding: 0; margin: 0;
|
|
display: flex; flex-wrap: wrap; gap: 2px 8px;
|
|
font-size: 12.5px; overflow-y: auto; flex: 1;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
#history-list li { padding: 1px 4px; border-radius: 3px; cursor: pointer; }
|
|
#history-list li.ply-num { opacity: 0.4; cursor: default; padding-right: 2px; }
|
|
#history-list li:not(.ply-num):hover { background: #25252b; }
|
|
#history-list li.active { background: #3d342a; color: #f0d090; }
|
|
|
|
/* ============ chat panel (right, full height) ============ */
|
|
#chat-col { display: flex; flex-direction: column; background: #15151a; border-radius: 8px; overflow: hidden; border: 1px solid #2a2a30; }
|
|
.col-header {
|
|
display: flex; justify-content: space-between; align-items: center;
|
|
padding: 6px 10px; opacity: 0.6; font-size: 10px; text-transform: uppercase;
|
|
letter-spacing: 0.1em; border-bottom: 1px solid #2a2a30;
|
|
}
|
|
#chat-list {
|
|
flex: 1; overflow-y: auto; padding: 10px;
|
|
display: flex; flex-direction: column; gap: 8px;
|
|
}
|
|
.bubble {
|
|
padding: 7px 10px 9px;
|
|
border-radius: 9px;
|
|
border: 1px solid transparent;
|
|
cursor: pointer;
|
|
line-height: 1.4;
|
|
word-wrap: break-word;
|
|
transition: outline-color 0.1s ease;
|
|
outline: 1px solid transparent;
|
|
outline-offset: 2px;
|
|
}
|
|
.bubble:hover { outline-color: #555; }
|
|
.bubble.active { outline-color: #c0a060; }
|
|
.bubble-white { background: #f0eee6; color: #16161a; align-self: flex-start; max-width: 92%; }
|
|
.bubble-black { background: #1f1e22; color: #e7e5e4; align-self: flex-end; max-width: 92%; border-color: #2a2a30; }
|
|
.bubble-meta {
|
|
font-size: 10px; opacity: 0.65; margin-bottom: 3px;
|
|
display: flex; justify-content: space-between; gap: 6px; align-items: center;
|
|
}
|
|
.bubble-san { font-weight: 700; opacity: 0.95; }
|
|
.bubble-body { font-size: 13px; }
|
|
.bubble-empty { font-style: italic; opacity: 0.5; }
|
|
|
|
/* ============ buttons + dialog ============ */
|
|
button {
|
|
background: #25252b; color: #e7e5e4; border: 1px solid #34343a;
|
|
padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px;
|
|
}
|
|
button:hover { background: #2e2e36; }
|
|
#live-btn { background: #3d342a; color: #f0d090; }
|
|
|
|
dialog {
|
|
background: #15151a; color: #e7e5e4; border: 1px solid #2a2a30;
|
|
padding: 16px; border-radius: 6px;
|
|
}
|
|
dialog form { display: flex; flex-direction: column; gap: 10px; min-width: 320px; }
|
|
dialog menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 0; }
|