SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function () {
  2.     $('.slide_description').click(function () {
  3.         $('#extend-description').slideToggle(function () {
  4.         });
  5.     });
  6.     $('#landing_text_1').fadeIn(4000);
  7.     $('#landing_text_2').delay(4000).fadeIn(2000);
  8.     $('#landing_text_3').delay(8000).fadeIn(2000);
  9.     $('#play_button').delay(9000).fadeIn(2000);
  10.     $('#position_image').fadeIn(2000);
  11.     $('#position_name').fadeIn(6000);
  12.     $('#roll_button').fadeIn(7000);
  13.     // Switch for dark mode
  14.     var switch_theme = document.querySelector('.theme-switch input[type="checkbox"]');
  15.     var current_theme = localStorage.getItem('theme');
  16.     if (current_theme) {
  17.         document.documentElement.setAttribute('data-theme', current_theme);
  18.  
  19.         if (current_theme === 'dark') {
  20.             switch_theme.checked = true;
  21.         }
  22.     }
  23.  
  24.     function switchTheme(e) {
  25.         if (e.target.checked) {
  26.             document.documentElement.setAttribute('data-theme', 'dark');
  27.             localStorage.setItem('theme', 'dark');
  28.         } else {
  29.             document.documentElement.setAttribute('data-theme', 'light');
  30.             localStorage.setItem('theme', 'light');
  31.         }
  32.     }
  33.  
  34.     switch_theme.addEventListener('change', switchTheme, false);
  35.     // User countdown
  36.     var myVar;
  37.     $('#countdown-start').click(function () {
  38.         clearInterval(myVar);
  39.         var count_val = document.getElementById("counter_val").value;
  40.         countdown(count_val);
  41.         document.getElementById("counter_val").innerHTML = null;
  42.     });
  43.  
  44.     function countdown(val) {
  45.         var counter = val;
  46.  
  47.         myVar = setInterval(function () {
  48.             if (counter >= 0) {
  49.                 document.getElementById("countdown").innerHTML = counter;
  50.             }
  51.             if (counter === 0) {
  52.                 $('#alarm').get(0).play();
  53.                 $('#timer-modal').modal({
  54.                     backdrop: 'static',
  55.                     keyboard: false
  56.                 });
  57.                 document.getElementById("countdown").innerHTML = null;
  58.             }
  59.             counter--;
  60.         }, 1000)
  61.  
  62.     }
  63.  
  64.     $('#timer-off').click(function () {
  65.         $('#alarm').get(0).pause();
  66.     })
  67. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top