/* WP Theme: Finix - Technology & IT Solutions WordPress Theme Author: powersquall.com Version: 1.4 Design and Developed by: Power Squall */ /*============================================= [ Table of contents ] =============================================== :: Predefined Variables :: Preloader :: ClassAdd Loading :: Check Exists :: Header Sticky :: Slicknav :: Header Search :: Header Sidemenu :: Page Header Mobile :: Swiper Slider :: Magnific Popup :: Progressbar :: Rounded Skill :: Masonry :: Isotope :: Sticky Footer :: Countdown :: Woocommerce SwitchToGrid :: Back to Top :: Mobile Click :: Mobile Bottom Navbar :: THEMEMAX Window load and functions ============================================== [ End table content ] ============================================*/ /*-------------------------*/ /* Predefined Variables */ /*-------------------------*/ (function($){ "use strict"; /*-------------------------*/ /* Predefined Variables */ /*-------------------------*/ var THEMEMAX = {}, $window = $(window), $document = $(document), $body = $('body'), $bar = $('.bar'), $header = $('header'), $progressBar = $('.progress-bar'), $counter = $('.counter'); /*-------------------------*/ /* Preloader */ /*-------------------------*/ THEMEMAX.preloader = function () { $('#preloader').delay(0).fadeOut('slow'); }; /*-------------------------*/ /* Class Add Loading */ /*-------------------------*/ THEMEMAX.classAdd = function () { $('#site-header').removeClass('header-loading'); }; /*-------------------------*/ /* Check if Function Exists */ /*-------------------------*/ $.fn.exists = function () { return this.length > 0; }; /*----------------------------*/ /* Header Sticky */ /*----------------------------*/ THEMEMAX.stickyHeader = function () { var headerHeight = $('.site-header').height(); var stickyHeaderheight = $('.site-header .header-main').height(); $("#page").css("padding-top", (headerHeight) + "px"); $(".header-transparnt .page-header").css("padding-top", (headerHeight) + "px"); $(".header-transparnt-light .page-header").css("padding-top", (headerHeight) + "px"); $(".elementor-column.sticky-top").css("top", (stickyHeaderheight) + 20 + "px"); $(".admin-bar .elementor-column.sticky-top").css("top", (stickyHeaderheight) + 50 + "px"); $(window).scroll(function () { if ($(this).scrollTop() > 250) { $('.site-header.sticky-on').addClass('sticky'); $('.Aqua-sticky-placeholder').css('display', 'block') } else { $('.site-header.sticky-on').removeClass('sticky'); $('.Aqua-sticky-placeholder').css('display', 'none') } }); }; /*-------------------------*/ /* Slicknav */ /*-------------------------*/ THEMEMAX.slickNav = function () { $('#menu').slicknav({prependTo:'#slicknav_menu'}); $('.slicknav_nav').slicknav({ label: '', prependTo:'.primary-nav #slicknav_menu', closedSymbol: "+", // Character after collapsed parents. "►" openedSymbol: "-", // Character after expanded parents. "▼" allowParentLinks: true, // Allow clickable links as parent elements. }); }; /*-------------------------*/ /* One Page Menu */ /*-------------------------*/ THEMEMAX.onePageMenu = function () { var pageSections = $('.elementor-section'); var onepageNav = $('#primary-menu .navbar-nav, #slicknav_menu .slicknav_nav'); var navHeight = $('#site-header').height(); $(window).on('scroll', function () { var curPosition = $(this).scrollTop(); pageSections.each(function() { var top = $(this).offset().top - navHeight - (-20), bottom = top + $(this).outerHeight(); if (curPosition >= top && curPosition <= bottom) { onepageNav.find('a').parent().removeClass('current-menu-item'); onepageNav.find('a[href="#'+$(this).attr('id')+'"]').parent().addClass('current-menu-item'); pageSections.removeClass('active'); $(this).addClass('active'); } }); }); onepageNav.find('a').on('click', function () { var $el = $(this); var id = $el.attr('href'); $('html, body').animate({ scrollTop: $(id).offset().top - navHeight - (-20) }, 700); return false; }); }; /*-------------------------*/ /* Header Search */ /*-------------------------*/ THEMEMAX.headerSearch = function () { $('.header-search .search-btn, #mobile-search').on('click', function() { $('.search-main').addClass('search-show'); }); $('.search-main .search-close').on('click', function() { $(this).parent().removeClass('search-show'); }); }; /*-------------------------*/ /* Header Sidemenu */ /*-------------------------*/ THEMEMAX.headerSidemenu = function () { $('.site-header .header-sidemenu').on('click', function() { $('body').addClass('sidemenu-open'); }); $('.sidemenu-main .sidemenu-close, .sidemenu-main .sidemenu-overlay').on('click', function() { $('body').removeClass('sidemenu-open'); }); }; /*-------------------------*/ /* Page Header - Mobile */ /*-------------------------*/ THEMEMAX.pageHeaderMobile = function () { if ($(window).width() < 975) { $('.page-header').addClass('mobile-page-header'); } else { $('.page-header').removeClass('mobile-page-header'); } }; /*-------------------------*/ /* Swiper Slider */ /*-------------------------*/ THEMEMAX.swiperSlider = function () { $( '.swiper-container' ).each(function () { var sectionId = $(this).data('sectionid') var preSelector = sectionId ? `#${sectionId}` : '' var swiper = new Swiper( $( this ), { slidesPerView: (($(this).attr('data-items')) ? $(this).attr('data-items') : 4), spaceBetween: (($(this).attr('data-space')) ? $(this).data('space') : 15), autoplay: (($(this).attr('data-autoplay')) ? $(this).data('autoplay') : false), loop: (($(this).attr('data-loop')) ? $(this).data('loop') : false), centeredSlides: (($(this).attr('data-centered')) ? $(this).data('centered') : false), slideToClickedSlide: $(this).data('slide_to_clicked_slide'), navigation: { nextEl: `${preSelector} .swiper-button-next`, prevEl: `${preSelector} .swiper-button-prev`, }, pagination: { el: '.swiper-pagination', clickable: true, }, breakpoints: { 1200: {slidesPerView: (($(this).attr('data-items')) ? $(this).attr('data-items') : 4),}, 992: {slidesPerView: (($(this).attr('data-lg-items')) ? $(this).attr('data-lg-items') : 3),}, 768: {slidesPerView: (($(this).attr('data-md-items')) ? $(this).attr('data-md-items') : 2),}, 480: {slidesPerView: (($(this).attr('data-sm-items')) ? $(this).attr('data-sm-items') : 1),}, 0: {slidesPerView: (($(this).attr('data-xs-items')) ? $(this).attr('data-xs-items') : 1),} } }); if (sectionId) { window[`swiper_${sectionId}`] = swiper } }); }; /*-------------------------*/ /* Magnific Popup */ /*-------------------------*/ THEMEMAX.mediaPopups = function () { if ($(".popup-youtube, .popup-vimeo, .popup-gmaps").exists()) { $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ disableOn: 700, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: false, fixedContentPos: false }); } } /*-------------------------*/ /* Progressbar */ /*-------------------------*/ THEMEMAX.progressBar = function () { if ($progressBar.exists()) { $progressBar.each(function (i, elem) { var $elem = $(this), percent = $elem.attr('data-percent') || "100", delay = $elem.attr('data-delay') || "100", type = $elem.attr('data-type') || "%"; if (!$elem.hasClass('progress-animated')) { $elem.css({ 'width': '0%' }); } var progressBarRun = function () { $elem.animate({ 'width': percent + '%' }, 'easeInOutCirc').addClass('progress-animated'); $elem.delay(delay).append('