"use strict"; // Main Home Slider function bootstrapAnimatedLayer() { //Function to animate slider captions function doAnimations(elems) { //Cache the animationend event in a variable var animEndEv = 'webkitAnimationEnd animationend'; elems.each(function () { var $this = $(this), $animationType = $this.data('animation'); $this.addClass($animationType).one(animEndEv, function () { $this.removeClass($animationType); }); }); } //Variables on page load var $myCarousel = $('#minimal-bootstrap-carousel'), $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); //Initialize carousel $myCarousel.carousel(); //Animate captions in first slide on page load doAnimations($firstAnimatingElems); //Other slides to be animated on carousel slide event $myCarousel.on('slide.bs.carousel', function (e) { var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']"); doAnimations($animatingElems); }); $('#minimal-bootstrap-carousel').find('.carousel-item').first().addClass('active'); } // Scroll to top function scrollToTop() { var $scrollUp = $('#scroll-top'), $lastScrollTop = 0, $window = $(window); $window.on('scroll', function () { var st = $(this).scrollTop(); if (st > $lastScrollTop) { $scrollUp.removeClass('show'); } else { if ($window.scrollTop() > 200) { $scrollUp.addClass('show'); } else { $scrollUp.removeClass('show'); } } $lastScrollTop = st; }); $scrollUp.on('click', function (evt) { $('html, body').animate({ scrollTop: 0 }, 600); evt.preventDefault(); }); } // Main menu function mainmenu() { //Submenu Dropdown Toggle if ($('.main-menu li.dropdown ul').length) { $('.main-menu li.dropdown').append(''); //Dropdown Button $('.main-menu li.dropdown .dropdown-btn').on('click', function () { $(this).prev('ul').slideToggle(500); }); } } // active menu $(document).ready(function() { $("#menu-toggle").click(function() { $("#menu-navbar").toggle(); }); }); $(function () { var url = window.location.pathname; var activePage = url.substring(url.lastIndexOf('/') + 1); $('#nvmenu li a').each(function () { var linkPage = this.href.substring(this.href.lastIndexOf('/') + 1); if (activePage === linkPage) { $(this).parent().addClass('current'); var parentDropDown = $(this).closest('.dropdown'); if (parentDropDown !== undefined) { parentDropDown.addClass('current'); } } }); }); // Header Sticky function stickyHeader() { if ($('.stricky').length) { var strickyScrollPos = 100; if ($(window).scrollTop() > strickyScrollPos) { $('.stricky').addClass('stricky-fixed'); $('.scroll-to-top').fadeIn(1500); } else if ($(this).scrollTop() <= strickyScrollPos) { $('.stricky').removeClass('stricky-fixed'); $('.scroll-to-top').fadeOut(1500); } } } //Update Header Style and Scroll to Top function headerStyle() { if ($('.header-bottom-style2').length) { var windowpos = $(window).scrollTop(); var siteHeader = $('.header-bottom-style2'); var sticky_header = $('.fixed-header .sticky-header'); var scrollLink = $('.scroll-to-top-style2'); if (windowpos > 50) { siteHeader.addClass('fixed-header'); sticky_header.addClass("animated slideInDown"); scrollLink.fadeIn(300); } else { siteHeader.removeClass('fixed-header'); sticky_header.removeClass("animated slideInDown"); scrollLink.fadeOut(300); } } } // Prealoder function prealoader() { if ($('.preloader').length) { $('.preloader').delay(200).fadeOut(500); } } // Fact counter function CounterNumberChanger() { var timer = $('.timer'); if (timer.length) { timer.appear(function () { timer.countTo(); }); } } //Fact Counter + Text Count if ($('.count-box').length) { $('.count-box').appear(function () { var $t = $(this), n = $t.find(".count-text").attr("data-stop"), r = parseInt($t.find(".count-text").attr("data-speed"), 10); if (!$t.hasClass("counted")) { $t.addClass("counted"); $({ countNum: $t.find(".count-text").text() }).animate({ countNum: n }, { duration: r, easing: "linear", step: function () { $t.find(".count-text").text(Math.floor(this.countNum)); }, complete: function () { $t.find(".count-text").text(this.countNum); } }); } }, { accY: 0 }); } // Tool tip $(function () { $('[data-toggle="tooltip"]').tooltip(); }); // Select menu function selectDropdown() { if ($(".selectmenu").length) { $(".selectmenu").selectmenu(); var changeSelectMenu = function (event, item) { $(this).trigger('change', item); }; $(".selectmenu").selectmenu({ change: changeSelectMenu }); } } //=== Choose Carousel === function chooseCarousel() { if ($('.choose-carousel').length) { $('.choose-carousel').owlCarousel({ dots: false, loop: true, margin: 30, nav: true, navText: [ '

