Some checks failed
This commit addresses Issue #7 and fixes the column resizing bug: 1. Issue #7 Fix (already implemented): - Added status-message element to index.html - Added CSS styling for status messages - Messages now display visually to users 2. Column Resizing Bug Fix: - Changed grid-template-columns from flexible minmax() to fixed widths - Changed from: minmax(200px, 250px) minmax(600px, 3fr) minmax(200px, 250px) - Changed to: 250px 600px 250px - Fixed sidebar widths to 250px (removed width: 100%, max-width) - Fixed board section width to 600px (removed min-width, width: 100%) - Fixed move-history width to 218px (accounting for padding) - Added justify-content: center to game-container Root cause: The minmax() function with fractional units (3fr) was causing the browser to recalculate column widths when sidebar content changed (captured pieces being added). Fixed widths prevent this reflow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
274 lines
4.7 KiB
CSS
274 lines
4.7 KiB
CSS
/* Global Styles and Layout */
|
|
:root {
|
|
--primary-color: #2c3e50;
|
|
--secondary-color: #3498db;
|
|
--success-color: #27ae60;
|
|
--danger-color: #e74c3c;
|
|
--light-bg: #ecf0f1;
|
|
--dark-bg: #34495e;
|
|
--text-primary: #2c3e50;
|
|
--text-secondary: #7f8c8d;
|
|
--border-color: #bdc3c7;
|
|
}
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background-color: var(--light-bg);
|
|
color: var(--text-primary);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.chess-app {
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.app-header {
|
|
background-color: var(--primary-color);
|
|
color: white;
|
|
padding: 1.5rem 2rem;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.app-header h1 {
|
|
font-size: 2rem;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.game-status {
|
|
display: flex;
|
|
gap: 2rem;
|
|
font-size: 1rem;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
}
|
|
|
|
.game-status span {
|
|
padding: 0.25rem 0.75rem;
|
|
background-color: rgba(255, 255, 255, 0.1);
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.status-message {
|
|
display: none;
|
|
padding: 0.75rem 1rem;
|
|
border-radius: 4px;
|
|
font-weight: 500;
|
|
text-align: center;
|
|
animation: fadeIn 0.3s ease-in;
|
|
flex: 1 0 100%;
|
|
}
|
|
|
|
.status-message.info {
|
|
background-color: #d1ecf1;
|
|
color: #0c5460;
|
|
border: 1px solid #bee5eb;
|
|
}
|
|
|
|
.status-message.success {
|
|
background-color: #d4edda;
|
|
color: #155724;
|
|
border: 1px solid #c3e6cb;
|
|
}
|
|
|
|
.status-message.error {
|
|
background-color: #f8d7da;
|
|
color: #721c24;
|
|
border: 1px solid #f5c6cb;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; transform: translateY(-10px); }
|
|
to { opacity: 1; transform: translateY(0); }
|
|
}
|
|
|
|
.game-container {
|
|
flex: 1;
|
|
display: grid;
|
|
grid-template-columns: 250px 600px 250px;
|
|
gap: 2rem;
|
|
padding: 2rem;
|
|
max-width: 1600px;
|
|
margin: 0 auto;
|
|
justify-content: center;
|
|
}
|
|
|
|
.board-section {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 600px;
|
|
}
|
|
|
|
.game-sidebar {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1.5rem;
|
|
width: 250px;
|
|
}
|
|
|
|
.captured-pieces {
|
|
background: white;
|
|
padding: 1rem;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
width: 250px;
|
|
}
|
|
|
|
.captured-pieces h3 {
|
|
margin-bottom: 1rem;
|
|
color: var(--text-secondary);
|
|
font-size: 0.9rem;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.captured-list {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.5rem;
|
|
min-height: 60px;
|
|
width: 100%;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.move-history-section {
|
|
background: white;
|
|
padding: 1rem;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
flex: 1;
|
|
width: 250px;
|
|
}
|
|
|
|
.move-history {
|
|
max-height: 400px;
|
|
overflow-y: auto;
|
|
overflow-x: hidden;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 0.9rem;
|
|
width: 218px;
|
|
}
|
|
|
|
.game-controls {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
.btn {
|
|
padding: 0.75rem 1.5rem;
|
|
border: none;
|
|
border-radius: 4px;
|
|
font-size: 1rem;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
}
|
|
|
|
.btn:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.btn-primary {
|
|
background-color: var(--secondary-color);
|
|
color: white;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background-color: var(--border-color);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.btn-danger {
|
|
background-color: var(--danger-color);
|
|
color: white;
|
|
}
|
|
|
|
.btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
/* Dialogs */
|
|
dialog {
|
|
border: none;
|
|
border-radius: 8px;
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
|
padding: 2rem;
|
|
}
|
|
|
|
dialog::backdrop {
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
.promotion-dialog h2,
|
|
.game-over-dialog h2 {
|
|
margin-bottom: 1.5rem;
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
.promotion-choices {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, 1fr);
|
|
gap: 1rem;
|
|
}
|
|
|
|
.promotion-piece {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: 1rem;
|
|
border: 2px solid var(--border-color);
|
|
background: white;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
.promotion-piece:hover {
|
|
border-color: var(--secondary-color);
|
|
background-color: var(--light-bg);
|
|
}
|
|
|
|
.promotion-piece .piece-icon {
|
|
font-size: 3rem;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.dialog-actions {
|
|
display: flex;
|
|
gap: 1rem;
|
|
margin-top: 1.5rem;
|
|
}
|
|
|
|
/* Responsive Design */
|
|
@media (max-width: 1200px) {
|
|
.game-container {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.captured-white {
|
|
order: 1;
|
|
}
|
|
|
|
.board-section {
|
|
order: 2;
|
|
}
|
|
|
|
.game-sidebar {
|
|
order: 3;
|
|
}
|
|
}
|