(function($) { "use strict"; /* .............................................. Loader ................................................. */ $(window).on('load', function() { $('.preloader').fadeOut(); $('#preloader').delay(550).fadeOut('slow'); $('body').delay(450).css({'overflow':'visible'}); }); /* .............................................. Navbar Bar ................................................. */ $('.navbar-nav .nav-link').on('click', function() { var toggle = $('.navbar-toggler').is(':visible'); if (toggle) { $('.navbar-collapse').collapse('hide'); } }); /* .............................................. Fixed Menu ................................................. */ $(window).on('scroll', function () { if ($(window).scrollTop() > 50) { $('.top-header').addClass('fixed-menu'); } else { $('.top-header').removeClass('fixed-menu'); } }); /* .............................................. ResponsiveSlides ................................................. */ $(".rslides").responsiveSlides({ auto: true, // Boolean: Animate automatically, true or false speed: 500, // Integer: Speed of the transition, in milliseconds timeout: 4000, // Integer: Time between slide transitions, in milliseconds pager: false, // Boolean: Show pager, true or false nav: false, // Boolean: Show navigation, true or false random: false, // Boolean: Randomize the order of the slides, true or false pause: false, // Boolean: Pause on hover, true or false pauseControls: true, // Boolean: Pause when hovering controls, true or false prevText: "Previous", // String: Text for the "previous" button nextText: "Next", // String: Text for the "next" button maxwidth: "", // Integer: Max-width of the slideshow, in pixels navContainer: "", // Selector: Where controls should be appended to, default is after the 'ul' manualControls: "", // Selector: Declare custom pager navigation namespace: "rslides", // String: Change the default namespace used before: function(){}, // Function: Before callback after: function(){} // Function: After callback }); /* .............................................. TimeLine ................................................. */ $('.timeLine').timeLine({ mainColor: '#890025', opacity: '0.85', lineColor: '#890025' }); /* .............................................. Gallery ................................................. */ $(document).ready(function() { $('.popup-gallery').magnificPopup({ delegate: 'a', type: 'image', tLoading: 'Loading image #%curr%...', mainClass: 'mfp-img-mobile', gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, image: { tError: 'The image #%curr% could not be loaded.', titleSrc: function(item) { return item.el.attr('title') + 'by Marsel Van Oosten'; } } }); }); /* .............................................. Smooth Scroll ................................................. */ $('a[href*="#"]:not([href="#"])').on('click', function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top - 65, }, 1000); return false; } } }); /* .............................................. Countdown Clock ................................................. */ function makeTimer() { var endTime = new Date("01 June 2019 10:45:00 GMT+01:00"); endTime = (Date.parse(endTime) / 1000); var now = new Date(); now = (Date.parse(now) / 1000); var timeLeft = endTime - now; var days = Math.floor(timeLeft / 86400); var hours = Math.floor((timeLeft - (days * 86400)) / 3600); var minutes = Math.floor((timeLeft - (days * 86400) - (hours * 3600 )) / 60); var seconds = Math.floor((timeLeft - (days * 86400) - (hours * 3600) - (minutes * 60))); if (hours < "10") { hours = "0" + hours; } if (minutes < "10") { minutes = "0" + minutes; } if (seconds < "10") { seconds = "0" + seconds; } $("#days").html(days + "