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 4605778..3a21c94 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): 30; + new Timer(secs, $('#timer'), $('#wrapper')); $('#timer').fit({width: $(window).width(), height: $(window).height()}); $(window).resize(function() {