summaryrefslogtreecommitdiffstats
path: root/pages/home.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2011-12-07 03:02:05 -0800
committerPatrick Davison <snapwilliam@gmail.com>2011-12-07 03:02:05 -0800
commitd2e8d7999913cae4c62b471133a90cc166e3f679 (patch)
tree0d3e16dfa82f5fd6f5ba5b0be9004317178461eb /pages/home.php
parent2fcf71ee0f0feb98cdd1fb1a44b2711a567056fe (diff)
downloadpathery-d2e8d7999913cae4c62b471133a90cc166e3f679.tar.xz
Countdown timer, Radivel/Splax added, Time taken => Time.
Diffstat (limited to 'pages/home.php')
-rw-r--r--pages/home.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/pages/home.php b/pages/home.php
index f263c2b..ef3438c 100644
--- a/pages/home.php
+++ b/pages/home.php
@@ -115,6 +115,44 @@ $mergesolution = $map;
<div id="fb">
</div>
+<?PHP
+$timediff = strtotime("tomorrow") - strtotime("now");
+?>
+<script type="text/javascript">
+var countdownInt=self.setInterval("countdown()", 1000);
+var timerem = <? echo $timediff; ?>;
+
+function countdown() {
+ var hours;
+ var minutes;
+ var seconds;
+ var stamp;
+ if (timerem < 1)
+ window.clearInterval(countdownInt);
+ hours = Math.floor(timerem / 3600);
+ minutes = Math.floor((timerem - (hours * 3600)) / 60);
+ seconds = timerem % 60;
+
+ hours = addZero(hours);
+ minutes = addZero(minutes);
+ seconds = addZero(seconds);
+
+ stamp = hours + ":" + minutes + ":" + seconds;
+ document.getElementById("countdown").innerHTML = stamp;
+
+ timerem--;
+}
+
+function addZero(num) {
+ var numStr = num + '';
+ if (numStr.length < 2)
+ numStr = "0" + numStr;
+ return numStr;
+}
+</script>
+ <div style='text-align: center; margin-top: 5px'>
+ New maps in: <span id="countdown">00:00:00</span>
+ </div>
</div>
<div id="copy">