Skip to content

Commit

Permalink
Countdown for brainstorming
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Holy committed Jun 25, 2013
1 parent b7025d5 commit 527c3fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 12 additions & 0 deletions resources/public/js/scotsgame.js
Expand Up @@ -6,3 +6,15 @@ function pollForChange(){
};
xhr.send();
}
function countdown(targetId){
var t=10;
var s=Date.now();
var interval = setInterval(function(){
console.log(--t);
document.getElementById(targetId).textContent=t;
if(t===0){
clearInterval(interval);
}
}
, 60000);
}
7 changes: 5 additions & 2 deletions src/clj_gamification/handler.clj
Expand Up @@ -85,7 +85,9 @@
"Teams"
(include-changepoll-js)
[:h1 "Teams & Topics"]
[:p [:strong "You have 10 min for brainstorming"]] ; TODO counter, sort by ID
[:p [:strong "Brainstorming time remaining: "
[:span#countdown {:style "font-size:150%"} "10"]
" min"]]
[:p "Teams:"]
[:ol (map
(fn [[id idea]] [:li "#" id ": " idea]) ; TODO show picture
Expand All @@ -96,7 +98,8 @@
[:li "DELINEATE target behaviors: ..."]
[:li "DESCRIBE your players: ..."]
[:li "DEVISE activity loops: ..."]
[:li "[5+6] DON’T forget the FUN & DEPLOY the appropriate tools: ..."]]))
[:li "[5+6] DON’T forget the FUN & DEPLOY the appropriate tools: ..."]]
[:script {:type "text/javascript"} "countdown('countdown');"]))

(defn page-vote [teams]
"Vote for a gamification idea"
Expand Down

0 comments on commit 527c3fe

Please sign in to comment.