Prev

', '

Next

' ], autoplayHoverPause: false, autoplay: 6000, smartSpeed: 1000, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 3 }, 1100: { items: 3 }, 1200: { items: 4 } } }); } } //=== Working Process Carousel === function workingProcessCarousel() { if ($('.working-process-carousel').length) { $('.working-process-carousel').owlCarousel({ dots: false, loop: true, margin: 30, nav: true, navText: [ '', '' ], autoplayHoverPause: false, autoplay: 6000, smartSpeed: 1000, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 2 }, 1100: { items: 3 }, 1200: { items: 3 } } }); } } //=== Project Carousel === function projectCarousel() { if ($('.project-carousel').length) { $('.project-carousel').owlCarousel({ dots: true, loop: true, margin: 30, nav: false, navText: [ '', '' ], autoplayHoverPause: false, autoplay: 15000, smartSpeed: 700, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 2 }, 1100: { items: 2 }, 1200: { items: 3 } } }); } } //=== Blog Carousel === function blogCarousel() { if ($('.blog-carousel').length) { $('.blog-carousel').owlCarousel({ dots: false, loop: true, margin: 30, nav: true, navText: [ '

Prev

', '

Next

' ], autoplayHoverPause: true, autoplay: 15000, smartSpeed: 1000, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 2 }, 1100: { items: 2 }, 1200: { items: 3 } } }); } } //=== Testimonial Carousel === function testimonialCarousel() { if ($('.testimonial-carousel').length) { $('.testimonial-carousel').owlCarousel({ dots: true, loop: true, margin: 30, nav: false, navText: [ '', '' ], autoplayHoverPause: false, autoplay: 15000, smartSpeed: 700, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 1 }, 1024: { items: 2 }, 1100: { items: 2 }, 1200: { items: 2 } } }); } } //=== Team Carousel === function teamCarousel() { if ($('.team-carousel').length) { $('.team-carousel').owlCarousel({ dots: true, loop: true, margin: 30, nav: false, navText: [ '', '' ], autoplayHoverPause: false, autoplay: 6000, smartSpeed: 1000, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 3 }, 1100: { items: 3 }, 1200: { items: 4 } } }); } } //=== Branches Carousel === function branchesCarousel() { if ($('.branches-carousel').length) { $('.branches-carousel').owlCarousel({ dots: false, loop: true, margin: 30, nav: true, navText: [ '

Prev

', '

Next

' ], autoplayHoverPause: false, autoplay: 6000, smartSpeed: 1000, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 3 }, 1100: { items: 3 }, 1200: { items: 4 } } }); } } //=== Service Offer Carousel === function serviceOfferCarousel() { if ($('.service-offer-carousel').length) { $('.service-offer-carousel').owlCarousel({ dots: false, loop: true, margin: 30, nav: true, navText: [ '

Prev

', '

Next

' ], autoplayHoverPause: false, autoplay: 6000, smartSpeed: 1000, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 3 }, 1100: { items: 3 }, 1200: { items: 4 } } }); } } //=== Excellent Project Carousel === function excellentProjectCarousel() { if ($('.excellent-project-carousel').length) { $('.excellent-project-carousel').owlCarousel({ dots: true, loop: true, margin: 30, nav: false, navText: [ '', '' ], autoplayHoverPause: false, autoplay: 6000, smartSpeed: 1000, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 2 }, 1024: { items: 3 }, 1100: { items: 3 }, 1200: { items: 4 } } }); } } //=== Testimonial Style2 Carousel === function testimonialStyle2Carousel() { if ($('.testimonial-style2-carousel').length) { $('.testimonial-style2-carousel').owlCarousel({ dots: false, loop: true, margin: 30, nav: true, navText: [ '

