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; | ||
- | |||
- | |||
height: 30px; | height: 30px; | ||
+ | width: 300px; | ||
+ | padding: 30px 10px; | ||
+ | display: none; | ||
+ | |||
+ | /* text */ | ||
line-height: 30px; | line-height: 30px; | ||
font-size: 30px; | font-size: 30px; | ||
- | + | font-family: sans-serif; | |
+ | text-align: center; | ||
text-decoration: none; | text-decoration: none; | ||
- | + | ||
- | + | /* color */ | |
+ | background-color: #aaa; | ||
+ | border: 4px solid #888; | ||
+ | color: #eee; | ||
+ | |||
+ | /* border radius */ | ||
+ | border-radius: 20px; | ||
+ | -webkit-border-radius: 20px; | ||
+ | -moz-border-radius: 20px; | ||
+ | |||
+ | /* select cancel */ | ||
+ | user-select: none; | ||
+ | -webkit-user-select: none; | ||
+ | -moz-user-select: none; | ||
+ | -khtml-user-select: none; | ||
} | } | ||
</style> | </style> | ||
Line 63: | Line 81: | ||
var timer = setInterval(function() { | var timer = setInterval(function() { | ||
- | var countdown = | + | var $countdown = $("#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. | + | $countdown.hide(); |
} else if (interval < 4 * 24 * 3600) { | } else if (interval < 4 * 24 * 3600) { | ||
if (interval < 1 * 3600) | if (interval < 1 * 3600) | ||
- | countdown. | + | $countdown.css("color", "#f00"); |
else if (interval < 24 * 3600) | else if (interval < 24 * 3600) | ||
- | countdown. | + | $countdown.css("color", "#ff0"); |
var time = []; | var time = []; | ||
Line 80: | Line 98: | ||
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. | + | $countdown.text(time.reverse().join(' : ')); |
- | countdown. | + | $countdown.show(); |
} else { | } else { | ||
var time = []; | var time = []; | ||
Line 90: | Line 108: | ||
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. | + | $countdown.text(time.reverse().join(' : ')); |
- | countdown. | + | $countdown.show(); |
} | } | ||
}, 200); | }, 200); |
Revision as of 00:19, 11 September 2014
count down