Add jam counter for DCD

This commit is contained in:
Neale Pickett 2012-06-27 21:56:17 -06:00
parent d3c4e2511e
commit 2e81f2a037
4 changed files with 35 additions and 16 deletions

Binary file not shown.

View File

@ -4,6 +4,9 @@
} }
#scoreboard { #scoreboard {
cursor: default; cursor: default;
-moz-user-select: none;
-khtml-user-select: none;
user-select: none;
} }
#scoreboard td { #scoreboard td {
vertical-align: top; vertical-align: top;
@ -17,6 +20,7 @@
} }
.team { .team {
font-family: Comunicacion Digital, sans-serif; font-family: Comunicacion Digital, sans-serif;
font-weight: normal;
font-size: 90%; font-size: 90%;
} }
.team img { .team img {
@ -46,7 +50,7 @@
} }
#jammer-a.lead, #jammer-b.lead { #jammer-a.lead, #jammer-b.lead {
color: yellow; color: white;
} }
#jam, #period { #jam, #period {
@ -56,6 +60,11 @@
padding: 0 0.1em; padding: 0 0.1em;
} }
#jamno {
float: right;
font-size: 0.6em;
}
/* States timers can be in */ /* States timers can be in */
#jam.paused, #period.paused { #jam.paused, #period.paused {
color: #888; color: #888;

View File

@ -21,21 +21,22 @@
<title>LADD Scoreboard</title> <title>LADD Scoreboard</title>
<meta charset="utf-8"> <meta charset="utf-8">
<style type="text/css"> <style type="text/css">
@font-face { body {
font-family: Most Wazted; background: url(bg.jpg) #222;
src: url(Mostwasted.ttf); background-size: 100% auto;
} color: #eee;
body { font-family: sans;
background: url(bg.jpg) #222; font-weight: bold;
background-size: 100% auto; text-align: center;
color: #eee; }
font-family: Most Wazted, fantasy; #scoreboard {
text-align: center; font-size: 5em;
} width: 100%;
#scoreboard { }
font-size: 5em; #periodtext {
width: 100%; font-size: 75%;
} }
#notice div { #notice div {
font-family: Crack Babies, Comunicacion Digital, sans-serif; font-family: Crack Babies, Comunicacion Digital, sans-serif;
font-size: 7em; font-size: 7em;
@ -91,6 +92,7 @@ window.onkeypress = key;
<span id="jammer-a" onclick="handle(event);"></span> <span id="jammer-a" onclick="handle(event);"></span>
<span id="jamtext">-</span> <span id="jamtext">-</span>
<span id="jammer-b" onclick="handle(event);"></span> <span id="jammer-b" onclick="handle(event);"></span>
<span id="jamno" onclick="handle(event);">0</span>
</p> </p>
<p> <p>
<span id="jam" onclick="handle(event);">-:--.-</span> <span id="jam" onclick="handle(event);">-:--.-</span>

View File

@ -34,6 +34,7 @@ var TIMEOUT = 3; // !P J 1:00
var periodtext = ["Period 1", "Halftime", "Period 2", "Break"]; var periodtext = ["Period 1", "Halftime", "Period 2", "Break"];
var jamtext = ["Jam", "Lineup", "Timeout", "Setup"]; var jamtext = ["Jam", "Lineup", "Timeout", "Setup"];
var period = 0; var period = 0;
var jamno = 0;
var state = SETUP; var state = SETUP;
@ -142,6 +143,7 @@ function transition(newstate) {
var jt = e("jam"); var jt = e("jam");
var pt = e("period"); var pt = e("period");
var jtext = e("jamtext"); var jtext = e("jamtext");
var jno = e("jamno");
if ((newstate == undefined) || (newstate == state)) { if ((newstate == undefined) || (newstate == state)) {
return; return;
@ -158,6 +160,8 @@ function transition(newstate) {
jt.set(120000); jt.set(120000);
jt.start(); jt.start();
jtext.innerHTML = jamtext[0]; jtext.innerHTML = jamtext[0];
jamno += 1;
jno.innerHTML = jamno;
} else if (state == LINEUP) { } else if (state == LINEUP) {
pt.start(); pt.start();
jt.set(30000, "lineup"); jt.set(30000, "lineup");
@ -343,6 +347,10 @@ function handle(event) {
newstate = JAM; newstate = JAM;
} }
break; break;
case "jamno":
jamno -= adj;
tgt.innerHTML = jamno;
break;
case "score-a": case "score-a":
case "score-b": case "score-b":
if (state == SETUP) { if (state == SETUP) {