make intro slide lighter for actual presenting
[slides.git] / fosdem2008 / slides.js
CommitLineData
a667e47e 1/******************************
2 * JavaScript for talk slides *
3 * by Robert Kaiser *
4 * <kairo@kairo.at> *
5 * (for FOSDEM 2007) *
6 ******************************/
7
8function docClicked(event) {
9 if (event.target.nodeName != "A") {
10 location.href = document.getElementById('goNext').href;
11 }
12}
13
14// do timed color variantion on slides
15var slide_seconds = 3*60;
16var slide_start = new Date();
17
18function timerFired() {
19 var slide_current = new Date();
20 var seconds_diff = Math.round((slide_current.getTime() - slide_start.getTime()) / 1000);
21 if (seconds_diff >= slide_seconds) {
22 document.getElementById("header-text").className = "overtime";
23 }
24 else if (seconds_diff >= Math.round(2*slide_seconds/3)) {
25 document.getElementById("header-text").className = "ontime";
26 setTimeout("timerFired()", 1000*(slide_seconds/3));
27 }
28 else if (seconds_diff >= Math.round(slide_seconds/3)) {
29 document.getElementById("header-text").className = "neartime";
30 setTimeout("timerFired()", 1000*(slide_seconds/3));
31 }
32 else {
33 // we should never come here, but if we do, go into a 1s loop until we get over the upcoming step
34 setTimeout("timerFired()", 1000);
35 }
36}
37
38setTimeout("timerFired()", 1000*(slide_seconds/3));