Prev

', '

Next

' ], autoplayHoverPause: false, autoplay: 6000, smartSpeed: 1000, responsive: { 0: { items: 1 }, 600: { items: 1 }, 800: { items: 1 }, 1024: { items: 1 }, 1100: { items: 1 }, 1200: { items: 1 } } }); } } if ($('.counter').length) { $('.counter').counterUp({ delay: 10, time: 3000 }); } if ($('.wow').length) { var wow = new WOW({ boxClass: 'wow', // animated element css class (default is wow) animateClass: 'animated', // animation css class (default is animated) offset: 250, // distance to the element when triggering the animation (default is 0) mobile: true, // trigger animations on mobile devices (default is true) live: true // act on asynchronously loaded content (default is true) }); wow.init(); } if ($('.image-popup').length) { var groups = {}; $('.image-popup').each(function () { var id = parseInt($(this).attr('data-group'), 10); if (!groups[id]) { groups[id] = []; } groups[id].push(this); }); $.each(groups, function () { $(this).magnificPopup({ type: 'image', closeOnContentClick: true, closeBtnInside: false, gallery: { enabled: true } }); }); } if ($('.video-popup').length) { $('.video-popup').magnificPopup({ disableOn: 700, type: 'iframe', mainClass: 'mfp-fade', removalDelay: 160, preloader: true, fixedContentPos: false }); } if ($('.main-navigation .navigation-box .sub-menu').length) { var subMenu = $('.main-navigation .sub-menu'); subMenu.parent('li').children('a').append(function () { return ''; }); var mainNavToggler = $('.header-navigation .menu-toggler'); var subNavToggler = $('.main-navigation .sub-nav-toggler'); mainNavToggler.on('click', function () { var Self = $(this); var menu = Self.data('target'); $(menu).slideToggle(); $(menu).toggleClass('showen'); return false; }); subNavToggler.on('click', function () { var Self = $(this); Self.parent().parent().children('.sub-menu').slideToggle(); return false; }); } if ($('.side-navigation').length) { $('.side-nav-opener').on('click', function () { $('.side-navigation').addClass('open'); return false; }); $('.side-navigation-close-btn, .page-wrapper').on('click', function () { $('.side-navigation').removeClass('open'); }); } if ($('.popup-with-zoom-anim').length) { $('.popup-with-zoom-anim').magnificPopup({ type: 'inline', fixedContentPos: false, fixedBgPos: true, overflowY: 'auto', closeBtnInside: true, preloader: false, midClick: true, removalDelay: 300, mainClass: 'my-mfp-zoom-in' }); } function isotopeActivator() { if ($('.masonary-layout').length) { $('.masonary-layout').isotope({ layoutMode: 'masonry' }); } if ($('.post-filter').length) { $('.post-filter li').children('.filter-text').on('click', function () { var Self = $(this); var selector = Self.parent().attr('data-filter'); $('.post-filter li').removeClass('active'); Self.parent().addClass('active'); $('.filter-layout').isotope({ filter: selector, animationOptions: { duration: 500, easing: 'linear', queue: false } }); return false; }); } if ($('.post-filter.has-dynamic-filters-counter').length) { // var allItem = $('.single-filter-item').length; var activeFilterItem = $('.post-filter.has-dynamic-filters-counter').find('li'); activeFilterItem.each(function () { var filterElement = $(this).data('filter'); var count = $('.filter-layout').find(filterElement).length; $(this).children('.filter-text').append('' + count + ''); }); } } if ($('.service-style-one-carousel').length) { $('.service-style-one-carousel').owlCarousel({ loop: true, margin: 30, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 2 }, 1199: { items: 3 }, 1200: { items: 3 } } }); } if ($('.blog-carousel-one').length) { $('.blog-carousel-one').owlCarousel({ dots: false, loop: true, margin: 30, nav: true, navText: [ '', '' ], autoplayHoverPause: true, autoplay: true, smartSpeed: 700, responsive: { 0: { items: 1 }, 575: { items: 1 }, 767: { items: 1 }, 991: { items: 2 }, 1199: { items: 3 }, 1200: { items: 3 } } }); } if ($('.service-style-two-carousel').length) { $('.service-style-two-carousel').owlCarousel({ loop: true, margin: 30, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 2 }, 1199: { items: 3 }, 1200: { items: 3 } } }); } if ($('.blog-carousel-style-one').length) { $('.blog-carousel-style-one').owlCarousel({ loop: true, margin: 30, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 2 }, 1199: { items: 2 }, 1200: { items: 3 } } }); } if ($('.testimonials-carousel-two').length) { $('.testimonials-carousel-two').owlCarousel({ loop: true, margin: 30, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 2 }, 1199: { items: 2 }, 1200: { items: 3 } } }); } if ($('.about-carousel-one').length) { $('.about-carousel-one').owlCarousel({ loop: true, margin: 0, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 1 }, 1199: { items: 1 }, 1200: { items: 1 } } }); } if ($('.testimonials-carousel-three').length) { var testiThreeCarousel = $('.testimonials-carousel-three'); var testiThreeCarouselNav = testiThreeCarousel.data('nav'); var testiThreeCarouseldots = testiThreeCarousel.data('dots'); testiThreeCarousel.owlCarousel({ loop: true, margin: 0, nav: testiThreeCarouselNav, navText: [ '', '' ], dots: testiThreeCarouseldots, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 1 }, 1199: { items: 1 }, 1200: { items: 1 } } }); } if ($('.blog-carousel-style-two').length) { $('.blog-carousel-style-two').owlCarousel({ loop: true, margin: 30, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 2 }, 1199: { items: 3 }, 1200: { items: 3 } } }); } if ($('.testimonials-carousel-style-one').length) { $('.testimonials-carousel-style-one').owlCarousel({ loop: true, margin: 30, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 2 }, 1199: { items: 2 }, 1200: { items: 3 } } }); } if ($('.testimonials-carousel-style-two').length) { $('.testimonials-carousel-style-two').owlCarousel({ loop: true, margin: 0, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 1 }, 1199: { items: 1 }, 1200: { items: 1 } } }); } if ($('.testimonials-style-three-carousel').length) { $('.testimonials-style-three-carousel').owlCarousel({ loop: true, margin: 0, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 767: { items: 1 }, 991: { items: 1 }, 1199: { items: 1 }, 1200: { items: 1 } } }); } if ($('.brand-carousel-one').length) { $('.brand-carousel-one').owlCarousel({ loop: true, margin: 20, nav: false, navText: [ '', '' ], dots: false, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 2 }, 480: { items: 3 }, 600: { items: 3 }, 991: { items: 4 }, 1000: { items: 6 }, 1200: { items: 6 } } }); } if ($('.brand-style-two-carousel').length) { $('.brand-style-two-carousel').owlCarousel({ loop: true, margin: 30, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 2 }, 480: { items: 2 }, 600: { items: 3 }, 991: { items: 4 }, 1000: { items: 5 }, 1200: { items: 5 } } }); } if ($('.footer-contact-carousel-one').length) { $('.footer-contact-carousel-one').owlCarousel({ loop: true, margin: 0, nav: false, navText: [ '', '' ], dots: true, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 600: { items: 1 }, 991: { items: 1 }, 1000: { items: 1 }, 1200: { items: 1 } } }); } if ($('.project-carousel-two').length) { $('.project-carousel-two').owlCarousel({ loop: true, margin: 0, nav: true, navText: [ '', '' ], dots: false, autoWidth: false, autoplay: true, smartSpeed: 700, autoplayTimeout: 5000, autoplayHoverPause: true, responsive: { 0: { items: 1 }, 480: { items: 1 }, 600: { items: 1 }, 991: { items: 2 }, 1000: { items: 2 }, 1200: { items: 2 } } }); } $(window).on('scroll', function () { if ($('.scrl-tt').length) { var strickyScrollPos = 100; if ($(window).scrollTop() > strickyScrollPos) { $('.scrl-tt').fadeIn(500); } else if ($(this).scrollTop() <= strickyScrollPos) { $('.scrl-tt').fadeOut(500); } } if ($('.stricky').length) { var headerScrollPos = 100; var stricky = $('.stricky'); if ($(window).scrollTop() > headerScrollPos) { stricky.removeClass('slideIn animated'); stricky.addClass('stricky-fixed slideInDown animated'); } else if ($(this).scrollTop() <= headerScrollPos) { stricky.removeClass('stricky-fixed slideInDown animated'); stricky.addClass('slideIn animated'); } } }); $(window).on('load', function () { isotopeActivator(); if ($('.preloader').length) { $('.preloader').fadeOut(); } if ($(window).width() < 1200) { if ($('.masonary-destroy-lg').length) { $('.masonary-destroy-lg').isotope('destroy'); } } if ($('.testimonials-style-one .slider').length) { $('.testimonials-style-one .slider').bxSlider({ adaptiveHeight: true, auto: true, controls: true, nextText: '', prevText: '', pause: 5000, speed: 1000, pagerCustom: '#testi-pager-1' }); } }); //Hidden Sidebar if ($('.hidden-bar').length) { var hiddenBar = $('.hidden-bar'); var hiddenBarOpener = $('.hidden-bar-opener'); var hiddenBarCloser = $('.hidden-bar-closer'); var navToggler = $('.nav-toggler'); $('.hidden-bar-wrapper').mCustomScrollbar(); //Show Sidebar hiddenBarOpener.on('click', function () { hiddenBar.toggleClass('visible-sidebar'); navToggler.toggleClass('open'); }); //Hide Sidebar hiddenBarCloser.on('click', function () { hiddenBar.toggleClass('visible-sidebar'); navToggler.toggleClass('open'); }); } //LightBox / Fancybox if ($('.lightbox-image').length) { $('.lightbox-image').fancybox({ openEffect: 'fade', closeEffect: 'fade', youtube: { controls: 0, showinfo: 0 }, helpers: { media: {} } }); } if ($('.paroller').length) { $('.paroller').paroller({ factor: 0.05, // multiplier for scrolling speed and offset, +- values for direction control factorLg: 0.05, // multiplier for scrolling speed and offset if window width is less than 1200px, +- values for direction control type: 'foreground', // background, foreground direction: 'horizontal' // vertical, horizontal }); } //Contact Form Validation if ($("#contact-form").length) { $("#contact-form").validate({ submitHandler: function (form) { var form_btn = $(form).find('button[type="submit"]'); var form_result_div = '#form-result'; $(form_result_div).remove(); form_btn.before(''); var form_btn_old_msg = form_btn.html(); form_btn.html(form_btn.prop('disabled', true).data("loading-text")); $(form).ajaxSubmit({ dataType: 'json', success: function (data) { if (data.status === 'true') { $(form).find('.form-control').val(''); } form_btn.prop('disabled', false).html(form_btn_old_msg); $(form_result_div).html(data.message).fadeIn('slow'); setTimeout(function () { $(form_result_div).fadeOut('slow'); }, 6000); } }); } }); } // Dom Ready Function jQuery(document).on('ready', function () { (function ($) { prealoader(); bootstrapAnimatedLayer(); scrollToTop(); mainmenu(); stickyHeader(); headerStyle(); CounterNumberChanger(); selectDropdown(); chooseCarousel(); workingProcessCarousel(); projectCarousel(); blogCarousel(); testimonialCarousel(); teamCarousel(); branchesCarousel(); serviceOfferCarousel(); excellentProjectCarousel(); testimonialStyle2Carousel(); })(jQuery); }); jQuery(window).on('scroll', function () { (function ($) { stickyHeader(); headerStyle(); })(jQuery); }); // Instance Of Fuction while Window Load event jQuery(window).on('load', function () { (function ($) { prealoader(); })(jQuery); }); $(window).enllax();