$(document).ready(function () { if ($('.main-header .FH').length){ // FASHION DEPTH ========== var fullMenu = ''; $('ul.base-menu li.ifDrop').each(function(){ fullMenu = fullMenu + ''; }); $('.nav-menu.base-menu').addClass('container-h'); $('ul.base-menu li.all-product-button').remove(); $('ul.base-menu').prepend(fullMenu); $('ul.base-menu li > a > i').removeClass('fa-angle-right'); $('ul.base-menu li > a > i').addClass('fa-angle-down'); $('ul.base-menu ul.drop-list').each(function(){ if(!$(this).parent('div.menu-dd').length){ $('').insertBefore($(this)); } }) $('div.menu-dd').each(function(){ var image = $(this).next('ul.drop-list').find('li.image').html(); var slider = $(this).next('ul.drop-list').find('li.slider-menu').html(); $(this).next('ul.drop-list').find('li.image').remove(); $(this).next('ul.drop-list').find('li.slider-menu').remove(); var subcat = $(this).next('ul.drop-list').html(); if(subcat != undefined){ var w = $(this).next('ul.drop-list').hasClass('w60') ? 'w60' : 'w100'; $(this).next('ul.drop-list').remove(); $(this).append(''); if ( $(image).length ) { $(this).append('
'+image+'
'); } if ( $(slider).length ) { $(this).append('
'+slider+'
'); } } }); // BASE MENU ========== $('ul.base-menu').show(); }; // FIXED HEADER function fixNav(){ if (!$('.cart-menu').length && !$('.-g-template-black-friday').length){ var nav = $('.main-header'); var pos = nav.height(); var posDelay = nav.height()*2; var prevScroll = 0; nav.addClass('fix-nav'); $(window).scroll(function () { var fix = ($(this).scrollTop() > posDelay) ? true : false; if(fix){ nav.addClass('fade-menu', fix); setTimeout(function() { nav.addClass('animate-menu'); }, 250); $('body').css('margin-top', pos); if($(this).scrollTop() > prevScroll){ nav.removeClass('active-menu'); }else{ nav.addClass('active-menu'); } }else{ $('body').css('margin-top', 0); nav.removeClass('fade-menu active-menu animate-menu', fix); } prevScroll = $(this).scrollTop(); }); } } $.Gomag.bind('Widget/Add/After', function(){ fixNav(); // BF SIDEBAR + MENU STICKY if($('.-g-template-black-friday').length){ $('.main-header').css({'top' : '-' + ($('.discount-tape').height() + $('.top-head-bg').height()) + 'px'}); } if($( window ).width() > 991 && $('.-g-template-black-friday').length){ $('.landing-h .side-menu.fixed').css({'top' : $('#navigation').outerHeight() + 20 + 'px'}); } }) // FASHION MENU ========== function Menu(){ $('.menu-dd').each(function() { var $this = $(this); var Nli = $this.find('li').length; var Nlink = $this.find('a').length; var Ncol = Math.ceil(Nlink / 15); var Mbanner = $this.find('.cat-img').length; Ncol = Ncol == 0 ? 1 : Ncol; col = Nli > Ncol ? Ncol : Nli; col = (col + (Mbanner ? 1 : 0) > 4) ? 4 : col; $this.addClass('column' + col); if (Mbanner){$this.addClass('banner');}; if ($this.find('li span > a').length == 0){ $this.addClass('no-sub'); }; if ($this.hasClass('column4')){ $this.parent().addClass('initial-h'); }; }); }; Menu(); $('.main-header .menu-drop').hover(function() { $('.main-header .menu-drop .menu-dd').removeClass('open'); $(this).children('.menu-dd').stop().addClass('open'); if ( $('.slide-item-menu').length ) { $('.slide-item-menu').owlCarousel({items:1,navigation:!0,pagination:!1}); // get owl element var owl = $('.slide-item-menu'); // get owl instance from element var owlInstance = owl.data('owlCarousel'); // if instance is existing if(owlInstance != null) owlInstance.reinit(); }; },function() { $('.main-header .menu-drop .menu-dd').removeClass('open'); }); }); /** * Scrie aici codul tau Javascript... */ // Status Day $(function() { var date = new Date(), currentDate = date.getDate()-1; $('.be-safe-calendar .pin:nth-child(-n+' + currentDate + ')').css({'filter':'grayscale(1)', 'opacity':'.4'}); }); /*https://www.empria.ro/domains/empria.ro/files/files/empria-gpec-3510.png*/ /* empria.ro JS file, (JUL 2023) */ var toMobWidth = 768; var setTmInt = ''; var setTmOut = ''; var winScrTop = $(window).scrollTop(); const winH = $(window).height(); const winW = $(window).width(); function bodyCls(){ if($('#category-page .product-listing').length){ $('body').addClass('bdy-cat'); }else if($('#category-page .brands-h').length){ $('body').addClass('bdy-brand'); }else if($('#product-page .-g-product-row-box').length){ $('body').addClass('bdy-prod'); }else if($('#shoppingcart #updateCart .cart-items').length){ $('body').addClass('bdy-cart'); }else if($('#shoppingcart .checkout').length){ $('body').addClass('bdy-check'); }else if($('#result-page .404Form').length){ $('body').addClass('bdy-404'); }else if( $('.account-h .account-section').length && $('.account-h .side-menu').length ){ $('body').addClass('bdy-default-txt'); }else if( $('#main-bnn .bnn-group-big').length || $('.brand-h .brand-sld').length ){ $('body').addClass('bdy-home'); } if( $('#category-page .product-listing').length && $('#category-page .result-section .order-type').length ){ $('body').addClass('bdy-cat-filters'); } } bodyCls(); function prodDetails(){ if( $('#product-page .add-section').length && $('#product-page .detail-price').length ){ if(!$('#product-page .add-section').hasClass('mvd')){ $('#product-page .add-section').insertAfter('#product-page .detail-price'); $('#product-page .add-section').addClass('mvd'); } } if( $('#product-page .short-description').length && $('#product-page .-g-discount-quantity-required').length ){ if(!$('#product-page .short-description').hasClass('mvd')){ $('#product-page .short-description').insertBefore('#product-page .-g-discount-quantity-required'); $('#product-page .short-description').addClass('mvd'); } }else if( $('#product-page .short-description').length && $('#product-page .product-code').length ){ if(!$('#product-page .short-description').hasClass('mvd')){ $('#product-page .short-description').insertAfter('#product-page .product-code'); $('#product-page .short-description').addClass('mvd'); } }else if( $('#product-page .short-description').length && $('#product-page .wish-section').length ){ if(!$('#product-page .short-description').hasClass('mvd')){ $('#product-page .short-description').insertAfter('#product-page .wish-section'); $('#product-page .short-description').addClass('mvd'); } } } prodDetails(); var catPagPosTop = ''; var fltrWidth = ''; var fltrPosLeft = ''; var targetFiltre = $('#category-page .filter-group > .filter-holder'); function stickyFilt(){ if(targetFiltre.length){ targetFiltre.css('max-height',winH-200); // winScrTop = $(window).scrollTop(); // catPagPosTop = $('#category-page').offset().top; // fltrWidth = targetFiltre.width(); // fltrPosLeft = targetFiltre.offset().left; // if( // winW >= toMobWidth && // targetFiltre.length // ){ // targetFiltre.addClass('sticky-filt'); // } // if(targetFiltre.hasClass('sticky-filt')){ // targetFiltre.css('max-height',winH-200); // if(winScrTop > catPagPosTop){ // $('body').addClass('stk-ev'); // targetFiltre.addClass('stk-on'); // targetFiltre.css('position','fixed').css('left',fltrPosLeft).css('top','110px').css('width',fltrWidth); // }else{ // $('body').removeClass('stk-ev'); // targetFiltre.removeClass('stk-on'); // targetFiltre.css('position','').css('left','').css('top','').css('min-width',''); // } // } } } stickyFilt(); function detectMenuPos(){ if($('#wrapper > .main-header').length){ if($('#wrapper > .main-header').hasClass('fade-menu')){ $('body').addClass('bdy-fade-menu'); }else{ $('body').removeClass('bdy-fade-menu'); } if($('#wrapper > .main-header').hasClass('active-menu')){ $('body').addClass('bdy-active-menu'); }else{ $('body').removeClass('bdy-active-menu'); } } } $(document).on('click','.__lockersInfo',function(){ clearInterval(setTmInt); clearTimeout(setTmOut); setTmOut = setTimeout(function(){ clearInterval(setTmInt); },15000); setTmInt = setInterval(function(){ if($('.fancybox-slide--complete .fancybox-content .fancybox-iframe').length){ var searchFld = ''; var ifrmSrch = $('.fancybox-slide--complete .fancybox-content .fancybox-iframe'); ifrmSrch.addClass('fancy-location'); $('body').addClass('fancy-body'); if(ifrmSrch.contents().find('.list-lockers #list-locker-content .-g-title-lockers').length){ $(searchFld).insertAfter(ifrmSrch.contents().find('.list-lockers #list-locker-content .-g-title-lockers')); } clearInterval(setTmInt); clearTimeout(setTmOut); } },100); }); var searchPostsTimeOut = ''; $(document).on('keyup','#ifr_lcs',function(){ var deThisSrchEl = jQuery(this); var deThisSrchElVal = deThisSrchEl.val().toLowerCase().trim(); clearTimeout(searchPostsTimeOut); searchPostsTimeOut = setTimeout(function(){ $(deThisSrchEl).parents('#list-locker-content').eq(0).find('.-g-item-lockers').show().filter(function() { return jQuery(this).text().toLowerCase().trim().indexOf(deThisSrchElVal) == -1; }).hide(); clearTimeout(searchPostsTimeOut); },500); }); function footerAffiliate(){ if($('.-g-footer-affiliate-block .gomag_footer_end').length){ $('.-g-footer-affiliate-block .gomag_footer_end').each(function(eachAffiliate){ $(this).addClass('aff-'+(eachAffiliate+1)); if($(this).find('a').length){ var getTheUrl = $(this).find('a').attr('href'); var getTheUrlOnClick = $(this).find('a').attr('onclick'); if(typeof getTheUrl !== 'undefined'){ getTheUrl = getTheUrl.replace('https://','').replace('http://','').replace('www.',''); getTheUrl = getTheUrl.substring(0,getTheUrl.indexOf(".ro")); $(this).addClass('cls-'+getTheUrl); }else if(typeof getTheUrlOnClick !== 'undefined'){ getTheUrlOnClick = getTheUrlOnClick.replace('https://','').replace('http://','').replace('www.','').replace("window.open('",'').replace('window.open("',''); getTheUrlOnClick = getTheUrlOnClick.substring(0,getTheUrlOnClick.indexOf(".ro")); $(this).addClass('cls-'+getTheUrlOnClick); } if($(this).find('img').length){ var getTheimgHeight = $(this).find('img').height(); if(getTheimgHeight <= 45){ $(this).addClass('small-img'); } } } }); if( $('.-g-footer-affiliate-block .small-img').length && $('.-g-footer-affiliate-block .small-affiliate-block').length < 1 ){ var getTheHeightOfSmallBox = $('.small-img').height(); var getTheWidthOfSmallBox = $('.small-img').width()+20; var smallAffiliateBox = ''; $(smallAffiliateBox).appendTo('.-g-footer-affiliate-block'); $('.-g-footer-affiliate-block .small-img').each(function(){ jQuery(this).appendTo('.small-affiliate-block'); }) } } $('.trusted-icon-footer').prependTo('.aff-3.cls-compari'); } $(document).ready(function () { $('#succes-page h1').text('Comanda plasata'); $('#succes-page h1').after('

Multumim pentru comanda!

Am primit comanda ta si urmeaza sa o pregatim cu mare grija in cel mai scurt timp. Ai facut o alegere inspirata din grija pentru cei dragi!

SUMAR COMANDA

'); $('.banner-succes').before('

Nu uita ca iti poate fi de mare folos contul in magazinul nostru: primesti puncte de fidelitate, care iti aduc reduceri la comenzile urmatoare (1 punct = 1 leu), poti salva produse favorite sau poti urmari cu usurinta statusul comenzii!

'); $('#succes-page .contact-information').before('

Pana ajunge comanda, te invitam sa citesti articolele din blogul nostru, unde poti afla mai multe despre siguranta celor mici.

Pe paginile noastre de Facebook si Instagram gasesti postari cu cele mai noi produse.

Instructiuni de utilizare ale produselor gasesti pe Youtube si pe TikTok poti vedea cum ne distram la Empria.

'); $('#succes-page .newsletter h4 span').text('Aboneaza-te pentru a primi informatii despre campaniile pe care le avem in desfasurare, produse noi si articole referitoare la protejarea celor mici!'); }); $(document).ajaxComplete(function(){ prodDetails(); }); $(window).scroll( function(){ stickyFilt(); detectMenuPos(); }); $(window).load( function(){ footerAffiliate(); detectMenuPos(); })