Change color of rotation clock

This commit is contained in:
Neale Pickett 2011-11-12 08:24:11 -07:00
parent eaefa14d37
commit 7943678472
2 changed files with 18 additions and 10 deletions

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<!-- Presentation Timer 2011 Neale Pickett --> <!-- Presentation Timer 2011 Neale Pickett -->
<!-- Placed in the public domain. --> <!-- Placed in the public domain. -->
<!-- Time-stamp: "2011-11-11 22:43:12 neale" --> <!-- Time-stamp: "2011-11-12 08:11:20 neale" -->
<html> <html>
<head> <head>
<title>LADD Scoreboard</title> <title>LADD Scoreboard</title>

View File

@ -19,6 +19,7 @@ function startTimer(element, precision, duration, callback) {
var beginning; var beginning;
var itimer; var itimer;
var precmult = 1; var precmult = 1;
var bg;
for (var i = 0; i < precision; i += 1) { for (var i = 0; i < precision; i += 1) {
precmult *= 10; precmult *= 10;
@ -37,12 +38,14 @@ function startTimer(element, precision, duration, callback) {
element.style.color = "#888"; element.style.color = "#888";
} }
if (! duration) { if (! bg) {
element.style.backgroundColor = "#044"; if (! duration) {
} else if (remain <= 20000) { element.style.backgroundColor = "#044";
element.style.backgroundColor = "#f24"; } else if (remain <= 20000) {
} else { element.style.backgroundColor = "#f24";
element.style.backgroundColor = element.bg; } else {
element.style.backgroundColor = element.bg;
}
} }
element.innerHTML = ""; element.innerHTML = "";
@ -91,7 +94,7 @@ function startTimer(element, precision, duration, callback) {
} }
// Unpause if paused // Unpause if paused
this.go = function () { this.go = function (color) {
if (itimer) return; if (itimer) return;
this.start(); this.start();
@ -107,7 +110,12 @@ function startTimer(element, precision, duration, callback) {
} }
// Restart with a new time // Restart with a new time
this.reset = function (t) { this.reset = function (t, color) {
bg = color;
if (color) {
element.style.backgroundColor = color;
}
duration = t; duration = t;
this.start(); this.start();
display(duration); display(duration);
@ -136,7 +144,7 @@ function transition() {
jtext.innerHTML = "Jam"; jtext.innerHTML = "Jam";
} else if (state == ROTATE) { } else if (state == ROTATE) {
pt.go(); pt.go();
jt.reset(30000); jt.reset(30000, "#060");
jtext.innerHTML = "Rotation"; jtext.innerHTML = "Rotation";
} else if (state == TIMEOUT) { } else if (state == TIMEOUT) {
pt.pause(); pt.pause();