From 5c855b503ea7e6d90129ac76db2c35c73b61cc34 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Sun, 24 Apr 2022 00:56:19 -0700 Subject: web: add one-player scoreboard mode --- web/static/dartboat.js | 8 ++++++++ web/static/index.html | 7 ++++--- web/static/style.css | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'web/static') diff --git a/web/static/dartboat.js b/web/static/dartboat.js index d1463b2..4967f18 100644 --- a/web/static/dartboat.js +++ b/web/static/dartboat.js @@ -163,6 +163,14 @@ function setPlayerActive(n) { e.classList[n && e.id == `p${n}-info` ? 'add' : 'remove']('active')); } +function hidePlayer2(n) { + document.getElementById('p2-info').style.visibility = 'hidden'; +} + +function unhidePlayer2(n) { + document.getElementById('p2-info').style.removeProperty('visibility'); +} + function updatePlayerRem(n, ptr) { document.getElementById(`p${n}-rem`).textContent = UTF8ToString(ptr); } diff --git a/web/static/index.html b/web/static/index.html index 59df139..0502644 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -10,7 +10,7 @@
-
+
oi!
@@ -48,8 +48,9 @@
REMAINING
-
(1) Play against bot
-
(2) Scoreboard (2-player)
+
[1] One-player scoreboard
+
[2] Two-player scoreboard
+
[3] Play against bot
diff --git a/web/static/style.css b/web/static/style.css index 62cdcaa..dc017f6 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -22,7 +22,7 @@ div#main { display: grid; grid-template-columns: 1fr; grid-template-rows: min-content min-content 2fr 3fr; - grid-template-areas: "settings-bar" "rem-bar" "visits" "controls"; + grid-template-areas: "settings-bar" "info" "visits" "controls"; } div#controls { @@ -70,7 +70,7 @@ div#oi { justify-content: center; } -div#rem-bar { +div#info { position: relative; grid-column: 1 / span 3; -- cgit v1.2.3-70-g09d2