first commit
This commit is contained in:
249
static/css/style.css
Normal file
249
static/css/style.css
Normal file
@ -0,0 +1,249 @@
|
||||
:root {
|
||||
--bg: #1b2735;
|
||||
--panel: #24344a;
|
||||
--water: #2f6f9e;
|
||||
--water-dark: #24597f;
|
||||
--grid-line: #16232f;
|
||||
--fog: #3a536b;
|
||||
--text: #eef3f8;
|
||||
--accent: #e8b23a;
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: "Segoe UI", Verdana, sans-serif;
|
||||
background: linear-gradient(180deg, var(--bg), #0e1620);
|
||||
color: var(--text);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.app {
|
||||
max-width: 1100px;
|
||||
margin: 0 auto;
|
||||
padding: 24px 16px 60px;
|
||||
}
|
||||
|
||||
header { text-align: center; margin-bottom: 8px; }
|
||||
header h1 { margin: 0 0 4px; font-size: 2.1rem; }
|
||||
.subtitle { margin: 0; opacity: 0.75; }
|
||||
|
||||
.message {
|
||||
text-align: center;
|
||||
min-height: 1.4em;
|
||||
margin: 14px auto 20px;
|
||||
padding: 10px 16px;
|
||||
background: var(--panel);
|
||||
border-radius: 8px;
|
||||
max-width: 640px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.screen.hidden { display: none; }
|
||||
|
||||
h2, h3 { text-align: center; }
|
||||
|
||||
.placement-controls {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
button {
|
||||
background: var(--accent);
|
||||
color: #2a1c00;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
padding: 10px 16px;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: transform 0.08s ease, opacity 0.15s ease;
|
||||
}
|
||||
button:hover:not(:disabled) { transform: translateY(-1px); }
|
||||
button:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||
|
||||
.fleet-picker {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.fleet-picker button {
|
||||
background: var(--panel);
|
||||
color: var(--text);
|
||||
border: 2px solid transparent;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.fleet-picker button.selected { border-color: var(--accent); }
|
||||
.fleet-picker button.placed { opacity: 0.35; cursor: default; }
|
||||
|
||||
.boards {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 32px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.board-wrap { margin-bottom: 20px; }
|
||||
|
||||
.board {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(10, 34px);
|
||||
grid-template-rows: repeat(10, 34px);
|
||||
gap: 2px;
|
||||
background: var(--grid-line);
|
||||
padding: 4px;
|
||||
border-radius: 8px;
|
||||
width: max-content;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.cell {
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
background: var(--water);
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
cursor: default;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.cell.own { background: var(--water-dark); }
|
||||
|
||||
#enemy-board .cell {
|
||||
cursor: crosshair;
|
||||
background: var(--fog);
|
||||
}
|
||||
#enemy-board .cell:hover:not(.hit):not(.miss) {
|
||||
background: #4a6a87;
|
||||
}
|
||||
|
||||
.cell.preview-ok { outline: 2px solid #2ecc71; }
|
||||
.cell.preview-bad { outline: 2px solid #e74c3c; }
|
||||
|
||||
.cell.miss::after {
|
||||
content: "";
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255,255,255,0.6);
|
||||
}
|
||||
|
||||
.cell.hit {
|
||||
background: #7a2323 !important;
|
||||
}
|
||||
.cell.hit::after {
|
||||
content: "💥";
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
/* --- Dwarf ship sprite, built purely from CSS shapes --- */
|
||||
.dwarf {
|
||||
position: relative;
|
||||
width: 24px;
|
||||
height: 26px;
|
||||
}
|
||||
.dwarf .hat {
|
||||
position: absolute;
|
||||
top: -2px;
|
||||
left: 2px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 10px solid transparent;
|
||||
border-right: 10px solid transparent;
|
||||
border-bottom: 12px solid var(--hat, #c0392b);
|
||||
filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4));
|
||||
}
|
||||
.dwarf .hat::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
left: -6px;
|
||||
width: 12px;
|
||||
height: 4px;
|
||||
background: var(--hat, #c0392b);
|
||||
border-radius: 2px;
|
||||
}
|
||||
.dwarf .head {
|
||||
position: absolute;
|
||||
top: 9px;
|
||||
left: 4px;
|
||||
width: 16px;
|
||||
height: 14px;
|
||||
background: #f0c090;
|
||||
border-radius: 50% 50% 45% 45%;
|
||||
}
|
||||
.dwarf .beard {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
left: 3px;
|
||||
width: 18px;
|
||||
height: 12px;
|
||||
background: #d9d9d9;
|
||||
border-radius: 0 0 9px 9px;
|
||||
}
|
||||
.dwarf .eyes {
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
left: 7px;
|
||||
width: 10px;
|
||||
height: 2px;
|
||||
background: transparent;
|
||||
box-shadow: 0 0 0 1px #2a1c00, 8px 0 0 -1px #2a1c00;
|
||||
}
|
||||
|
||||
.cell.hit .dwarf { filter: grayscale(1) brightness(0.6); transform: rotate(90deg); }
|
||||
.cell.hit .dwarf .eyes { box-shadow: none; }
|
||||
.cell.hit .dwarf::before {
|
||||
content: "✕";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.fleet-status {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
justify-content: center;
|
||||
margin-top: 10px;
|
||||
max-width: 340px;
|
||||
}
|
||||
.fleet-status .badge {
|
||||
font-size: 0.78rem;
|
||||
padding: 4px 8px;
|
||||
border-radius: 12px;
|
||||
background: var(--panel);
|
||||
}
|
||||
.fleet-status .badge.sunk {
|
||||
text-decoration: line-through;
|
||||
opacity: 0.5;
|
||||
background: #5a1a1a;
|
||||
}
|
||||
|
||||
#new-game-btn { display: block; margin: 24px auto 0; }
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.board {
|
||||
grid-template-columns: repeat(10, 28px);
|
||||
grid-template-rows: repeat(10, 28px);
|
||||
}
|
||||
.cell { width: 28px; height: 28px; }
|
||||
}
|
||||
Reference in New Issue
Block a user