From 519ee15a901a51d53a97c1afb6f42527724bd09c Mon Sep 17 00:00:00 2001 From: Steve Dalton Date: Sun, 7 Aug 2011 20:28:34 +1000 Subject: [PATCH 1/2] Changed to seconds instead of minutes --- timer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/timer.js b/timer.js index 4605778..62bdce7 100644 --- a/timer.js +++ b/timer.js @@ -97,14 +97,14 @@ Timer.prototype = { var seconds = t % 60; var text = minutes + ':' + (seconds < 10? '0' + seconds: seconds); - if (t < 60) { + if (t < 10) { this.background.attr('class', 'warning'); } - else if (t >= 60) { + else if (t >= 10) { this.background.attr('class', 'ok'); } - if (t < 10) { + if (t < 5) { this.element.attr('class', 'ohshit ' + Timer.cr[this._status].toLowerCase()); } else { @@ -121,8 +121,8 @@ Timer.prototype = { jQuery(document).ready(function($) { var hash = window.location.hash.substring(1); - var mins = parseInt(hash) > 0? parseInt(hash): 5; - new Timer(60 * mins, $('#timer'), $('#wrapper')); + var secs = parseInt(hash) > 0? parseInt(hash): 5; + new Timer(secs, $('#timer'), $('#wrapper')); $('#timer').fit({width: $(window).width(), height: $(window).height()}); $(window).resize(function() { From af30f68269155c43898128d210b1b99fd17a2075 Mon Sep 17 00:00:00 2001 From: Steve Dalton Date: Sun, 7 Aug 2011 20:40:51 +1000 Subject: [PATCH 2/2] changed default and doco --- README.md | 6 +++--- timer.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 790cd88..3bf1766 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,17 @@ Timer What ---- -I needed a simple timer for holding lightning talks, so I built one. You can see a demo of it at [http://hackandtell.org/timer](http://hackandtell.org/timer). +This is a variation of the Hack and Tell Timer using seconds instead of minutes. I use it for timing iterations in Agile games like the [Lean Lego Game](http://www.dtsato.com/blog/work/lean-lego-game). Who --- -Andrew Gwozdziewycz originally made this for [Hack and Tell](http://hackandtell.org). +Andrew Gwozdziewycz originally made this for [Hack and Tell](http://hackandtell.org) but used minutes instead of seconds. Usage ----- -Just dump all the files in a directory and load up `index.html` in your browser. If you append `#10` to the url, you'll get a 10 minute timer. It defaults to 5. +Just dump all the files in a directory and load up `index.html` in your browser. If you append `#45` to the url, you'll get a 45 second timer. It defaults to 30. Double click on the time resets it. Single click pauses/unpauses. diff --git a/timer.js b/timer.js index 62bdce7..3a21c94 100644 --- a/timer.js +++ b/timer.js @@ -121,7 +121,7 @@ Timer.prototype = { jQuery(document).ready(function($) { var hash = window.location.hash.substring(1); - var secs = parseInt(hash) > 0? parseInt(hash): 5; + var secs = parseInt(hash) > 0? parseInt(hash): 30; new Timer(secs, $('#timer'), $('#wrapper')); $('#timer').fit({width: $(window).width(), height: $(window).height()});