File tree Expand file tree Collapse file tree 1 file changed +56
-0
lines changed
Expand file tree Collapse file tree 1 file changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ < html >
2+
3+ < head >
4+ < title > Rotation Time</ title >
5+
6+
7+
8+ </ head >
9+
10+ < body >
11+ < h1 > Rotation Time</ h1 >
12+
13+ < label >
14+ Rotation in minutes
15+ < input id ="rotation " name ="rotation " type ="number " value ="10 " onchange ="update() " min ="1 " required />
16+ </ label >
17+ < label >
18+ Participants
19+ < input id ="size " name ="size " type ="number " value ="4 " onchange ="update() " min ="3 " required />
20+ </ label >
21+
22+ < div >
23+ Time to next turn (or time for Twitter): < span id ="timeToNextTurn "> 30</ span > minutes
24+ </ div >
25+
26+ < div >
27+ < h3 > What if?</ h3 >
28+ < div >
29+ +1 participant: < span id ="timeToNextTurnPlusOne "> 20</ span > minutes
30+ </ div >
31+ < div >
32+ -1 participant: < span id ="timeToNextTurnMinusOne "> 40</ span > minutes
33+ </ div >
34+ </ div >
35+
36+
37+ < script type ="application/javascript ">
38+ function timeToNextTurn ( rotation , size ) {
39+ return rotation * ( size - 1 )
40+ }
41+
42+ function update ( ) {
43+ let rotation = parseInt ( document . getElementById ( 'rotation' ) . value )
44+ let size = parseInt ( document . getElementById ( 'size' ) . value )
45+
46+ document . getElementById ( 'timeToNextTurn' ) . innerText = timeToNextTurn ( rotation , size )
47+ document . getElementById ( 'timeToNextTurnPlusOne' ) . innerText = timeToNextTurn ( rotation , size + 1 )
48+ document . getElementById ( 'timeToNextTurnMinusOne' ) . innerText = timeToNextTurn ( rotation , size - 1 )
49+ }
50+
51+ update ( )
52+ </ script >
53+
54+ </ body >
55+
56+ </ html >
You can’t perform that action at this time.
0 commit comments