File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ <h1>Rotation Time</h1>
2626
2727< div style ="margin-top: 1em; ">
2828 Time to next turn (or time for Twitter): < strong > < span id ="timeToNextTurn "> 30</ span > minutes</ strong >
29+ < img id ="twitter " src ="https://www.iconpacks.net/icons/2/free-twitter-logo-icon-2429-thumb.png " height ="16 ">
2930</ div >
3031
3132< div >
@@ -48,7 +49,12 @@ <h3>What if?</h3>
4849 let rotation = parseInt ( document . getElementById ( 'rotation' ) . value )
4950 let size = parseInt ( document . getElementById ( 'size' ) . value )
5051
51- document . getElementById ( 'timeToNextTurn' ) . innerText = timeToNextTurn ( rotation , size )
52+ let timeToNextTurnInMinutes = timeToNextTurn ( rotation , size ) ;
53+ let upperBound = 120
54+ let timeToNextTurnInMinutesUpperBound = Math . min ( upperBound , timeToNextTurnInMinutes )
55+ let opacity = ( timeToNextTurnInMinutesUpperBound / upperBound )
56+ document . getElementById ( 'timeToNextTurn' ) . innerText = timeToNextTurnInMinutes
57+ document . getElementById ( 'twitter' ) . style = 'opacity: ' + opacity + ';'
5258 document . getElementById ( 'timeToNextTurnPlusOne' ) . innerText = timeToNextTurn ( rotation , size + 1 )
5359 document . getElementById ( 'timeToNextTurnMinusOne' ) . innerText = timeToNextTurn ( rotation , size - 1 )
5460 }
You can’t perform that action at this time.
0 commit comments