"use strict"; var $ = jQuery; function fixOfferImageHeight() { var image = $('.offer-image-area img'); if (image.length > 0) { var height = image.height() + 'px'; $('.offer-content-wrapper').css('min-height', height); } } function fixBannerHeight() { var banner = $('.banner'); if (banner.length > 0) { var height = $(window).height(); banner.css('min-height', height); } } function fixsection03Height() { var featureItems = $('.feature-lists-style-three .feature-list'); if (featureItems.length > 0) { var featureHeight = featureItems.getMaxHeight(); featureItems.height(featureHeight); } } (function() { var screenshoot_slider_obj = {}; screenshoot_slider_obj.callback = function() { screenshoot_slider_obj.addingClasses(this); }; screenshoot_slider_obj.addingClasses = function(e) { $(e.$owlItems).removeClass('opacity80 opacity100 left center right'); var $currentItems = $(e.$owlWrapper).find('.owl-item.active'); var middleItemIndex; if (e.options.items == 5) { middleItemIndex = $currentItems.eq(2).index(); } else if (e.options.items == 3) { middleItemIndex = $currentItems.eq(1).index(); } else { middleItemIndex = $currentItems.eq(0).index(); } $(e.$owlItems).each(function() { if ($(this).index() < middleItemIndex) { $(this).addClass('left'); } else if ($(this).index() > middleItemIndex) { $(this).addClass('right'); } else { $(this).addClass('center'); } }); }; var $screenshoot_slider = $('#screenshoot_slider'); if ($screenshoot_slider.length > 0) { $screenshoot_slider.owlCarousel({ autoPlay: true, stopOnHover: true, slideSpeed: 200, paginationSpeed: 400, itemsCustom: [ [320, 1], [450, 2], [580, 2], [992, 3] ], addClassActive: true, afterInit: screenshoot_slider_obj.callback, afterMove: screenshoot_slider_obj.callback }); screenshoot_slider_obj.slider = $screenshoot_slider.data('owlCarousel'); $('.screenshoot-arrow').click(function(e) { e.preventDefault(); if ($(this).hasClass('left-arrow')) { screenshoot_slider_obj.slider.prev(); } else { screenshoot_slider_obj.slider.next(); } }); } }()); (function() { var app_brief_slider_obj = {}; app_brief_slider_obj.callback = function() { app_brief_slider_obj.addingClasses(this); }; app_brief_slider_obj.addingClasses = function(e) { var $currentItem = $(e.$owlWrapper).find('.owl-item.active'), middleItemIndex = $currentItem.index(); $(e.$owlItems).each(function() { if ($(this).index() < middleItemIndex) { $(this).removeClass('center left right').addClass('left'); } else if ($(this).index() > middleItemIndex) { $(this).removeClass('center left right').addClass('right'); } else { $(this).removeClass('center left right'); } }); }; var $app_brief_slider = $('#section02-slider'); if ($app_brief_slider.length > 0) { $app_brief_slider.owlCarousel({ autoPlay: true, slideSpeed: 1200, paginationSpeed: 1200, rewindSpeed: 2000, addClassActive: true, singleItem: true, afterInit: app_brief_slider_obj.callback, afterMove: app_brief_slider_obj.callback }); app_brief_slider_obj.slider = $app_brief_slider.data('owlCarousel'); $('section02-arrow').click(function(e) { e.preventDefault(); if ($(this).hasClass('left-arrow')) { app_brief_slider_obj.slider.prev(); } else { app_brief_slider_obj.slider.next(); } }); } }()); (function() { var section06_slider_obj = {}, thumbLists = $('#section06-thumb-ctrl li'); section06_slider_obj.beforeMoveCallback = function() { var currentIndex = this.currentItem; thumbLists.removeClass('active').eq(currentIndex).addClass('active'); }; var $section06_slider = $('#section06'); if ($section06_slider.length > 0) { $section06_slider.owlCarousel({ stopOnHover: true, slideSpeed: 800, singleItem: true, pagination: false, afterMove: section06_slider_obj.beforeMoveCallback }); section06_slider_obj.slider = $section06_slider.data('owlCarousel'); $('#section06-thumb-ctrl li a').on('click', function(e) { e.preventDefault(); var userSlide = $(this).parent().index(); section06_slider_obj.slider.goTo(userSlide); }); } }()); (function() { var sliderWrap = $('#section01_slider'), slideItems = sliderWrap.children(), height = slideItems.getMaxHeight(), lists = $('#section01-feature-lists li'), current = 0; sliderWrap.height(height); $(window).resize(function() { height = slideItems.getMaxHeight(); sliderWrap.height(height); }); function show(item) { item.removeClass('inactive').addClass('active').animate({ 'left': '0px' }, 1300, 'swing'); lists.eq(current).addClass('active').siblings('li').removeClass('active'); } function hide(item) { item.removeClass('active').addClass('inactive').animate({ 'left': '-100%' }, 1300, 'swing', function() { $(this).css('left', '100%').removeClass('inactive'); }); } sliderWrap.waypoint({ handler: function(event, direction) { show(slideItems.eq(current)); $(this).waypoint('destroy'); }, offset: '60%' }); lists.find('a').click(function(e) { e.preventDefault(); //if (jQuery.browser.mobile === true) { // return false; //} if (slideItems.is(':animated')) { return false; } var oldCurrent = current; current = $(this).parent().index(); if (current === oldCurrent) { return false; } hide(slideItems.eq(oldCurrent)); show(slideItems.eq(current)); return $(this); }); }()); (function() { var banner_slider_obj = {}; banner_slider_obj.beforeMoveCallback = function() { var currentIndex = this.currentItem; $('#banner-slider-controller a').removeClass('active').eq(currentIndex).addClass('active'); }; var $banner_slider = $('#banner-sldier'); if ($banner_slider.length > 0) { $banner_slider.owlCarousel({ stopOnHover: true, slideSpeed: 800, singleItem: true, pagination: false, afterMove: banner_slider_obj.beforeMoveCallback }); banner_slider_obj.slider = $banner_slider.data('owlCarousel'); $('#banner-slider-controller a').on('click', function(e) { e.preventDefault(); var userSlide = $(this).index(); banner_slider_obj.slider.goTo(userSlide); }); } }()); if (jQuery.browser.mobile !== true && typeof jQuery.stellar === 'function') { $(window).stellar(); } if (jQuery.browser.mobile == true && typeof jQuery.stellar === 'function') { $(window).stellar(); } (function() { var sections = $(".scroll-section"); function getActiveSectionLength(section, sections) { return sections.index(section); } if (sections.length > 0) { sections.waypoint({ handler: function(event, direction) { var active_section, active_section_index, prev_section_index; active_section = $(this); active_section_index = getActiveSectionLength($(this), sections); prev_section_index = (active_section_index - 1); if (direction === "up") { active_section = sections.eq(prev_section_index); } if (active_section.attr('id') != 'home') { var active_link = $('.menu-smooth-scroll[href="#' + active_section.attr("id") + '"]'); active_link.parent('li').addClass("current").siblings().removeClass("current"); } else { $('.menu-smooth-scroll').parent('li').removeClass('current'); } }, offset: '35%' }); } }()); (function() { function Menu($element, options) { var handler, defaults = { domObj: $element, className: 'small-menu', position: '100px' }, config = $.extend({}, defaults, options), coreFuns = { displaySmallMenu: function() { if (!config.domObj.hasClass(config.className)) { config.domObj.css('top', '-' + config.position).addClass(config.className).stop().animate({ 'top': '0px' }, 300); } }, displayNormalMenu: function() { if (config.domObj.hasClass(config.className)) { config.domObj.stop().animate({ 'top': '-' + config.position }, 200, function() { $(this).removeClass(config.className).animate({ 'top': '0px' }, 300); }); } }, hideSmallMenu: function() { if (config.domObj.hasClass(config.className)) { config.domObj.stop().animate({ 'top': '-' + config.position }, 200, function() { $(this).removeClass(config.className).animate({ 'top': '0px' }, 300); }); } } }, publicFuns = { intelligent_menu: function() { var lastScrollTop = 0, direction; if (handler != undefined) { $(window).unbind('scroll', handler); } handler = function(e) { var scrollTop = $(this).scrollTop(); if (scrollTop > lastScrollTop) { direction = 'down'; } else { direction = 'up'; } lastScrollTop = scrollTop; if (direction == 'up') { if (scrollTop > 150) { coreFuns.displaySmallMenu(); } else { coreFuns.displayNormalMenu(); } } else { coreFuns.hideSmallMenu(); } }; $(window).bind('scroll', handler); }, fixed_menu: function() { if (handler !== undefined) { $(window).unbind('scroll', handler); } handler = function(e) { var scrollTop = $(this).scrollTop(); if (scrollTop > 150) { coreFuns.displaySmallMenu(); } else { coreFuns.displayNormalMenu(); } }; $(window).bind('scroll', handler); }, mobile_intelligent_menu: function() { if (jQuery.browser.mobile === true) { this.intelligent_menu(); } else { this.fixed_menu(); } } }; return publicFuns; } $.fn.menu = function(options) { var $element = this.first(); var menuFuns = new Menu($element, options); return menuFuns; }; })(); var menuFun = $('header').menu({ className: 'small-menu', position: '100px' }); menuFun.intelligent_menu(); $('#switch input').on('change', function(e) { var menuId = this.id; if (menuId === 'menu1') { menuFun.fixed_menu(); } else if (menuId === 'menu2') { menuFun.intelligent_menu(); } else { menuFun.mobile_intelligent_menu(); } }); var mobileMenu = { bar: $('.header-mobile-screen .bar-area'), menu: $('.header-mobile-screen .menu'), hideMenu: function() { if (!mobileMenu.bar.is(':visible')) { return false; } mobileMenu.bar.find('a.close-menu').hide().siblings('a').show(); $('header').removeClass('mobileBG'); mobileMenu.menu.removeClass('fadeInUpSmall').addClass('fadeOutUpSmall').fadeOut(function() { $('header').css('height', 'auto'); $('#home .overlay-content').removeClass('fadeOutUpSmall').addClass('fadeInUpSmall'); }); return this; }, showMenu: function() { if (!mobileMenu.bar.is(':visible')) { return false; } mobileMenu.bar.find('a.open-menu').hide().siblings('a').show(); $('#home .overlay-content').removeClass('fadeInUpSmall').addClass('fadeOutUpSmall'); $('header').css('height', '100%').addClass('mobileBG'); var hand = setTimeout(function() { mobileMenu.menu.removeClass('fadeOutUpSmall').addClass('fadeInUpSmall').fadeIn(); clearTimeout(hand); }, 200); return this; }, init: function() { mobileMenu.bar.find('a').click(function(e) { e.preventDefault(); if ($(this).hasClass('open-menu')) { mobileMenu.showMenu(); } else { mobileMenu.hideMenu(); } }); mobileMenu.menu.click(function() { mobileMenu.hideMenu(); }); $(window).bind('resize', function() { mobileMenu.hideMenu(); }); } }; mobileMenu.init(); $(document).ready(function() { $(document).click(function() { $('#contactForm .form-message').slideUp(); }); }); $(window).load(function() { fixOfferImageHeight(); fixsection03Height(); fixBannerHeight(); var handler = setTimeout(function() { $('.banner .images-area').removeClass('animated'); clearTimeout(handler); }, 1000); var $countNumb = $('.countNumb'); if ($countNumb.length > 0) { $countNumb.counterUp({ delay: 30, time: 20000 }); } $('.menu-smooth-scroll').scrollingTo({ easing: 'easeOutQuart', animationTime: 1800, callbackBeforeTransition: function(e) { if (e.currentTarget.hash !== "") { if (e.currentTarget.hash != '#home') { $(e.currentTarget).parent().addClass('current').siblings().removeClass('current'); } if (e.currentTarget.hash == '#contact') { $('.contact-content-wrapper').slideDown(600, 'easeOutQuart'); } } }, callbackAfterTransition: function(e) { if (e.currentTarget.hash !== "") { if (e.currentTarget.hash == '#home') { window.location.hash = ''; } else { window.location.hash = e.currentTarget.hash; } } } }); $('.smooth-scroll:visible').scrollingTo({ easing: 'easeOutQuart' }); }); $(window).resize(function() { fixOfferImageHeight(); fixBannerHeight(); fixsection03Height(); });