Guest User

Splatoon Countdown Timer by xenon

a guest
Jun 7th, 2015
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div id="countdown-stage">Please enable JavaScript to see the stage timer.</div>
  2. <script>
  3. console.log("31337 haxed by xen0n");
  4. var countTo = 0
  5. function messageUpdate(msg) {
  6. document.getElementById("countdown-stage").innerHTML = msg;
  7. }
  8. var mess = "Please wait"
  9. messageUpdate(mess);
  10. function findCountTo() {
  11. currentTime = new Date();
  12. hrs = currentTime.getUTCHours();
  13. if (hrs >= 0 && hrs < 2) {
  14. countTo = 2
  15. }
  16. if (hrs >= 2 && hrs < 6) {
  17. countTo = 6
  18. }
  19. if (hrs >= 6 && hrs < 10) {
  20. countTo = 10
  21. }
  22. if (hrs >= 10 && hrs < 14) {
  23. countTo = 14
  24. }
  25. if (hrs >= 14 && hrs < 18) {
  26. countTo = 18
  27. }
  28. if (hrs >= 18 && hrs < 22) {
  29. countTo = 22
  30. }
  31. if (hrs >= 22) {
  32. countTo = 2
  33. }
  34. }
  35. findCountTo();
  36. function update() {
  37. currentTime = new Date();
  38. hrs = currentTime.getUTCHours();
  39. mins = currentTime.getUTCMinutes();
  40. secs = currentTime.getUTCSeconds();
  41. var showHrs = countTo - hrs - 1
  42. var showMins = 60 - mins
  43. if (hrs < countTo) {
  44. mess = "Stages will update in " + parseInt(showHrs) + " hours " + parseInt(showMins) + " minutes " + parseInt(60 - secs) + " seconds"
  45. }
  46. if (hrs == countTo) {
  47. mess = "The stages have been updated!"
  48. findCountTo();
  49. }
  50. messageUpdate(mess);
  51. }
  52. setInterval(update, 1000);
  53. </script>
Advertisement
Add Comment
Please, Sign In to add comment