mpp-frontend-dev/countdown.html

28 lines
644 B
HTML
Raw Permalink Normal View History

2021-05-24 18:30:16 +02:00
<style>
body, td {
background: #631;
color: orange;
font: 256px monospace;
text-shadow: 10px 10px 5px #531;
}
</style>
<table width="100%" height="100%">
<td id="hours" align="center" valign="middle"></td>
</table>
<script>
var then = new Date("January 7 2014 17:13:00 GMT-0400 (EDT)");
var div = document.getElementById("hours");
setInterval(function() {
var now = Date.now();
var hours = ((then - now) / (1000 * 60 * 60));
hours = Math.round(hours * 100000) / 100000;
hours = hours.toString();
while(hours.length < 8)
hours = hours + "0";
hours = hours.substr(0, 8);
div.innerHTML = hours;
}, 10);
</script>