feat: add snake multiplayer chat as sidebar with vivid player colors

Move chat to the right of the board using a flex wrapper that stacks
vertically on narrow screens. Restore original snake player colors by
removing the desaturation filter added with the dark theme.
This commit is contained in:
Ryan Hamamura
2026-02-05 10:15:26 -10:00
parent 0279615b36
commit 3d019fd948
4 changed files with 248 additions and 10 deletions

View File

@@ -101,10 +101,54 @@
}
.snake-wrapper:focus { outline: none; }
/* Desaturate inline-styled snake body/head colors */
.snake-cell[style*="background"] {
filter: saturate(0) brightness(0.85);
/* Snake game area: board + chat side-by-side */
.snake-game-area {
display: flex;
gap: 16px;
align-items: flex-start;
justify-content: center;
}
.snake-cell.snake-head[style] {
box-shadow: none !important;
@media (max-width: 768px) {
.snake-game-area { flex-direction: column; align-items: center; }
}
/* Snake chat */
.snake-chat { width: 100%; max-width: 480px; }
.snake-game-area .snake-chat { width: 260px; max-width: none; flex-shrink: 0; }
.snake-chat-history {
height: 300px;
overflow-y: auto;
background: #334;
border-radius: 8px 8px 0 0;
padding: 8px;
display: flex;
flex-direction: column;
gap: 2px;
}
.snake-chat-msg { font-size: 0.85rem; line-height: 1.3; }
.snake-chat-input {
display: flex;
gap: 0;
background: #445;
border-radius: 0 0 8px 8px;
overflow: hidden;
}
.snake-chat-input input {
flex: 1;
padding: 6px 10px;
background: transparent;
border: none;
color: inherit;
outline: none;
font-size: 0.85rem;
}
.snake-chat-input button {
padding: 6px 14px;
background: #556;
border: none;
color: inherit;
cursor: pointer;
font-size: 0.85rem;
}
.snake-chat-input button:hover { background: #667; }