Template:Kyoto/small countdown
From 2014.igem.org
(Difference between revisions)
(Undo revision 112309 by SockeyeSalmon (talk)) |
|||
Line 9: | Line 9: | ||
top: 30px; | top: 30px; | ||
right: 10px; | right: 10px; | ||
+ | background-color: #333; | ||
+ | border: 4px solid #000; | ||
height: 30px; | height: 30px; | ||
- | |||
- | |||
- | |||
- | |||
- | |||
line-height: 30px; | line-height: 30px; | ||
font-size: 30px; | font-size: 30px; | ||
- | + | color: #ddd; | |
- | + | ||
text-decoration: none; | text-decoration: none; | ||
- | + | padding: 30px 10px; | |
- | + | display: none; | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
} | } | ||
</style> | </style> | ||
- | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | |||
- | |||
$(function(){ | $(function(){ | ||
- | /* October | + | /* October 10 wiki FREEZE at 11:59PM EDT */ |
- | var | + | var freeze = Date.UTC(</html>{{{year|2014}}}, {{{month|9}}}, {{{day|10}}}<html>, 4, 00, 0); |
- | + | ||
- | + | ||
- | + | ||
function get_current_utc() { | function get_current_utc() { | ||
Line 87: | Line 63: | ||
var timer = setInterval(function() { | var timer = setInterval(function() { | ||
- | + | var countdown = document.getElementById("kyoto_alert"); | |
- | + | ||
var current_utc = get_current_utc(); | var current_utc = get_current_utc(); | ||
var interval = (freeze - current_utc)/1000; | var interval = (freeze - current_utc)/1000; | ||
if (interval < 0) { | if (interval < 0) { | ||
- | + | countdown.style.display = "none"; | |
} else if (interval < 4 * 24 * 3600) { | } else if (interval < 4 * 24 * 3600) { | ||
if (interval < 1 * 3600) | if (interval < 1 * 3600) | ||
- | + | countdown.style.color = "#f00"; | |
else if (interval < 24 * 3600) | else if (interval < 24 * 3600) | ||
- | + | countdown.style.color = "#ff0"; | |
var time = []; | var time = []; | ||
Line 105: | Line 80: | ||
time.push(itos(minute_qr[1], 2) + 'm'); | time.push(itos(minute_qr[1], 2) + 'm'); | ||
time.push(itos(minute_qr[0], 2) + 'h'); | time.push(itos(minute_qr[0], 2) + 'h'); | ||
- | + | countdown.innerText = time.reverse().join(' : '); | |
- | + | countdown.style.display = "block"; | |
} else { | } else { | ||
var time = []; | var time = []; | ||
Line 115: | Line 90: | ||
time.push(itos(hour_qr[1], 2) + 'h'); | time.push(itos(hour_qr[1], 2) + 'h'); | ||
time.push(itos(hour_qr[0], 3) + 'd'); | time.push(itos(hour_qr[0], 3) + 'd'); | ||
- | + | countdown.innerText = time.reverse().join(' : '); | |
- | + | countdown.style.display = "block"; | |
} | } | ||
}, 200); | }, 200); | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
}); | }); | ||
- | |||
- | |||
- | |||
- | |||
</script> | </script> | ||
</html> | </html> |
Revision as of 00:15, 11 September 2014
count down