芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/www/wp-content/themes/brunn/assets/js/modules.js
(function ($) { "use strict"; window.qodef = {}; qodef.modules = {}; qodef.scroll = 0; qodef.window = $(window); qodef.document = $(document); qodef.windowWidth = $(window).width(); qodef.windowHeight = $(window).height(); qodef.body = $('body'); qodef.html = $('html, body'); qodef.htmlEl = $('html'); qodef.menuDropdownHeightSet = false; qodef.defaultHeaderStyle = ''; qodef.minVideoWidth = 1500; qodef.videoWidthOriginal = 1280; qodef.videoHeightOriginal = 720; qodef.videoRatio = 1.61; qodef.qodefOnDocumentReady = qodefOnDocumentReady; qodef.qodefOnWindowResize = qodefOnWindowResize; qodef.qodefOnWindowScroll = qodefOnWindowScroll; $(document).ready(qodefOnDocumentReady); $(window).resize(qodefOnWindowResize); $(window).scroll(qodefOnWindowScroll); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodef.scroll = $(window).scrollTop(); //set global variable for header style which we will use in various functions if (qodef.body.hasClass('qodef-dark-header')) { qodef.defaultHeaderStyle = 'qodef-dark-header'; } if (qodef.body.hasClass('qodef-light-header')) { qodef.defaultHeaderStyle = 'qodef-light-header'; } } /* All functions to be called on $(window).resize() should be in this function */ function qodefOnWindowResize() { qodef.windowWidth = $(window).width(); qodef.windowHeight = $(window).height(); } /* All functions to be called on $(window).scroll() should be in this function */ function qodefOnWindowScroll() { qodef.scroll = $(window).scrollTop(); } //set boxed layout width variable for various calculations switch (true) { case qodef.body.hasClass('qodef-grid-1300'): qodef.boxedLayoutWidth = 1350; //qodef.gridWidth = 1300; break; case qodef.body.hasClass('qodef-grid-1200'): qodef.boxedLayoutWidth = 1250; //qodef.gridWidth = 1200; break; case qodef.body.hasClass('qodef-grid-1000'): qodef.boxedLayoutWidth = 1050; //qodef.gridWidth = 1000; break; case qodef.body.hasClass('qodef-grid-800'): qodef.boxedLayoutWidth = 850; //qodef.gridWidth = 800; break; default : qodef.boxedLayoutWidth = 1150; //qodef.gridWidth = 1100; break; } qodef.gridWidth = function () { var gridWidth = 1100; switch (true) { case qodef.body.hasClass('qodef-grid-1300') && qodef.windowWidth > 1400: gridWidth = 1300; break; case qodef.body.hasClass('qodef-grid-1200') && qodef.windowWidth > 1300: gridWidth = 1200; break; case qodef.body.hasClass('qodef-grid-1000') && qodef.windowWidth > 1200: gridWidth = 1200; break; case qodef.body.hasClass('qodef-grid-800') && qodef.windowWidth > 1024: gridWidth = 800; break; default : break; } return gridWidth; }; qodef.transitionEnd = (function () { var el = document.createElement('transitionDetector'), transEndEventNames = { 'WebkitTransition' : 'webkitTransitionEnd',// Saf 6, Android Browser 'MozTransition' : 'transitionend', // only for FF < 15 'transition' : 'transitionend' // IE10, Opera, Chrome, FF 15+, Saf 7+ }; for(var t in transEndEventNames){ if( el.style[t] !== undefined ){ return transEndEventNames[t]; } } })(); qodef.animationEnd = (function() { var el = document.createElement("animationDetector"); var animations = { "animation" : "animationend", "OAnimation" : "oAnimationEnd", "MozAnimation" : "animationend", "WebkitAnimation": "webkitAnimationEnd" }; for (var t in animations){ if (el.style[t] !== undefined){ return animations[t]; } } })(); })(jQuery); (function($) { "use strict"; var common = {}; qodef.modules.common = common; common.qodefFluidVideo = qodefFluidVideo; common.qodefEnableScroll = qodefEnableScroll; common.qodefDisableScroll = qodefDisableScroll; common.qodefOwlSlider = qodefOwlSlider; common.qodefInitGridMasonryListLayout = qodefInitGridMasonryListLayout; common.qodefInitParallax = qodefInitParallax; common.qodefInitSelfHostedVideoPlayer = qodefInitSelfHostedVideoPlayer; common.qodefSelfHostedVideoSize = qodefSelfHostedVideoSize; common.qodefPrettyPhoto = qodefPrettyPhoto; common.qodefStickySidebarWidget = qodefStickySidebarWidget; common.getLoadMoreData = getLoadMoreData; common.setLoadMoreAjaxData = setLoadMoreAjaxData; common.setFixedImageProportionSize = setFixedImageProportionSize; common.qodefInitPerfectScrollbar = qodefInitPerfectScrollbar; common.qodefOnDocumentReady = qodefOnDocumentReady; common.qodefOnWindowLoad = qodefOnWindowLoad; common.qodefOnWindowResize = qodefOnWindowResize; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); $(window).resize(qodefOnWindowResize); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefIconWithHover().init(); qodefDisableSmoothScrollForMac(); qodefInitAnchor().init(); qodefInitBackToTop(); qodefBackButtonShowHide(); qodefInitSelfHostedVideoPlayer(); qodefSelfHostedVideoSize(); qodefFluidVideo(); qodefOwlSlider(); qodefPreloadBackgrounds(); qodefPrettyPhoto(); qodefSearchPostTypeWidget(); qodefDashboardForm(); qodefInitGridMasonryListLayout(); qodefSmoothTransition(); variousItemsAppear(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefInitParallax(); qodefStickySidebarWidget().init(); qodefElementorGlobal(); } /* All functions to be called on $(window).resize() should be in this function */ function qodefOnWindowResize() { qodefInitGridMasonryListLayout(); qodefSelfHostedVideoSize(); } /** * Elementor Global */ function qodefElementorGlobal() { $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/global', function () { qodefInitParallax(); variousItemsAppear(); }); }); } /* ** Disable smooth scroll for mac if smooth scroll is enabled */ function qodefDisableSmoothScrollForMac() { var os = navigator.appVersion.toLowerCase(); if (os.indexOf('mac') > -1 && qodef.body.hasClass('qodef-smooth-scroll')) { qodef.body.removeClass('qodef-smooth-scroll'); } } function qodefDisableScroll() { if (window.addEventListener) { window.addEventListener('DOMMouseScroll', qodefWheel, false); } window.onmousewheel = document.onmousewheel = qodefWheel; document.onkeydown = qodefKeydown; } function qodefEnableScroll() { if (window.removeEventListener) { window.removeEventListener('DOMMouseScroll', qodefWheel, false); } window.onmousewheel = document.onmousewheel = document.onkeydown = null; } function qodefWheel(e) { qodefPreventDefaultValue(e); } function qodefKeydown(e) { var keys = [37, 38, 39, 40]; for (var i = keys.length; i--;) { if (e.keyCode === keys[i]) { qodefPreventDefaultValue(e); return; } } } function qodefPreventDefaultValue(e) { e = e || window.event; if (e.preventDefault) { e.preventDefault(); } e.returnValue = false; } /* ** Anchor functionality */ var qodefInitAnchor = function() { /** * Set active state on clicked anchor * @param anchor, clicked anchor */ var setActiveState = function(anchor){ var headers = $('.qodef-main-menu, .qodef-mobile-nav, .qodef-fullscreen-menu, .qodef-vertical-menu'); headers.each(function(){ var currentHeader = $(this); if (anchor.parents(currentHeader).length) { currentHeader.find('.qodef-active-item').removeClass('qodef-active-item'); anchor.parent().addClass('qodef-active-item'); currentHeader.find('a').removeClass('current'); anchor.addClass('current'); } }); }; /** * Check anchor active state on scroll */ var checkActiveStateOnScroll = function(){ var anchorData = $('[data-qodef-anchor]'), anchorElement, siteURL = window.location.href.split('#')[0]; if (siteURL.substr(-1) !== '/') { siteURL += '/'; } anchorData.waypoint( function(direction) { if(direction === 'down') { if ($(this.element).length > 0) { anchorElement = $(this.element).data("qodef-anchor"); } else { anchorElement = $(this).data("qodef-anchor"); } setActiveState($("a[href='"+siteURL+"#"+anchorElement+"']")); } }, { offset: '50%' }); anchorData.waypoint( function(direction) { if(direction === 'up') { if ($(this.element).length > 0) { anchorElement = $(this.element).data("qodef-anchor"); } else { anchorElement = $(this).data("qodef-anchor"); } setActiveState($("a[href='"+siteURL+"#"+anchorElement+"']")); } }, { offset: function(){ return -($(this.element).outerHeight() - 150); } }); }; /** * Check anchor active state on load */ var checkActiveStateOnLoad = function(){ var hash = window.location.hash.split('#')[1]; if(hash !== "" && $('[data-qodef-anchor="'+hash+'"]').length > 0){ anchorClickOnLoad(hash); } }; /** * Handle anchor on load */ var anchorClickOnLoad = function ($this) { var scrollAmount, anchor = $('.qodef-main-menu a, .qodef-mobile-nav a, .qodef-fullscreen-menu a, .qodef-vertical-menu a'), hash = $this, anchorData = hash !== '' ? $('[data-qodef-anchor="' + hash + '"]') : ''; if (hash !== '' && anchorData.length > 0) { var anchoredElementOffset = anchorData.offset().top; scrollAmount = anchoredElementOffset - headerHeightToSubtract(anchoredElementOffset) - qodefGlobalVars.vars.qodefAddForAdminBar; if(anchor.length) { anchor.each(function(){ var thisAnchor = $(this); if(thisAnchor.attr('href').indexOf(hash) > -1) { setActiveState(thisAnchor); } }); } qodef.html.stop().animate({ scrollTop: Math.round(scrollAmount) }, 1000, function () { //change hash tag in url if (history.pushState) { history.pushState(null, '', '#' + hash); } }); return false; } }; /** * Calculate header height to be substract from scroll amount * @param anchoredElementOffset, anchorded element offset */ var headerHeightToSubtract = function (anchoredElementOffset) { if (qodef.modules.stickyHeader.behaviour === 'qodef-sticky-header-on-scroll-down-up') { qodef.modules.stickyHeader.isStickyVisible = (anchoredElementOffset > qodef.modules.header.stickyAppearAmount); } if (qodef.modules.stickyHeader.behaviour === 'qodef-sticky-header-on-scroll-up') { if ((anchoredElementOffset > qodef.scroll)) { qodef.modules.stickyHeader.isStickyVisible = false; } } var headerHeight = qodef.modules.stickyHeader.isStickyVisible ? qodefGlobalVars.vars.qodefStickyHeaderTransparencyHeight : qodefPerPageVars.vars.qodefHeaderTransparencyHeight; if (qodef.windowWidth < 1025) { headerHeight = 0; } return headerHeight; }; /** * Handle anchor click */ var anchorClick = function () { qodef.document.on("click", ".qodef-main-menu a, .qodef-fullscreen-menu a, .qodef-btn, .qodef-anchor, .qodef-mobile-nav a, .qodef-vertical-menu a", function () { var scrollAmount, anchor = $(this), hash = anchor.prop("hash").split('#')[1], anchorData = hash !== '' ? $('[data-qodef-anchor="' + hash + '"]') : ''; if (hash !== '' && anchorData.length > 0) { var anchoredElementOffset = anchorData.offset().top; scrollAmount = anchoredElementOffset - headerHeightToSubtract(anchoredElementOffset) - qodefGlobalVars.vars.qodefAddForAdminBar; setActiveState(anchor); qodef.html.stop().animate({ scrollTop: Math.round(scrollAmount) }, 1000, function () { //change hash tag in url if (history.pushState) { history.pushState(null, '', '#' + hash); } }); return false; } }); }; return { init: function () { if ($('[data-qodef-anchor]').length) { anchorClick(); checkActiveStateOnScroll(); $(window).on('load', function () { checkActiveStateOnLoad(); }); } } }; }; function qodefInitBackToTop() { var backToTopButton = $('#qodef-back-to-top'); backToTopButton.on('click', function (e) { e.preventDefault(); qodef.html.animate({scrollTop: 0}, qodef.window.scrollTop() / 3, 'easeInOutExpo'); }); } function qodefBackButtonShowHide() { qodef.window.scroll(function () { var b = $(this).scrollTop(), c = $(this).height(), d; if (b > 0) { d = b + c / 2; } else { d = 1; } if (d < 1e3) { qodefToTopButton('off'); } else { qodefToTopButton('on'); } }); } function qodefToTopButton(a) { var b = $("#qodef-back-to-top"); b.removeClass('off on'); if (a === 'on') { b.addClass('on'); } else { b.addClass('off'); } } function qodefInitSelfHostedVideoPlayer() { var players = $('.qodef-self-hosted-video'); if (players.length) { players.mediaelementplayer({ audioWidth: '100%' }); } } function qodefSelfHostedVideoSize(){ var selfVideoHolder = $('.qodef-self-hosted-video-holder .qodef-video-wrap'); if(selfVideoHolder.length) { selfVideoHolder.each(function(){ var thisVideo = $(this), videoWidth = thisVideo.closest('.qodef-self-hosted-video-holder').outerWidth(), videoHeight = videoWidth / qodef.videoRatio; if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)){ thisVideo.parent().width(videoWidth); thisVideo.parent().height(videoHeight); } thisVideo.width(videoWidth); thisVideo.height(videoHeight); thisVideo.find('video, .mejs-overlay, .mejs-poster').width(videoWidth); thisVideo.find('video, .mejs-overlay, .mejs-poster').height(videoHeight); }); } } function qodefFluidVideo() { fluidvids.init({ selector: ['iframe'], players: ['www.youtube.com', 'player.vimeo.com'] }); } function variousItemsAppear() { var itemHolder = $(".qodef-si-text-box, .qodef-iwt-background-text, .qodef-st-background-text"); if (itemHolder.length) { itemHolder.each(function() { var thisHolder = $(this); thisHolder.appear(function() { // this element is now inside browser viewport thisHolder.addClass('qodef-item-appear'); }, {accX: 0, accY: 0}); }); } } function qodefSmoothTransition() { if (qodef.body.hasClass('qodef-smooth-page-transitions')) { //check for preload animation if (qodef.body.hasClass('qodef-smooth-page-transitions-preloader')) { var loader = $('body > .qodef-smooth-transition-loader.qodef-mimic-ajax'), mainRevHolder = $('#qodef-main-rev-holder'), isElementorEditMode = false; if( typeof elementorFrontend !== 'undefined'){ isElementorEditMode = Boolean(elementorFrontend.isEditMode()); } /** * Loader Fade Out function * * @param {number} speed - fade out duration * @param {number} delay - fade out delay * @param {string} easing - fade out easing function */ var fadeOutLoader = function(speed, delay, easing) { speed = speed ? speed : 600; delay = delay ? delay : 0; easing = easing ? easing : 'easeOutSine'; loader.delay(delay).fadeOut(speed, easing); $(window).on( 'pageshow', function (event) { if (event.originalEvent.persisted) { loader.fadeOut(speed, easing); } }); }; if (mainRevHolder.length) { mainRevHolder.find('.rev_slider').on('revolution.slide.onloaded', function() { fadeOutLoader(); }); } else { $(window).on('load', function() { fadeOutLoader(); }); } if(isElementorEditMode){ loader.fadeOut(1000, 'easeOutSine'); } } // if back button is pressed, than show content to avoid state where content is on display:none window.addEventListener( "pageshow", function ( event ) { var historyPath = event.persisted || ( typeof window.performance != "undefined" && window.performance.navigation.type === 2 ); if ( historyPath ) { $('.qodef-wrapper-inner').show(); } }); //check for fade out animation if (qodef.body.hasClass('qodef-smooth-page-transitions-fadeout')) { var linkItem = $('a'); linkItem.on('click', function (e) { var a = $(this); if ((a.parents('.qodef-shopping-cart-dropdown').length || a.parent('.product-remove').length) && a.hasClass('remove')) { return; } if ( e.which === 1 && // check if the left mouse button has been pressed a.attr('href').indexOf(window.location.host) >= 0 && // check if the link is to the same domain (typeof a.data('rel') === 'undefined') && //Not pretty photo link (typeof a.attr('rel') === 'undefined') && //Not VC pretty photo link (!a.hasClass('lightbox-active')) && //Not lightbox plugin active (typeof a.attr('target') === 'undefined' || a.attr('target') === '_self') && // check if the link opens in the same window (a.attr('href').split('#')[0] !== window.location.href.split('#')[0]) // check if it is an anchor aiming for a different page ) { e.preventDefault(); $('.qodef-wrapper-inner').fadeOut(600, 'easeOutSine', function () { window.location = a.attr('href'); }); } }); } } } /* * Preload background images for elements that have 'qodef-preload-background' class */ function qodefPreloadBackgrounds(){ var preloadBackHolder = $('.qodef-preload-background'); if(preloadBackHolder.length) { preloadBackHolder.each(function() { var preloadBackground = $(this); if(preloadBackground.css('background-image') !== '' && preloadBackground.css('background-image') !== 'none') { var bgUrl = preloadBackground.attr('style'); bgUrl = bgUrl.match(/url\(["']?([^'")]+)['"]?\)/); bgUrl = bgUrl ? bgUrl[1] : ""; if (bgUrl) { var backImg = new Image(); backImg.src = bgUrl; $(backImg).load(function(){ preloadBackground.removeClass('qodef-preload-background'); }); } } else { $(window).on('load', function(){ preloadBackground.removeClass('qodef-preload-background'); }); //make sure that qodef-preload-background class is removed from elements with forced background none in css } }); } } function qodefPrettyPhoto() { /*jshint multistr: true */ var markupWhole = '
\
\
\
\
\
\
\
\
\
\
\
\
\
Expand
\
\
\
\
\
\
\
\
Previous
\
0/0
\
Next
\
\
\ {pp_social} \
Close
\
\
\
\
\
\
\
\
\
\
\
\
\
'; $("a[data-rel^='prettyPhoto']").prettyPhoto({ hook: 'data-rel', animation_speed: 'normal', /* fast/slow/normal */ slideshow: false, /* false OR interval time in ms */ autoplay_slideshow: false, /* true/false */ opacity: 0.80, /* Value between 0 and 1 */ show_title: true, /* true/false */ allow_resize: true, /* Resize the photos bigger than viewport. true/false */ horizontal_padding: 0, default_width: 960, default_height: 540, counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */ hideflash: false, /* Hides all the flash object on a page, set to TRUE if flash appears over prettyPhoto */ wmode: 'opaque', /* Set the flash wmode attribute */ autoplay: true, /* Automatically start videos: True/False */ modal: false, /* If set to true, only the close button will close the window */ overlay_gallery: false, /* If set to true, a gallery will overlay the fullscreen image on mouse over */ keyboard_shortcuts: true, /* Set to false if you open forms inside prettyPhoto */ deeplinking: false, custom_markup: '', social_tools: false, markup: markupWhole }); } function qodefSearchPostTypeWidget() { var searchPostTypeHolder = $('.qodef-search-post-type'); if (searchPostTypeHolder.length) { searchPostTypeHolder.each(function () { var thisSearch = $(this), searchField = thisSearch.find('.qodef-post-type-search-field'), resultsHolder = thisSearch.siblings('.qodef-post-type-search-results'), searchLoading = thisSearch.find('.qodef-search-loading'), searchIcon = thisSearch.find('.qodef-search-icon'); searchLoading.addClass('qodef-hidden'); var postType = thisSearch.data('post-type'), keyPressTimeout; searchField.on('keyup paste', function() { var field = $(this); field.attr('autocomplete','off'); searchLoading.removeClass('qodef-hidden'); searchIcon.addClass('qodef-hidden'); clearTimeout(keyPressTimeout); keyPressTimeout = setTimeout( function() { var searchTerm = field.val(); if(searchTerm.length < 3) { resultsHolder.html(''); resultsHolder.fadeOut(); searchLoading.addClass('qodef-hidden'); searchIcon.removeClass('qodef-hidden'); } else { var ajaxData = { action: 'brunn_select_search_post_types', term: searchTerm, postType: postType, search_post_types_nonce: $('input[name="qodef_search_post_types_nonce"]').val() }; $.ajax({ type: 'POST', data: ajaxData, url: qodefGlobalVars.vars.qodefAjaxUrl, success: function (data) { var response = JSON.parse(data); if (response.status === 'success') { searchLoading.addClass('qodef-hidden'); searchIcon.removeClass('qodef-hidden'); resultsHolder.html(response.data.html); resultsHolder.fadeIn(); } }, error: function(XMLHttpRequest, textStatus, errorThrown) { console.log("Status: " + textStatus); console.log("Error: " + errorThrown); searchLoading.addClass('qodef-hidden'); searchIcon.removeClass('qodef-hidden'); resultsHolder.fadeOut(); } }); } }, 500); }); searchField.on('focusout', function () { searchLoading.addClass('qodef-hidden'); searchIcon.removeClass('qodef-hidden'); resultsHolder.fadeOut(); }); }); } } /** * Initializes load more data params * @param container with defined data params * return array */ function getLoadMoreData(container){ var dataList = container.data(), returnValue = {}; for (var property in dataList) { if (dataList.hasOwnProperty(property)) { if (typeof dataList[property] !== 'undefined' && dataList[property] !== false) { returnValue[property] = dataList[property]; } } } return returnValue; } /** * Sets load more data params for ajax function * @param container with defined data params * @param action with defined action name * return array */ function setLoadMoreAjaxData(container, action) { var returnValue = { action: action }; for (var property in container) { if (container.hasOwnProperty(property)) { if (typeof container[property] !== 'undefined' && container[property] !== false) { returnValue[property] = container[property]; } } } return returnValue; } /* ** Init Masonry List Layout */ function qodefInitGridMasonryListLayout() { var holder = $('.qodef-grid-masonry-list'); if (holder.length) { holder.each(function () { var thisHolder = $(this), masonry = thisHolder.find('.qodef-masonry-list-wrapper'), size = thisHolder.find('.qodef-masonry-grid-sizer').width(); masonry.waitForImages(function () { masonry.isotope({ layoutMode: 'packery', itemSelector: '.qodef-item-space', percentPosition: true, masonry: { columnWidth: '.qodef-masonry-grid-sizer', gutter: '.qodef-masonry-grid-gutter' } }); if (thisHolder.find('.qodef-fixed-masonry-item').length || thisHolder.hasClass('qodef-fixed-masonry-items')) { setFixedImageProportionSize(masonry, masonry.find('.qodef-item-space'), size, true); } setTimeout(function () { qodefInitParallax(); }, 600); masonry.isotope('layout').css('opacity', 1); }); }); } } /** * Initializes size for fixed image proportion - masonry layout */ function setFixedImageProportionSize(container, item, size, isFixedEnabled) { if (container.hasClass('qodef-masonry-images-fixed') || isFixedEnabled === true) { var padding = parseInt(item.css('paddingLeft'), 10), newSize = size - 2 * padding, defaultMasonryItem = container.find('.qodef-masonry-size-small'), largeWidthMasonryItem = container.find('.qodef-masonry-size-large-width'), largeHeightMasonryItem = container.find('.qodef-masonry-size-large-height'), largeWidthHeightMasonryItem = container.find('.qodef-masonry-size-large-width-height'); defaultMasonryItem.css('height', newSize); largeHeightMasonryItem.css('height', Math.round(2 * (newSize + padding))); if (qodef.windowWidth > 680) { largeWidthMasonryItem.css('height', newSize); largeWidthHeightMasonryItem.css('height', Math.round(2 * (newSize + padding))); } else { largeWidthMasonryItem.css('height', Math.round(newSize / 2)); largeWidthHeightMasonryItem.css('height', newSize); } } } /** * Object that represents icon with hover data * @returns {{init: Function}} function that initializes icon's functionality */ var qodefIconWithHover = function() { //get all icons on page var icons = $('.qodef-icon-has-hover'); /** * Function that triggers icon hover color functionality */ var iconHoverColor = function(icon) { if(typeof icon.data('hover-color') !== 'undefined') { var changeIconColor = function(event) { event.data.icon.css('color', event.data.color); }; var hoverColor = icon.data('hover-color'), originalColor = icon.css('color'); if(hoverColor !== '') { icon.on('mouseenter', {icon: icon, color: hoverColor}, changeIconColor); icon.on('mouseleave', {icon: icon, color: originalColor}, changeIconColor); } } }; return { init: function() { if(icons.length) { icons.each(function() { iconHoverColor($(this)); }); } } }; }; /* ** Init parallax */ function qodefInitParallax(){ var parallaxHolder = $('.qodef-parallax-row-holder'); if(parallaxHolder.length){ parallaxHolder.each(function() { var parallaxElement = $(this); var helperHolder = parallaxElement.find('.qodef-parallax-helper-holder'); if (helperHolder.length) { var image = helperHolder.data('parallax-bg-image'); var speed = helperHolder.data('parallax-bg-speed') * 0.4; var height = 0; } else { var image = parallaxElement.data('parallax-bg-image'); var speed = parallaxElement.data('parallax-bg-speed') * 0.4; var height = 0; } if (typeof parallaxElement.data('parallax-bg-height') !== 'undefined' && parallaxElement.data('parallax-bg-height') !== false) { height = parseInt(parallaxElement.data('parallax-bg-height')); } parallaxElement.css({'background-image': 'url('+image+')'}); if(height > 0) { parallaxElement.css({'min-height': height+'px', 'height': height+'px'}); } parallaxElement.parallax('50%', speed); }); } } /* ** Init sticky sidebar widget */ function qodefStickySidebarWidget(){ var sswHolder = $('.qodef-widget-sticky-sidebar'), headerHolder = $('.qodef-page-header'), headerHeight = headerHolder.length ? headerHolder.outerHeight() : 0, widgetTopOffset = 0, widgetTopPosition = 0, sidebarHeight = 0, sidebarWidth = 0, objectsCollection = []; function addObjectItems() { if (sswHolder.length) { sswHolder.each(function () { var thisSswHolder = $(this), mainSidebarHolder = thisSswHolder.parents('aside.qodef-sidebar'), widgetiseSidebarHolder = thisSswHolder.parents('.wpb_widgetised_column'), sidebarHolder = '', sidebarHolderHeight = 0; widgetTopOffset = thisSswHolder.offset().top; widgetTopPosition = thisSswHolder.position().top; sidebarHeight = 0; sidebarWidth = 0; if (mainSidebarHolder.length) { sidebarHeight = mainSidebarHolder.outerHeight(); sidebarWidth = mainSidebarHolder.outerWidth(); sidebarHolder = mainSidebarHolder; sidebarHolderHeight = mainSidebarHolder.parent().parent().outerHeight(); var blogHolder = mainSidebarHolder.parent().parent().find('.qodef-blog-holder'); if (blogHolder.length) { sidebarHolderHeight -= parseInt(blogHolder.css('marginBottom')); } } else if (widgetiseSidebarHolder.length) { sidebarHeight = widgetiseSidebarHolder.outerHeight(); sidebarWidth = widgetiseSidebarHolder.outerWidth(); sidebarHolder = widgetiseSidebarHolder; sidebarHolderHeight = widgetiseSidebarHolder.parents('.vc_row').outerHeight(); } objectsCollection.push({ 'object': thisSswHolder, 'offset': widgetTopOffset, 'position': widgetTopPosition, 'height': sidebarHeight, 'width': sidebarWidth, 'sidebarHolder': sidebarHolder, 'sidebarHolderHeight': sidebarHolderHeight }); }); } } function initStickySidebarWidget() { if (objectsCollection.length) { $.each(objectsCollection, function (i) { var thisSswHolder = objectsCollection[i].object, thisWidgetTopOffset = objectsCollection[i].offset, thisWidgetTopPosition = objectsCollection[i].position, thisSidebarHeight = objectsCollection[i].height, thisSidebarWidth = objectsCollection[i].width, thisSidebarHolder = objectsCollection[i].sidebarHolder, thisSidebarHolderHeight = objectsCollection[i].sidebarHolderHeight; if (qodef.body.hasClass('qodef-fixed-on-scroll')) { var fixedHeader = $('.qodef-fixed-wrapper.fixed'); if (fixedHeader.length) { headerHeight = fixedHeader.outerHeight() + qodefGlobalVars.vars.qodefAddForAdminBar; } } else if (qodef.body.hasClass('qodef-no-behavior')) { headerHeight = qodefGlobalVars.vars.qodefAddForAdminBar; } if (qodef.windowWidth > 1024 && thisSidebarHolder.length) { var sidebarPosition = -(thisWidgetTopPosition - headerHeight), sidebarHeight = thisSidebarHeight - thisWidgetTopPosition - 40; // 40 is bottom margin of widget holder //move sidebar up when hits the end of section row var rowSectionEndInViewport = thisSidebarHolderHeight + thisWidgetTopOffset - headerHeight - thisWidgetTopPosition - qodefGlobalVars.vars.qodefTopBarHeight; if ((qodef.scroll >= thisWidgetTopOffset - headerHeight) && thisSidebarHeight < thisSidebarHolderHeight) { if (thisSidebarHolder.hasClass('qodef-sticky-sidebar-appeared')) { thisSidebarHolder.css({'top': sidebarPosition + 'px'}); } else { thisSidebarHolder.addClass('qodef-sticky-sidebar-appeared').css({ 'position': 'fixed', 'top': sidebarPosition + 'px', 'width': thisSidebarWidth, 'margin-top': '-10px' }).animate({'margin-top': '0'}, 200); } if (qodef.scroll + sidebarHeight >= rowSectionEndInViewport) { var absBottomPosition = thisSidebarHolderHeight - sidebarHeight + sidebarPosition - headerHeight; thisSidebarHolder.css({ 'position': 'absolute', 'top': absBottomPosition + 'px' }); } else { if (thisSidebarHolder.hasClass('qodef-sticky-sidebar-appeared')) { thisSidebarHolder.css({ 'position': 'fixed', 'top': sidebarPosition + 'px' }); } } } else { thisSidebarHolder.removeClass('qodef-sticky-sidebar-appeared').css({ 'position': 'relative', 'top': '0', 'width': 'auto' }); } } else { thisSidebarHolder.removeClass('qodef-sticky-sidebar-appeared').css({ 'position': 'relative', 'top': '0', 'width': 'auto' }); } }); } } return { init: function () { addObjectItems(); initStickySidebarWidget(); $(window).scroll(function () { initStickySidebarWidget(); }); }, reInit: initStickySidebarWidget }; } /** * Init Owl Carousel */ function qodefOwlSlider() { var sliders = $('.qodef-owl-slider'); if (sliders.length) { sliders.each(function(){ var slider = $(this), owlSlider = $(this), slideItemsNumber = slider.children().length, numberOfItems = 1, loop = true, autoplay = true, autoplayHoverPause = true, sliderSpeed = 5000, sliderSpeedAnimation = 600, margin = 0, responsiveMargin = 0, responsiveMargin1 = 0, stagePadding = 0, stagePaddingEnabled = false, center = false, autoWidth = false, animateInClass = false, // keyframe css animation animateOutClass = false, // keyframe css animation navigation = true, pagination = false, thumbnail = false, thumbnailSlider, sliderIsCPTList = !!slider.hasClass('qodef-list-is-slider'), sliderDataHolder = sliderIsCPTList ? slider.parent() : slider; // this is condition for cpt to set list to be slider if (typeof slider.data('number-of-items') !== 'undefined' && slider.data('number-of-items') !== false && ! sliderIsCPTList) { numberOfItems = slider.data('number-of-items'); } var ipadCenter = false; if(slider.hasClass('qodef-fs-slides')) { ipadCenter = true; } if (typeof sliderDataHolder.data('number-of-columns') !== 'undefined' && sliderDataHolder.data('number-of-columns') !== false && sliderIsCPTList) { switch (sliderDataHolder.data('number-of-columns')) { case 'one': numberOfItems = 1; break; case 'two': numberOfItems = 2; break; case 'three': numberOfItems = 3; break; case 'four': numberOfItems = 4; break; case 'five': numberOfItems = 5; break; case 'six': numberOfItems = 6; break; default : numberOfItems = 4; break; } } if (sliderDataHolder.data('enable-loop') === 'no') { loop = false; } if (sliderDataHolder.data('enable-autoplay') === 'no') { autoplay = false; } if (sliderDataHolder.data('enable-autoplay-hover-pause') === 'no') { autoplayHoverPause = false; } if (typeof sliderDataHolder.data('slider-speed') !== 'undefined' && sliderDataHolder.data('slider-speed') !== false) { sliderSpeed = sliderDataHolder.data('slider-speed'); } if (typeof sliderDataHolder.data('slider-speed-animation') !== 'undefined' && sliderDataHolder.data('slider-speed-animation') !== false) { sliderSpeedAnimation = sliderDataHolder.data('slider-speed-animation'); } if (typeof sliderDataHolder.data('slider-margin') !== 'undefined' && sliderDataHolder.data('slider-margin') !== false) { if (sliderDataHolder.data('slider-margin') === 'no') { margin = 0; } else { margin = sliderDataHolder.data('slider-margin'); } } else { if(slider.parent().hasClass('qodef-huge-space')) { margin = 60; } else if (slider.parent().hasClass('qodef-large-space')) { margin = 50; } else if (slider.parent().hasClass('qodef-medium-space')) { margin = 40; } else if (slider.parent().hasClass('qodef-normal-space')) { margin = 30; } else if (slider.parent().hasClass('qodef-small-space')) { margin = 20; } else if (slider.parent().hasClass('qodef-tiny-space')) { margin = 10; } } if (sliderDataHolder.data('slider-padding') === 'yes') { stagePaddingEnabled = true; stagePadding = parseInt(slider.outerWidth() * 0.28); margin = 50; } if (sliderDataHolder.data('enable-center') === 'yes') { center = true; } if (sliderDataHolder.data('enable-auto-width') === 'yes') { autoWidth = true; } if (typeof sliderDataHolder.data('slider-animate-in') !== 'undefined' && sliderDataHolder.data('slider-animate-in') !== false) { animateInClass = sliderDataHolder.data('slider-animate-in'); } if (typeof sliderDataHolder.data('slider-animate-out') !== 'undefined' && sliderDataHolder.data('slider-animate-out') !== false) { animateOutClass = sliderDataHolder.data('slider-animate-out'); } if (sliderDataHolder.data('enable-navigation') === 'no') { navigation = false; } if (sliderDataHolder.data('enable-pagination') === 'yes') { pagination = true; } if (sliderDataHolder.data('enable-thumbnail') === 'yes') { thumbnail = true; } if(thumbnail && !pagination) { /* page.index works only when pagination is enabled, so we add through html, but hide via css */ pagination = true; owlSlider.addClass('qodef-slider-hide-pagination'); } if(navigation && pagination) { slider.addClass('qodef-slider-has-both-nav'); } if (slideItemsNumber <= 1) { loop = false; autoplay = false; navigation = false; pagination = false; } var responsiveNumberOfItems1 = 1, responsiveNumberOfItems2 = 2, responsiveNumberOfItems3 = 3, responsiveNumberOfItems4 = numberOfItems, responsiveNumberOfItems5 = numberOfItems; if (numberOfItems < 3) { responsiveNumberOfItems2 = numberOfItems; responsiveNumberOfItems3 = numberOfItems; } if (numberOfItems > 4) { responsiveNumberOfItems4 = 4; } if (numberOfItems > 5) { responsiveNumberOfItems5 = 5; } if (stagePaddingEnabled || margin > 30) { responsiveMargin = 20; responsiveMargin1 = 30; } if (margin > 0 && margin <= 30) { responsiveMargin = margin; responsiveMargin1 = margin; } slider.waitForImages(function () { owlSlider = slider.owlCarousel({ items: numberOfItems, loop: loop, autoplay: autoplay, autoplayHoverPause: autoplayHoverPause, autoplayTimeout: sliderSpeed, smartSpeed: sliderSpeedAnimation, margin: margin, stagePadding: stagePadding, center: center, autoWidth: autoWidth, animateIn: animateInClass, animateOut: animateOutClass, dots: pagination, nav: navigation, navText: [ '
', '
' ], responsive: { 0: { items: responsiveNumberOfItems1, margin: responsiveMargin, stagePadding: 0, center: false, autoWidth: false }, 681: { items: responsiveNumberOfItems2, margin: responsiveMargin1, center: ipadCenter, autoWidth: ipadCenter }, 769: { items: responsiveNumberOfItems3, margin: responsiveMargin1, center: ipadCenter, autoWidth: ipadCenter }, 1025: { items: responsiveNumberOfItems4 }, 1281: { items: responsiveNumberOfItems5 }, 1367: { items: numberOfItems } }, onInitialize: function () { slider.css('visibility', 'visible'); qodefInitParallax(); if (slider.find('iframe').length || slider.find('video').length) { setTimeout(function(){ qodefSelfHostedVideoSize(); qodefFluidVideo(); }, 500); } if(thumbnail) { thumbnailSlider.find('.qodef-slider-thumbnail-item:first-child').addClass('active'); } }, onRefreshed: function() { if(autoWidth === true) { var oldSize = parseInt(slider.find('.owl-stage').css('width')); slider.find('.owl-stage').css('width', (oldSize + 1) + 'px'); } }, onTranslate: function(e) { if(thumbnail) { var index = e.page.index + 1; thumbnailSlider.find('.qodef-slider-thumbnail-item.active').removeClass('active'); thumbnailSlider.find('.qodef-slider-thumbnail-item:nth-child(' + index + ')').addClass('active'); } }, onDrag: function (e) { if (qodef.body.hasClass('qodef-smooth-page-transitions-fadeout')) { var sliderIsMoving = e.isTrigger > 0; if (sliderIsMoving) { slider.addClass('qodef-slider-is-moving'); } } }, onDragged: function () { if (qodef.body.hasClass('qodef-smooth-page-transitions-fadeout') && slider.hasClass('qodef-slider-is-moving')) { setTimeout(function () { slider.removeClass('qodef-slider-is-moving'); }, 500); } } }); }); if(thumbnail) { thumbnailSlider = slider.parent().find('.qodef-slider-thumbnail'); var numberOfThumbnails = parseInt(thumbnailSlider.data('thumbnail-count')); var numberOfThumbnailsClass = ''; switch (numberOfThumbnails % 6) { case 2 : numberOfThumbnailsClass = 'two'; break; case 3 : numberOfThumbnailsClass = 'three'; break; case 4 : numberOfThumbnailsClass = 'four'; break; case 5 : numberOfThumbnailsClass = 'five'; break; case 0 : numberOfThumbnailsClass = 'six'; break; default : numberOfThumbnailsClass = 'six'; break; } if(numberOfThumbnailsClass !== '') { thumbnailSlider.addClass('qodef-slider-columns-' + numberOfThumbnailsClass); } thumbnailSlider.find('.qodef-slider-thumbnail-item').on('click' ,function () { $(this).siblings('.active').removeClass('active'); $(this).addClass('active'); owlSlider.trigger('to.owl.carousel', [$(this).index(), sliderSpeedAnimation]); }); } }); } } function qodefDashboardForm() { var forms = $('.qodef-dashboard-form'); if (forms.length) { forms.each(function () { var thisForm = $(this), btnText = thisForm.find('button.qodef-dashboard-form-button'), updatingBtnText = btnText.data('updating-text'), updatedBtnText = btnText.data('updated-text'), actionName = thisForm.data('action'); thisForm.on('submit', function (e) { e.preventDefault(); var prevBtnText = btnText.html(), gallery = $(this).find('.qodef-dashboard-gallery-upload-hidden'), namesArray = []; btnText.html(updatingBtnText); //get data var formData = new FormData(); //get files gallery.each(function () { var thisGallery = $(this), thisName = thisGallery.attr('name'), thisRepeaterID = thisGallery.attr('id'), thisFiles = thisGallery[0].files, newName; //this part is needed for repeater with image uploads //adding specific names so they can be sorted in regular files and files in repeater if (thisName.indexOf("[") > -1) { newName = thisName.substring(0, thisName.indexOf("[")) + '_qodef_regarray_'; var firstIndex = thisRepeaterID.indexOf('['), lastIndex = thisRepeaterID.indexOf(']'), index = thisRepeaterID.substring(firstIndex + 1, lastIndex); namesArray.push(newName); newName = newName + index + '_'; } else { newName = thisName + '_qodef_reg_'; } //if file not sent, send dummy file - so repeater fields are sent if (thisFiles.length === 0) { formData.append(newName, new File([""], "qodef-dummy-file.txt", { type: "text/plain" })); } for (var i = 0; i < thisFiles.length; i++) { var allowedTypes = ['image/png','image/jpg','image/jpeg','application/pdf']; //security purposed - check if there is more than one dot in file name, also check whether the file type is in allowed types if (thisFiles[i].name.match(/\./g).length === 1 && $.inArray(thisFiles[i].type, allowedTypes) !== -1) { formData.append(newName + i, thisFiles[i]); } } }); formData.append('action', actionName); //get data from form var otherData = $(this).serialize(); formData.append('data', otherData); $.ajax({ type: 'POST', data: formData, contentType: false, processData: false, url: qodefGlobalVars.vars.qodefAjaxUrl, success: function (data) { var response; response = JSON.parse(data); // append ajax response html qodef.modules.socialLogin.qodefRenderAjaxResponseMessage(response); if (response.status === 'success') { btnText.html(updatedBtnText); window.location = response.redirect; } else { btnText.html(prevBtnText); } } }); return false; }); }); } } /** * Init Perfect Scrollbar */ function qodefInitPerfectScrollbar() { var defaultParams = { wheelSpeed: 0.6, suppressScrollX: true }; var qodefInitScroll = function (holder) { var ps = new PerfectScrollbar(holder[0], defaultParams); $(window).resize(function () { ps.update(); }); }; return { init: function (holder) { if(holder.length){ qodefInitScroll(holder); } } }; } })(jQuery); (function($) { "use strict"; var blog = {}; qodef.modules.blog = blog; blog.qodefOnDocumentReady = qodefOnDocumentReady; blog.qodefOnWindowLoad = qodefOnWindowLoad; blog.qodefOnWindowScroll = qodefOnWindowScroll; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); $(window).scroll(qodefOnWindowScroll); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitAudioPlayer(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefInitBlogPagination().init(); } /* All functions to be called on $(window).scroll() should be in this function */ function qodefOnWindowScroll() { qodefInitBlogPagination().scroll(); } /** * Init audio player for Blog list and single pages */ function qodefInitAudioPlayer() { var players = $('audio.qodef-blog-audio'); if (players.length) { players.mediaelementplayer({ audioWidth: '100%' }); } } /** * Initializes blog pagination functions */ function qodefInitBlogPagination(){ var holder = $('.qodef-blog-holder'); var initLoadMorePagination = function(thisHolder) { var loadMoreButton = thisHolder.find('.qodef-blog-pag-load-more a'); loadMoreButton.on('click', function(e) { e.preventDefault(); e.stopPropagation(); initMainPagFunctionality(thisHolder); }); }; var initInifiteScrollPagination = function(thisHolder) { var blogListHeight = thisHolder.outerHeight(), blogListTopOffest = thisHolder.offset().top, blogListPosition = blogListHeight + blogListTopOffest - qodefGlobalVars.vars.qodefAddForAdminBar; if(!thisHolder.hasClass('qodef-blog-pagination-infinite-scroll-started') && qodef.scroll + qodef.windowHeight > blogListPosition) { initMainPagFunctionality(thisHolder); } }; var initMainPagFunctionality = function(thisHolder) { var thisHolderInner = thisHolder.children('.qodef-blog-holder-inner'), nextPage, maxNumPages; if (typeof thisHolder.data('max-num-pages') !== 'undefined' && thisHolder.data('max-num-pages') !== false) { maxNumPages = thisHolder.data('max-num-pages'); } if(thisHolder.hasClass('qodef-blog-pagination-infinite-scroll')) { thisHolder.addClass('qodef-blog-pagination-infinite-scroll-started'); } var loadMoreDatta = qodef.modules.common.getLoadMoreData(thisHolder), loadingItem = thisHolder.find('.qodef-blog-pag-loading'); nextPage = loadMoreDatta.nextPage; var nonceHolder = thisHolder.find('input[name*="qodef_blog_load_more_nonce_"]'); loadMoreDatta.blog_load_more_id = nonceHolder.attr('name').substring(nonceHolder.attr('name').length - 4, nonceHolder.attr('name').length); loadMoreDatta.blog_load_more_nonce = nonceHolder.val(); if(nextPage <= maxNumPages){ loadingItem.addClass('qodef-showing'); var ajaxData = qodef.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'brunn_select_blog_load_more'); $.ajax({ type: 'POST', data: ajaxData, url: qodefGlobalVars.vars.qodefAjaxUrl, success: function (data) { nextPage++; thisHolder.data('next-page', nextPage); var response = $.parseJSON(data), responseHtml = response.html; thisHolder.waitForImages(function(){ if(thisHolder.hasClass('qodef-grid-masonry-list')){ qodefInitAppendIsotopeNewContent(thisHolderInner, loadingItem, responseHtml); qodef.modules.common.setFixedImageProportionSize(thisHolder, thisHolder.find('article'), thisHolderInner.find('.qodef-masonry-grid-sizer').width()); } else { qodefInitAppendGalleryNewContent(thisHolderInner, loadingItem, responseHtml); } setTimeout(function() { qodefInitAudioPlayer(); qodef.modules.common.qodefOwlSlider(); qodef.modules.common.qodefFluidVideo(); qodef.modules.common.qodefInitSelfHostedVideoPlayer(); qodef.modules.common.qodefSelfHostedVideoSize(); if (typeof qodef.modules.common.qodefStickySidebarWidget === 'function') { qodef.modules.common.qodefStickySidebarWidget().reInit(); } // Trigger event. $( document.body ).trigger( 'blog_list_load_more_trigger' ); }, 400); }); if(thisHolder.hasClass('qodef-blog-pagination-infinite-scroll-started')) { thisHolder.removeClass('qodef-blog-pagination-infinite-scroll-started'); } } }); } if(nextPage === maxNumPages){ thisHolder.find('.qodef-blog-pag-load-more').hide(); } }; var qodefInitAppendIsotopeNewContent = function(thisHolderInner, loadingItem, responseHtml) { thisHolderInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'}); loadingItem.removeClass('qodef-showing'); setTimeout(function() { thisHolderInner.isotope('layout'); }, 600); }; var qodefInitAppendGalleryNewContent = function(thisHolderInner, loadingItem, responseHtml) { loadingItem.removeClass('qodef-showing'); thisHolderInner.append(responseHtml); }; return { init: function() { if(holder.length) { holder.each(function() { var thisHolder = $(this); if(thisHolder.hasClass('qodef-blog-pagination-load-more')) { initLoadMorePagination(thisHolder); } if(thisHolder.hasClass('qodef-blog-pagination-infinite-scroll')) { initInifiteScrollPagination(thisHolder); } }); } }, scroll: function() { if(holder.length) { holder.each(function() { var thisHolder = $(this); if(thisHolder.hasClass('qodef-blog-pagination-infinite-scroll')) { initInifiteScrollPagination(thisHolder); } }); } } }; } })(jQuery); (function ($) { "use strict"; var footer = {}; qodef.modules.footer = footer; footer.qodefOnWindowLoad = qodefOnWindowLoad; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { uncoveringFooter(); } function uncoveringFooter() { var uncoverFooter = $('body:not(.error404) .qodef-footer-uncover'); if (uncoverFooter.length && !qodef.htmlEl.hasClass('touch')) { var footer = $('footer'), footerHeight = footer.outerHeight(), content = $('.qodef-content'); var uncoveringCalcs = function () { content.css('margin-bottom', footerHeight); footer.css('height', footerHeight); }; //set uncoveringCalcs(); $(window).resize(function () { //recalc footerHeight = footer.find('.qodef-footer-inner').outerHeight(); uncoveringCalcs(); }); } } })(jQuery); (function($) { "use strict"; var header = {}; qodef.modules.header = header; header.qodefSetDropDownMenuPosition = qodefSetDropDownMenuPosition; header.qodefSetDropDownWideMenuPosition = qodefSetDropDownWideMenuPosition; header.qodefOnDocumentReady = qodefOnDocumentReady; header.qodefOnWindowLoad = qodefOnWindowLoad; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefSetDropDownMenuPosition(); setTimeout(function(){ qodefDropDownMenu(); }, 100); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefSetDropDownWideMenuPosition(); } /** * Set dropdown position */ function qodefSetDropDownMenuPosition() { var menuItems = $('.qodef-drop-down > ul > li.narrow.menu-item-has-children'); if (menuItems.length) { menuItems.each(function (i) { var thisItem = $(this), menuItemPosition = thisItem.offset().left, dropdownHolder = thisItem.find('.second'), dropdownMenuItem = dropdownHolder.find('.inner ul'), dropdownMenuWidth = dropdownMenuItem.outerWidth(), menuItemFromLeft = qodef.windowWidth - menuItemPosition; if (qodef.body.hasClass('qodef-boxed')) { menuItemFromLeft = qodef.boxedLayoutWidth - (menuItemPosition - (qodef.windowWidth - qodef.boxedLayoutWidth ) / 2); } var dropDownMenuFromLeft; //has to stay undefined because 'dropDownMenuFromLeft < dropdownMenuWidth' conditional will be true if (thisItem.find('li.sub').length > 0) { dropDownMenuFromLeft = menuItemFromLeft - dropdownMenuWidth; } dropdownHolder.removeClass('right'); dropdownMenuItem.removeClass('right'); if (menuItemFromLeft < dropdownMenuWidth || dropDownMenuFromLeft < dropdownMenuWidth) { dropdownHolder.addClass('right'); dropdownMenuItem.addClass('right'); } }); } } /** * Set dropdown wide position */ function qodefSetDropDownWideMenuPosition(){ var menuItems = $(".qodef-drop-down > ul > li.wide"); if(menuItems.length) { menuItems.each( function(i) { var menuItem = $(this); var menuItemSubMenu = menuItem.find('.second'); if(menuItemSubMenu.length && !menuItemSubMenu.hasClass('left_position') && !menuItemSubMenu.hasClass('right_position')) { menuItemSubMenu.css('left', 0); var left_position = menuItemSubMenu.offset().left; if(qodef.body.hasClass('qodef-boxed')) { //boxed layout case var boxedWidth = $('.qodef-boxed .qodef-wrapper .qodef-wrapper-inner').outerWidth(); left_position = left_position - (qodef.windowWidth - boxedWidth) / 2; menuItemSubMenu.css({'left': -left_position, 'width': boxedWidth}); } else if(qodef.body.hasClass('qodef-wide-dropdown-menu-in-grid')) { //wide dropdown in grid case menuItemSubMenu.css({'left': -left_position + (qodef.windowWidth - qodef.gridWidth()) / 2, 'width': qodef.gridWidth()}); } else { //wide dropdown full width case menuItemSubMenu.css({'left': -left_position, 'width': qodef.windowWidth}); } } }); } } function qodefDropDownMenu() { var menu_items = $('.qodef-drop-down > ul > li'); menu_items.each(function() { var thisItem = $(this); if(thisItem.find('.second').length) { thisItem.waitForImages(function(){ var dropDownHolder = thisItem.find('.second'), dropDownHolderHeight = !qodef.menuDropdownHeightSet ? dropDownHolder.outerHeight() : 0; if(thisItem.hasClass('wide')) { var tallest = 0, dropDownSecondItem = dropDownHolder.find('> .inner > ul > li'); dropDownSecondItem.each(function() { var thisHeight = $(this).outerHeight(); if(thisHeight > tallest) { tallest = thisHeight; } }); dropDownSecondItem.css('height', '').height(tallest); if (!qodef.menuDropdownHeightSet) { dropDownHolderHeight = dropDownHolder.outerHeight(); } } if (!qodef.menuDropdownHeightSet) { dropDownHolder.height(0); } if(navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { thisItem.on("touchstart mouseenter", function() { dropDownHolder.css({ 'height': dropDownHolderHeight, 'overflow': 'visible', 'visibility': 'visible', 'opacity': '1' }); }).on("mouseleave", function() { dropDownHolder.css({ 'height': '0px', 'overflow': 'hidden', 'visibility': 'hidden', 'opacity': '0' }); }); } else { if (qodef.body.hasClass('qodef-dropdown-animate-height')) { var animateConfig = { interval: 0, over: function () { setTimeout(function () { dropDownHolder.addClass('qodef-drop-down-start').css({ 'visibility': 'visible', 'height': '0', 'opacity': '1' }); dropDownHolder.stop().animate({ 'height': dropDownHolderHeight }, 400, 'easeInOutQuint', function () { dropDownHolder.css('overflow', 'visible'); }); }, 100); }, timeout: 100, out: function () { dropDownHolder.stop().animate({ 'height': '0', 'opacity': 0 }, 100, function () { dropDownHolder.css({ 'overflow': 'hidden', 'visibility': 'hidden' }); }); dropDownHolder.removeClass('qodef-drop-down-start'); } }; thisItem.hoverIntent(animateConfig); } else { var config = { interval: 0, over: function () { setTimeout(function () { dropDownHolder.addClass('qodef-drop-down-start').stop().css({'height': dropDownHolderHeight}); }, 150); }, timeout: 150, out: function () { dropDownHolder.stop().css({'height': '0'}).removeClass('qodef-drop-down-start'); } }; thisItem.hoverIntent(config); } } }); } }); $('.qodef-drop-down ul li.wide ul li a').on('click', function(e) { if (e.which === 1){ var $this = $(this); setTimeout(function() { $this.mouseleave(); }, 500); } }); qodef.menuDropdownHeightSet = true; } })(jQuery); (function($) { 'use strict'; var like = {}; like.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /** * All functions to be called on $(document).ready() should be in this function **/ function qodefOnDocumentReady() { qodefLikes(); } function qodefLikes() { $(document).on('click','.qodef-like', function() { var likeLink = $(this), id = likeLink.attr('id'), postID = likeLink.data('post-id'), type; if ( likeLink.hasClass('liked') ) { return false; } if (typeof likeLink.data('type') !== 'undefined') { type = likeLink.data('type'); } var dataToPass = { action: 'brunn_select_like', likes_id: id, type: type, like_nonce: $('#qodef_like_nonce_'+postID).val() }; var like = $.post(qodefGlobalVars.vars.qodefAjaxUrl, dataToPass, function( data ) { likeLink.html(data).addClass('liked').attr('title', 'You already like this!'); }); return false; }); } })(jQuery); (function($) { "use strict"; var sidearea = {}; qodef.modules.sidearea = sidearea; sidearea.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefSideArea(); } /** * Show/hide side area */ function qodefSideArea() { var wrapper = $('.qodef-wrapper'), sideMenu = $('.qodef-side-menu'), sideMenuButtonOpen = $('a.qodef-side-menu-button-opener'), cssClass, //Flags slideFromRight = false, slideWithContent = false, slideUncovered = false; if (qodef.body.hasClass('qodef-side-menu-slide-from-right')) { $('.qodef-cover').remove(); cssClass = 'qodef-right-side-menu-opened'; wrapper.prepend('
'); slideFromRight = true; } else if (qodef.body.hasClass('qodef-side-menu-slide-with-content')) { cssClass = 'qodef-side-menu-open'; slideWithContent = true; } else if (qodef.body.hasClass('qodef-side-area-uncovered-from-content')) { cssClass = 'qodef-right-side-menu-opened'; slideUncovered = true; } $('a.qodef-side-menu-button-opener, a.qodef-close-side-menu').on('click', function (e) { e.preventDefault(); if (!sideMenuButtonOpen.hasClass('opened')) { sideMenuButtonOpen.addClass('opened'); qodef.body.addClass(cssClass); if (slideFromRight) { $('.qodef-wrapper .qodef-cover').on('click', function () { qodef.body.removeClass('qodef-right-side-menu-opened'); sideMenuButtonOpen.removeClass('opened'); }); } if (slideUncovered) { sideMenu.css({ 'visibility': 'visible' }); } var currentScroll = $(window).scrollTop(); $(window).scroll(function () { if (Math.abs(qodef.scroll - currentScroll) > 400) { qodef.body.removeClass(cssClass); sideMenuButtonOpen.removeClass('opened'); if (slideUncovered) { var hideSideMenu = setTimeout(function () { sideMenu.css({'visibility': 'hidden'}); clearTimeout(hideSideMenu); }, 400); } } }); } else { sideMenuButtonOpen.removeClass('opened'); qodef.body.removeClass(cssClass); if (slideUncovered) { var hideSideMenu = setTimeout(function () { sideMenu.css({'visibility': 'hidden'}); clearTimeout(hideSideMenu); }, 400); } } if (slideWithContent) { e.stopPropagation(); wrapper.on('click', function () { e.preventDefault(); sideMenuButtonOpen.removeClass('opened'); qodef.body.removeClass('qodef-side-menu-open'); }); } }); if(sideMenu.length){ qodef.modules.common.qodefInitPerfectScrollbar().init(sideMenu); } } })(jQuery); (function($) { "use strict"; var title = {}; qodef.modules.title = title; title.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefParallaxTitle(); } /* ** Title image with parallax effect */ function qodefParallaxTitle() { var parallaxBackground = $('.qodef-title-holder.qodef-bg-parallax'); if (parallaxBackground.length > 0 && qodef.windowWidth > 1024) { var parallaxBackgroundWithZoomOut = parallaxBackground.hasClass('qodef-bg-parallax-zoom-out'), titleHeight = parseInt(parallaxBackground.data('height')), imageWidth = parseInt(parallaxBackground.data('background-width')), parallaxRate = titleHeight / 10000 * 7, parallaxYPos = -(qodef.scroll * parallaxRate), adminBarHeight = qodefGlobalVars.vars.qodefAddForAdminBar; parallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'}); if (parallaxBackgroundWithZoomOut) { parallaxBackground.css({'background-size': imageWidth - qodef.scroll + 'px auto'}); } //set position of background on window scroll $(window).scroll(function () { parallaxYPos = -(qodef.scroll * parallaxRate); parallaxBackground.css({'background-position': 'center ' + (parallaxYPos + adminBarHeight) + 'px'}); if (parallaxBackgroundWithZoomOut) { parallaxBackground.css({'background-size': imageWidth - qodef.scroll + 'px auto'}); } }); } } })(jQuery); (function($) { 'use strict'; var woocommerce = {}; qodef.modules.woocommerce = woocommerce; woocommerce.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitQuantityButtons(); qodefInitSelect2(); qodefInitSingleProductLightbox(); } /* ** Init quantity buttons to increase/decrease products for cart */ function qodefInitQuantityButtons() { $(document).on('click', '.qodef-quantity-minus, .qodef-quantity-plus', function (e) { e.stopPropagation(); var button = $(this), $inputField = button.siblings('.qodef-quantity-input'), step = parseFloat($inputField.data('step')), max = parseFloat($inputField.data('max')), min = parseFloat($inputField.data('min')), minus = false, inputValue = parseFloat($inputField.val()), newInputValue; if (button.hasClass('qodef-quantity-minus')) { minus = true; } if (minus) { newInputValue = inputValue - step; if (newInputValue >= min) { $inputField.val(newInputValue); } else { $inputField.val(min); } } else { newInputValue = inputValue + step; if (max === undefined) { $inputField.val(newInputValue); } else { if (newInputValue >= max) { $inputField.val(max); } else { $inputField.val(newInputValue); } } } $inputField.trigger('change'); }); } /* ** Init select2 script for select html dropdowns */ function qodefInitSelect2() { var orderByDropDown = $('.woocommerce-ordering .orderby'); if (orderByDropDown.length) { orderByDropDown.select2({ minimumResultsForSearch: Infinity }); } var variableProducts = $('.qodef-woocommerce-page .qodef-content .variations td.value select'); if (variableProducts.length) { variableProducts.select2(); } var shippingCountryCalc = $('#calc_shipping_country'); if (shippingCountryCalc.length) { shippingCountryCalc.select2(); } var shippingStateCalc = $('.cart-collaterals .shipping select#calc_shipping_state'); if (shippingStateCalc.length) { shippingStateCalc.select2(); } } /* ** Init Product Single Pretty Photo attributes */ function qodefInitSingleProductLightbox() { var item = $('.qodef-woo-single-page.qodef-woo-single-has-pretty-photo .images .woocommerce-product-gallery__image'); if(item.length) { item.children('a').attr('data-rel', 'prettyPhoto[woo_single_pretty_photo]'); if (typeof qodef.modules.common.qodefPrettyPhoto === "function") { qodef.modules.common.qodefPrettyPhoto(); } } } })(jQuery); (function($) { "use strict"; var blogListSC = {}; qodef.modules.blogListSC = blogListSC; blogListSC.qodefOnWindowLoad = qodefOnWindowLoad; blogListSC.qodefOnWindowScroll = qodefOnWindowScroll; $(window).on('load', qodefOnWindowLoad); $(window).scroll(qodefOnWindowScroll); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefInitBlogListShortcodePagination().init(); qodefElementorInitBlogList(); } /* All functions to be called on $(window).scroll() should be in this function */ function qodefOnWindowScroll() { qodefInitBlogListShortcodePagination().scroll(); } /** * Elementor */ function qodefElementorInitBlogList(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_blog_list.default', function() { qodefInitBlogListShortcodePagination().init(); qodef.modules.common.qodefInitGridMasonryListLayout(); } ); }); } /** * Init blog list shortcode pagination functions */ function qodefInitBlogListShortcodePagination(){ var holder = $('.qodef-blog-list-holder'); var initStandardPagination = function(thisHolder) { var standardLink = thisHolder.find('.qodef-bl-standard-pagination li'); if(standardLink.length) { standardLink.each(function(){ var thisLink = $(this).children('a'), pagedLink = 1; thisLink.on('click', function(e) { e.preventDefault(); e.stopPropagation(); if (typeof thisLink.data('paged') !== 'undefined' && thisLink.data('paged') !== false) { pagedLink = thisLink.data('paged'); } initMainPagFunctionality(thisHolder, pagedLink); }); }); } }; var initLoadMorePagination = function(thisHolder) { var loadMoreButton = thisHolder.find('.qodef-blog-pag-load-more a'); loadMoreButton.on('click', function(e) { e.preventDefault(); e.stopPropagation(); initMainPagFunctionality(thisHolder); }); }; var initInifiteScrollPagination = function(thisHolder) { var blogListHeight = thisHolder.outerHeight(), blogListTopOffest = thisHolder.offset().top, blogListPosition = blogListHeight + blogListTopOffest - qodefGlobalVars.vars.qodefAddForAdminBar; if(!thisHolder.hasClass('qodef-bl-pag-infinite-scroll-started') && qodef.scroll + qodef.windowHeight > blogListPosition) { initMainPagFunctionality(thisHolder); } }; var initMainPagFunctionality = function(thisHolder, pagedLink) { var thisHolderInner = thisHolder.find('.qodef-blog-list'), nextPage, maxNumPages; if (typeof thisHolder.data('max-num-pages') !== 'undefined' && thisHolder.data('max-num-pages') !== false) { maxNumPages = thisHolder.data('max-num-pages'); } if(thisHolder.hasClass('qodef-bl-pag-standard-shortcodes')) { thisHolder.data('next-page', pagedLink); } if(thisHolder.hasClass('qodef-bl-pag-infinite-scroll')) { thisHolder.addClass('qodef-bl-pag-infinite-scroll-started'); } var loadMoreDatta = qodef.modules.common.getLoadMoreData(thisHolder), loadingItem = thisHolder.find('.qodef-blog-pag-loading'); nextPage = loadMoreDatta.nextPage; var nonceHolder = thisHolder.find('input[name*="qodef_blog_load_more_nonce_"]'); loadMoreDatta.blog_load_more_id = nonceHolder.attr('name').substring(nonceHolder.attr('name').length - 4, nonceHolder.attr('name').length); loadMoreDatta.blog_load_more_nonce = nonceHolder.val(); if(nextPage <= maxNumPages){ if(thisHolder.hasClass('qodef-bl-pag-standard-shortcodes')) { loadingItem.addClass('qodef-showing qodef-standard-pag-trigger'); thisHolder.addClass('qodef-bl-pag-standard-shortcodes-animate'); } else { loadingItem.addClass('qodef-showing'); } var ajaxData = qodef.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'brunn_select_blog_shortcode_load_more'); $.ajax({ type: 'POST', data: ajaxData, url: qodefGlobalVars.vars.qodefAjaxUrl, success: function (data) { if(!thisHolder.hasClass('qodef-bl-pag-standard-shortcodes')) { nextPage++; } thisHolder.data('next-page', nextPage); var response = $.parseJSON(data), responseHtml = response.html; if(thisHolder.hasClass('qodef-bl-pag-standard-shortcodes')) { qodefInitStandardPaginationLinkChanges(thisHolder, maxNumPages, nextPage); thisHolder.waitForImages(function(){ if(thisHolder.hasClass('qodef-bl-masonry')){ qodefInitHtmlIsotopeNewContent(thisHolder, thisHolderInner, loadingItem, responseHtml); } else { qodefInitHtmlGalleryNewContent(thisHolder, thisHolderInner, loadingItem, responseHtml); if (typeof qodef.modules.common.qodefStickySidebarWidget === 'function') { qodef.modules.common.qodefStickySidebarWidget().reInit(); } } }); } else { thisHolder.waitForImages(function(){ if(thisHolder.hasClass('qodef-bl-masonry')){ qodefInitAppendIsotopeNewContent(thisHolderInner, loadingItem, responseHtml); } else { qodefInitAppendGalleryNewContent(thisHolderInner, loadingItem, responseHtml); if (typeof qodef.modules.common.qodefStickySidebarWidget === 'function') { qodef.modules.common.qodefStickySidebarWidget().reInit(); } } }); } if(thisHolder.hasClass('qodef-bl-pag-infinite-scroll-started')) { thisHolder.removeClass('qodef-bl-pag-infinite-scroll-started'); } } }); } if(nextPage === maxNumPages){ thisHolder.find('.qodef-blog-pag-load-more').hide(); } }; var qodefInitStandardPaginationLinkChanges = function(thisHolder, maxNumPages, nextPage) { var standardPagHolder = thisHolder.find('.qodef-bl-standard-pagination'), standardPagNumericItem = standardPagHolder.find('li.qodef-pag-number'), standardPagPrevItem = standardPagHolder.find('li.qodef-pag-prev a'), standardPagNextItem = standardPagHolder.find('li.qodef-pag-next a'); standardPagNumericItem.removeClass('qodef-pag-active'); standardPagNumericItem.eq(nextPage-1).addClass('qodef-pag-active'); standardPagPrevItem.data('paged', nextPage-1); standardPagNextItem.data('paged', nextPage+1); if(nextPage > 1) { standardPagPrevItem.css({'opacity': '1'}); } else { standardPagPrevItem.css({'opacity': '0'}); } if(nextPage === maxNumPages) { standardPagNextItem.css({'opacity': '0'}); } else { standardPagNextItem.css({'opacity': '1'}); } }; var qodefInitHtmlIsotopeNewContent = function(thisHolder, thisHolderInner, loadingItem, responseHtml) { thisHolderInner.html(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'}); loadingItem.removeClass('qodef-showing qodef-standard-pag-trigger'); thisHolder.removeClass('qodef-bl-pag-standard-shortcodes-animate'); setTimeout(function() { thisHolderInner.isotope('layout'); if (typeof qodef.modules.common.qodefStickySidebarWidget === 'function') { qodef.modules.common.qodefStickySidebarWidget().reInit(); } }, 600); }; var qodefInitHtmlGalleryNewContent = function(thisHolder, thisHolderInner, loadingItem, responseHtml) { loadingItem.removeClass('qodef-showing qodef-standard-pag-trigger'); thisHolder.removeClass('qodef-bl-pag-standard-shortcodes-animate'); thisHolderInner.html(responseHtml); }; var qodefInitAppendIsotopeNewContent = function(thisHolderInner, loadingItem, responseHtml) { thisHolderInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'}); loadingItem.removeClass('qodef-showing'); setTimeout(function() { thisHolderInner.isotope('layout'); if (typeof qodef.modules.common.qodefStickySidebarWidget === 'function') { qodef.modules.common.qodefStickySidebarWidget().reInit(); } }, 600); }; var qodefInitAppendGalleryNewContent = function(thisHolderInner, loadingItem, responseHtml) { loadingItem.removeClass('qodef-showing'); thisHolderInner.append(responseHtml); }; return { init: function() { if(holder.length) { holder.each(function() { var thisHolder = $(this); if(thisHolder.hasClass('qodef-bl-pag-standard-shortcodes')) { initStandardPagination(thisHolder); } if(thisHolder.hasClass('qodef-bl-pag-load-more')) { initLoadMorePagination(thisHolder); } if(thisHolder.hasClass('qodef-bl-pag-infinite-scroll')) { initInifiteScrollPagination(thisHolder); } }); } }, scroll: function() { if(holder.length) { holder.each(function() { var thisHolder = $(this); if(thisHolder.hasClass('qodef-bl-pag-infinite-scroll')) { initInifiteScrollPagination(thisHolder); } }); } } }; } })(jQuery); (function($) { "use strict"; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorBlogSlider(); } /** * Elementor */ function qodefElementorBlogSlider() { $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/qodef_blog_slider.default', function () { qodef.modules.common.qodefOwlSlider(); }); }); } })(jQuery); (function($) { "use strict"; var headerMinimal = {}; qodef.modules.headerMinimal = headerMinimal; headerMinimal.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefFullscreenMenu(); } /** * Init Fullscreen Menu */ function qodefFullscreenMenu() { var popupMenuOpener = $( 'a.qodef-fullscreen-menu-opener'); if (popupMenuOpener.length) { var popupMenuHolderOuter = $(".qodef-fullscreen-menu-holder-outer"), cssClass, //Flags for type of animation fadeRight = false, fadeTop = false, //Widgets widgetAboveNav = $('.qodef-fullscreen-above-menu-widget-holder'), widgetBelowNav = $('.qodef-fullscreen-below-menu-widget-holder'), //Menu menuItems = $('.qodef-fullscreen-menu-holder-outer nav > ul > li > a'), menuItemWithChild = $('.qodef-fullscreen-menu > ul li.has_sub > a'), menuItemWithoutChild = $('.qodef-fullscreen-menu ul li:not(.has_sub) a'); //set height of popup holder and initialize perfectScrollbar qodef.modules.common.qodefInitPerfectScrollbar().init(popupMenuHolderOuter); //set height of popup holder on resize $(window).resize(function() { popupMenuHolderOuter.height(qodef.windowHeight); }); if (qodef.body.hasClass('qodef-fade-push-text-right')) { cssClass = 'qodef-push-nav-right'; fadeRight = true; } else if (qodef.body.hasClass('qodef-fade-push-text-top')) { cssClass = 'qodef-push-text-top'; fadeTop = true; } //Appearing animation if (fadeRight || fadeTop) { if (widgetAboveNav.length) { widgetAboveNav.children().css({ '-webkit-animation-delay' : 0 + 'ms', '-moz-animation-delay' : 0 + 'ms', 'animation-delay' : 0 + 'ms' }); } menuItems.each(function(i) { $(this).css({ '-webkit-animation-delay': (i+1) * 70 + 'ms', '-moz-animation-delay': (i+1) * 70 + 'ms', 'animation-delay': (i+1) * 70 + 'ms' }); }); if (widgetBelowNav.length) { widgetBelowNav.children().css({ '-webkit-animation-delay' : (menuItems.length + 1)*70 + 'ms', '-moz-animation-delay' : (menuItems.length + 1)*70 + 'ms', 'animation-delay' : (menuItems.length + 1)*70 + 'ms' }); } } // Open popup menu popupMenuOpener.on('click',function(e){ e.preventDefault(); if (!popupMenuOpener.hasClass('qodef-fm-opened')) { popupMenuOpener.addClass('qodef-fm-opened'); qodef.body.removeClass('qodef-fullscreen-fade-out').addClass('qodef-fullscreen-menu-opened qodef-fullscreen-fade-in'); qodef.body.removeClass(cssClass); qodef.modules.common.qodefDisableScroll(); $(document).keyup(function(e){ if (e.keyCode === 27 ) { popupMenuOpener.removeClass('qodef-fm-opened'); qodef.body.removeClass('qodef-fullscreen-menu-opened qodef-fullscreen-fade-in').addClass('qodef-fullscreen-fade-out'); qodef.body.addClass(cssClass); qodef.modules.common.qodefEnableScroll(); $("nav.qodef-fullscreen-menu ul.sub_menu").slideUp(200); } }); } else { popupMenuOpener.removeClass('qodef-fm-opened'); qodef.body.removeClass('qodef-fullscreen-menu-opened qodef-fullscreen-fade-in').addClass('qodef-fullscreen-fade-out'); qodef.body.addClass(cssClass); qodef.modules.common.qodefEnableScroll(); $("nav.qodef-fullscreen-menu ul.sub_menu").slideUp(200); } }); //logic for open sub menus in popup menu menuItemWithChild.on('tap click', function(e) { e.preventDefault(); var thisItem = $(this), thisItemParent = thisItem.parent(), thisItemParentSiblingsWithDrop = thisItemParent.siblings('.menu-item-has-children'); if (thisItemParent.hasClass('has_sub')) { var submenu = thisItemParent.find('> ul.sub_menu'); if (submenu.is(':visible')) { submenu.slideUp(450, 'easeInOutQuint'); thisItemParent.removeClass('open_sub'); } else { thisItemParent.addClass('open_sub'); if(thisItemParentSiblingsWithDrop.length === 0) { submenu.slideDown(400, 'easeInOutQuint'); } else { thisItemParent.closest('li.menu-item').siblings().find('.menu-item').removeClass('open_sub'); thisItemParent.siblings().removeClass('open_sub').find('.sub_menu').slideUp(400, 'easeInOutQuint', function() { submenu.slideDown(400, 'easeInOutQuint'); }); } } } return false; }); //if link has no submenu and if it's not dead, than open that link menuItemWithoutChild.on('click', function (e) { if(($(this).attr('href') !== "http://#") && ($(this).attr('href') !== "#")){ if (e.which === 1) { popupMenuOpener.removeClass('qodef-fm-opened'); qodef.body.removeClass('qodef-fullscreen-menu-opened'); qodef.body.removeClass('qodef-fullscreen-fade-in').addClass('qodef-fullscreen-fade-out'); qodef.body.addClass(cssClass); $("nav.qodef-fullscreen-menu ul.sub_menu").slideUp(200); qodef.modules.common.qodefEnableScroll(); } } else { return false; } }); } } })(jQuery); (function($) { "use strict"; var headerVerticalClosed = {}; qodef.modules.headerVerticalClosed = headerVerticalClosed; headerVerticalClosed.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefVerticalClosedMenu().init(); } /** * Function object that represents vertical menu area. * @returns {{init: Function}} */ var qodefVerticalClosedMenu = function() { var verticalMenuObject = $('.qodef-header-vertical-closed .qodef-vertical-menu-area'); /** * Initialzes navigation functionality. It checks navigation type data attribute and calls proper functions */ var initNavigation = function () { var verticalNavObject = verticalMenuObject.find('.qodef-vertical-menu'); if (verticalNavObject.hasClass('qodef-vertical-dropdown-below')) { dropdownClickToggle(); } /** * Initializes click toggle navigation type. Works the same for touch and no-touch devices */ function dropdownClickToggle() { var menuItems = verticalNavObject.find('ul li.menu-item-has-children'); menuItems.each(function () { var elementToExpand = $(this).find(' > .second, > ul'); var menuItem = this; var dropdownOpener = $(this).find('> a'); var slideUpSpeed = 'fast'; var slideDownSpeed = 'slow'; dropdownOpener.on('click tap', function (e) { e.preventDefault(); e.stopPropagation(); if (elementToExpand.is(':visible')) { $(menuItem).removeClass('open'); elementToExpand.slideUp(slideUpSpeed); } else if (dropdownOpener.parent().parent().children().hasClass('open') && dropdownOpener.parent().parent().parent().hasClass('qodef-vertical-menu')) { $(this).parent().parent().children().removeClass('open'); $(this).parent().parent().children().find(' > .second').slideUp(slideUpSpeed); $(menuItem).addClass('open'); elementToExpand.slideDown(slideDownSpeed); } else { if (!$(this).parents('li').hasClass('open')) { menuItems.removeClass('open'); menuItems.find(' > .second, > ul').slideUp(slideUpSpeed); } if ($(this).parent().parent().children().hasClass('open')) { $(this).parent().parent().children().removeClass('open'); $(this).parent().parent().children().find(' > .second, > ul').slideUp(slideUpSpeed); } $(menuItem).addClass('open'); elementToExpand.slideDown(slideDownSpeed); } }); }); } }; var initHiddenVerticalArea = function() { var verticalLogo = $('.qodef-vertical-area-bottom-logo'); var verticalMenuOpener = verticalMenuObject.find('.qodef-vertical-area-opener'); var scrollPosition = 0; verticalMenuOpener.on('click tap', function() { if(isVerticalAreaOpen()) { closeVerticalArea(); } else { openVerticalArea(); } }); $(window).scroll(function() { if(Math.abs($(window).scrollTop() - scrollPosition) > 400){ closeVerticalArea(); } }); /** * Closes vertical menu area by removing 'active' class on that element */ function closeVerticalArea() { verticalMenuObject.removeClass('active'); if(verticalLogo.length) { verticalLogo.removeClass('active'); } } /** * Opens vertical menu area by adding 'active' class on that element */ function openVerticalArea() { verticalMenuObject.addClass('active'); if(verticalLogo.length) { verticalLogo.addClass('active'); } scrollPosition = $(window).scrollTop(); } function isVerticalAreaOpen() { return verticalMenuObject.hasClass('active'); } }; return { /** * Calls all necessary functionality for vertical menu area if vertical area object is valid */ init: function() { if(verticalMenuObject.length) { initNavigation(); initHiddenVerticalArea(); } } }; }; })(jQuery); (function ($) { "use strict"; var mobileHeader = {}; qodef.modules.mobileHeader = mobileHeader; mobileHeader.qodefOnDocumentReady = qodefOnDocumentReady; mobileHeader.qodefOnWindowResize = qodefOnWindowResize; $(document).ready(qodefOnDocumentReady); $(window).resize(qodefOnWindowResize); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitMobileNavigation(); qodefInitMobileNavigationScroll(); qodefMobileHeaderBehavior(); } /* All functions to be called on $(window).resize() should be in this function */ function qodefOnWindowResize() { qodefInitMobileNavigationScroll(); } function qodefInitMobileNavigation() { var navigationOpener = $('.qodef-mobile-header .qodef-mobile-menu-opener'), navigationHolder = $('.qodef-mobile-header .qodef-mobile-nav'), dropdownOpener = $('.qodef-mobile-nav .mobile_arrow, .qodef-mobile-nav h6, .qodef-mobile-nav a.qodef-mobile-no-link'); //whole mobile menu opening / closing if (navigationOpener.length && navigationHolder.length) { navigationOpener.on('tap click', function (e) { e.stopPropagation(); e.preventDefault(); if (navigationHolder.is(':visible')) { navigationHolder.slideUp(450, 'easeInOutQuint'); navigationOpener.removeClass('qodef-mobile-menu-opened'); } else { navigationHolder.slideDown(450, 'easeInOutQuint'); navigationOpener.addClass('qodef-mobile-menu-opened'); } }); } //dropdown opening / closing if (dropdownOpener.length) { dropdownOpener.each(function () { var thisItem = $(this); thisItem.on('tap click', function (e) { var thisItemParent = thisItem.parent('li'), thisItemParentSiblingsWithDrop = thisItemParent.siblings('.menu-item-has-children'); if (thisItemParent.hasClass('has_sub')) { var submenu = thisItemParent.find('> ul.sub_menu'); if (submenu.is(':visible')) { submenu.slideUp(450, 'easeInOutQuint'); thisItemParent.removeClass('edgtf-opened'); } else { thisItemParent.addClass('edgtf-opened'); if (thisItemParentSiblingsWithDrop.length === 0) { thisItemParent.find('.sub_menu').slideUp(400, 'easeInOutQuint', function () { submenu.slideDown(400, 'easeInOutQuint'); }); } else { thisItemParent.siblings().removeClass('edgtf-opened').find('.sub_menu').slideUp(400, 'easeInOutQuint', function () { submenu.slideDown(400, 'easeInOutQuint'); }); } } } }); }); } $('.qodef-mobile-nav a, .qodef-mobile-logo-wrapper a').on('click tap', function (e) { if ($(this).attr('href') !== 'http://#' && $(this).attr('href') !== '#') { navigationHolder.slideUp(450, 'easeInOutQuint'); navigationOpener.removeClass("qodef-mobile-menu-opened"); } }); } function qodefInitMobileNavigationScroll() { if (qodef.windowWidth <= 1024) { var mobileHeader = $('.qodef-mobile-header'), mobileHeaderHeight = mobileHeader.length ? mobileHeader.height() : 0, navigationHolder = mobileHeader.find('.qodef-mobile-nav'), navigationHeight = navigationHolder.outerHeight(), windowHeight = qodef.windowHeight - 100; //init scrollable menu var scrollHeight = mobileHeaderHeight + navigationHeight > windowHeight ? windowHeight - mobileHeaderHeight : navigationHeight; // in case if mobile header exists on specific page if (navigationHolder.length) { navigationHolder.height(scrollHeight); qodef.modules.common.qodefInitPerfectScrollbar().init(navigationHolder); } } } function qodefMobileHeaderBehavior() { var mobileHeader = $('.qodef-mobile-header'), mobileMenuOpener = mobileHeader.find('.qodef-mobile-menu-opener'), mobileHeaderHeight = mobileHeader.length ? mobileHeader.outerHeight() : 0; if (qodef.body.hasClass('qodef-content-is-behind-header') && mobileHeaderHeight > 0 && qodef.windowWidth <= 1024) { $('.qodef-content').css('marginTop', -mobileHeaderHeight); } if (qodef.body.hasClass('qodef-sticky-up-mobile-header')) { var stickyAppearAmount, adminBar = $('#wpadminbar'); var docYScroll1 = $(document).scrollTop(); stickyAppearAmount = mobileHeaderHeight + qodefGlobalVars.vars.qodefAddForAdminBar; $(window).scroll(function () { var docYScroll2 = $(document).scrollTop(); if (docYScroll2 > stickyAppearAmount) { mobileHeader.addClass('qodef-animate-mobile-header'); } else { mobileHeader.removeClass('qodef-animate-mobile-header'); } if ((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount && !mobileMenuOpener.hasClass('qodef-mobile-menu-opened')) || (docYScroll2 < stickyAppearAmount)) { mobileHeader.removeClass('mobile-header-appear'); mobileHeader.css('margin-bottom', 0); if (adminBar.length) { mobileHeader.find('.qodef-mobile-header-inner').css('top', adminBar.height()); } } else { mobileHeader.addClass('mobile-header-appear'); mobileHeader.css('margin-bottom', stickyAppearAmount); } docYScroll1 = $(document).scrollTop(); }); } } })(jQuery); (function($) { "use strict"; var stickyHeader = {}; qodef.modules.stickyHeader = stickyHeader; stickyHeader.isStickyVisible = false; stickyHeader.stickyAppearAmount = 0; stickyHeader.behaviour = ''; stickyHeader.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { if(qodef.windowWidth > 1024) { qodefHeaderBehaviour(); } } /* ** Show/Hide sticky header on window scroll */ function qodefHeaderBehaviour() { var header = $('.qodef-page-header'), stickyHeader = $('.qodef-sticky-header'), fixedHeaderWrapper = $('.qodef-fixed-wrapper'), fixedMenuArea = fixedHeaderWrapper.children('.qodef-menu-area'), fixedMenuAreaHeight = fixedMenuArea.outerHeight(), sliderHolder = $('.qodef-slider'), revSliderHeight = sliderHolder.length ? sliderHolder.outerHeight() : 0, stickyAppearAmount, headerAppear; var headerMenuAreaOffset = fixedHeaderWrapper.length ? fixedHeaderWrapper.offset().top - qodefGlobalVars.vars.qodefAddForAdminBar : 0; switch(true) { // sticky header that will be shown when user scrolls up case qodef.body.hasClass('qodef-sticky-header-on-scroll-up'): qodef.modules.stickyHeader.behaviour = 'qodef-sticky-header-on-scroll-up'; var docYScroll1 = $(document).scrollTop(); stickyAppearAmount = parseInt(qodefGlobalVars.vars.qodefTopBarHeight) + parseInt(qodefGlobalVars.vars.qodefLogoAreaHeight) + parseInt(qodefGlobalVars.vars.qodefMenuAreaHeight) + parseInt(qodefGlobalVars.vars.qodefStickyHeaderHeight); headerAppear = function(){ var docYScroll2 = $(document).scrollTop(); if((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount) || (docYScroll2 < stickyAppearAmount)) { qodef.modules.stickyHeader.isStickyVisible = false; stickyHeader.removeClass('header-appear').find('.qodef-main-menu .second').removeClass('qodef-drop-down-start'); qodef.body.removeClass('qodef-sticky-header-appear'); } else { qodef.modules.stickyHeader.isStickyVisible = true; stickyHeader.addClass('header-appear'); qodef.body.addClass('qodef-sticky-header-appear'); } docYScroll1 = $(document).scrollTop(); }; headerAppear(); $(window).scroll(function() { headerAppear(); }); break; // sticky header that will be shown when user scrolls both up and down case qodef.body.hasClass('qodef-sticky-header-on-scroll-down-up'): qodef.modules.stickyHeader.behaviour = 'qodef-sticky-header-on-scroll-down-up'; if(qodefPerPageVars.vars.qodefStickyScrollAmount !== 0){ qodef.modules.stickyHeader.stickyAppearAmount = parseInt(qodefPerPageVars.vars.qodefStickyScrollAmount); } else { qodef.modules.stickyHeader.stickyAppearAmount = parseInt(qodefGlobalVars.vars.qodefTopBarHeight) + parseInt(qodefGlobalVars.vars.qodefLogoAreaHeight) + parseInt(qodefGlobalVars.vars.qodefMenuAreaHeight) + parseInt(revSliderHeight); } headerAppear = function(){ if(qodef.scroll < qodef.modules.stickyHeader.stickyAppearAmount) { qodef.modules.stickyHeader.isStickyVisible = false; stickyHeader.removeClass('header-appear').find('.qodef-main-menu .second').removeClass('qodef-drop-down-start'); qodef.body.removeClass('qodef-sticky-header-appear'); }else{ qodef.modules.stickyHeader.isStickyVisible = true; stickyHeader.addClass('header-appear'); qodef.body.addClass('qodef-sticky-header-appear'); } }; headerAppear(); $(window).scroll(function() { headerAppear(); }); break; // on scroll down, part of header will be sticky case qodef.body.hasClass('qodef-fixed-on-scroll'): qodef.modules.stickyHeader.behaviour = 'qodef-fixed-on-scroll'; var headerFixed = function(){ if(qodef.scroll <= headerMenuAreaOffset) { fixedHeaderWrapper.removeClass('fixed'); qodef.body.removeClass('qodef-fixed-header-appear'); header.css('margin-bottom', '0'); } else { fixedHeaderWrapper.addClass('fixed'); qodef.body.addClass('qodef-fixed-header-appear'); header.css('margin-bottom', fixedMenuAreaHeight + 'px'); } }; headerFixed(); $(window).scroll(function() { headerFixed(); }); break; } } })(jQuery); (function($) { "use strict"; var searchFullscreen = {}; qodef.modules.searchFullscreen = searchFullscreen; searchFullscreen.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefSearchFullscreen(); } /** * Init Search Types */ function qodefSearchFullscreen() { if ( qodef.body.hasClass( 'qodef-fullscreen-search' ) ) { var searchOpener = $('a.qodef-search-opener'); if (searchOpener.length > 0) { var searchHolder = $('.qodef-fullscreen-search-holder'), searchClose = $('.qodef-search-close'); searchOpener.on('click', function (e) { e.preventDefault(); if (searchHolder.hasClass('qodef-animate')) { qodef.body.removeClass('qodef-fullscreen-search-opened qodef-search-fade-out'); qodef.body.removeClass('qodef-search-fade-in'); searchHolder.removeClass('qodef-animate'); setTimeout(function () { searchHolder.find('.qodef-search-field').val(''); searchHolder.find('.qodef-search-field').blur(); }, 300); qodef.modules.common.qodefEnableScroll(); } else { qodef.body.addClass('qodef-fullscreen-search-opened qodef-search-fade-in'); qodef.body.removeClass('qodef-search-fade-out'); searchHolder.addClass('qodef-animate'); setTimeout(function () { searchHolder.find('.qodef-search-field').focus(); }, 900); qodef.modules.common.qodefDisableScroll(); } searchClose.on('click', function (e) { e.preventDefault(); qodef.body.removeClass('qodef-fullscreen-search-opened qodef-search-fade-in'); qodef.body.addClass('qodef-search-fade-out'); searchHolder.removeClass('qodef-animate'); setTimeout(function () { searchHolder.find('.qodef-search-field').val(''); searchHolder.find('.qodef-search-field').blur(); }, 300); qodef.modules.common.qodefEnableScroll(); }); //Close on click away $(document).mouseup(function (e) { var container = $(".qodef-form-holder-inner"); if (!container.is(e.target) && container.has(e.target).length === 0) { e.preventDefault(); qodef.body.removeClass('qodef-fullscreen-search-opened qodef-search-fade-in'); qodef.body.addClass('qodef-search-fade-out'); searchHolder.removeClass('qodef-animate'); setTimeout(function () { searchHolder.find('.qodef-search-field').val(''); searchHolder.find('.qodef-search-field').blur(); }, 300); qodef.modules.common.qodefEnableScroll(); } }); //Close on escape $(document).keyup(function (e) { if (e.keyCode === 27) { //KeyCode for ESC button is 27 qodef.body.removeClass('qodef-fullscreen-search-opened qodef-search-fade-in'); qodef.body.addClass('qodef-search-fade-out'); searchHolder.removeClass('qodef-animate'); setTimeout(function () { searchHolder.find('.qodef-search-field').val(''); searchHolder.find('.qodef-search-field').blur(); }, 300); qodef.modules.common.qodefEnableScroll(); } }); }); //Text input focus change var inputSearchField = $('.qodef-fullscreen-search-holder .qodef-search-field'), inputSearchLine = $('.qodef-fullscreen-search-holder .qodef-field-holder .qodef-line'); inputSearchField.focus(function () { inputSearchLine.css('width', '100%'); }); inputSearchField.blur(function () { inputSearchLine.css('width', '0'); }); } } } })(jQuery); (function($) { "use strict"; $(window).on('load', qodefOnWindowLoad); function qodefOnWindowLoad() { qodefElementorPortfolioList(); } function qodefElementorPortfolioList(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_product_list.default', function() { qodef.modules.common.qodefInitGridMasonryListLayout(); } ); }); } })(jQuery); (function ($) { 'use strict'; var rating = {}; qodef.modules.rating = rating; rating.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitCommentRating(); } function qodefInitCommentRating() { var ratingHolder = $('.qodef-comment-form-rating'); var addActive = function (stars, ratingValue) { for (var i = 0; i < stars.length; i++) { var star = stars[i]; if (i < ratingValue) { $(star).addClass('active'); } else { $(star).removeClass('active'); } } }; ratingHolder.each(function() { var thisHolder = $(this), ratingInput = thisHolder.find('.qodef-rating'), ratingValue = ratingInput.val(), stars = thisHolder.find('.qodef-star-rating'); addActive(stars, ratingValue); stars.on('click', function () { ratingInput.val($(this).data('value')).trigger('change'); }); ratingInput.change(function () { ratingValue = ratingInput.val(); addActive(stars, ratingValue); }); }); } })(jQuery); (function($) { 'use strict'; var portfolio = {}; qodef.modules.portfolio = portfolio; portfolio.qodefOnWindowLoad = qodefOnWindowLoad; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefPortfolioSingleFollow().init(); } var qodefPortfolioSingleFollow = function () { var info = $('.qodef-follow-portfolio-info .qodef-portfolio-single-holder .qodef-ps-info-sticky-holder'); if (info.length) { var infoHolder = info.parent(), infoHolderOffset = infoHolder.offset().top, infoHolderHeight = infoHolder.height(), mediaHolder = $('.qodef-ps-image-holder'), mediaHolderHeight = mediaHolder.height(), header = $('.header-appear, .qodef-fixed-wrapper'), headerHeight = (header.length) ? header.height() : 0, constant = 30; //30 to prevent mispositioned } var infoHolderPosition = function () { if (info.length && mediaHolderHeight >= infoHolderHeight) { if (qodef.scroll >= infoHolderOffset - headerHeight - qodefGlobalVars.vars.qodefAddForAdminBar - constant) { var marginTop = qodef.scroll - infoHolderOffset + qodefGlobalVars.vars.qodefAddForAdminBar + headerHeight + constant; // if scroll is initially positioned below mediaHolderHeight if (marginTop + infoHolderHeight > mediaHolderHeight) { marginTop = mediaHolderHeight - infoHolderHeight + constant; } info.stop().animate({ marginTop: marginTop }); } } }; var recalculateInfoHolderPosition = function () { if (info.length && mediaHolderHeight >= infoHolderHeight) { //Calculate header height if header appears if (qodef.scroll > 0 && header.length) { headerHeight = header.height(); } var headerMixin = headerHeight + qodefGlobalVars.vars.qodefAddForAdminBar + constant; if (qodef.scroll >= infoHolderOffset - headerMixin) { if (qodef.scroll + infoHolderHeight + headerMixin + 2 * constant < infoHolderOffset + mediaHolderHeight) { info.stop().animate({ marginTop: (qodef.scroll - infoHolderOffset + headerMixin + 2 * constant) }); //Reset header height headerHeight = 0; } else { info.stop().animate({ marginTop: mediaHolderHeight - infoHolderHeight }); } } else { info.stop().animate({ marginTop: 0 }); } } }; return { init: function () { infoHolderPosition(); $(window).scroll(function () { recalculateInfoHolderPosition(); }); } }; }; })(jQuery); (function($) { 'use strict'; var accordions = {}; qodef.modules.accordions = accordions; accordions.qodefInitAccordions = qodefInitAccordions; accordions.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitAccordions(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorInitAccordions(); } /** * Elementor */ function qodefElementorInitAccordions(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_accordion.default', function() { qodefInitAccordions(); } ); }); } /** * Init accordions shortcode */ function qodefInitAccordions(){ var accordion = $('.qodef-accordion-holder'); if(accordion.length){ accordion.each(function(){ var thisAccordion = $(this); if(thisAccordion.hasClass('qodef-accordion')){ thisAccordion.accordion({ animate: "swing", collapsible: true, active: 0, icons: "", heightStyle: "content" }); } if(thisAccordion.hasClass('qodef-toggle')){ var toggleAccordion = $(this), toggleAccordionTitle = toggleAccordion.find('.qodef-accordion-title'), toggleAccordionContent = toggleAccordionTitle.next(); toggleAccordion.addClass("accordion ui-accordion ui-accordion-icons ui-widget ui-helper-reset"); toggleAccordionTitle.addClass("ui-accordion-header ui-state-default ui-corner-top ui-corner-bottom"); toggleAccordionContent.addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(); toggleAccordionTitle.each(function(){ var thisTitle = $(this); thisTitle.on('mouseenter mouseleave', function(){ thisTitle.toggleClass("ui-state-hover"); }); thisTitle.on('click',function(){ thisTitle.toggleClass('ui-accordion-header-active ui-state-active ui-state-default ui-corner-bottom'); thisTitle.next().toggleClass('ui-accordion-content-active').slideToggle(400); }); }); } }); } } })(jQuery); (function($) { 'use strict'; var animationHolder = {}; qodef.modules.animationHolder = animationHolder; animationHolder.qodefInitAnimationHolder = qodefInitAnimationHolder; animationHolder.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitAnimationHolder(); } /* * Init animation holder shortcode */ function qodefInitAnimationHolder(){ var elements = $('.qodef-grow-in, .qodef-fade-in-down, .qodef-element-from-fade, .qodef-element-from-left, .qodef-element-from-right, .qodef-element-from-top, .qodef-element-from-bottom, .qodef-flip-in, .qodef-x-rotate, .qodef-z-rotate, .qodef-y-translate, .qodef-fade-in, .qodef-fade-in-left-x-rotate'), animationClass, animationData, animationDelay; if(elements.length){ elements.each(function(){ var thisElement = $(this); thisElement.appear(function() { animationData = thisElement.data('animation'); animationDelay = parseInt(thisElement.data('animation-delay')); if(typeof animationData !== 'undefined' && animationData !== '') { animationClass = animationData; var newClass = animationClass+'-on'; setTimeout(function(){ thisElement.addClass(newClass); },animationDelay); } },{accX: 0, accY: qodefGlobalVars.vars.qodefElementAppearAmount}); }); } } })(jQuery); (function($) { 'use strict'; var button = {}; qodef.modules.button = button; button.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefButton().init(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorButton(); } /** * Elementor */ function qodefElementorButton(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_button.default', function() { qodefButton().init(); } ); }); } /** * Button object that initializes whole button functionality * @type {Function} */ var qodefButton = function() { //all buttons on the page var buttons = $('.qodef-btn'); /** * Initializes button hover color * @param button current button */ var buttonHoverColor = function(button) { if(typeof button.data('hover-color') !== 'undefined') { var changeButtonColor = function(event) { event.data.button.css('color', event.data.color); }; var originalColor = button.css('color'); var hoverColor = button.data('hover-color'); button.on('mouseenter', { button: button, color: hoverColor }, changeButtonColor); button.on('mouseleave', { button: button, color: originalColor }, changeButtonColor); } }; /** * Initializes button hover background color * @param button current button */ var buttonHoverBgColor = function(button) { if(typeof button.data('hover-bg-color') !== 'undefined') { var changeButtonBg = function(event) { event.data.button.css('background-color', event.data.color); }; var originalBgColor = button.css('background-color'); var hoverBgColor = button.data('hover-bg-color'); button.on('mouseenter', { button: button, color: hoverBgColor }, changeButtonBg); button.on('mouseleave', { button: button, color: originalBgColor }, changeButtonBg); } }; /** * Initializes button border color * @param button */ var buttonHoverBorderColor = function(button) { if(typeof button.data('hover-border-color') !== 'undefined') { var changeBorderColor = function(event) { event.data.button.css('border-color', event.data.color); }; var originalBorderColor = button.css('borderTopColor'); //take one of the four sides var hoverBorderColor = button.data('hover-border-color'); button.on('mouseenter', { button: button, color: hoverBorderColor }, changeBorderColor); button.on('mouseleave', { button: button, color: originalBorderColor }, changeBorderColor); } }; return { init: function() { if(buttons.length) { buttons.each(function() { buttonHoverColor($(this)); buttonHoverBgColor($(this)); buttonHoverBorderColor($(this)); }); } } }; }; button.qodefButton = qodefButton; })(jQuery); (function($) { 'use strict'; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorCallToActionButton(); } function qodefElementorCallToActionButton(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_call_to_action.default', function() { qodef.modules.button.qodefButton().init(); } ); }); } })(jQuery); (function($) { 'use strict'; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorClientsCarousel(); } /** * Elementor */ function qodefElementorClientsCarousel() { $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/qodef_clients_carousel.default', function () { qodef.modules.common.qodefOwlSlider(); }); }); } })(jQuery); (function($) { 'use strict'; var countdown = {}; qodef.modules.countdown = countdown; countdown.qodefInitCountdown = qodefInitCountdown; countdown.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitCountdown(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorInitCountdown(); } /** * Elementor */ function qodefElementorInitCountdown(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_countdown.default', function() { qodefInitCountdown(); } ); }); } /** * Countdown Shortcode */ function qodefInitCountdown() { var countdowns = $('.qodef-countdown'), date = new Date(), currentMonth = date.getMonth(), year, month, day, hour, minute, timezone, monthLabel, dayLabel, hourLabel, minuteLabel, secondLabel; if (countdowns.length) { countdowns.each(function(){ //Find countdown elements by id-s var countdownId = $(this).attr('id'), countdown = $('#'+countdownId), digitFontSize, labelFontSize; //Get data for countdown year = countdown.data('year'); month = countdown.data('month'); day = countdown.data('day'); hour = countdown.data('hour'); minute = countdown.data('minute'); timezone = countdown.data('timezone'); monthLabel = countdown.data('month-label'); dayLabel = countdown.data('day-label'); hourLabel = countdown.data('hour-label'); minuteLabel = countdown.data('minute-label'); secondLabel = countdown.data('second-label'); digitFontSize = countdown.data('digit-size'); labelFontSize = countdown.data('label-size'); if( currentMonth !== month ) { month = month - 1; } //Initialize countdown countdown.countdown({ until: new Date(year, month, day, hour, minute, 44), labels: ['', monthLabel, '', dayLabel, hourLabel, minuteLabel, secondLabel], format: 'ODHMS', timezone: timezone, padZeroes: true, onTick: setCountdownStyle }); function setCountdownStyle() { countdown.find('.countdown-amount').css({ 'font-size' : digitFontSize+'px', 'line-height' : digitFontSize+'px' }); countdown.find('.countdown-period').css({ 'font-size' : labelFontSize+'px' }); } }); } } })(jQuery); (function($) { 'use strict'; var counter = {}; qodef.modules.counter = counter; counter.qodefInitCounter = qodefInitCounter; counter.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitCounter(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorInitCounter(); } /** * Elementor */ function qodefElementorInitCounter(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_counter.default', function() { qodefInitCounter(); } ); }); } /** * Counter Shortcode */ function qodefInitCounter() { var counterHolder = $('.qodef-counter-holder'); if (counterHolder.length) { counterHolder.each(function() { var thisCounterHolder = $(this), thisCounter = thisCounterHolder.find('.qodef-counter'); thisCounterHolder.appear(function() { thisCounterHolder.css('opacity', '1'); //Counter zero type if (thisCounter.hasClass('qodef-zero-counter')) { var max = parseFloat(thisCounter.text()); thisCounter.countTo({ from: 0, to: max, speed: 1500, refreshInterval: 100 }); } else { thisCounter.absoluteCounter({ speed: 2000, fadeInDelay: 1000 }); } },{accX: 0, accY: qodefGlobalVars.vars.qodefElementAppearAmount}); }); } } })(jQuery); (function ($) { 'use strict'; var customFont = {}; qodef.modules.customFont = customFont; customFont.qodefCustomFontResize = qodefCustomFontResize; customFont.qodefCustomFontTypeOut = qodefCustomFontTypeOut; customFont.qodefOnDocumentReady = qodefOnDocumentReady; customFont.qodefOnWindowLoad = qodefOnWindowLoad; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefCustomFontResize(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefCustomFontTypeOut(); qodefElementorInitCustomFont(); } /** * Elementor */ function qodefElementorInitCustomFont(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_custom_font.default', function() { qodefCustomFontTypeOut(); qodefCustomFontResize(); } ); }); } /* ** Custom Font resizing style */ function qodefCustomFontResize() { var holder = $('.qodef-custom-font-holder'); if (holder.length) { holder.each(function () { var thisItem = $(this), itemClass = '', smallLaptopStyle = '', ipadLandscapeStyle = '', ipadPortraitStyle = '', mobileLandscapeStyle = '', style = '', responsiveStyle = ''; if (typeof thisItem.data('item-class') !== 'undefined' && thisItem.data('item-class') !== false) { itemClass = thisItem.data('item-class'); } if (typeof thisItem.data('font-size-1366') !== 'undefined' && thisItem.data('font-size-1366') !== false) { smallLaptopStyle += 'font-size: ' + thisItem.data('font-size-1366') + ' !important;'; } if (typeof thisItem.data('font-size-1024') !== 'undefined' && thisItem.data('font-size-1024') !== false) { ipadLandscapeStyle += 'font-size: ' + thisItem.data('font-size-1024') + ' !important;'; } if (typeof thisItem.data('font-size-768') !== 'undefined' && thisItem.data('font-size-768') !== false) { ipadPortraitStyle += 'font-size: ' + thisItem.data('font-size-768') + ' !important;'; } if (typeof thisItem.data('font-size-680') !== 'undefined' && thisItem.data('font-size-680') !== false) { mobileLandscapeStyle += 'font-size: ' + thisItem.data('font-size-680') + ' !important;'; } if (typeof thisItem.data('line-height-1366') !== 'undefined' && thisItem.data('line-height-1366') !== false) { smallLaptopStyle += 'line-height: ' + thisItem.data('line-height-1366') + ' !important;'; } if (typeof thisItem.data('line-height-1024') !== 'undefined' && thisItem.data('line-height-1024') !== false) { ipadLandscapeStyle += 'line-height: ' + thisItem.data('line-height-1024') + ' !important;'; } if (typeof thisItem.data('line-height-768') !== 'undefined' && thisItem.data('line-height-768') !== false) { ipadPortraitStyle += 'line-height: ' + thisItem.data('line-height-768') + ' !important;'; } if (typeof thisItem.data('line-height-680') !== 'undefined' && thisItem.data('line-height-680') !== false) { mobileLandscapeStyle += 'line-height: ' + thisItem.data('line-height-680') + ' !important;'; } if (smallLaptopStyle.length || ipadLandscapeStyle.length || ipadPortraitStyle.length || mobileLandscapeStyle.length) { if (smallLaptopStyle.length) { responsiveStyle += "@media only screen and (max-width: 1366px) {.qodef-custom-font-holder." + itemClass + " { " + smallLaptopStyle + " } }"; } if (ipadLandscapeStyle.length) { responsiveStyle += "@media only screen and (max-width: 1024px) {.qodef-custom-font-holder." + itemClass + " { " + ipadLandscapeStyle + " } }"; } if (ipadPortraitStyle.length) { responsiveStyle += "@media only screen and (max-width: 768px) {.qodef-custom-font-holder." + itemClass + " { " + ipadPortraitStyle + " } }"; } if (mobileLandscapeStyle.length) { responsiveStyle += "@media only screen and (max-width: 680px) {.qodef-custom-font-holder." + itemClass + " { " + mobileLandscapeStyle + " } }"; } } if (responsiveStyle.length) { style = ''; } if (style.length) { $('head').append(style); } }); } } /* * Init Type out functionality for Custom Font shortcode */ function qodefCustomFontTypeOut() { var qodefTyped = $('.qodef-cf-typed'); if (qodefTyped.length) { qodefTyped.each(function () { //vars var thisTyped = $(this), typedWrap = thisTyped.parent('.qodef-cf-typed-wrap'), customFontHolder = typedWrap.parent('.qodef-custom-font-holder'), $strings = typedWrap.data( 'strings' ); var options = { strings: $strings, typeSpeed: 90, backDelay: 700, loop: true, contentType: 'text', loopCount: false, cursorChar: '_' }; customFontHolder.appear( function () { if ( ! thisTyped.hasClass( 'qodef--initialized' ) ) { var typed = new Typed( thisTyped[0], options ); thisTyped.addClass( 'qodef--initialized' ); } }, { accX: 0, accY: qodefGlobalVars.vars.qodefElementAppearAmount } ); } ); } } })(jQuery); (function ($) { 'use strict'; var dividedHolder = {}; qodef.modules.dividedHolder = dividedHolder; dividedHolder.qodefInitDividedHolder = qodefInitDividedHolder; dividedHolder.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitDividedHolder().init(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorDividedHolder(); } /** * Elementor */ function qodefElementorDividedHolder(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_divided_holder.default', function() { qodefInitDividedHolder().init(); } ); }); } /** * Initializes divided holder */ var qodefInitDividedHolder = function () { var dividedHolder = $('.qodef-divided-holder'); /** * Function that triggers divided holder scroll */ var dividedHolderScroll = function (dHolder) { // divided scroll image var dividedHolderImage = dHolder.find('.qodef-divided-image'); // space between image and window bottom var image_space_after = 0; if (typeof dividedHolderImage.data('image-space') !== 'undefined' && dividedHolderImage.data('image-space') !== false) { image_space_after = dividedHolderImage.data('image-space'); } // divided text holder var dividedHolderInner = dHolder.find('.qodef-divided-inner'); // header height var header = $('.qodef-page-header'), headerHeight = (header.length) ? header.height() : 0; // if image is higher, return function var allowDividedHolderScroll = dividedHolderImage.height() < dividedHolderInner.height(); if (qodef.windowWidth > 1024 && allowDividedHolderScroll) { dividedHolderSize(dHolder); qodef.window.scroll(function () { // divided text holder offset var dividedHolderRepOffset = dividedHolderInner.offset().top; // divided text holder height var dividedHolderRepHeight = dividedHolderInner.height() + parseInt(dividedHolderInner.css('padding-top')) + parseInt(dividedHolderInner.css('padding-bottom')); // this is staring value for scrolling var scrollStartValue = (qodef.scroll + headerHeight) - dividedHolderRepOffset; // this is ending value for scrolling var scrollEndValue = (scrollStartValue + dividedHolderImage.height() + image_space_after) - (dividedHolderRepHeight); // position for holder when it is fixed var scrollStartingPosition = headerHeight; // scrolling holder if (scrollStartValue > 0 && scrollEndValue <= 0) { //add class if (!dividedHolderImage.hasClass('qodef-divided-image-init')) { dividedHolderImage.addClass('qodef-divided-image-init'); } //remove class if (dHolder.hasClass('qodef-divided-image-after')) { dHolder.removeClass('qodef-divided-image-after'); } // scroll image dividedHolderImage.css('top', scrollStartingPosition + 'px'); // after holder } else if (scrollEndValue > 0) { //remove class if (dividedHolderImage.hasClass('qodef-divided-image-init')) { dividedHolderImage.removeClass('qodef-divided-image-init'); } //add class if (!dHolder.hasClass('qodef-divided-image-after')) { dHolder.addClass('qodef-divided-image-after'); } } else { //remove class if (dividedHolderImage.hasClass('qodef-divided-image-init')) { dividedHolderImage.removeClass('qodef-divided-image-init'); } //remove class if (dHolder.hasClass('qodef-divided-image-after')) { dHolder.removeClass('qodef-divided-image-after'); } } }); } else { } }; /** * Function that triggers divided holder size */ var dividedHolderSize = function (dHolder) { // divided scroll image var dividedHolderImage = dHolder.find('.qodef-divided-image'); // divided scroll image holder var dividedHolder = dHolder.find('.qodef-divided-image-holder'); // space between image and window bottom var imageSpaceAfter = 0; if (typeof dividedHolderImage.data('image-space') !== 'undefined' && dividedHolderImage.data('image-space') !== false) { imageSpaceAfter = dividedHolderImage.data('image-space'); } // header height var header = $('.qodef-page-header'), headerHeight = (header.length) ? header.height() : 0; dividedHolderImage.height($(window).height() - headerHeight - imageSpaceAfter); dividedHolderImage.css('width', dividedHolder.css('width')); }; return { init: function () { if (dividedHolder.length) { dividedHolder.each(function () { dividedHolderScroll($(this)); }); } } }; }; })(jQuery); (function($) { 'use strict'; var elementsHolder = {}; qodef.modules.elementsHolder = elementsHolder; elementsHolder.qodefInitElementsHolderResponsiveStyle = qodefInitElementsHolderResponsiveStyle; elementsHolder.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitElementsHolderResponsiveStyle(); } /* ** Elements Holder responsive style */ function qodefInitElementsHolderResponsiveStyle(){ var elementsHolder = $('.qodef-elements-holder'); if(elementsHolder.length){ elementsHolder.each(function() { var thisElementsHolder = $(this), elementsHolderItem = thisElementsHolder.children('.qodef-eh-item'), style = '', responsiveStyle = ''; elementsHolderItem.each(function() { var thisItem = $(this), itemClass = '', largeLaptop = '', smallLaptop = '', ipadLandscape = '', ipadPortrait = '', mobileLandscape = '', mobilePortrait = ''; if (typeof thisItem.data('item-class') !== 'undefined' && thisItem.data('item-class') !== false) { itemClass = thisItem.data('item-class'); } if (typeof thisItem.data('1367-1600') !== 'undefined' && thisItem.data('1367-1600') !== false) { largeLaptop = thisItem.data('1367-1600'); } if (typeof thisItem.data('1025-1366') !== 'undefined' && thisItem.data('1025-1366') !== false) { smallLaptop = thisItem.data('1025-1366'); } if (typeof thisItem.data('769-1024') !== 'undefined' && thisItem.data('769-1024') !== false) { ipadLandscape = thisItem.data('769-1024'); } if (typeof thisItem.data('681-768') !== 'undefined' && thisItem.data('681-768') !== false) { ipadPortrait = thisItem.data('681-768'); } if (typeof thisItem.data('680') !== 'undefined' && thisItem.data('680') !== false) { mobileLandscape = thisItem.data('680'); } if(largeLaptop.length || smallLaptop.length || ipadLandscape.length || ipadPortrait.length || mobileLandscape.length || mobilePortrait.length) { if(largeLaptop.length) { responsiveStyle += "@media only screen and (min-width: 1367px) and (max-width: 1600px) {.qodef-eh-item-content."+itemClass+" { padding: "+largeLaptop+" !important; } }"; } if(smallLaptop.length) { responsiveStyle += "@media only screen and (min-width: 1025px) and (max-width: 1366px) {.qodef-eh-item-content."+itemClass+" { padding: "+smallLaptop+" !important; } }"; } if(ipadLandscape.length) { responsiveStyle += "@media only screen and (min-width: 769px) and (max-width: 1024px) {.qodef-eh-item-content."+itemClass+" { padding: "+ipadLandscape+" !important; } }"; } if(ipadPortrait.length) { responsiveStyle += "@media only screen and (min-width: 681px) and (max-width: 768px) {.qodef-eh-item-content."+itemClass+" { padding: "+ipadPortrait+" !important; } }"; } if(mobileLandscape.length) { responsiveStyle += "@media only screen and (max-width: 680px) {.qodef-eh-item-content."+itemClass+" { padding: "+mobileLandscape+" !important; } }"; } } if (typeof qodef.modules.common.qodefOwlSlider === "function") { // if owl function exist var owl = thisItem.find('.qodef-owl-slider'); if (owl.length) { // if owl is in elements holder setTimeout(function () { owl.trigger('refresh.owl.carousel'); // reinit owl }, 100); } } }); if(responsiveStyle.length) { style = ''; } if(style.length) { $('head').append(style); } }); } } })(jQuery); (function($) { 'use strict'; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorFrameSilider(); } /** * Elementor */ function qodefElementorFrameSilider() { $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/qodef_frame_slider.default', function () { qodef.modules.common.qodefOwlSlider(); }); }); } })(jQuery); (function($) { 'use strict'; var googleMap = {}; qodef.modules.googleMap = googleMap; googleMap.qodefShowGoogleMap = qodefShowGoogleMap; googleMap.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefShowGoogleMap(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorShowGoogleMap(); } /** * Elementor */ function qodefElementorShowGoogleMap(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_google_map.default', function() { qodefShowGoogleMap(); } ); }); } /* ** Show Google Map */ function qodefShowGoogleMap(){ var googleMap = $('.qodef-google-map'); if(googleMap.length){ googleMap.each(function(){ var element = $(this); var snazzyMapStyle = false; var snazzyMapCode = ''; if(typeof element.data('snazzy-map-style') !== 'undefined' && element.data('snazzy-map-style') === 'yes') { snazzyMapStyle = true; var snazzyMapHolder = element.parent().find('.qodef-snazzy-map'), snazzyMapCodes = snazzyMapHolder.val(); if( snazzyMapHolder.length && snazzyMapCodes.length ) { snazzyMapCode = JSON.parse( snazzyMapCodes.replace(/`{`/g, '[').replace(/`}`/g, ']').replace(/``/g, '"').replace(/`/g, '') ); } } var customMapStyle; if(typeof element.data('custom-map-style') !== 'undefined') { customMapStyle = element.data('custom-map-style'); } var colorOverlay; if(typeof element.data('color-overlay') !== 'undefined' && element.data('color-overlay') !== false) { colorOverlay = element.data('color-overlay'); } var saturation; if(typeof element.data('saturation') !== 'undefined' && element.data('saturation') !== false) { saturation = element.data('saturation'); } var lightness; if(typeof element.data('lightness') !== 'undefined' && element.data('lightness') !== false) { lightness = element.data('lightness'); } var zoom; if(typeof element.data('zoom') !== 'undefined' && element.data('zoom') !== false) { zoom = element.data('zoom'); } var pin; if(typeof element.data('pin') !== 'undefined' && element.data('pin') !== false) { pin = element.data('pin'); } var mapHeight; if(typeof element.data('height') !== 'undefined' && element.data('height') !== false) { mapHeight = element.data('height'); } var uniqueId; if(typeof element.data('unique-id') !== 'undefined' && element.data('unique-id') !== false) { uniqueId = element.data('unique-id'); } var scrollWheel; if(typeof element.data('scroll-wheel') !== 'undefined') { scrollWheel = element.data('scroll-wheel'); } var addresses; if(typeof element.data('addresses') !== 'undefined' && element.data('addresses') !== false) { addresses = element.data('addresses'); } var map = "map_"+ uniqueId; var geocoder = "geocoder_"+ uniqueId; var holderId = "qodef-map-"+ uniqueId; qodefInitializeGoogleMap(snazzyMapStyle, snazzyMapCode, customMapStyle, colorOverlay, saturation, lightness, scrollWheel, zoom, holderId, mapHeight, pin, map, geocoder, addresses); }); } } /* ** Init Google Map */ function qodefInitializeGoogleMap(snazzyMapStyle, snazzyMapCode, customMapStyle, color, saturation, lightness, wheel, zoom, holderId, height, pin, map, geocoder, data){ if(typeof google !== 'object') { return; } var mapStyles = []; if(snazzyMapStyle && snazzyMapCode.length) { mapStyles = snazzyMapCode; } else { mapStyles = [ { stylers: [ {hue: color }, {saturation: saturation}, {lightness: lightness}, {gamma: 1} ] } ]; } var googleMapStyleId; if(snazzyMapStyle || customMapStyle === 'yes'){ googleMapStyleId = 'qodef-style'; } else { googleMapStyleId = google.maps.MapTypeId.ROADMAP; } wheel = wheel === 'yes'; var qoogleMapType = new google.maps.StyledMapType(mapStyles, {name: "Google Map"}); geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(-34.397, 150.644); if (!isNaN(height)){ height = height + 'px'; } var myOptions = { zoom: zoom, scrollwheel: wheel, center: latlng, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.RIGHT_CENTER }, scaleControl: false, scaleControlOptions: { position: google.maps.ControlPosition.LEFT_CENTER }, streetViewControl: false, streetViewControlOptions: { position: google.maps.ControlPosition.LEFT_CENTER }, panControl: false, panControlOptions: { position: google.maps.ControlPosition.LEFT_CENTER }, mapTypeControl: false, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'qodef-style'], style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.LEFT_CENTER }, mapTypeId: googleMapStyleId }; map = new google.maps.Map(document.getElementById(holderId), myOptions); map.mapTypes.set('qodef-style', qoogleMapType); var index; for (index = 0; index < data.length; ++index) { qodefInitializeGoogleAddress(data[index], pin, map, geocoder); } var holderElement = document.getElementById(holderId); holderElement.style.height = height; } /* ** Init Google Map Addresses */ function qodefInitializeGoogleAddress(data, pin, map, geocoder){ if (data === '') { return; } var contentString = '
'+ '
'+ '
'+ '
'+ '
'+data+'
'+ '
'+ '
'; var infowindow = new google.maps.InfoWindow({ content: contentString }); geocoder.geocode( { 'address': data}, function(results, status) { if (status === google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location, icon: pin, title: data.store_title }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); google.maps.event.addDomListener(window, 'resize', function() { map.setCenter(results[0].geometry.location); }); } }); } })(jQuery); (function($) { 'use strict'; var icon = {}; qodef.modules.icon = icon; icon.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefIcon().init(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorIcon(); } /** * Elementor */ function qodefElementorIcon(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_icon.default', function() { qodefIcon().init(); } ); }); } /** * Object that represents icon shortcode * @returns {{init: Function}} function that initializes icon's functionality */ var qodefIcon = function() { var icons = $('.qodef-icon-shortcode'); /** * Function that triggers icon animation and icon animation delay */ var iconAnimation = function(icon) { if(icon.hasClass('qodef-icon-animation')) { icon.appear(function() { icon.parent('.qodef-icon-animation-holder').addClass('qodef-icon-animation-show'); }, {accX: 0, accY: qodefGlobalVars.vars.qodefElementAppearAmount}); } }; /** * Function that triggers icon hover color functionality */ var iconHoverColor = function(icon) { if(typeof icon.data('hover-color') !== 'undefined') { var changeIconColor = function(event) { event.data.icon.css('color', event.data.color); }; var iconElement = icon.find('.qodef-icon-element'); var hoverColor = icon.data('hover-color'); var originalColor = iconElement.css('color'); if(hoverColor !== '') { icon.on('mouseenter', {icon: iconElement, color: hoverColor}, changeIconColor); icon.on('mouseleave', {icon: iconElement, color: originalColor}, changeIconColor); } } }; /** * Function that triggers icon holder background color hover functionality */ var iconHolderBackgroundHover = function(icon) { if(typeof icon.data('hover-background-color') !== 'undefined') { var changeIconBgColor = function(event) { event.data.icon.css('background-color', event.data.color); }; var hoverBackgroundColor = icon.data('hover-background-color'); var originalBackgroundColor = icon.css('background-color'); if(hoverBackgroundColor !== '') { icon.on('mouseenter', {icon: icon, color: hoverBackgroundColor}, changeIconBgColor); icon.on('mouseleave', {icon: icon, color: originalBackgroundColor}, changeIconBgColor); } } }; /** * Function that initializes icon holder border hover functionality */ var iconHolderBorderHover = function(icon) { if(typeof icon.data('hover-border-color') !== 'undefined') { var changeIconBorder = function(event) { event.data.icon.css('border-color', event.data.color); }; var hoverBorderColor = icon.data('hover-border-color'); var originalBorderColor = icon.css('borderTopColor'); if(hoverBorderColor !== '') { icon.on('mouseenter', {icon: icon, color: hoverBorderColor}, changeIconBorder); icon.on('mouseleave', {icon: icon, color: originalBorderColor}, changeIconBorder); } } }; return { init: function() { if(icons.length) { icons.each(function() { iconAnimation($(this)); iconHoverColor($(this)); iconHolderBackgroundHover($(this)); iconHolderBorderHover($(this)); }); } } }; }; icon.qodefIcon = qodefIcon; })(jQuery); (function($) { 'use strict'; var iconListItem = {}; qodef.modules.iconListItem = iconListItem; iconListItem.qodefInitIconList = qodefInitIconList; iconListItem.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitIconList().init(); } /** * Button object that initializes icon list with animation * @type {Function} */ var qodefInitIconList = function() { var iconList = $('.qodef-animate-list'); /** * Initializes icon list animation * @param list current slider */ var iconListInit = function(list) { setTimeout(function(){ list.appear(function(){ list.addClass('qodef-appeared'); },{accX: 0, accY: qodefGlobalVars.vars.qodefElementAppearAmount}); },30); }; return { init: function() { if(iconList.length) { iconList.each(function() { iconListInit($(this)); }); } } }; }; })(jQuery); (function($) { 'use strict'; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorIconWithText(); } /** * Elementor */ function qodefElementorIconWithText(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_icon_with_text.default', function() { qodef.modules.icon.qodefIcon().init(); } ); }); } })(jQuery); (function($) { 'use strict'; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorImageGallery(); } /** * Elementor */ function qodefElementorImageGallery() { $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/qodef_image_gallery.default', function () { qodef.modules.common.qodefInitGridMasonryListLayout(); qodef.modules.common.qodefOwlSlider(); }); }); } })(jQuery); (function($) { 'use strict'; var pieChart = {}; qodef.modules.pieChart = pieChart; pieChart.qodefInitPieChart = qodefInitPieChart; pieChart.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitPieChart(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorInitPieChart(); } /** * Elementor */ function qodefElementorInitPieChart(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_pie_chart.default', function() { qodefInitPieChart(); } ); }); } /** * Init Pie Chart shortcode */ function qodefInitPieChart() { var pieChartHolder = $('.qodef-pie-chart-holder'); if (pieChartHolder.length) { pieChartHolder.each(function () { var thisPieChartHolder = $(this), pieChart = thisPieChartHolder.children('.qodef-pc-percentage'), barColor = '#fac400', trackColor = '#f4f4f4', lineWidth = 7, size = 198; if(typeof pieChart.data('size') !== 'undefined' && pieChart.data('size') !== '') { size = pieChart.data('size'); } if(typeof pieChart.data('bar-color') !== 'undefined' && pieChart.data('bar-color') !== '') { barColor = pieChart.data('bar-color'); } if(typeof pieChart.data('track-color') !== 'undefined' && pieChart.data('track-color') !== '') { trackColor = pieChart.data('track-color'); } pieChart.appear(function() { initToCounterPieChart(pieChart); thisPieChartHolder.css('opacity', '1'); pieChart.easyPieChart({ barColor: barColor, trackColor: trackColor, scaleColor: false, lineCap: 'butt', lineWidth: lineWidth, animate: 1500, size: size }); },{accX: 0, accY: qodefGlobalVars.vars.qodefElementAppearAmount}); }); } } /* ** Counter for pie chart number from zero to defined number */ function initToCounterPieChart(pieChart){ var counter = pieChart.find('.qodef-pc-percent'), max = parseFloat(counter.text()); counter.countTo({ from: 0, to: max, speed: 1500, refreshInterval: 50 }); } })(jQuery); (function($) { 'use strict'; var process = {}; qodef.modules.process = process; process.qodefInitProcess = qodefInitProcess; process.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorInitProcess(); } /** * Elementor */ function qodefElementorInitProcess(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_process.default', function() { qodefInitProcess(); } ); }); } /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitProcess(); } /** * Inti process shortcode on appear */ function qodefInitProcess() { var holder = $('.qodef-process-holder'); if(holder.length) { holder.each(function(){ var thisHolder = $(this); thisHolder.appear(function(){ thisHolder.addClass('qodef-process-appeared'); },{accX: 0, accY: qodefGlobalVars.vars.qodefElementAppearAmount}); }); } } })(jQuery); (function($) { 'use strict'; var progressBar = {}; qodef.modules.progressBar = progressBar; progressBar.qodefInitProgressBars = qodefInitProgressBars; progressBar.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitProgressBars(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorInitProgressBars(); } /** * Elementor */ function qodefElementorInitProgressBars(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_progress_bar.default', function() { qodefInitProgressBars(); } ); }); } /* ** Horizontal progress bars shortcode */ function qodefInitProgressBars() { var progressBar = $('.qodef-progress-bar'); if (progressBar.length) { progressBar.each(function () { var thisBar = $(this), thisBarContent = thisBar.find('.qodef-pb-content'), progressBar = thisBar.find('.qodef-pb-percent'), percentage = thisBarContent.data('percentage'); thisBar.appear(function () { qodefInitToCounterProgressBar(progressBar, percentage); thisBarContent.css('width', '0%').animate({'width': percentage + '%'}, 2000); if (thisBar.hasClass('qodef-pb-percent-floating')) { progressBar.css('left', '0%').animate({'left': percentage + '%'}, 2000); } }); }); } } /* ** Counter for horizontal progress bars percent from zero to defined percent */ function qodefInitToCounterProgressBar(progressBar, percentageValue){ var percentage = parseFloat(percentageValue); if(progressBar.length) { progressBar.each(function() { var thisPercent = $(this); thisPercent.css('opacity', '1'); thisPercent.countTo({ from: 0, to: percentage, speed: 2000, refreshInterval: 50 }); }); } } })(jQuery); (function($) { 'use strict'; var tabs = {}; qodef.modules.tabs = tabs; tabs.qodefInitTabs = qodefInitTabs; tabs.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitTabs(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorInitTabs(); } /** * Elementor */ function qodefElementorInitTabs(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_tabs.default', function() { qodefInitTabs(); } ); }); } /* ** Init tabs shortcode */ function qodefInitTabs(){ var tabs = $('.qodef-tabs'); if(tabs.length){ tabs.each(function(){ var thisTabs = $(this); thisTabs.children('.qodef-tab-container').each(function(index){ index = index + 1; var that = $(this), link = that.attr('id'), navItem = that.parent().find('.qodef-tabs-nav li:nth-child('+index+') a'), navLink = navItem.attr('href'); link = '#'+link; if(link.indexOf(navLink) > -1) { navItem.attr('href',link); } }); thisTabs.tabs(); $('.qodef-tabs a.qodef-external-link').off('click'); }); } } })(jQuery); (function($) { 'use strict'; var tripleFrameImageHighlight = {}; qodef.modules.tripleFrameImageHighlight = tripleFrameImageHighlight; tripleFrameImageHighlight.qodefOnDocumentReady = qodefOnDocumentReady; tripleFrameImageHighlight.qodefTripleFrameImageHighlight = qodefTripleFrameImageHighlight; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefTripleFrameImageHighlight(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorTripleFrameImageHighlight(); } /** * Elementor */ function qodefElementorTripleFrameImageHighlight(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_triple_frame_image_highlight.default', function() { qodefTripleFrameImageHighlight(); } ); }); } /** * Triple Frame Image Highlight */ function qodefTripleFrameImageHighlight() { var tfihShortcodes = $('.qodef-triple-frame-image-highlight'); if (tfihShortcodes.length) { var initClasses = function(c, l, r) { c.addClass('qodef-c'); l.addClass('qodef-l'); r.addClass('qodef-r'); }; var resetIndexes = function(c, l, r) { c.css('z-index', 30); l.css('z-index', 20); r.css('z-index', 20); }; var setTriggerSize = function(holder,inner) { holder.find('div[class*="trigger"]').width(Math.round(inner.position().left)); }; var setPositioning = function(holder, inner) { var left = holder.find('.qodef-l'), right = holder.find('.qodef-r'), centered = holder.find('.qodef-c'); var xOffset = inner.position().left; left.css({ 'visibility': 'visible', 'transform-origin': '0% 50%', 'transform': 'matrix(.68,0,0,.68,-'+xOffset+',0)' }); right.css({ 'visibility': 'visible', 'transform-origin': '100% 50%', 'transform': 'matrix(.68,0,0,.68,'+xOffset+',0)' }); centered.css({ 'transform': 'matrix(1, 0, 0, 1, 0, 0)' }); }; var rotateAnimation = function(holder, inner, direction) { holder.data('animating', true); var toFront, toBack, toPrep; if (direction == 'left') { toFront = holder.find('.qodef-l'), toBack = holder.find('.qodef-c'), toPrep = holder.find('.qodef-r'); toPrep.removeClass('qodef-r').addClass('qodef-l'); toBack.removeClass('qodef-c').addClass('qodef-r'); toFront.removeClass('qodef-l').addClass('qodef-c'); } else { toFront = holder.find('.qodef-r'), toBack = holder.find('.qodef-c'), toPrep = holder.find('.qodef-l'); toPrep.removeClass('qodef-l').addClass('qodef-r'); toBack.removeClass('qodef-c').addClass('qodef-l'); toFront.removeClass('qodef-r').addClass('qodef-c'); } toPrep.css({ 'z-index': 15, 'transform-origin': '0% 50%', 'transition': 'transform .5s, transform-origin .5s' }); toBack.css({ 'z-index': 25, 'transform-origin': '100% 50%', 'transition': 'transform 1s cubic-bezier(0.19, 1, 0.22, 1) .2s, ' + 'transform-origin 1s cubic-bezier(0.19, 1, 0.22, 1) .2s' }); toFront.css({ 'z-index': 20, 'transform-origin': '50% 50%', 'transition': 'transform .75s cubic-bezier(0.86, 0, 0.07, 1) .5s, ' + 'transform-origin .75s cubic-bezier(0.86, 0, 0.07, 1) .5s' }); holder.find('a').css('pointer-events', 'none'); setTimeout(function() { holder.find('a').css('pointer-events', 'auto'); resetIndexes(toFront, toPrep, toBack); }, 500); toFront.one(qodef.transitionEnd, function() { holder.data('animating', false); clearInterval(holder.data('autoplay')); holder.data('autoplay', setInterval(function() { navigate(holder, inner); }, 3000)); }); }; var navigate = function(holder, inner, event) { var direction, linkActive = false; if (typeof event !== 'undefined') { switch(event.target.className) { case 'qodef-tfih-left-trigger': direction = 'left'; break; case 'qodef-tfih-right-trigger': direction = 'right'; break; case 'qodef-tfih-link': linkActive = true; holder.data('animating', false); clearInterval(holder.data('autoplay')); break; } } else { direction = 'right'; } if (!linkActive) { rotateAnimation(holder, inner, direction); setPositioning(holder, inner); } }; tfihShortcodes.each(function() { var holder = $(this), inner = holder.find('.qodef-tfih-inner'), centeredH = holder.find('.qodef-tfih-centered-image-holder'), leftH = holder.find('.qodef-tfih-left-image-holder'), rightH = holder.find('.qodef-tfih-right-image-holder'); //state holder .data('animating', false) .data('autoplay', false); initClasses(centeredH, leftH, rightH); resetIndexes(centeredH, leftH, rightH); setTriggerSize(holder, inner); holder.waitForImages(function() { holder.appear(function() { holder.css('visibility', 'visible'); setPositioning(holder, inner); holder.data('autoplay', setInterval(function() { navigate(holder, inner); }, 3000)); }, {accX: 0, accY: qodefGlobalVars.vars.qodefElementAppearAmount}); }); holder.on('click', function(event) { if (!holder.data('animating')) { clearInterval(holder.data('autoplay')); navigate(holder, inner, event); } }); if (holder.parent().hasClass('qodef-tfih-with-nav')) { var left = holder.parent().find('.qodef-tfih-left'), right = holder.parent().find('.qodef-tfih-right'); left.on('click', function() { if (!holder.data('animating')) { rotateAnimation(holder, inner, 'left'); setPositioning(holder, inner); } }); right.on('click', function() { if (!holder.data('animating')) { rotateAnimation(holder, inner, 'right'); setPositioning(holder, inner); } }); } $(window).on('resize', function() { setPositioning(holder, inner); setTriggerSize(holder, inner); inner.find('>div').css('transition', 'none'); }); }); } } })(jQuery); (function($) { 'use strict'; var verticalShowcase = {}; qodef.modules.verticalShowcase = verticalShowcase; verticalShowcase.qodefInitVerticalShowcase = qodefInitVerticalShowcase; verticalShowcase.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitVerticalShowcase(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorVerticalShowcase(); } /** * Elementor */ function qodefElementorVerticalShowcase(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_vertical_showcase.default', function() { qodefInitVerticalShowcase(); } ); }); } /** * Init vertical showcase shortcode */ function qodefInitVerticalShowcase() { var verticalShowcase = $('.qodef-vertical-showcase'); if (verticalShowcase.length) { verticalShowcase.each(function () { var holder = $(this), pasepartuWrapper = $('.qodef-wrapper'), item = holder.find('.qodef-vs-item'), stripe = holder.find('.qodef-vs-stripe'), frameImage = holder.find('.qodef-vs-inner-frame'), frameInfo = holder.find('.qodef-vs-frame-info'), frameSlideText = frameInfo.find('.qodef-vs-frame-slide-text'), frameSlideNumber= frameInfo.find('.qodef-vs-frame-slide-number'), frameTitle = frameInfo.find('.qodef-vs-frame-title'), frameSubtitle = frameInfo.find('.qodef-vs-frame-subtitle'), swiperInstance = holder.find('.swiper-container'), swiperSlide = swiperInstance.find('.swiper-slide'), lastSlide = swiperSlide.length, secondLastSlide = lastSlide - 1, indexCounter = 1, currentActiveIndex, currentActiveSlideText, currentActiveTitle, currentActiveSubtitle, onLastSlide = false, onSecondLastSlide = false, currentActiveImageSrc; var swiperSlider = new Swiper (swiperInstance, { loop: false, direction: 'vertical', slidesPerView: 1, // mousewheel: { // invert: false, // eventsTarged: holder // }, touchStartForcePreventDefault: true, speed: 1000, pagination: { el: '.swiper-pagination', clickable: true, renderBullet: function (index, className) { return '
'; }, }, init: false }); var scrollStart = false; swiperInstance.on('wheel', function(e) { e.preventDefault(); if (!scrollStart) { scrollStart = true; var delta = e.originalEvent.deltaY; if (delta > 0) { swiperInstance[0].swiper.slideNext(); } else { swiperInstance[0].swiper.slidePrev(); } setTimeout(function() { scrollStart = false; }, 1000); } }); // Recalculate slider height if paspartu enabled if (qodef.body.hasClass('qodef-paspartu-enabled')) { var paspartuPadding = parseInt(pasepartuWrapper.css('padding')); holder.css("height", "calc(100vh - " + paspartuPadding*2 + "px)"); swiperInstance.css("height", "calc(100vh - " + paspartuPadding*2 + "px)"); } if (qodef.windowWidth < 1025) { var headerHeight = $('.qodef-mobile-header-inner').css('height'); holder.css("height", "calc(100vh - " + headerHeight + ")"); swiperInstance.css("height", "calc(100vh - " + headerHeight + ")"); pasepartuWrapper.css('padding', 0); } holder.waitForImages(function() { swiperSlider.init(); var rotateDegrees = 0; var swiperPagination = holder.find('.swiper-pagination'); var swiperPaginationBullet = swiperPagination.find('.swiper-pagination-bullet'); swiperSlide.each(function() { $(this).attr('slide-index', indexCounter); $(this).data('slide-index', indexCounter); indexCounter++; }); function enableAdjacentPagination() { var activeBullet = swiperPagination.find('.swiper-pagination-bullet-active'); swiperPaginationBullet.removeClass('bullet-clickable'); activeBullet.addClass('bullet-clickable'); activeBullet.next().addClass('bullet-clickable'); activeBullet.prev().addClass('bullet-clickable'); } // function find active item function findActiveItem() { currentActiveIndex = swiperInstance.find('.swiper-slide-active').data('slide-index'); currentActiveSlideText = swiperInstance.find('.swiper-slide-active .qodef-vs-item-slide-text').text(); currentActiveTitle = swiperInstance.find('.swiper-slide-active .qodef-vs-item-title').text(); currentActiveSubtitle = swiperInstance.find('.swiper-slide-active .qodef-vs-item-subtitle').text(); currentActiveImageSrc = swiperInstance.find('.swiper-slide-active>.qodef-vs-item>img').attr('src'); } function updateFrameInfo() { frameImage.css('background-image', "url(" + currentActiveImageSrc + ")"); frameSlideText.text(currentActiveSlideText); frameSlideNumber.text('0' + currentActiveIndex); frameTitle.text(currentActiveTitle); frameSubtitle.text(currentActiveSubtitle); } function readyAnimation() { setTimeout(function() { frameInfo.removeClass("qodef-vs-frame-animate-out"); }, 700); holder.removeClass("qodef-vs-ready-animation"); } // Initialize frame info when slider is ready findActiveItem(); updateFrameInfo(); enableAdjacentPagination(); setTimeout(function() { readyAnimation(); }, 500); swiperSlider.on('slideNextTransitionStart', function() { if (!onLastSlide) { rotateDegrees+=180; stripe.css('transform', 'rotate('+ rotateDegrees +'deg)'); } }); swiperSlider.on('slidePrevTransitionStart', function() { if (currentActiveIndex !== secondLastSlide) { rotateDegrees-=180; stripe.css('transform', 'rotate('+ rotateDegrees +'deg)'); } }); swiperSlider.on('slideChangeTransitionStart', function() { findActiveItem(); enableAdjacentPagination(); if (currentActiveIndex == lastSlide) { onLastSlide = true; holder.addClass("qodef-vs-last-slide"); } else { onLastSlide = false; holder.removeClass("qodef-vs-last-slide"); } if (!onLastSlide) { frameInfo.addClass("qodef-vs-frame-animate-out"); setTimeout(function() { // if even slide move the frame info down if (currentActiveIndex % 2 == 0) { frameInfo.addClass("qodef-vs-frame-even"); } else { frameInfo.removeClass("qodef-vs-frame-even"); } updateFrameInfo(); frameInfo.removeClass("qodef-vs-frame-animate-out"); }, 800); } }); }); }); } } })(jQuery); (function($) { 'use strict'; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorVideoButton(); } /** * Elementor */ function qodefElementorVideoButton(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_video_button.default', function() { qodef.modules.common.qodefPrettyPhoto(); } ); }); } })(jQuery); (function($) { 'use strict'; var masonryGalleryList = {}; qodef.modules.masonryGalleryList = masonryGalleryList; masonryGalleryList.qodefInitMasonryGallery = qodefInitMasonryGallery; masonryGalleryList.qodefOnDocumentReady = qodefOnDocumentReady; $(document).ready(qodefOnDocumentReady); $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(document).ready() should be in this function */ function qodefOnDocumentReady() { qodefInitMasonryGallery().init(); } /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorMasonryGallery(); } /** * Elementor */ function qodefElementorMasonryGallery(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_masonry_gallery.default', function() { qodefInitMasonryGallery().init(); } ); }); } /** * Masonry gallery, init masonry and resize pictures in grid */ function qodefInitMasonryGallery() { var holder = $('.qodef-masonry-gallery-holder'); var initMasonryGallery = function (thisHolder, size) { thisHolder.waitForImages(function () { var masonry = thisHolder.children(); masonry.isotope({ layoutMode: 'packery', itemSelector: '.qodef-mg-item', percentPosition: true, packery: { gutter: '.qodef-mg-grid-gutter', columnWidth: '.qodef-mg-grid-sizer' } }); qodef.modules.common.setFixedImageProportionSize(thisHolder, thisHolder.find('.qodef-mg-item'), size, true); setTimeout(function () { qodef.modules.common.qodefInitParallax(); }, 600); masonry.isotope( 'layout').css('opacity', '1'); }); }; var reInitMasonryGallery = function (thisHolder, size) { qodef.modules.common.setFixedImageProportionSize(thisHolder, thisHolder.find('.qodef-mg-item'), size, true); thisHolder.children().isotope('reloadItems'); }; return { init: function () { if (holder.length) { holder.each(function () { var thisHolder = $(this), size = thisHolder.find('.qodef-mg-grid-sizer').outerWidth(); initMasonryGallery(thisHolder, size); $(window).resize(function () { reInitMasonryGallery(thisHolder, size); }); }); } } }; } })(jQuery); (function($) { 'use strict'; var portfolioList = {}; qodef.modules.portfolioList = portfolioList; portfolioList.qodefOnWindowLoad = qodefOnWindowLoad; portfolioList.qodefOnWindowScroll = qodefOnWindowScroll; $(window).on('load', qodefOnWindowLoad); $(window).scroll(qodefOnWindowScroll); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefInitPortfolioFilter(); qodefInitPortfolioListAnimation(); qodefInitPortfolioPagination().init(); qodefElementorInitPortfolioList(); } /* All functions to be called on $(window).scroll() should be in this function */ function qodefOnWindowScroll() { qodefInitPortfolioPagination().scroll(); } /** * Elementor */ function qodefElementorInitPortfolioList(){ $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction( 'frontend/element_ready/qodef_portfolio_list.default', function() { qodefInitPortfolioFilter(); qodefInitPortfolioListAnimation(); qodefInitPortfolioPagination().init(); qodef.modules.common.qodefInitGridMasonryListLayout(); } ); }); } /** * Initializes portfolio list article animation */ function qodefInitPortfolioListAnimation(){ var portList = $('.qodef-portfolio-list-holder.qodef-pl-has-animation'); if(portList.length){ portList.each(function(){ var thisPortList = $(this).children('.qodef-pl-inner'); thisPortList.children('article').each(function(l) { var thisArticle = $(this); thisArticle.appear(function() { thisArticle.addClass('qodef-item-show'); setTimeout(function(){ thisArticle.addClass('qodef-item-shown'); }, 1000); },{accX: 0, accY: 0}); }); }); } } /** * Initializes portfolio masonry filter */ function qodefInitPortfolioFilter(){ var filterHolder = $('.qodef-portfolio-list-holder .qodef-pl-filter-holder'); if(filterHolder.length){ filterHolder.each(function(){ var thisFilterHolder = $(this), thisPortListHolder = thisFilterHolder.closest('.qodef-portfolio-list-holder'), thisPortListInner = thisPortListHolder.find('.qodef-pl-inner'), portListHasLoadMore = thisPortListHolder.hasClass('qodef-pl-pag-load-more') ? true : false; thisFilterHolder.find('.qodef-pl-filter:first').addClass('qodef-pl-current'); if(thisPortListHolder.hasClass('qodef-pl-gallery')) { thisPortListInner.isotope(); } thisFilterHolder.find('.qodef-pl-filter').on('click', function(){ var thisFilter = $(this), filterValue = thisFilter.attr('data-filter'), filterClassName = filterValue.length ? filterValue.substring(1) : '', portListHasArticles = thisPortListInner.children().hasClass(filterClassName) ? true : false; thisFilter.parent().children('.qodef-pl-filter').removeClass('qodef-pl-current'); thisFilter.addClass('qodef-pl-current'); if(portListHasLoadMore && !portListHasArticles && filterValue.length) { qodefInitLoadMoreItemsPortfolioFilter(thisPortListHolder, filterValue, filterClassName); } else { filterValue = filterValue.length === 0 ? '*' : filterValue; thisFilterHolder.parent().children('.qodef-pl-inner').isotope({ filter: filterValue }); qodef.modules.common.qodefInitParallax(); } }); }); } } /** * Initializes load more items if portfolio masonry filter item is empty */ function qodefInitLoadMoreItemsPortfolioFilter($portfolioList, $filterValue, $filterClassName) { var thisPortList = $portfolioList, thisPortListInner = thisPortList.find('.qodef-pl-inner'), filterValue = $filterValue, filterClassName = $filterClassName, maxNumPages = 0; if (typeof thisPortList.data('max-num-pages') !== 'undefined' && thisPortList.data('max-num-pages') !== false) { maxNumPages = thisPortList.data('max-num-pages'); } var loadMoreDatta = qodef.modules.common.getLoadMoreData(thisPortList), nextPage = loadMoreDatta.nextPage, ajaxData = qodef.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'brunn_core_portfolio_ajax_load_more'), loadingItem = thisPortList.find('.qodef-pl-loading'); if(nextPage <= maxNumPages) { loadingItem.addClass('qodef-showing qodef-filter-trigger'); thisPortListInner.css('opacity', '0'); $.ajax({ type: 'POST', data: ajaxData, url: qodefGlobalVars.vars.qodefAjaxUrl, success: function (data) { nextPage++; thisPortList.data('next-page', nextPage); var response = $.parseJSON(data), responseHtml = response.html; thisPortList.waitForImages(function () { thisPortListInner.append(responseHtml).isotope('reloadItems').isotope({sortBy: 'original-order'}); var portListHasArticles = !!thisPortListInner.children().hasClass(filterClassName); if(portListHasArticles) { setTimeout(function() { qodef.modules.common.setFixedImageProportionSize(thisPortList, thisPortListInner.find('article'), thisPortListInner.find('.qodef-masonry-grid-sizer').width(), true); thisPortListInner.isotope('layout').isotope({filter: filterValue}); loadingItem.removeClass('qodef-showing qodef-filter-trigger'); setTimeout(function() { thisPortListInner.css('opacity', '1'); qodefInitPortfolioListAnimation(); qodef.modules.common.qodefInitParallax(); }, 150); }, 400); } else { loadingItem.removeClass('qodef-showing qodef-filter-trigger'); qodefInitLoadMoreItemsPortfolioFilter(thisPortList, filterValue, filterClassName); } }); } }); } } /** * Initializes portfolio pagination functions */ function qodefInitPortfolioPagination(){ var portList = $('.qodef-portfolio-list-holder'); var initStandardPagination = function(thisPortList) { var standardLink = thisPortList.find('.qodef-pl-standard-pagination li'); if(standardLink.length) { standardLink.each(function(){ var thisLink = $(this).children('a'), pagedLink = 1; thisLink.on('click', function(e) { e.preventDefault(); e.stopPropagation(); if (typeof thisLink.data('paged') !== 'undefined' && thisLink.data('paged') !== false) { pagedLink = thisLink.data('paged'); } initMainPagFunctionality(thisPortList, pagedLink); }); }); } }; var initLoadMorePagination = function(thisPortList) { var loadMoreButton = thisPortList.find('.qodef-pl-load-more a'); loadMoreButton.on('click', function(e) { e.preventDefault(); e.stopPropagation(); initMainPagFunctionality(thisPortList); }); }; var initInifiteScrollPagination = function(thisPortList) { var portListHeight = thisPortList.outerHeight(), portListTopOffest = thisPortList.offset().top, portListPosition = portListHeight + portListTopOffest - qodefGlobalVars.vars.qodefAddForAdminBar; if(!thisPortList.hasClass('qodef-pl-infinite-scroll-started') && qodef.scroll + qodef.windowHeight > portListPosition) { initMainPagFunctionality(thisPortList); } }; var initMainPagFunctionality = function(thisPortList, pagedLink) { var thisPortListInner = thisPortList.find('.qodef-pl-inner'), nextPage, maxNumPages; if (typeof thisPortList.data('max-num-pages') !== 'undefined' && thisPortList.data('max-num-pages') !== false) { maxNumPages = thisPortList.data('max-num-pages'); } if(thisPortList.hasClass('qodef-pl-pag-standard')) { thisPortList.data('next-page', pagedLink); } if(thisPortList.hasClass('qodef-pl-pag-infinite-scroll')) { thisPortList.addClass('qodef-pl-infinite-scroll-started'); } var loadMoreDatta = qodef.modules.common.getLoadMoreData(thisPortList), loadingItem = thisPortList.find('.qodef-pl-loading'); nextPage = loadMoreDatta.nextPage; if(nextPage <= maxNumPages || maxNumPages === 0){ if(thisPortList.hasClass('qodef-pl-pag-standard')) { loadingItem.addClass('qodef-showing qodef-standard-pag-trigger'); thisPortList.addClass('qodef-pl-pag-standard-animate'); } else { loadingItem.addClass('qodef-showing'); } var ajaxData = qodef.modules.common.setLoadMoreAjaxData(loadMoreDatta, 'brunn_core_portfolio_ajax_load_more'); $.ajax({ type: 'POST', data: ajaxData, url: qodefGlobalVars.vars.qodefAjaxUrl, success: function (data) { if(!thisPortList.hasClass('qodef-pl-pag-standard')) { nextPage++; } thisPortList.data('next-page', nextPage); var response = $.parseJSON(data), responseHtml = response.html; if(thisPortList.hasClass('qodef-pl-pag-standard')) { qodefInitStandardPaginationLinkChanges(thisPortList, maxNumPages, nextPage); thisPortList.waitForImages(function(){ if(thisPortList.hasClass('qodef-pl-masonry')){ qodefInitHtmlIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml); } else if (thisPortList.hasClass('qodef-pl-gallery') && thisPortList.hasClass('qodef-pl-has-filter')) { qodefInitHtmlIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml); } else { qodefInitHtmlGalleryNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml); } }); } else { thisPortList.waitForImages(function(){ if(thisPortList.hasClass('qodef-pl-masonry')){ if(pagedLink === 1) { qodefInitHtmlIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml); } else { qodefInitAppendIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml); } } else if (thisPortList.hasClass('qodef-pl-gallery') && thisPortList.hasClass('qodef-pl-has-filter') && pagedLink !== 1) { qodefInitAppendIsotopeNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml); } else { if (pagedLink === 1) { qodefInitHtmlGalleryNewContent(thisPortList, thisPortListInner, loadingItem, responseHtml); } else { qodefInitAppendGalleryNewContent(thisPortListInner, loadingItem, responseHtml); } } }); } if(thisPortList.hasClass('qodef-pl-infinite-scroll-started')) { thisPortList.removeClass('qodef-pl-infinite-scroll-started'); } } }); } if(nextPage === maxNumPages){ thisPortList.find('.qodef-pl-load-more-holder').hide(); } }; var qodefInitStandardPaginationLinkChanges = function(thisPortList, maxNumPages, nextPage) { var standardPagHolder = thisPortList.find('.qodef-pl-standard-pagination'), standardPagNumericItem = standardPagHolder.find('li.qodef-pag-number'), standardPagPrevItem = standardPagHolder.find('li.qodef-pag-prev a'), standardPagNextItem = standardPagHolder.find('li.qodef-pag-next a'); standardPagNumericItem.removeClass('qodef-pag-active'); standardPagNumericItem.eq(nextPage-1).addClass('qodef-pag-active'); standardPagPrevItem.data('paged', nextPage-1); standardPagNextItem.data('paged', nextPage+1); if(nextPage > 1) { standardPagPrevItem.css({'opacity': '1'}); } else { standardPagPrevItem.css({'opacity': '0'}); } if(nextPage === maxNumPages) { standardPagNextItem.css({'opacity': '0'}); } else { standardPagNextItem.css({'opacity': '1'}); } }; var qodefInitHtmlIsotopeNewContent = function(thisPortList, thisPortListInner, loadingItem, responseHtml) { thisPortListInner.find('article').remove(); thisPortListInner.append(responseHtml); qodef.modules.common.setFixedImageProportionSize(thisPortList, thisPortListInner.find('article'), thisPortListInner.find('.qodef-masonry-grid-sizer').width(), true); thisPortListInner.isotope('reloadItems').isotope({sortBy: 'original-order'}); loadingItem.removeClass('qodef-showing qodef-standard-pag-trigger'); thisPortList.removeClass('qodef-pl-pag-standard-animate'); setTimeout(function() { thisPortListInner.isotope('layout'); qodefInitPortfolioListAnimation(); qodef.modules.common.qodefInitParallax(); qodef.modules.common.qodefPrettyPhoto(); }, 600); }; var qodefInitHtmlGalleryNewContent = function(thisPortList, thisPortListInner, loadingItem, responseHtml) { loadingItem.removeClass('qodef-showing qodef-standard-pag-trigger'); thisPortList.removeClass('qodef-pl-pag-standard-animate'); thisPortListInner.html(responseHtml); qodefInitPortfolioListAnimation(); qodef.modules.common.qodefInitParallax(); qodef.modules.common.qodefPrettyPhoto(); }; var qodefInitAppendIsotopeNewContent = function(thisPortList, thisPortListInner, loadingItem, responseHtml) { thisPortListInner.append(responseHtml); qodef.modules.common.setFixedImageProportionSize(thisPortList, thisPortListInner.find('article'), thisPortListInner.find('.qodef-masonry-grid-sizer').width(), true); thisPortListInner.isotope('reloadItems').isotope({sortBy: 'original-order'}); loadingItem.removeClass('qodef-showing'); setTimeout(function() { thisPortListInner.isotope('layout'); qodefInitPortfolioListAnimation(); qodef.modules.common.qodefInitParallax(); qodef.modules.common.qodefPrettyPhoto(); }, 600); }; var qodefInitAppendGalleryNewContent = function(thisPortListInner, loadingItem, responseHtml) { loadingItem.removeClass('qodef-showing'); thisPortListInner.append(responseHtml); qodefInitPortfolioListAnimation(); qodef.modules.common.qodefInitParallax(); qodef.modules.common.qodefPrettyPhoto(); }; return { init: function() { if(portList.length) { portList.each(function() { var thisPortList = $(this); if(thisPortList.hasClass('qodef-pl-pag-standard')) { initStandardPagination(thisPortList); } if(thisPortList.hasClass('qodef-pl-pag-load-more')) { initLoadMorePagination(thisPortList); } if(thisPortList.hasClass('qodef-pl-pag-infinite-scroll')) { initInifiteScrollPagination(thisPortList); } }); } }, scroll: function() { if(portList.length) { portList.each(function() { var thisPortList = $(this); if(thisPortList.hasClass('qodef-pl-pag-infinite-scroll')) { initInifiteScrollPagination(thisPortList); } }); } }, getMainPagFunction: function(thisPortList, paged) { initMainPagFunctionality(thisPortList, paged); } }; } })(jQuery); (function($) { 'use strict'; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorPortfolioSlider(); } /** * Elementor Portfolio Slider */ function qodefElementorPortfolioSlider() { $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/qodef_portfolio_slider.default', function () { qodef.modules.common.qodefOwlSlider(); }); }); } })(jQuery); (function($) { 'use strict'; $(window).on('load', qodefOnWindowLoad); /* All functions to be called on $(window).load() should be in this function */ function qodefOnWindowLoad() { qodefElementorTestimonials(); } /** * Elementor Portfolio Slider */ function qodefElementorTestimonials() { $(window).on('elementor/frontend/init', function () { elementorFrontend.hooks.addAction('frontend/element_ready/qodef_testimonials.default', function () { qodef.modules.common.qodefOwlSlider(); }); }); } })(jQuery);