jQuery(document).ready(function($) { $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll <= 1500) { $(".1").removeClass("clearHeader").addClass("dropdown-backdrop animated fadeInDown"); } }) }); jQuery(document).ready(function($) { $(window).scroll(function() { if ($(this).scrollTop() > 600) { $('.scrollup').fadeIn(); } else { $('.scrollup').fadeOut(); } }); }); jQuery(document).ready(function($) { setTimeout(() => { $("#removeanimated").removeClass("animated fadeInDown"); }, 2500); }); /* $(function(){ $(".panel-right-toggle").on("click", function(){ if (!$(this).hasClass("toggled-on")) { $(".panel-right-toggle.toggled-on").removeClass("toggled-on"); $(this).addClass("close"); } }); }); */ jQuery(document).ready(function($) { $(".panel-right-toggle").on("click", function(e) { $("#panel-right").addClass("open"); $("#panel-right").removeClass("close"); e.stopPropagation() }); $(document).on("click", function(e) { if ($(e.target).is("#panel-right") === false) { $("#panel-right").removeClass("open"); $("#panel-right").addClass("close"); } }); }); /* jQuery(document).ready(function($) { $('a[data-rel^=lightcase]').lightcase(); $(window).scroll(function() { if ($(this).scrollTop() > 100) { $('.scrollup').fadeIn(); } else { $('.scrollup').fadeOut(); } }); $('.scrollup').click(function() { $("html, body").animate({ scrollTop: 0 }, 600); return false; }); }); */ jQuery(document).ready(function($) { { setTimeout(() => document.body.classList.add('render'), 60); const navdemos = Array.from(document.querySelectorAll('nav.demos > .demo')); const total = navdemos.length; const current = navdemos.findIndex(el => el.classList.contains('demo--current')); const navigate = (linkEl) => { document.body.classList.remove('render'); document.body.addEventListener('transitionend', () => window.location = linkEl.href); }; navdemos.forEach(link => link.addEventListener('click', (ev) => { ev.preventDefault(); navigate(ev.target); })); document.addEventListener('keydown', (ev) => { const keyCode = ev.keyCode || ev.which; let linkEl; if (keyCode === 37) { linkEl = current > 0 ? navdemos[current - 1] : navdemos[total - 1]; } else if (keyCode === 39) { linkEl = current < total - 1 ? navdemos[current + 1] : navdemos[0]; } else { return false; } navigate(linkEl); }); imagesLoaded('.glitch__img', { background: true }, () => { document.body.classList.remove('loading'); document.body.classList.add('imgloaded'); }); } }); jQuery(document).ready(function($) { //set animation timing var animationDelay = 2500, //loading bar effect barAnimationDelay = 3800, barWaiting = barAnimationDelay - 3000, //3000 is the duration of the transition on the loading bar - set in the scss/css file //letters effect lettersDelay = 50, //type effect typeLettersDelay = 150, selectionDuration = 500, typeAnimationDelay = selectionDuration + 800, //clip effect revealDuration = 600, revealAnimationDelay = 1500; initHeadline(); function initHeadline() { //insert element for each letter of a changing word singleLetters($('.cd-headline.letters').find('b')); //initialise headline animation animateHeadline($('.cd-headline')); } function singleLetters($words) { $words.each(function() { var word = $(this), letters = word.text().split(''), selected = word.hasClass('is-visible'); for (i in letters) { if (word.parents('.rotate-2').length > 0) letters[i] = '' + letters[i] + ''; letters[i] = (selected) ? '' + letters[i] + '' : '' + letters[i] + ''; } var newLetters = letters.join(''); word.html(newLetters).css('opacity', 1); }); } function animateHeadline($headlines) { var duration = animationDelay; $headlines.each(function() { var headline = $(this); if (headline.hasClass('loading-bar')) { duration = barAnimationDelay; setTimeout(function() { headline.find('.cd-words-wrapper').addClass('is-loading') }, barWaiting); } else if (headline.hasClass('clip')) { var spanWrapper = headline.find('.cd-words-wrapper'), newWidth = spanWrapper.width() + 10 spanWrapper.css('width', newWidth); } else if (!headline.hasClass('type')) { //assign to .cd-words-wrapper the width of its longest word var words = headline.find('.cd-words-wrapper b'), width = 0; words.each(function() { var wordWidth = $(this).width(); if (wordWidth > width) width = wordWidth; }); headline.find('.cd-words-wrapper').css('width', width); }; //trigger animation setTimeout(function() { hideWord(headline.find('.is-visible').eq(0)) }, duration); }); } function hideWord($word) { var nextWord = takeNext($word); if ($word.parents('.cd-headline').hasClass('type')) { var parentSpan = $word.parent('.cd-words-wrapper'); parentSpan.addClass('selected').removeClass('waiting'); setTimeout(function() { parentSpan.removeClass('selected'); $word.removeClass('is-visible').addClass('is-hidden').children('i').removeClass('in').addClass('out'); }, selectionDuration); setTimeout(function() { showWord(nextWord, typeLettersDelay) }, typeAnimationDelay); } else if ($word.parents('.cd-headline').hasClass('letters')) { var bool = ($word.children('i').length >= nextWord.children('i').length) ? true : false; hideLetter($word.find('i').eq(0), $word, bool, lettersDelay); showLetter(nextWord.find('i').eq(0), nextWord, bool, lettersDelay); } else if ($word.parents('.cd-headline').hasClass('clip')) { $word.parents('.cd-words-wrapper').animate({ width: '2px' }, revealDuration, function() { switchWord($word, nextWord); showWord(nextWord); }); } else if ($word.parents('.cd-headline').hasClass('loading-bar')) { $word.parents('.cd-words-wrapper').removeClass('is-loading'); switchWord($word, nextWord); setTimeout(function() { hideWord(nextWord) }, barAnimationDelay); setTimeout(function() { $word.parents('.cd-words-wrapper').addClass('is-loading') }, barWaiting); } else { switchWord($word, nextWord); setTimeout(function() { hideWord(nextWord) }, animationDelay); } } function showWord($word, $duration) { if ($word.parents('.cd-headline').hasClass('type')) { showLetter($word.find('i').eq(0), $word, false, $duration); $word.addClass('is-visible').removeClass('is-hidden'); } else if ($word.parents('.cd-headline').hasClass('clip')) { $word.parents('.cd-words-wrapper').animate({ 'width': $word.width() + 10 }, revealDuration, function() { setTimeout(function() { hideWord($word) }, revealAnimationDelay); }); } } function hideLetter($letter, $word, $bool, $duration) { $letter.removeClass('in').addClass('out'); if (!$letter.is(':last-child')) { setTimeout(function() { hideLetter($letter.next(), $word, $bool, $duration); }, $duration); } else if ($bool) { setTimeout(function() { hideWord(takeNext($word)) }, animationDelay); } if ($letter.is(':last-child') && $('html').hasClass('no-csstransitions')) { var nextWord = takeNext($word); switchWord($word, nextWord); } } function showLetter($letter, $word, $bool, $duration) { $letter.addClass('in').removeClass('out'); if (!$letter.is(':last-child')) { setTimeout(function() { showLetter($letter.next(), $word, $bool, $duration); }, $duration); } else { if ($word.parents('.cd-headline').hasClass('type')) { setTimeout(function() { $word.parents('.cd-words-wrapper').addClass('waiting'); }, 200); } if (!$bool) { setTimeout(function() { hideWord($word) }, animationDelay) } } } function takeNext($word) { return (!$word.is(':last-child')) ? $word.next() : $word.parent().children().eq(0); } function takePrev($word) { return (!$word.is(':first-child')) ? $word.prev() : $word.parent().children().last(); } function switchWord($oldWord, $newWord) { $oldWord.removeClass('is-visible').addClass('is-hidden'); $newWord.removeClass('is-hidden').addClass('is-visible'); } }); /* jQuery(document).ready(function($) { document.onreadystatechange = function() { var state = document.readyState if (state == 'complete') { document.getElementById('interactive'); document.getElementById('load').style.visibility = "hidden"; } } }); */ AOS.init(); function initAnimation () { new WOW().init(); } /* demos */ jQuery(document).ready(function($) { $(".loader-inner").fadeOut(); $(".loader").delay(400).fadeOut("slow"); if ($(this).width() > 768) { $('.navmobilemyaccount').addClass('d-flex'); } else { $('.navmobilemyaccount').removeClass('d-block'); } if ($(this).width() > 768) { $('.rightsidebarmob').addClass('d-block'); } else { $('.rightsidebarmob').removeClass('d-flex'); } } ); jQuery(document).ready(function($) { $(".gallery__content").not(":first").hide(); $(".filter-label").click(function() { $(".filter-label").removeClass("active").eq($(this).index()).addClass("active"); $(".gallery__content").hide().eq($(this).index()).fadeIn() }).eq(0).addClass("active"); }); jQuery(document).ready(function($) { $(".gallery__content_2").not(":first").hide(); $(".filter-label").click(function() { $(".filter-label").removeClass("active").eq($(this).index()).addClass("active"); $(".gallery__content_2").hide().eq($(this).index()).fadeIn() }).eq(0).addClass("active"); }); /* finaliza demos */ jQuery(function ($) { if ($(this).width() < 768) { $('.navmobilemyaccount2').removeClass('inner-wrapper-sticky'); } if ($(this).width() < 768) { $('.navmobilemyaccount3').removeClass('main-sticky'); } if ($(this).width() < 768) { $('.mobilesidebar').removeClass('sidebar'); } }); jQuery(function ($) { if ($(this).width() < 768) { $('.navmobilemyaccount2').removeClass('inner-wrapper-sticky'); } if ($(this).width() < 768) { $('.rem-main-sticky').removeClass('main-sticky'); } if ($(this).width() < 768) { $('.mobilesidebar').removeClass('home-page-sidebar'); } if ($(this).width() < 768) { $('.mobilesidebar-2').removeClass('is-affixed'); } /* if ($(this).width() < 768) { $('.mobilecontent').removeClass('col-md-8'); } */ if ($(this).width() < 768) { $('.rem-sidebar-inner').removeClass('sidebar__inner'); } }); jQuery(function ($) { if ($(this).width() > 768) { if($('.sidebar__inner').length){ var a = new StickySidebar('.home-page-sidebar', { topSpacing: 80, bottomSpacing: 0, containerSelector: '.main-sticky', innerWrapperSelector: '.sidebar__inner' }) } }}); /* jQuery(function ($) { const progressElement = document.querySelector('.progress-bar-indicator'); ($) = new ScrollProgress(function (x, y) { progressElement.style.width = y * 120 + '%'; }); }); */ /*** Custom Orderby on Product Page ***/ /*** Custom Orderby on Product Page ***/ jQuery(function ($) { $('form.woocommerce-ordering ul.orderby ul a').on('click', function(e){ e.preventDefault(); if( $(this).hasClass('current') ){ return; } var form = $(this).closest('form.woocommerce-ordering'); var data = $(this).attr('data-orderby'); form.find('select.orderby').val(data).trigger('change'); }); /*** Select2 - Search by Category ***/ if( typeof $.fn.select2 == 'function' ){ $('.search-by-category select.select-category').select2(); var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; $.fn.attrchange = function(callback) { if (MutationObserver) { var options = { subtree: false, attributes: true }; var observer = new MutationObserver(function(mutations) { mutations.forEach(function(e) { callback.call(e.target, e.attributeName); }); }); return this.each(function() { observer.observe(this, options); }); } } $(' .search-by-category .select2-container').attrchange(function(attrName){ if( attrName == 'class' ){ if( $(this).hasClass('select2-container--open') ){ $('body > .select2-container--open').addClass('category-dropdown'); } else{ $('body > .select2-container--open').removeClass('category-dropdown'); } } }); } }); /*-------------------------------------------------------------- Theme JS --------------------------------------------------------------*/ jQuery(function ($) { // Close offcanvas on click a, keep .dropdown-menu open $('.offcanvas a:not(.dropdown-toggle):not(a.remove_from_cart_button), a.dropdown-item').on('click', function () { $('.offcanvas').offcanvas('hide'); }); // Search collapse button hide if empty if ($('#collapse-search').children().length == 0) { $('.top-nav-search-md, .top-nav-search-lg').remove(); } // Searchform focus $('#collapse-search').on('shown.bs.collapse', function () { $('.top-nav-search input:first-of-type').trigger('focus'); }); // Close collapse if searchform loses focus $('.top-nav-search input:first-of-type').on('focusout', function () { $('#collapse-search').collapse('hide'); }); }); jQuery(function ($) { // Woocommerce Quantity on GitHub $( document ).on( 'click', '.plus, .minus', function() { // Get values var $qty = $( this ).closest( '.quantity' ).find( '.qty' ), currentVal = parseFloat( $qty.val() ), max = parseFloat( $qty.attr( 'max' ) ), min = parseFloat( $qty.attr( 'min' ) ), step = $qty.attr( 'step' ); // Format values if ( ! currentVal || currentVal === '' || currentVal === 'NaN' ) currentVal = 0; if ( max === '' || max === 'NaN' ) max = ''; if ( min === '' || min === 'NaN' ) min = 0; if ( step === 'any' || step === '' || step === undefined || parseFloat( step ) === 'NaN' ) step = 1; // Change the value if ( $( this ).is( '.plus' ) ) { if ( max && ( max == currentVal || currentVal > max ) ) { $qty.val( max ); } else { $qty.val( currentVal + parseFloat( step ) ); } } else { if ( min && ( min == currentVal || currentVal < min ) ) { $qty.val( min ); } else if ( currentVal > 0 ) { $qty.val( currentVal - parseFloat( step ) ); } } // Trigger change event $qty.trigger( 'change' ); }); }); jQuery(function ($) { if ($('.aspace-gallery-section').length) { $('.aspace-gallery-section').magnificPopup({ delegate: 'a', type: 'image', tLoading: 'Loading image #%curr%...', mainClass: 'mfp-img-mobile', gallery: { enabled: true, navigateByImgClick: true, preload: [0, 1] }, image: { tError: 'The image #%curr% could not be loaded.', titleSrc: function(item) { return item.el.attr('title') + 'by sbtechnosoft'; } } }); } if ($('.image-popup-no-margins').length) { $('.image-popup-no-margins').magnificPopup({ type: 'image', closeOnContentClick: true, closeBtnInside: false, fixedContentPos: true, mainClass: 'mfp-no-margins mfp-with-zoom', image: { verticalFit: true }, zoom: { enabled: true, duration: 300 } }); } }); jQuery(function ($) { // Single add to cart button $('.single_add_to_cart_button:not(.product_type_variable):not(.product_type_external):not(.product_type_grouped)').attr('data-bs-toggle', 'offcanvas').attr('data-bs-target', '#offcanvas-cart'); // Single add to cart button END }); jQuery(function(){ "use strict"; if ( typeof jQuery.cookie == 'function' && jQuery.cookie('gridcookie_2') == null ) { jQuery('#main-accordion ul.tabs').addClass('defaults'); jQuery('.tabs-features').addClass('active'); } if( typeof jQuery.cookie == 'function' ){ jQuery('#tabs-overview').on('click', function() { if( jQuery(this).hasClass('active') ){ return false; } jQuery(this).addClass('active'); jQuery('#tabs-features').removeClass('active'); jQuery('#tabs-video').removeClass('active'); jQuery('#tabs-asp-virtual_tour_360').removeClass('active'); jQuery.cookie('gridcookie_2','default-class', { path: '/' }); jQuery('#main-accordion ul.tabs-overview').fadeOut(300, function() { jQuery(this).addClass('').removeClass('').fadeIn(300); }); jQuery('#main-accordion li.tabs-elementsw').fadeOut(300, function() { jQuery(this).addClass('').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-asp-virtual_tour_360').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-overview').fadeOut(300, function() { jQuery(this).addClass('').removeClass('hide-all').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-features').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); return false; }); jQuery('#tabs-features').on('click', function() { if( jQuery(this).hasClass('active') ){ return false; } jQuery(this).addClass('active'); jQuery('#tabs-overview').removeClass('active'); jQuery('#tabs-video').removeClass('active'); jQuery('#tabs-asp-virtual_tour_360').removeClass('active'); jQuery.cookie('gridcookie_2','default-class', { path: '/' }); jQuery('#main-accordion ul.tabs-features').fadeOut(300, function() { jQuery(this).addClass('').removeClass('').fadeIn(300); }); jQuery('#main-accordion li.tabs-elementsw').fadeOut(300, function() { jQuery(this).addClass('').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-asp-virtual_tour_360').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-overview').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-video').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-features').fadeOut(300, function() { jQuery(this).addClass('').removeClass('hide-all').fadeIn(300); }); return false; }); jQuery('#tabs-video').on('click', function() { if( jQuery(this).hasClass('active') ){ return false; } jQuery(this).addClass('active'); jQuery('#tabs-features').removeClass('active'); jQuery('#tabs-overview').removeClass('active'); jQuery('#tabs-asp-virtual_tour_360').removeClass('active'); jQuery.cookie('gridcookie_2','default-class', { path: '/' }); jQuery('#main-accordion ul.tabs-video').fadeOut(300, function() { jQuery(this).removeClass('').addClass('').fadeIn(300); }); jQuery('#main-accordion li.columns').fadeOut(300, function() { jQuery(this).removeClass('').addClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-asp-virtual_tour_360').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-video').fadeOut(300, function() { jQuery(this).addClass('').removeClass('hide-all').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-overview').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-features').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); return false; }); jQuery('#tabs-asp-virtual_tour_360').on('click', function() { if( jQuery(this).hasClass('active') ){ return false; } jQuery(this).addClass('active'); jQuery('#tabs-features').removeClass('active'); jQuery('#tabs-overview').removeClass('active'); jQuery('#tabs-video').removeClass('active'); jQuery.cookie('gridcookie_2','default-class', { path: '/' }); jQuery('#main-accordion ul.tabs-asp-virtual_tour_360').fadeOut(300, function() { jQuery(this).removeClass('').addClass('').fadeIn(300); }); jQuery('#main-accordion li.columns').fadeOut(300, function() { jQuery(this).removeClass('').addClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-asp-virtual_tour_360').fadeOut(300, function() { jQuery(this).addClass('').removeClass('hide-all').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-video').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-overview').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); jQuery('#main-accordion div.tab-paneles-features').fadeOut(300, function() { jQuery(this).addClass('hide-all').removeClass('').fadeIn(300); }); return false; }); /* if( jQuery.cookie('gridcookie_2') ){ jQuery('#main ul.products, #gridlist-toggle').addClass(jQuery.cookie('gridcookie_2')); } if( jQuery.cookie('gridcookie_2') ){ jQuery('#main li.columns, #gridlist-toggle').addClass(jQuery.cookie('gridcookie_2')); } if( jQuery.cookie('gridcookie_2') ){ jQuery('#main div.column-product, #gridlist-toggle').addClass(jQuery.cookie('gridcookie_2')); } if( jQuery.cookie('gridcookie_2') == 'grid-view' ){ jQuery('.gridlist-toggle #grid').addClass('active'); jQuery('.gridlist-toggle #list').removeClass('active'); jQuery('.gridlist-toggle #split').removeClass('active'); } if( jQuery.cookie('gridcookie_2') == 'list-view' ){ jQuery('.gridlist-toggle #list').addClass('active'); jQuery('.gridlist-toggle #grid').removeClass('active'); jQuery('.gridlist-toggle #split').removeClass('active'); } if( jQuery.cookie('gridcookie_2') == 'split-view' ){ jQuery('.gridlist-toggle #split').addClass('active'); jQuery('.gridlist-toggle #grid').removeClass('active'); jQuery('.gridlist-toggle #list').removeClass('active'); } */ /* jQuery('#tabs-features a').on('click', function(event) { event.preventDefault(); }); */ } }); /* { let paymentBlock = document.querySelector('.payment-method'); if(paymentBlock) { paymentBlock.addEventListener('click', (e) => { if(e.target.closest('input[type="radio"]')) { upDownBottomBlock(); } }) function upDownBottomBlock() { for(let item of paymentBlock.children) { let radio = item.querySelector('input[type="radio"]'); let bottomBLock = item.querySelector('.payment-method__data-input'); if(radio.checked) { _slideDown(bottomBLock); } else { _slideUp(bottomBLock); } } } upDownBottomBlock(); } }; */