Skip to content
Snippets Groups Projects
Commit 3d7a5c1c authored by Tim Repke's avatar Tim Repke
Browse files

countdown action

parent 68943fe1
No related branches found
No related tags found
No related merge requests found
...@@ -398,6 +398,7 @@ function index_show_countdown($opentime) { ...@@ -398,6 +398,7 @@ function index_show_countdown($opentime) {
echo " echo "
<script> <script>
var a = '0123456789abcdef'; var a = '0123456789abcdef';
var opentime = " . $opentime . ";
function randstr () { function randstr () {
var str = ''; var str = '';
for(var i = 0; i < 6; ++i) for(var i = 0; i < 6; ++i)
...@@ -410,6 +411,7 @@ function index_show_countdown($opentime) { ...@@ -410,6 +411,7 @@ function index_show_countdown($opentime) {
hurrrdurrr('#menubox'); hurrrdurrr('#menubox');
hurrrdurrr('body'); hurrrdurrr('body');
hurrrdurr();
function hurrrdurrr(elem) { function hurrrdurrr(elem) {
$(elem).stop().animate({backgroundColor:'#'+randstr()}, 333, $(elem).stop().animate({backgroundColor:'#'+randstr()}, 333,
...@@ -421,6 +423,22 @@ function index_show_countdown($opentime) { ...@@ -421,6 +423,22 @@ function index_show_countdown($opentime) {
}); });
} }
function hurrrdurr() {
var now = (Date.now() + ((new Date()).getTimezoneOffset()*60))/1000;
var diff = opentime - now;
var view = '';
if (diff <= 0) {
view = '00:00:00.00';
} else {
view = hurrdurrr(parseInt(diff/60/60/24, 10)) + ':' + hurrdurrr(parseInt(diff / 60 / 60 % 24, 10))
+ ':' + hurrdurrr(parseInt(diff / 60 % 60, 10)) + '.' + hurrdurrr(parseInt(diff%60, 10));
}
$('#countdown').text(view);
function hurrdurrr(num) {
return ((num < 10) ? '0' : '') + num;
}
}
b = !b; b = !b;
} }
$(function () { $(function () {
...@@ -430,10 +448,11 @@ function index_show_countdown($opentime) { ...@@ -430,10 +448,11 @@ function index_show_countdown($opentime) {
</script>"; </script>";
echo '<div id="text" style="font-weight:bold;text-align:center;font-size:40pt;font-family:Verdana, Geneva, sans-serif"> echo '<div id="text" style="font-weight:bold;text-align:center;font-size:40pt;font-family:Verdana, Geneva, sans-serif">
ANMELDUNG IN KÜRZE ANMELDUNG IN KÜRZE<br />
<span id="countdown"></span>
</div>'; </div>';
echo '<div style="width:100%"> echo '<div style="width:100%; margin-top: 20px;">
<div style="margin:0 auto; width:420px"> <div style="margin:0 auto; width:420px">
<iframe width="420" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/109529816&amp;auto_play=true&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe> <iframe width="420" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/109529816&amp;auto_play=true&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true"></iframe>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment