Restyle frontend with dark retro console theme
This commit is contained in:
@@ -11,11 +11,11 @@
|
|||||||
<section class="play-area">
|
<section class="play-area">
|
||||||
<header class="topbar">
|
<header class="topbar">
|
||||||
<div>
|
<div>
|
||||||
<p class="eyebrow">capture tic tac toe</p>
|
<p class="eyebrow">CAPTURE_TAC_TOE.EXE</p>
|
||||||
<h1 id="game-title">Tictactics</h1>
|
<h1 id="game-title">Tictactics</h1>
|
||||||
</div>
|
</div>
|
||||||
<button id="resetButton" class="icon-button" type="button" aria-label="Restart game" title="Restart">
|
<button id="resetButton" class="icon-button" type="button" aria-label="Restart game" title="Restart">
|
||||||
<span aria-hidden="true">↻</span>
|
<span aria-hidden="true">RST</span>
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="rule-card">
|
<div class="rule-card">
|
||||||
<h2>Rule</h2>
|
<h2>RULE</h2>
|
||||||
<p>Open the game in two browser windows. The first two connected players are paired automatically.</p>
|
<p>Open the game in two browser windows. The first two connected players are paired automatically.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
284
styles.css
284
styles.css
@@ -1,17 +1,20 @@
|
|||||||
:root {
|
:root {
|
||||||
color-scheme: light;
|
color-scheme: dark;
|
||||||
--ink: #161616;
|
--bg: #07090d;
|
||||||
--muted: #62635f;
|
--panel: #0d121a;
|
||||||
--paper: #f9f6ee;
|
--panel-2: #111923;
|
||||||
--panel: #fffdfa;
|
--cell: #0a0f16;
|
||||||
--line: #252525;
|
--line: #26384b;
|
||||||
--grid: #d9d1bf;
|
--line-bright: #61d6ff;
|
||||||
--x: #cb3d3d;
|
--text: #d9f7ff;
|
||||||
--o: #216e8d;
|
--muted: #7e9aa8;
|
||||||
--x-soft: #ffe1df;
|
--x: #ff5f8f;
|
||||||
--o-soft: #d9f1f8;
|
--o: #47e5bc;
|
||||||
--focus: #6750a4;
|
--warn: #ffd166;
|
||||||
--shadow: 0 20px 50px rgba(30, 25, 15, 0.12);
|
--ok: #7cff6b;
|
||||||
|
--bad: #ff6b6b;
|
||||||
|
--focus: #f7f052;
|
||||||
|
--shadow: 0 0 0 1px rgba(97, 214, 255, 0.18), 0 18px 48px rgba(0, 0, 0, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
* {
|
||||||
@@ -21,13 +24,30 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
color: var(--ink);
|
color: var(--text);
|
||||||
background:
|
background:
|
||||||
linear-gradient(rgba(22, 22, 22, 0.035) 1px, transparent 1px),
|
linear-gradient(rgba(97, 214, 255, 0.04) 1px, transparent 1px),
|
||||||
linear-gradient(90deg, rgba(22, 22, 22, 0.035) 1px, transparent 1px),
|
linear-gradient(90deg, rgba(97, 214, 255, 0.035) 1px, transparent 1px),
|
||||||
var(--paper);
|
radial-gradient(circle at 50% 0%, rgba(71, 229, 188, 0.12), transparent 30rem),
|
||||||
background-size: 32px 32px;
|
var(--bg);
|
||||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
background-size: 24px 24px, 24px 24px, auto, auto;
|
||||||
|
font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
body::before {
|
||||||
|
content: "";
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
background: repeating-linear-gradient(
|
||||||
|
to bottom,
|
||||||
|
rgba(255, 255, 255, 0.035),
|
||||||
|
rgba(255, 255, 255, 0.035) 1px,
|
||||||
|
transparent 1px,
|
||||||
|
transparent 4px
|
||||||
|
);
|
||||||
|
opacity: 0.22;
|
||||||
|
mix-blend-mode: screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
@@ -35,29 +55,29 @@ button {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.app {
|
.app {
|
||||||
width: min(1120px, calc(100vw - 32px));
|
width: min(920px, calc(100vw - 28px));
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(0, 1fr) 320px;
|
grid-template-columns: minmax(0, 1fr) 260px;
|
||||||
gap: 28px;
|
gap: 14px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 32px 0;
|
padding: 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.play-area,
|
.play-area,
|
||||||
.side-panel {
|
.side-panel {
|
||||||
background: rgba(255, 253, 250, 0.86);
|
background: linear-gradient(180deg, rgba(17, 25, 35, 0.94), rgba(8, 12, 18, 0.98));
|
||||||
border: 1px solid rgba(37, 37, 37, 0.12);
|
border: 1px solid var(--line);
|
||||||
box-shadow: var(--shadow);
|
box-shadow: var(--shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
.play-area {
|
.play-area {
|
||||||
padding: 24px;
|
padding: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.side-panel {
|
.side-panel {
|
||||||
padding: 18px;
|
padding: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.topbar,
|
.topbar,
|
||||||
@@ -66,118 +86,133 @@ button {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 16px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.eyebrow {
|
.eyebrow {
|
||||||
margin: 0 0 4px;
|
margin: 0 0 4px;
|
||||||
color: var(--muted);
|
color: var(--o);
|
||||||
font-size: 0.78rem;
|
font-size: 0.68rem;
|
||||||
font-weight: 800;
|
font-weight: 700;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: clamp(2.2rem, 4.8rem, 5rem);
|
color: var(--text);
|
||||||
line-height: 0.92;
|
font-size: clamp(1.9rem, 4vw, 3.2rem);
|
||||||
|
line-height: 0.95;
|
||||||
|
text-transform: uppercase;
|
||||||
|
text-shadow: 0 0 12px rgba(97, 214, 255, 0.55);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-button {
|
.icon-button {
|
||||||
width: 44px;
|
width: 46px;
|
||||||
height: 44px;
|
height: 32px;
|
||||||
display: inline-grid;
|
display: inline-grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
border: 2px solid var(--line);
|
border: 1px solid var(--line-bright);
|
||||||
border-radius: 8px;
|
border-radius: 2px;
|
||||||
color: var(--ink);
|
color: var(--line-bright);
|
||||||
background: var(--panel);
|
background: #05080d;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 150ms ease, background 150ms ease;
|
font-size: 0.72rem;
|
||||||
|
font-weight: 800;
|
||||||
|
transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-button:disabled {
|
.icon-button:disabled {
|
||||||
opacity: 0.45;
|
opacity: 0.4;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
transform: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-button:hover {
|
.icon-button:hover:not(:disabled) {
|
||||||
background: #eee6d6;
|
color: #061016;
|
||||||
transform: translateY(-1px);
|
background: var(--line-bright);
|
||||||
|
box-shadow: 0 0 18px rgba(97, 214, 255, 0.45);
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-button:focus-visible,
|
.icon-button:focus-visible,
|
||||||
.cell:focus-visible {
|
.cell:focus-visible {
|
||||||
outline: 3px solid var(--focus);
|
outline: 2px solid var(--focus);
|
||||||
outline-offset: 3px;
|
outline-offset: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-row {
|
.status-row {
|
||||||
margin: 24px 0 18px;
|
margin: 14px 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.turn-badge {
|
.turn-badge {
|
||||||
min-width: 104px;
|
min-width: 128px;
|
||||||
padding: 9px 12px;
|
padding: 7px 9px;
|
||||||
border: 2px solid currentColor;
|
border: 1px solid currentColor;
|
||||||
border-radius: 8px;
|
border-radius: 2px;
|
||||||
font-weight: 900;
|
font-size: 0.78rem;
|
||||||
|
font-weight: 800;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
.player-x {
|
.player-x {
|
||||||
color: var(--x);
|
color: var(--x);
|
||||||
background: var(--x-soft);
|
background: rgba(255, 95, 143, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
.player-o {
|
.player-o {
|
||||||
color: var(--o);
|
color: var(--o);
|
||||||
background: var(--o-soft);
|
background: rgba(71, 229, 188, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
.message {
|
.message {
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
font-size: 0.95rem;
|
font-size: 0.78rem;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
line-height: 1.35;
|
||||||
}
|
}
|
||||||
|
|
||||||
.network-status {
|
.network-status {
|
||||||
margin: 0 0 18px;
|
margin: 0 0 12px;
|
||||||
padding: 10px 12px;
|
padding: 8px 10px;
|
||||||
border: 1px solid rgba(37, 37, 37, 0.14);
|
border: 1px solid var(--line);
|
||||||
border-radius: 8px;
|
border-radius: 2px;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
background: var(--panel);
|
background: #070b11;
|
||||||
|
font-size: 0.74rem;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.network-status::before {
|
||||||
|
content: "> ";
|
||||||
}
|
}
|
||||||
|
|
||||||
.network-status.paired {
|
.network-status.paired {
|
||||||
color: #31592d;
|
color: var(--ok);
|
||||||
background: #e5f3df;
|
border-color: rgba(124, 255, 107, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.network-status.waiting,
|
.network-status.waiting,
|
||||||
.network-status.connecting {
|
.network-status.connecting {
|
||||||
color: #665019;
|
color: var(--warn);
|
||||||
background: #fff3c7;
|
border-color: rgba(255, 209, 102, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.network-status.error {
|
.network-status.error {
|
||||||
color: #8d2525;
|
color: var(--bad);
|
||||||
background: #ffe1df;
|
border-color: rgba(255, 107, 107, 0.55);
|
||||||
}
|
}
|
||||||
|
|
||||||
.board {
|
.board {
|
||||||
aspect-ratio: 1;
|
aspect-ratio: 1;
|
||||||
width: min(100%, 620px);
|
width: min(100%, 520px);
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, 1fr);
|
grid-template-columns: repeat(5, 1fr);
|
||||||
grid-template-rows: repeat(5, 1fr);
|
grid-template-rows: repeat(5, 1fr);
|
||||||
border: 3px solid var(--line);
|
border: 2px solid var(--line-bright);
|
||||||
background: var(--line);
|
background: var(--line-bright);
|
||||||
gap: 3px;
|
gap: 2px;
|
||||||
|
box-shadow: 0 0 24px rgba(97, 214, 255, 0.22);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell {
|
.cell {
|
||||||
@@ -185,25 +220,26 @@ h1 {
|
|||||||
border: 0;
|
border: 0;
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
background: var(--panel);
|
background: var(--cell);
|
||||||
color: var(--ink);
|
color: var(--text);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
isolation: isolate;
|
isolation: isolate;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell::before {
|
.cell::before {
|
||||||
content: "";
|
content: "+";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 13%;
|
color: rgba(126, 154, 168, 0.25);
|
||||||
border: 2px dashed rgba(37, 37, 37, 0.14);
|
font-size: 0.9rem;
|
||||||
border-radius: 50%;
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 120ms ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell:hover::before {
|
.cell:hover:not([disabled]) {
|
||||||
opacity: 1;
|
background: #101926;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cell:hover:not([disabled])::before {
|
||||||
|
color: var(--line-bright);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell[disabled] {
|
.cell[disabled] {
|
||||||
@@ -213,113 +249,127 @@ h1 {
|
|||||||
.mark {
|
.mark {
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
width: 72%;
|
width: 80%;
|
||||||
height: 72%;
|
height: 80%;
|
||||||
border-radius: 50%;
|
font-size: clamp(1.75rem, 6vw, 3.25rem);
|
||||||
font-size: clamp(2rem, 8vw, 4.4rem);
|
font-weight: 900;
|
||||||
font-weight: 950;
|
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
transform: scale(0.96);
|
animation: pop 120ms steps(2, end);
|
||||||
animation: pop 180ms ease-out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mark-x {
|
.mark-x {
|
||||||
color: var(--x);
|
color: var(--x);
|
||||||
|
text-shadow: 0 0 12px rgba(255, 95, 143, 0.65);
|
||||||
}
|
}
|
||||||
|
|
||||||
.mark-o {
|
.mark-o {
|
||||||
color: var(--o);
|
color: var(--o);
|
||||||
|
text-shadow: 0 0 12px rgba(71, 229, 188, 0.65);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell.captured {
|
.cell.captured {
|
||||||
animation: capture 360ms ease-out;
|
animation: capture 300ms steps(3, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell.winning {
|
.cell.winning {
|
||||||
background: #fff0aa;
|
background: #1b2440;
|
||||||
|
box-shadow: inset 0 0 0 3px var(--focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
.score-row {
|
.score-row {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.score-box {
|
.score-box {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 14px;
|
padding: 9px;
|
||||||
border: 1px solid rgba(37, 37, 37, 0.14);
|
border: 1px solid var(--line);
|
||||||
border-radius: 8px;
|
border-radius: 2px;
|
||||||
background: var(--panel);
|
background: var(--panel-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.score-label {
|
.score-label {
|
||||||
display: block;
|
display: block;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
font-size: 0.76rem;
|
font-size: 0.62rem;
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
.score-box strong {
|
.score-box strong {
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 4px;
|
margin-top: 2px;
|
||||||
font-size: 2rem;
|
color: var(--text);
|
||||||
|
font-size: 1.45rem;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rule-card {
|
.rule-card {
|
||||||
padding: 14px;
|
padding: 10px;
|
||||||
border: 1px solid rgba(37, 37, 37, 0.14);
|
border: 1px solid var(--line);
|
||||||
border-radius: 8px;
|
border-radius: 2px;
|
||||||
background: #f5efe2;
|
background: #070b11;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rule-card h2 {
|
.rule-card h2 {
|
||||||
margin: 0 0 8px;
|
margin: 0 0 7px;
|
||||||
font-size: 1rem;
|
color: var(--line-bright);
|
||||||
|
font-size: 0.76rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rule-card p {
|
.rule-card p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
|
font-size: 0.72rem;
|
||||||
line-height: 1.45;
|
line-height: 1.45;
|
||||||
}
|
}
|
||||||
|
|
||||||
.move-list {
|
.move-list {
|
||||||
max-height: 320px;
|
max-height: 250px;
|
||||||
margin: 16px 0 0;
|
margin: 10px 0 0;
|
||||||
padding: 0 0 0 24px;
|
padding: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
color: var(--muted);
|
color: var(--muted);
|
||||||
|
font-size: 0.72rem;
|
||||||
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.move-list li {
|
.move-list li {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 5px;
|
||||||
padding-left: 4px;
|
padding: 5px 7px;
|
||||||
|
border-left: 2px solid var(--line);
|
||||||
|
background: rgba(97, 214, 255, 0.04);
|
||||||
|
}
|
||||||
|
|
||||||
|
.move-list li::before {
|
||||||
|
content: "$ ";
|
||||||
|
color: var(--o);
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes pop {
|
@keyframes pop {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: scale(0.66);
|
transform: scale(0.7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes capture {
|
@keyframes capture {
|
||||||
35% {
|
35% {
|
||||||
background: #202020;
|
background: var(--bad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 860px) {
|
@media (max-width: 780px) {
|
||||||
.app {
|
.app {
|
||||||
min-height: auto;
|
min-height: auto;
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
align-items: start;
|
align-items: start;
|
||||||
padding: 18px 0;
|
padding: 14px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.play-area,
|
.play-area,
|
||||||
.side-panel {
|
.side-panel {
|
||||||
padding: 16px;
|
padding: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-row {
|
.status-row {
|
||||||
@@ -332,10 +382,14 @@ h1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 3rem;
|
font-size: 2.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.board {
|
||||||
|
width: min(100%, 430px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.move-list {
|
.move-list {
|
||||||
max-height: 180px;
|
max-height: 150px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user