This repository was archived by the owner on Jul 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Expand file tree Collapse file tree 3 files changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -20,4 +20,9 @@ FULL POWER - Starts the timer at the time specified for the length specified and
20
20
warnAt: 2
21
21
}
22
22
};
23
- var t = PresentationTimer();
23
+ var t = PresentationTimer();
24
+
25
+
26
+
27
+ CHANGE LOG
28
+ 2011-09-20: added support to hide the clock 10 minutes after the presentation finishes.
Original file line number Diff line number Diff line change 21
21
# cClock : hover {
22
22
opacity : 1.0 ;
23
23
}
24
+
25
+ # cClock .hidden {
26
+ display : none;
27
+ }
24
28
25
29
</ style >
26
30
</ head >
29
33
< script src ="config.js "> </ script >
30
34
< script src ="timer.js "> </ script >
31
35
< script type ="text/javascript ">
32
- var t = PresentationTimer ( 10 , true ) ;
36
+ var t = PresentationTimer ( ) ;
37
+ t . start ( ) ;
33
38
</ script >
34
39
</ body >
35
40
</ html >
Original file line number Diff line number Diff line change 12
12
opacity: 1.0;
13
13
}
14
14
15
+ #cClock.hidden {
16
+ display: none;
17
+ }
18
+
15
19
window.timerConfig = window.timerConfig || {
16
20
settings : {
17
21
date: new Date('Sept 18 2011 16:22'),
@@ -66,7 +70,13 @@ var PresentationTimer = function(minutes, startImmediately) {
66
70
setTimeout ( timerTick , tickLength ) ;
67
71
} else if ( currentTime > stopTime ) {
68
72
//console.log("after");
69
- drawClock ( 0 , "#f00" ) ;
73
+ var minOver = ( currentTime . getTime ( ) - stopTime . getTime ( ) ) / 1000 / 60 ;
74
+ if ( minOver <= 10 ) {
75
+ drawClock ( Math . ceil ( minOver ) , "#f00" ) ;
76
+ setTimeout ( timerTick , 15000 ) ;
77
+ } else {
78
+ showClock ( false ) ;
79
+ }
70
80
} else {
71
81
//console.log("during");
72
82
minLeft = ( stopTime . getTime ( ) - currentTime . getTime ( ) ) / 1000 / 60 ;
@@ -95,6 +105,15 @@ var PresentationTimer = function(minutes, startImmediately) {
95
105
ctx . fillText ( min , 15 , 15 ) ;
96
106
}
97
107
108
+ var showClock = function ( visible ) {
109
+ var canvas = document . getElementById ( "cClock" ) ;
110
+ if ( visible ) {
111
+ canvas . classList . remove ( "hidden" ) ;
112
+ } else {
113
+ canvas . classList . add ( "hidden" ) ;
114
+ }
115
+ }
116
+
98
117
var toRadians = function ( val ) {
99
118
return ( Math . PI / 180 ) * val ;
100
119
}
You can’t perform that action at this time.
0 commit comments