diff --git a/registration-system/index.php b/registration-system/index.php index e463d91c5564a8d2d0fb2559819d9412b20dfeae..bc9b5cadcfabcb958b912a822e3514d3936b256e 100644 --- a/registration-system/index.php +++ b/registration-system/index.php @@ -398,6 +398,7 @@ function index_show_countdown($opentime) { echo " <script> var a = '0123456789abcdef'; + var opentime = " . $opentime . "; function randstr () { var str = ''; for(var i = 0; i < 6; ++i) @@ -410,6 +411,7 @@ function index_show_countdown($opentime) { hurrrdurrr('#menubox'); hurrrdurrr('body'); + hurrrdurr(); function hurrrdurrr(elem) { $(elem).stop().animate({backgroundColor:'#'+randstr()}, 333, @@ -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; } $(function () { @@ -430,10 +448,11 @@ function index_show_countdown($opentime) { </script>"; 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>'; - echo '<div style="width:100%"> + echo '<div style="width:100%; margin-top: 20px;"> <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&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true"></iframe> </div>