var LayoutBrand = function() { return { init: function() { $('body').on('click', '.c-hor-nav-toggler', function() { var target = $(this).data('target'); $(target).toggleClass("c-shown"); }); } }; }(); var LayoutHeaderCart = function() { return { init: function() { var cart = $('.c-cart-menu'); if (cart.size() === 0) { return; } if (App.getViewPort().width < App.getBreakpoint('md')) { $('body').on('click', '.c-cart-toggler', function(e) { e.preventDefault(); e.stopPropagation(); $('body').toggleClass("c-header-cart-shown"); }); $('body').on('click', function(e) { if (!cart.is(e.target) && cart.has(e.target).length === 0) { $('body').removeClass('c-header-cart-shown'); } }); } else { $('body').on('hover', '.c-cart-toggler, .c-cart-menu', function(e) { $('body').addClass("c-header-cart-shown"); }); $('body').on('hover', '.c-mega-menu > .navbar-nav > li:not(.c-cart-toggler-wrapper)', function(e) { $('body').removeClass("c-header-cart-shown"); }); $('body').on('mouseleave', '.c-cart-menu', function(e) { $('body').removeClass("c-header-cart-shown"); }); } } }; }(); var LayoutHeader = function() { var offset = parseInt($('.c-layout-header').attr('data-minimize-offset') > 0 ? parseInt($('.c-layout-header').attr('data-minimize-offset')) : 0); // var _handleHeaderOnScroll = function() { if ($(window).scrollTop() > offset) { $("body").addClass("c-page-on-scroll"); } else { $("body").removeClass("c-page-on-scroll"); $('body').removeClass('c-layout-quick-search-shown'); } } var _handleTopbarCollapse = function() { $('.c-layout-header .c-topbar-toggler').on('click', function(e) { $('.c-layout-header-topbar-collapse').toggleClass("c-topbar-expanded"); }); } return { init: function() { if ($('body').hasClass('c-layout-header-fixed-non-minimized')) { return; } // _handleHeaderOnScroll(); _handleTopbarCollapse(); // $(window).scroll(function() { _handleHeaderOnScroll(); }); } }; }(); var LayoutMegaMenu = function() { return { init: function() { $('.c-mega-menu').on('click', '.c-toggler', function(e) { if (App.getViewPort().width < App.getBreakpoint('md')) { e.preventDefault(); if ($(this).closest("li").hasClass('c-open')) { $(this).closest("li").removeClass('c-open'); } else { $(this).closest("li").addClass('c-open'); } } }); $('.c-layout-header .c-hor-nav-toggler:not(.c-quick-sidebar-toggler)').on('click', function() { $('.c-layout-header').toggleClass('c-mega-menu-shown'); if ($('body').hasClass('c-layout-header-mobile-fixed')) { var height = App.getViewPort().height - $('.c-layout-header').outerHeight(true) - 60; $('.c-mega-menu').css('max-height', height); } }); } }; }(); var LayoutSidebarMenu = function() { return { init: function() { $('.c-layout-sidebar-menu > .c-sidebar-menu .c-toggler').on('click', function(e) { e.preventDefault(); $(this).closest('.c-dropdown').toggleClass('c-open').siblings().removeClass('c-open'); }); } }; }(); var LayoutQuickSearch = function() { return { init: function() { $('.c-layout-header').on('click', '.c-mega-menu .c-search-toggler', function(e) { e.preventDefault(); $('body').addClass('c-layout-quick-search-shown'); if (App.isIE() === false) { $('.c-quick-search > .form-control').focus(); } }); $('.c-layout-header').on('click', '.c-brand .c-search-toggler', function(e) { e.preventDefault(); $('body').addClass('c-layout-quick-search-shown'); if (App.isIE() === false) { $('.c-quick-search > .form-control').focus(); } }); $('.c-quick-search').on('click', '> span', function(e) { e.preventDefault(); $('body').removeClass('c-layout-quick-search-shown'); }); } }; }(); var LayoutCartMenu = function() { return { init: function() { $('.c-layout-header').on('mouseenter', '.c-mega-menu .c-cart-toggler-wrapper', function(e) { e.preventDefault(); $('.c-cart-menu').addClass('c-layout-cart-menu-shown'); }); $('.c-cart-menu, .c-layout-header').on('mouseleave', function(e) { e.preventDefault(); $('.c-cart-menu').removeClass('c-layout-cart-menu-shown'); }); $('.c-layout-header').on('click', '.c-brand .c-cart-toggler', function(e) { e.preventDefault(); $('.c-cart-menu').toggleClass('c-layout-cart-menu-shown'); }); } }; }(); var LayoutQuickSidebar = function() { return { init: function() { $('.c-layout-header').on('click', '.c-quick-sidebar-toggler', function(e) { e.preventDefault(); e.stopPropagation(); if ($('body').hasClass("c-layout-quick-sidebar-shown")) { $('body').removeClass("c-layout-quick-sidebar-shown"); } else { $('body').addClass("c-layout-quick-sidebar-shown"); } }); $('.c-layout-quick-sidebar').on('click', '.c-close', function(e) { e.preventDefault(); $('body').removeClass("c-layout-quick-sidebar-shown"); }); $('.c-layout-quick-sidebar').on('click', function(e) { e.stopPropagation(); }); $(document).on('click', '.c-layout-quick-sidebar-shown', function(e) { $(this).removeClass("c-layout-quick-sidebar-shown"); }); } }; }(); var LayoutGo2Top = function() { var handle = function() { var currentWindowPosition = $(window).scrollTop(); if (currentWindowPosition > 300) { $(".c-layout-go2top").show(); } else { $(".c-layout-go2top").hide(); } }; return { init: function() { handle(); if (navigator.userAgent.match(/iPhone|iPad|iPod/i)) { $(window).bind("touchend touchcancel touchleave", function(e) { handle(); }); } else { $(window).scroll(function() { handle(); }); } $(".c-layout-go2top").on('click', function(e) { e.preventDefault(); $("html, body").animate({ scrollTop: 0 }, 600); }); } }; }(); var LayoutOnepageNav = function() { var handle = function() { var offset; var scrollspy; var speed; var nav; $('body').addClass('c-page-on-scroll'); offset = $('.c-layout-header-onepage').outerHeight(true); $('body').removeClass('c-page-on-scroll'); if ($('.c-mega-menu-onepage-dots').size() > 0) { if ($('.c-onepage-dots-nav').size() > 0) { $('.c-onepage-dots-nav').css('margin-top', -($('.c-onepage-dots-nav').outerHeight(true) / 2)); } scrollspy = $('body').scrollspy({ target: '.c-mega-menu-onepage-dots', offset: offset }); speed = parseInt($('.c-mega-menu-onepage-dots').attr('data-onepage-animation-speed')); } else { scrollspy = $('body').scrollspy({ target: '.c-mega-menu-onepage', offset: offset }); speed = parseInt($('.c-mega-menu-onepage').attr('data-onepage-animation-speed')); } scrollspy.on('activate.bs.scrollspy', function() { $(this).find('.c-onepage-link.c-active').removeClass('c-active'); $(this).find('.c-onepage-link.active').addClass('c-active'); }); $('.c-onepage-link > a').on('click', function(e) { var section = $(this).attr('href'); var top = 0; if (section !== "#home") { top = $(section).offset().top - offset + 1; } $('html, body').stop().animate({ scrollTop: top, }, speed, 'easeInExpo'); e.preventDefault(); if (App.getViewPort().width < App.getBreakpoint('md')) { $('.c-hor-nav-toggler').click(); } }); }; return { init: function() { handle(); } }; }(); var LayoutThemeSettings = function() { var handle = function() { $('.c-settings .c-color').on('click', function() { var val = $(this).attr('data-color'); var demo = App.getURLParameter('d') || 'default'; $('#style_theme').attr('href', '../assets/demos/' + demo + '/css/themes/' + val + '.css'); $('.c-settings .c-color').removeClass('c-active'); $(this).addClass('c-active'); }); $('.c-setting_header-type').on('click', function() { var val = $(this).attr('data-value'); if (val == 'fluid') { $('.c-layout-header .c-topbar > .container').removeClass('container').addClass('container-fluid'); $('.c-layout-header .c-navbar > .container').removeClass('container').addClass('container-fluid'); } else { $('.c-layout-header .c-topbar > .container-fluid').removeClass('container-fluid').addClass('container'); $('.c-layout-header .c-navbar > .container-fluid').removeClass('container-fluid').addClass('container'); } $('.c-setting_header-type').removeClass('active'); $(this).addClass('active'); }); $('.c-setting_header-mode').on('click', function() { var val = $(this).attr('data-value'); if (val == 'static') { $('body').removeClass('c-layout-header-fixed').addClass('c-layout-header-static'); } else { $('body').removeClass('c-layout-header-static').addClass('c-layout-header-fixed'); } $('.c-setting_header-mode').removeClass('active'); $(this).addClass('active'); }); $('.c-setting_font-style').on('click', function() { var val = $(this).attr('data-value'); if (val == 'light') { $('.c-font-uppercase').addClass('c-font-uppercase-reset').removeClass('c-font-uppercase'); $('.c-font-bold').addClass('c-font-bold-reset').removeClass('c-font-bold'); $('.c-fonts-uppercase').addClass('c-fonts-uppercase-reset').removeClass('c-fonts-uppercase'); $('.c-fonts-bold').addClass('c-fonts-bold-reset').removeClass('c-fonts-bold'); } else { $('.c-font-uppercase-reset').addClass('c-font-uppercase').removeClass('c-font-uppercase-reset'); $('.c-font-bold-reset').addClass('c-font-bold').removeClass('c-font-bold-reset'); $('.c-fonts-uppercase-reset').addClass('c-fonts-uppercase').removeClass('c-fonts-uppercase-reset'); $('.c-fonts-bold-reset').addClass('c-fonts-bold').removeClass('c-fonts-bold-reset'); } $('.c-setting_font-style').removeClass('active'); $(this).addClass('active'); }); $('.c-setting_megamenu-style').on('click', function() { var val = $(this).attr('data-value'); if (val == 'dark') { $('.c-mega-menu').removeClass('c-mega-menu-light').addClass('c-mega-menu-dark'); } else { $('.c-mega-menu').removeClass('c-mega-menu-dark').addClass('c-mega-menu-light'); } $('.c-setting_megamenu-style').removeClass('active'); $(this).addClass('active'); }); }; return { init: function() { handle(); } }; }(); var ContentOwlcarousel = function() { var _initInstances = function() { if ($(".owl-carousel").size() > 0) { $("[data-slider='owl'] .owl-carousel").each(function() { var parent = $(this); var items; var itemsDesktop; var itemsDesktopSmall; var itemsTablet; var itemsTabletSmall; var itemsMobile; var rtl_mode = (parent.data('rtl')) ? parent.data('rtl') : false; var items_loop = (parent.data('loop')) ? parent.data('loop') : true; var items_nav_dots = (parent.attr('data-navigation-dots')) ? parent.data('navigation-dots') : true; var items_nav_label = (parent.attr('data-navigation-label')) ? parent.data('navigation-label') : false; if (parent.data("single-item") == true) { items = 1; itemsDesktop = 1; itemsDesktopSmall = 1; itemsTablet = 1; itemsTabletSmall = 1; itemsMobile = 1; } else { items = parent.data('items'); itemsDesktop = parent.data('desktop-items') ? parent.data('desktop-items') : items; itemsDesktopSmall = parent.data('desktop-small-items') ? parent.data('desktop-small-items') : 3; itemsTablet = parent.data('tablet-items') ? parent.data('tablet-items') : 2; itemsMobile = parent.data('mobile-items') ? parent.data('mobile-items') : 1; } parent.owlCarousel({ rtl: rtl_mode, loop: items_loop, items: items, responsive: { 0: { items: itemsMobile }, 480: { items: itemsMobile }, 768: { items: itemsTablet }, 980: { items: itemsDesktopSmall }, 1200: { items: itemsDesktop } }, dots: items_nav_dots, nav: items_nav_label, navText: false, autoplay: (parent.data("auto-play")) ? parent.data("auto-play") : true, autoplayTimeout: parent.data('slide-speed'), autoplayHoverPause: (parent.data('auto-play-hover-pause')) ? parent.data('auto-play-hover-pause') : false, }); }); } }; return { init: function() { _initInstances(); } }; }(); var ContentCubeLatestPortfolio = function() { var _initInstances = function() { if ($(".c-content-latest-works").size() > 0) { $('.c-content-latest-works').cubeportfolio({ filters: '#filters-container', loadMore: '#loadMore-container', loadMoreAction: 'click', layoutMode: 'grid', defaultFilter: '*', animationType: 'quicksand', gapHorizontal: 20, gapVertical: 23, gridAdjustment: 'responsive', mediaQueries: [{ width: 1100, cols: 4 }, { width: 800, cols: 3 }, { width: 500, cols: 2 }, { width: 320, cols: 1 }], caption: 'zoom', displayType: 'lazyLoading', displayTypeSpeed: 100, lightboxDelegate: '.cbp-lightbox', lightboxGallery: true, lightboxTitleSrc: 'data-title', lightboxCounter: '