New mini and micro layouts

This commit is contained in:
Neale Pickett 2012-04-07 09:35:17 -06:00
parent 07ae62c1dd
commit eda25d4dcf
3 changed files with 167 additions and 15 deletions

63
micro.html Normal file
View File

@ -0,0 +1,63 @@
<!DOCTYPE html>
<!--
Roller Derby Scoreboard Copyright © 2011 Neale Pickett
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
-->
<html>
<head>
<title>LADD Scoreboard</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="scoreboard.css">
<style type="text/css">
@font-face {
font-family: Most Wazted;
src: url(Mostwasted.ttf);
}
body {
background: black;
background-size: 100% auto;
color: #eee;
font-family: Most Wazted, fantasy;
text-align: center;
}
#scoreboard {
font-size: 155px;
width: 100%;
}
html, p {
padding: 0;
margin: 0;
}
</style>
<script type="text/javascript" src="logos.js"></script>
<script type="text/javascript" src="scoreboard.js"></script>
<script type="text/javascript">
window.onkeypress = key;
window.tenths = false;
</script>
</head>
<body>
<div id="scoreboard">
<p>
<span id="period" onclick="handle(event);">--:--</span>
</p>
<p>
<span id="jam" onclick="handle(event);">-:--.-</span>
</p>
</div>
</body>
</html>

76
mini.html Normal file
View File

@ -0,0 +1,76 @@
<!DOCTYPE html>
<!--
Roller Derby Scoreboard Copyright © 2011 Neale Pickett
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
-->
<html>
<head>
<title>LADD Scoreboard</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="scoreboard.css">
<style type="text/css">
@font-face {
font-family: Most Wazted;
src: url(Mostwasted.ttf);
}
body {
background: black;
background-size: 100% auto;
color: #eee;
font-family: Most Wazted, fantasy;
text-align: center;
}
#scoreboard {
font-size: 120px;
width: 100%;
}
#score-a, #score-b {
font-size: 100px;
}
#score-a {
float: left;
}
#score-b {
float: right;
}
html, p {
padding: 0;
margin: 0;
}
</style>
<script type="text/javascript" src="logos.js"></script>
<script type="text/javascript" src="scoreboard.js"></script>
<script type="text/javascript">
window.onkeypress = key;
</script>
</head>
<body>
<div id="scoreboard">
<p>
<span id="period" onclick="handle(event);">--:--</span>
</p>
<p>
<span id="score-a" onclick="handle(event);">-</span>
<span id="jamtext">-</span>
<span id="score-b" onclick="handle(event);">-</span>
</p>
<p>
<span id="jam" onclick="handle(event);">-:--.-</span>
</p>
</div>
</body>
</html>

View File

@ -138,9 +138,9 @@ function startTimer(element, tenths, callback) {
// Transition state machine based on state // Transition state machine based on state
function transition(newstate) { function transition(newstate) {
var jt = document.getElementById("jam"); var jt = e("jam");
var pt = document.getElementById("period"); var pt = e("period");
var jtext = document.getElementById("jamtext"); var jtext = e("jamtext");
if ((newstate == undefined) || (newstate == state)) { if ((newstate == undefined) || (newstate == state)) {
return; return;
@ -209,7 +209,11 @@ function notice(n) {
} }
function e(id) { function e(id) {
return document.getElementById(id); ret = document.getElementById(id);
if (! ret) {
return Array();
}
return ret;
} }
function score(team, points) { function score(team, points) {
@ -401,19 +405,27 @@ function dfl(v, d) {
} }
} }
function store(k, v) {
if ((v == undefined) || ! localStorage) {
return;
} else {
localStorage["rdsb_" + k] = v;
}
}
function save() { function save() {
var ls = localStorage || {}; var ls = localStorage || {};
ls.rdsb_name_a = e("name-a").innerHTML; store("period_clock", e("period").remaining());
ls.rdsb_name_b = e("name-b").innerHTML; store("name_a", e("name-a").innerHTML);
ls.rdsb_logo_a = e("logo-a").src; store("name_b", e("name-b").innerHTML);
ls.rdsb_logo_b = e("logo-b").src; store("logo_a", e("logo-a").src);
ls.rdsb_score_a = e("score-a").innerHTML; store("logo_b", e("logo-b").src);
ls.rdsb_score_b = e("score-b").innerHTML; store("score_a", e("score-a").innerHTML);
ls.rdsb_timeout_a = e("timeouts-a").innerHTML; store("score_b", e("score-b").innerHTML);
ls.rdsb_timeout_b = e("timeouts-b").innerHTML; store("timeout_a", e("timeouts-a").innerHTML);
ls.rdsb_period = period; store("timeout_b", e("timeouts-b").innerHTML);
ls.rdsb_period_clock = e("period").remaining(); store("period", period);
} }
function start() { function start() {
@ -450,7 +462,7 @@ function start() {
p.set(c); p.set(c);
var j = document.getElementById("jam"); var j = document.getElementById("jam");
startTimer(j, true); startTimer(j, window.tenths);
j.set(120000); j.set(120000);
save_timer = setInterval(save, 1000); save_timer = setInterval(save, 1000);
@ -458,3 +470,4 @@ function start() {
} }
window.onload = start; window.onload = start;
window.tenths = true;