From 746df1cfc9d0ff5e22da28a5fe049e4aef974646 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Fri, 28 Oct 2016 17:51:41 -0500 Subject: [PATCH] Update to scorekeeper to support 4 players. --- scorekeeper/scorekeep.html | 41 +++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/scorekeeper/scorekeep.html b/scorekeeper/scorekeep.html index ef71c6d..8234a2b 100644 --- a/scorekeeper/scorekeep.html +++ b/scorekeeper/scorekeep.html @@ -10,23 +10,28 @@ html { div.score { display: inline-block; font-family: monospace, sans-serif; - font-size: 20vw; font-weight: bold; + position: relative; text-align: center; width: 49%; } -.score.elijah { - color: darkblue; -} +div.score span { font-size: 20vw; } + +.score.p1 { color: darkblue; } +.score.p2 { color: darkred; } +.score.p3 { color: darkgreen; } +.score.p4 { color: black; } input { border: none; border-bottom: solid thin black; font-family: monospace; - font-size: 10vw; - margin: 1rem 12%; - width: 24% + font-size: 4vw; + position: absolute; + right: 0; + bottom: 0; + width: 24%; } @@ -34,20 +39,28 @@ input { console.log("Loaded"); function updateScore(event, player) { if (event.key != 'Enter') return; - var sbEl = document.getElementsByClassName(player)[0]; + var sbEl = document.querySelector('.score.' + player + ' span'); sbEl.innerHTML = +(sbEl.innerHTML) + +(event.target.value); event.target.value = ""; } -
- 0 +
+ 0 +
-
- 0 +
+ 0 + +
+
+ 0 + +
+
+ 0 +
- -