Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function () {
- $('.slide_description').click(function () {
- $('#extend-description').slideToggle(function () {
- });
- });
- $('#landing_text_1').fadeIn(4000);
- $('#landing_text_2').delay(4000).fadeIn(2000);
- $('#landing_text_3').delay(8000).fadeIn(2000);
- $('#play_button').delay(9000).fadeIn(2000);
- $('#position_image').fadeIn(2000);
- $('#position_name').fadeIn(6000);
- $('#roll_button').fadeIn(7000);
- // Switch for dark mode
- var switch_theme = document.querySelector('.theme-switch input[type="checkbox"]');
- var current_theme = localStorage.getItem('theme');
- if (current_theme) {
- document.documentElement.setAttribute('data-theme', current_theme);
- if (current_theme === 'dark') {
- switch_theme.checked = true;
- }
- }
- function switchTheme(e) {
- if (e.target.checked) {
- document.documentElement.setAttribute('data-theme', 'dark');
- localStorage.setItem('theme', 'dark');
- } else {
- document.documentElement.setAttribute('data-theme', 'light');
- localStorage.setItem('theme', 'light');
- }
- }
- switch_theme.addEventListener('change', switchTheme, false);
- // User countdown
- var myVar;
- $('#countdown-start').click(function () {
- clearInterval(myVar);
- var count_val = document.getElementById("counter_val").value;
- countdown(count_val);
- document.getElementById("counter_val").innerHTML = null;
- });
- function countdown(val) {
- var counter = val;
- myVar = setInterval(function () {
- if (counter >= 0) {
- document.getElementById("countdown").innerHTML = counter;
- }
- if (counter === 0) {
- $('#alarm').get(0).play();
- $('#timer-modal').modal({
- backdrop: 'static',
- keyboard: false
- });
- document.getElementById("countdown").innerHTML = null;
- }
- counter--;
- }, 1000)
- }
- $('#timer-off').click(function () {
- $('#alarm').get(0).pause();
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement