-
-
Save unabridgedxcrpt/4590260 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
body { | |
background-color: black; | |
color: white; | |
font-family: sans-serif; | |
text-align: center; | |
} | |
#minutes { | |
font-size: 500px; | |
} | |
#seconds { | |
font-size: 100px; | |
} | |
</style> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> | |
<script> | |
$(function() { | |
// Change me!!! | |
var seconds = 25 * 60; | |
// Change me!!! | |
setInterval(function() { | |
seconds--; | |
if (seconds < (3 * 60)) | |
{ | |
$('body').css('background-color', 'red'); | |
$('body').css('color', 'black'); | |
} | |
else if (seconds < (5 * 60)) | |
{ | |
$('body').css('background-color', 'yellow'); | |
$('body').css('color', 'black'); | |
} | |
$("#minutes").html(Math.floor(seconds/60)); | |
var secs = seconds % 60; | |
$("#seconds").html((secs < 10) ? '0'+secs : secs ); | |
}, 1000); | |
}); | |
</script> | |
<!-- Change the values here and in the javascript above --> | |
<div id='minutes'>25</div> | |
<div id='seconds'>00</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment