Advertisement
Guest User

Untitled

a guest
Dec 28th, 2018
942
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. <?php
  2. /* Template Name: Timer */
  3. ?>
  4.  
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title>Timer</title>
  9.  
  10. <meta charset="utf-8">
  11. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
  12. <meta http-equiv="Pragma" content="no-cache"/>
  13. <meta http-equiv="Expires" content="0"/>
  14. <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/css/flipclock.css">
  15.  
  16.  
  17. </head>
  18. <body>
  19.  
  20. <div id="timer">
  21. <div class="clock" style="margin:2em;"></div>
  22. <div class="message" style="color: #ccc;"></div>
  23. </div>
  24.  
  25. <script src="<?php echo get_stylesheet_directory_uri(); ?>/assets/jquery-2.1.4.min.js"></script>
  26. <script src="<?php echo get_stylesheet_directory_uri(); ?>/js/flipclock.min.js"></script>
  27. <script>
  28.  
  29. function GetURLParameter(sParam) {
  30. var sPageURL = window.location.search.substring(1);
  31. var sURLVariables = sPageURL.split('&');
  32.  
  33. for (var i = 0; i < sURLVariables.length; i++) {
  34. var sParameterName = sURLVariables[i].split('=');
  35. if (sParameterName[0] == sParam) {
  36. return sParameterName[1];
  37. }
  38. }
  39. }
  40.  
  41. // Update time and refresh
  42. function DynamicFields(f0, f0_value) {
  43. time = unescape(f0_value);
  44. setClock()
  45. }
  46.  
  47. var clock;
  48. var time = GetURLParameter('time');
  49.  
  50. $(document).ready(function(){ setClock(); });
  51.  
  52. function setClock(){
  53.  
  54. clock = $('.clock').FlipClock(time, {
  55. clockFace: 'MinuteCounter',
  56. countdown: true,
  57. callbacks: {
  58. stop: function() {
  59. //$('.message').html('STREAM STARTING SOON');
  60. }
  61. }
  62. });
  63.  
  64. };
  65.  
  66.  
  67. </script>
  68.  
  69. </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement