/* Template */ (function($){ 'use strict'; var $win = $(window), $body_m = $('body'), $navbar = $('.navbar'); // Touch Class if (!("ontouchstart" in document.documentElement)) { $body_m.addClass("no-touch"); } // Get Window Width function winwidth () { return $win.width(); } var wwCurrent = winwidth(); $win.on('resize', function () { wwCurrent = winwidth(); }); // Sticky var $is_sticky = $('.is-sticky'); if ($is_sticky.length > 0 ) { var $navm = $('#mainnav').offset(); $win.scroll(function(){ var $scroll = $win.scrollTop(); if ($win.width() > 991 || $is_sticky.hasClass('mobile-sticky')) { if($scroll > $navm.top ){ if(!$is_sticky.hasClass('has-fixed')) {$is_sticky.addClass('has-fixed');} } else { if($is_sticky.hasClass('has-fixed')) {$is_sticky.removeClass('has-fixed');} } } else { if($is_sticky.hasClass('has-fixed')) {$is_sticky.removeClass('has-fixed');} } }); } // OnePage Scrolling $('a.menu-link[href*="#"]:not([href="#"])').on("click", function() { if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) { var toHash = $(this.hash), toHashN = (this.hash.slice(1)) ? $('[name=' + this.hash.slice(1) + ']') : false, nbar = (wwCurrent >= 992) ? $navbar.height() - 1 : 0; toHash = toHash.length ? toHash : toHashN; if (toHash.length) { $('html, body').animate({ scrollTop: (toHash.offset().top - nbar) }, 1000, "easeInOutExpo"); return false; } } }); // Active page menu when click var CurURL = window.location.href, urlSplit = CurURL.split("#"); var $nav_link = $(".nav li a"); if ($nav_link.length > 0) { $nav_link.each(function() { if (CurURL === (this.href) && (urlSplit[1]!=="")) { $(this).closest("li").addClass("active").parent().closest("li").addClass("active"); } }); } // Bootstrap Dropdown var $dropdown_menu = $('.dropdown'), $dropdown_toggle = $('.dropdown-toggle'); if ($dropdown_menu.length > 0 ) { $dropdown_menu.on("mouseover",function(){ if ($win.width() > 991) { $(this).children('.dropdown-menu').stop().fadeIn(400); $(this).addClass('open'); } }); $dropdown_menu.on("mouseleave",function(){ if ($win.width() > 991) { $(this).children('.dropdown-menu').stop().fadeOut(400); $(this).removeClass('open'); } }); $dropdown_toggle.on("click",function(){ if ($win.width() < 991) { $(this).parent().children('.dropdown-menu').fadeToggle(400); $(this).parent().toggleClass('open'); return false; } }); } $win.on('resize', function() { $('.navbar-collapse').removeClass('in'); $dropdown_menu.parent().children('.dropdown-menu').fadeOut("400"); }); // remove ani var $navtoggler = $('.navbar-toggler'), $trannav =$('.is-transparent'); if ($navtoggler.length > 0) { $navtoggler.on("click",function(){ $('.remove-animation').removeClass('animated'); if (!$trannav.hasClass('active')) { $trannav.addClass('active'); }else{ $trannav.removeClass('active'); } }); } // Select var $selectbox = $('select'); if ($selectbox.length > 0) { $selectbox.select2(); } // Nav collapse $('.menu-link').on("click",function() { $('.navbar-collapse').collapse('hide'); $trannav.removeClass('active'); }); $(document).on('mouseup', function(e){ if (!$trannav.is(e.target) && $trannav.has(e.target).length===0) { $('.navbar-collapse').collapse('hide'); $trannav.removeClass('active'); } }); //Carousel Time Line var $timeline_carousel = $('.timeline-carousel'); if ($timeline_carousel.length > 0 ) { var c_rtl = ($body_m.hasClass('is-rtl')) ? true : false; $timeline_carousel.addClass('owl-carousel').owlCarousel({ navText: ["",""], items:6, nav:true, margin:30, rtl: c_rtl, responsive:{ 0 : { items:1, }, 400 : { items:2, center:false, }, 599 : { items:3, }, 1024 : { items:5, }, 1170 : { items:6, } } }); } //Carousel Roadmap var $roadmap_carousel = $('.roadmap-carousel'); if ($roadmap_carousel.length > 0 ) { var c_rtl_r = ($body_m.hasClass('is-rtl')) ? true : false; $roadmap_carousel.addClass('owl-carousel').owlCarousel({ items:6, nav:false, dost:true, margin:30, rtl: c_rtl_r, responsive:{ 0 : { items:1, }, 400 : { items:2, center:false, }, 599 : { items:3, }, 1024 : { items:4, }, 1170 : { items:5, } } }); } //Carousel Roadmap var $roadmap_carousel_withnav = $('.roadmap-carousel-withnav'); if ($roadmap_carousel_withnav.length > 0 ) { var c_rtl_rn = ($body_m.hasClass('is-rtl')) ? true : false; $roadmap_carousel_withnav.addClass('owl-carousel').owlCarousel({ navText: ["",""], items:5, nav:true, dost:false, margin:30, rtl: c_rtl_rn, responsive:{ 0 : { items:1, }, 400 : { items:2, center:false, }, 599 : { items:3, }, 1024 : { items:4, }, 1170 : { items:5, } } }); } //Carousel Prblm Sltn var $prblmsltn_list = $('.prblmsltn-list'); if ($prblmsltn_list.length > 0 ) { var c_rtl_pl = ($body_m.hasClass('is-rtl')) ? true : false; $prblmsltn_list.addClass('owl-carousel').owlCarousel({ navText: ["",""], items:1, margin:30, nav:true, dost:false, autoplay:true, loop:true, animateOut: 'fadeOut', autoHeight: true, rtl: c_rtl_pl }); } //Carousel var $has_carousel = $('.has-carousel'); if ($has_carousel.length > 0 ) { var c_rtl_c = ($body_m.hasClass('is-rtl')) ? true : false; $has_carousel.each(function(){ var $self = $(this); var c_item = ($self.data('items')) ? $self.data('items') : 4; var c_item_t = (c_item >= 3) ? 2 : c_item; var c_item_m = (c_item_t >= 2) ? 1 : c_item_t; var c_delay =($self.data('delay')) ? $self.data('delay') : 6000; var c_auto =($self.data('auto')) ? true : false; var c_loop =($self.data('loop')) ? true : false; var c_dots = ($self.data('dots')) ? true : false; var c_navs = ($self.data('navs')) ? true : false; var c_ctr = ($self.data('center')) ? true : false; var c_mgn = ($self.data('margin')) ? $self.data('margin') : 30; $self.addClass('owl-carousel').owlCarousel({ navText: ["",""], items: c_item, loop: c_loop, nav: c_navs, dots: c_dots, margin: c_mgn, center: c_ctr, autoplay: c_auto, autoplayTimeout: c_delay, autoplaySpeed: 300, rtl: c_rtl_c, responsive:{ 0:{ items:1 }, 480:{ items: c_item_m }, 768:{ items: c_item_t }, 1170:{ items: c_item } } }); }); } // Count Down var $count_token = $('.token-countdown'); if ($count_token.length > 0 ) { $count_token.each(function() { var $self = $(this), datetime = $self.attr("data-date"); $self.countdown(datetime).on('update.countdown', function(event) { $(this).html(event.strftime('' + '