1window.addEventListener('pageshow', function(event) { 2 if (!event.persisted) { 3 if (!document.body.classList.contains('woocommerce-checkout')) { 4 sessionStorage.removeItem('openCartOnReturn'); 5 sessionStorage.removeItem('checkoutReturnUrl'); 6 } 7 return; 8 } 9 10 if (document.body.classList.contains('woocommerce-checkout')) return; 11 if (window.innerWidth >= 768) return; 12 if (sessionStorage.getItem('openCartOnReturn') !== 'true') return; 13 14 sessionStorage.removeItem('openCartOnReturn'); 15 sessionStorage.removeItem('checkoutReturnUrl'); 16 17 jQuery.ajax({ 18 url: woocommerce_params.wc_ajax_url.toString().replace('%%endpoint%%', 'get_refreshed_fragments_custom'), 19 type: 'POST', 20 success: function(data) { 21 if (data) { 22 try { 23 sessionStorage.setItem('watatsumi', JSON.stringify(data.watatsumi)); 24 sessionStorage.setItem('wc_cart_hash', data.cart_hash); 25 } catch (e) {} 26 jQuery('body').trigger('dds_update_mini_cart'); 27 } 28 setTimeout(function() { 29 var $cart = jQuery('.lpd-shopping-cart'); 30 if (!$cart.hasClass('active')) {
31 jQuery('.cart-button').trigger('click'); 32 } 33 }, 150); 34 } 35 }); 36}); 37 38(function($){ 39 Inputmask({ 40 mask: [ 41 "+99 999 999 999", 42 "+99 999 999 9999", 43 "+99 999 999 99999" 44 ], 45 keepStatic: true, 46 placeholder: "" 47 }).mask($('input[type="tel"]')); 48 49 $('.c-btn__item-01').click(function(){ 50 $('.c-btn').toggleClass('active'); 51 }); 52 var cBtn = $(".c-btn"); 53 function closeCbtn() { 54 if(cBtn.hasClass('active')) { 55 if (!cBtn.is(event.target) && cBtn.has(event.target).length === 0) { 56 cBtn.removeClass('active'); 57 } 58 } 59 } 60 $(document).mouseup(function (event){ 61 closeCbtn(); 62 }); 63 $(window).on('scroll',function(event){ 64 closeCbtn(); 65 }); 66 67 // Fixed menu 68 var wWidth = jQuery(window).width();; 69 jQuery(window).on('scroll',function(){ 70 if(wWidth >= 768){ 71 if ( jQuery(this).scrollTop() > 200 ){ 72 jQuery('.header-middle').addClass('fixed'); 73 } else if(jQuery(this).scrollTop() <= 200 ) { 74 jQuery('.header-middle').removeClass('fixed'); 75 } 76 }else{ 77 if ( jQuery(this).scrollTop() > 350 ){ 78 jQuery('.header-middle').addClass('fixed'); 79 } else if(jQuery(this).scrollTop() <= 350 ) { 80 jQuery('.header-middle').removeClass('fixed'); 81 } 82 } 83 84 }); 85 86 const $htmlBody = $('html, body'); 87 const $overlay = $('.overlay-bg'); 88 89 const $menu = $('.mobile-menu'); 90 const $menuOpenBtn = $('.menu-toggle'); 91 const $menuCloseBtn= $('.mobile-menu-close'); 92 93 const $cartBtn = $('.cart-button'); 94 const $cart = $('.lpd-shopping-cart'); 95 96 const $phonesPopupBtn = $('.btn-popup-phones'); 97 98 function toggleOverlay() { 99 $overlay.toggleClass('overlay-bg--show'); 100 $htmlBody.toggleClass('is-menu-open'); 101 } 102 103 function closeAll() { 104 $menu.removeClass('is-open'); 105 $cart.removeClass('active'); 106 $menuOpenBtn.removeClass('active'); 107 $cartBtn.removeClass('active'); 108 $overlay.removeClass('overlay-bg--show'); 109 $htmlBody.removeClass('is-menu-open'); 110 } 111 112 $menuOpenBtn.add($menuCloseBtn).on('click', function () { 113 $menu.toggleClass('is-open'); 114 toggleOverlay(); 115 }); 116 117 $cartBtn.on('click', function () { 118 $cart.toggleClass('active'); 119 $(this).toggleClass('active'); 120 toggleOverlay(); 121 }); 122 123 $(document).on('click', '.cart-dropdown-close', function () { 124 closeAll(); 125 }); 126 127 $(document).on('click', '.overlay-bg--show', function () { 128 closeAll(); 129 }); 130 131 $phonesPopupBtn.on('click', function (e) { 132 e.preventDefault(); 133 134 closeAll(); 135 136 $.fancybox.open({ 137 src: '.popup-phones', 138 type: 'inline', 139 toolbar: false, 140 smallBtn: true 141 }); 142 }); 143 144 145 if($(window).width() < 992 ) { 146 $(document).mouseup(function (e){ 147 var div = $(".lpd-shopping-cart"); 148 if (!div.is(e.target) && div.has(e.target).length === 0) { 149 div.removeClass("active"); 150 } 151 }); 152 } 153 154 const MenuScroll = (function() { 155 let menu, chevronLeft, chevronRight; 156 157 function init() { 158 cleanup(); 159 160 if (window.innerWidth >= 992) return; 161 162 menu = document.querySelector('.header-main-menu > ul'); 163 if (!menu) return; 164 165 insertChevrons(); 166 scrollToActive(); 167 updateChevrons(); 168 attachEvents(); 169 } 170 171 function cleanup() { 172 const existingLeft = document.querySelector('.scroll-button-left'); 173 const existingRight = document.querySelector('.scroll-button-right'); 174 175 if (existingLeft) existingLeft.remove(); 176 if (existingRight) existingRight.remove(); 177 178 if (menu) { 179 menu.removeEventListener('scroll', updateChevrons); 180 } 181 182 chevronLeft = null; 183 chevronRight = null; 184 } 185 186 function insertChevrons() { 187 const container = menu.parentElement; 188 189 const leftChevron = document.createElement('div'); 190 leftChevron.className = 'scroll-button-left'; 191 leftChevron.innerHTML = '<svg width="6" height="10" viewB
191ox="0 0 8 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M6.00016 12L7.41016 10.59L2.83014 6L7.41016 1.41L6.00016 -1.23266e-07L0.0001369 6L6.00016 12Z" /></svg>'; 192 193 const rightChevron = document.createElement('div'); 194 rightChevron.className = 'scroll-button-right'; 195 rightChevron.innerHTML = '<svg width="6" height="10" viewBox="0 0 8 12" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M1.41 0L0 1.41L4.58002 6L0 10.59L1.41 12L7.41002 6L1.41 0Z" /></svg>'; 196 197 container.insertBefore(leftChevron, menu); 198 container.appendChild(rightChevron); 199 200 chevronLeft = leftChevron; 201 chevronRight = rightChevron; 202 } 203 204 function scrollToActive() { 205 const activeItem = menu.querySelector('.current-menu-item'); 206 if (!activeItem) return; 207 208 const maxScroll = menu.scrollWidth - menu.clientWidth; 209 const menuRect = menu.getBoundingClientRect(); 210 const itemRect = activeItem.getBoundingClientRect(); 211 const offset = itemRect.left - menuRect.left - 12; 212 213 let targetScroll = menu.scrollLeft + offset; 214 215 if (targetScroll < 0) { 216 targetScroll = 0; 217 } else if (targetScroll > maxScroll) { 218 targetScroll = maxScroll; 219 } 220 221 menu.scrollTo({ 222 left: targetScroll, 223 behavior: 'smooth' 224 }); 225 } 226 227 function updateChevrons() { 228 const scrollLeft = menu.scrollLeft; 229 const maxScroll = menu.scrollWidth - menu.clientWidth; 230 231 if (scrollLeft <= 1) { 232 chevronLeft.classList.add('disabled'); 233 } else { 234 chevronLeft.classList.remove('disabled'); 235 } 236 237 if (scrollLeft >= maxScroll - 1) { 238 chevronRight.classList.add('disabled'); 239 } else { 240 chevronRight.classList.remove('disabled'); 241 } 242 } 243 244 function scrollByItems(direction) { 245 const items = Array.from(menu.querySelectorAll('li')); 246 if (items.length === 0) return; 247 248 let scrollAmount = 0; 249 const startIndex = direction === 'right' ? 0 : Math.max(0, items.length - 2); 250 const endIndex = direction === 'right' ? 2 : items.length; 251 252 for (let i = startIndex; i < Math.min(endIndex, items.length) && i < startIndex + 2; i++) { 253 scrollAmount += items[i].offsetWidth; 254 } 255 256 const scrollDirection = direction === 'right' ? scrollAmount : -scrollAmount; 257 const currentScroll = menu.scrollLeft; 258 const maxScroll = menu.scrollWidth - menu.clientWidth; 259 260 let targetScroll = currentScroll + scrollDirection; 261 262 if (targetScroll < 0) { 263 targetScroll = 0; 264 } else if (targetScroll > maxScroll) { 265 targetScroll = maxScroll; 266 } 267 268 menu.scrollTo({ 269 left: targetScroll, 270 behavior: 'smooth' 271 }); 272 } 273 274 function attachEvents() { 275 chevronLeft.addEventListener('click', function() { 276 if (!this.classList.contains('disabled')) { 277 scrollByItems('left'); 278 } 279 }); 280 281 chevronRight.addEventListener('click', function() { 282 if (!this.classList.contains('disabled')) { 283 scrollByItems('right'); 284 } 285 }); 286 287 menu.addEventListener('scroll', updateChevrons); 288 } 289 290 return { 291 init: init 292 }; 293 })(); 294 295 function fixCartPosition() { 296 const cart = document.querySelector('.cart-button'); 297 if (!cart) return; 298 299 if (window.innerWidth < 992) { 300 cart.style.removeProperty('right'); 301 return; 302 } 303 304 const originalPosition = cart.style.position; 305 cart.style.position = 'static'; 306 307 const cartRect = cart.getBoundingClientRect(); 308 const rightPosition = window.innerWidth - cartRect.right; 309 310 cart.style.position = originalPosition; 311 cart.style.right = rightPosition + 'px'; 312 } 313 314 MenuScroll.init(); 315 fixCartPosition(); 316
317 let clearTimer; 318 let cartResizeTimer; 319 let dropdownResizeTimer; 320 $(window).on('resize', function() { 321 clearTimeout(clearTimer); 322 resizeTimer = setTimeout(function() { 323 MenuScroll.init(); 324 }, 50); 325 326 clearTimeout(cartResizeTimer); 327 cartResizeTimer = setTimeout(function() { 328 fixCartPosition(); 329 }, 50); 330 331 }); 332 333 const CheckoutOrderReview = { 334 storageKey: 'checkout_order_review_state', 335 $heading: null, 336 $tbody: null, 337 breakpoint: 768, 338 339 init: function() { 340 this.cacheElements(); 341 342 if (window.innerWidth >= this.breakpoint) { 343 this.resetDesktop(); 344 return; 345 } 346 347 this.restoreState(); 348 this.bindEvents(); 349 this.cleanupOnLeave(); 350 }, 351 352 cacheElements: function() { 353 this.$heading = $('#order_review_heading'); 354 this.$tbody = $('.woocommerce-checkout .woocommerce-checkout-review-order-table tbody'); 355 }, 356 357 restoreState: function() { 358 const isOpen = sessionStorage.getItem(this.storageKey); 359 360 if (isOpen === null) { 361 // ÐеÑÐ²Ð°Ñ Ð·Ð°Ð³ÑÑзка - ÑвоÑаÑиваем 362 this.$tbody.hide(); 363 this.$heading.addClass('collapsed'); 364 sessionStorage.setItem(this.storageKey, 'closed'); 365 } else if (isOpen === 'open') { 366 this.$tbody.show(); 367 this.$heading.removeClass('collapsed'); 368 } else { 369 this.$tbody.hide(); 370 this.$heading.addClass('collapsed'); 371 } 372 }, 373 374 bindEvents: function() { 375 const self = this; 376 377 this.$heading.on('click', function() { 378 if (window.innerWidth >= self.breakpoint) { 379 return; 380 } 381 self.toggleState(); 382 }); 383 384 $(document.body).on('updated_checkout', function() { 385 self.cacheElements(); 386 387 if (window.innerWidth >= self.breakpoint) { 388 self.resetDesktop(); 389 return; 390 } 391 392 self.restoreState(); 393 }); 394 395 $(window).on('resize', function() { 396 if (window.innerWidth >= self.breakpoint) { 397 self.resetDesktop(); 398 } else { 399 self.restoreState(); 400 } 401 }); 402 }, 403 404 toggleState: function() { 405 const isCurrentlyOpen = this.$tbody.is(':visible'); 406 407 if (isCurrentlyOpen) { 408 this.$tbody.slideUp(300); 409 this.$heading.addClass('collapsed'); 410 sessionStorage.setItem(this.storageKey, 'closed'); 411 } else { 412 this.$tbody.slideDown(300); 413 this.$heading.removeClass('collapsed'); 414 sessionStorage.setItem(this.storageKey, 'open'); 415 } 416 }, 417 418 resetDesktop: function() { 419 this.$tbody.show().removeAttr('style'); 420 this.$heading.removeClass('collapsed'); 421 }, 422 423 cleanupOnLeave: function() { 424 const self = this; 425 426 $(window).on('beforeunload', function() { 427 sessionStorage.removeItem(self.storageKey); 428 }); 429 } 430 }; 431 432 if ($('body').hasClass('woocommerce-checkout')) { 433 CheckoutOrderReview.init(); 434 435 const closeButton = document.querySelector('.cart-checkout-close'); 436 437 if (closeButton) { 438 closeButton.addEventListener('click', function(e) { 439 e.preventDefault(); 440 441 if (window.innerWidth < 768) { 442 sessionStorage.setItem('openCartOnReturn', 'true'); 443 sessionStorage.setItem('checkoutReturnUrl', window.location.href); 444 } 445 446 window.history.back(); 447 }); 448 } 449 450 sessionStorage.removeItem('openCartOnReturn');
451 sessionStorage.removeItem('checkoutReturnUrl'); 452 } 453 454 // if (!$('body').hasClass('woocommerce-checkout') && window.innerWidth < 768 && sessionStorage.getItem('openCartOnReturn') === 'true') { 455 // const checkoutUrl = sessionStorage.getItem('checkoutReturnUrl'); 456 // 457 // if (checkoutUrl && document.referrer.includes(checkoutUrl.split('?')[0])) { 458 // sessionStorage.removeItem('openCartOnReturn'); 459 // sessionStorage.removeItem('checkoutReturnUrl'); 460 // 461 // setTimeout(function() { 462 // const $cart = $('.lpd-shopping-cart'); 463 // if (!$cart.hasClass('active')) { 464 // $('.cart-button').trigger('click'); 465 // } 466 // }, 100); 467 // } else { 468 // sessionStorage.removeItem('openCartOnReturn'); 469 // sessionStorage.removeItem('checkoutReturnUrl'); 470 // } 471 // } 472 473 474 jQuery(document.body).on('added_to_cart', function() { 475 const countElement = document.querySelector('.cart-icon .count'); 476 if (countElement) { 477 countElement.classList.remove('blink-animation'); 478 void countElement.offsetWidth; 479 countElement.classList.add('blink-animation'); 480 481 setTimeout(function() { 482 countElement.classList.remove('blink-animation'); 483 }, 400); 484 } 485 }); 486 487 jQuery('.pizza-product-filter__toggle').on('click', function(){ 488 jQuery(this).toggleClass('active'); 489 jQuery('.pizza-product-filter').toggleClass('show'); 490 }); 491 if (jQuery('.main-slider-list').length>0) { 492 jQuery('.main-slider-list').slick({ 493 lazyLoad: 'ondemand', 494 autoplay: true, 495 autoplaySpeed: 5000, 496 infinite: true, 497 arrows: true, 498 dots: false, 499 slidesToShow: 1, 500 slidesToScroll: 1, 501 fade: true, 502 cssEase: 'linear', 503 // adaptiveHeight: true 504 prevArrow: '<button class="slick-prev"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="currentColor" d="M238.475 475.535l7.071-7.07c4.686-4.686 4.686-12.284 0-16.971L50.053 256 245.546 60.506c4.686-4.686 4.686-12.284 0-16.971l-7.071-7.07c-4.686-4.686-12.284-4.686-16.97 0L10.454 247.515c-4.686 4.686-4.686 12.284 0 16.971l211.051 211.05c4.686 4.686 12.284 4.686 16.97-.001z"></path></svg></button>', 505 nextArrow: '<button class="slick-next"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="currentColor" d="M17.525 36.465l-7.071 7.07c-4.686 4.686-4.686 12.284 0 16.971L205.947 256 10.454 451.494c-4.686 4.686-4.686 12.284 0 16.971l7.071 7.07c4.686 4.686 12.284 4.686 16.97 0l211.051-211.05c4.686-4.686 4.686-12.284 0-16.971L34.495 36.465c-4.686-4.687-12.284-4.687-16.97 0z" ></path></svg></button>', 506 }); 507 } 508 509 if($('.main-intro-slider').length > 0) { 510 let mainIntroSlider = new Swiper('.main-intro-slider .swiper', { 511 slidesPerView: 1, 512 spaceBetween: 0, 513 preloadImages: false, 514 lazy: true, 515 speed: 1000, 516 loop: true, 517 effect: 'fade', 518 fadeEffect: { 519 crossFade: true 520 }, 521 autoplay: { 522 delay: 3000, 523 disableOnInteraction: false 524 }, 525 navigation: { 526 nextEl: ".main-intro-slider-nav .swiper-button-next", 527 prevEl: ".main-intro-slider-nav .swiper-button-prev", 528 }, 529 pagination: { 530 el: ".main-intro-slider-nav-pagination", 531 clickable: true, 532 }, 533 }); 534 } 535 536 const CartEmptySlider = { 537 instance: null, 538 539 init: function() { 540 const $el = $('.cart-empty-slider'); 541 542 if (!$el.length) { 543 this.destroy(); 544 return; 545 } 546 547 this.destroy(); 548 549 const slidesCount = $el.find('.swiper-slide').length; 550 551 this.instance = new Swiper('.cart-empty-slider .swiper', { 552 slidesPerView: 1, 553 spaceBetween: 0, 554 preloadImages: true, 555 lazy: false, 556 speed: 1000, 557 loop: slidesCount > 1, 558 effect: 'fade', 559 fadeEffect: { 560 crossFade: true 561 }, 562 autoplay: { 563 delay: 1000, 564 disableOnInteraction: false 565 }, 566 pagination: { 567 el: ".cart-empty-slider-nav-pagination", 568 clickable: true, 569 }, 570 observer: true, 571 observeParents: true 572 }); 573 }, 574 575 destroy: function() { 576 if (this.instance) { 577 this.instance.destroy(true, true); 578 this.instance = null; 579 } 580 } 581 }; 582 583 $(document.body).on('dds_update_mini_cart', function() { 584 setTimeout(function() { 585 CartEmptySlider.init(); 586 }, 100); 587 });
588 589 $cartBtn.on('click', function() { 590 if ($cart.hasClass('active')) { 591 setTimeout(function() { 592 CartEmptySlider.init(); 593 }, 100); 594 } 595 }); 596 597 CartEmptySlider.init(); 598 599 $(document).on('click', '.cart-dropdown-empty-menu-btn', function (e) { 600 if ($(window).width() > 992) { 601 return; 602 } 603 604 e.preventDefault(); 605 closeAll(); 606 $menuOpenBtn.trigger('click'); 607 }); 608 609 if($('.review-slider').length > 0) { 610 let reviewSlider = new Swiper('.review-slider .swiper', { 611 slidesPerView: 1.3, 612 spaceBetween: 15, 613 loop: false, 614 navigation: { 615 nextEl: ".review-slider-nav .swiper-button-next", 616 prevEl: ".review-slider-nav .swiper-button-prev", 617 }, 618 pagination: { 619 el: ".review-slider-nav-pagination", 620 clickable: true, 621 }, 622 breakpoints: { 623 420: { 624 slidesPerView: 2.3, 625 }, 626 580: { 627 slidesPerView: 3, 628 }, 629 992: { 630 slidesPerView: 4, 631 spaceBetween: 20, 632 }, 633 1400: { 634 slidesPerView: 5, 635 spaceBetween: 20, 636 } 637 }, 638 }); 639 } 640 641 if($('.clients-slider').length > 0) { 642 let clientsSlider = new Swiper('.clients-slider .swiper', { 643 slidesPerView: 1.3, 644 spaceBetween: 20, 645 loop: false, 646 navigation: { 647 nextEl: ".clients-slider-nav .swiper-button-next", 648 prevEl: ".clients-slider-nav .swiper-button-prev", 649 }, 650 pagination: { 651 el: ".clients-slider-nav-pagination", 652 clickable: true, 653 }, 654 breakpoints: { 655 580: { 656 slidesPerView: 2, 657 }, 658 992: { 659 slidesPerView: 3, 660 }, 661 }, 662 }); 663 } 664 665 if($('.recent-posts-slider').length > 0) { 666 let recentPostsSlider = new Swiper('.recent-posts-slider .swiper', { 667 slidesPerView: 1.3, 668 spaceBetween: 20, 669 loop: false, 670 navigation: { 671 nextEl: ".recent-posts-slider-nav .swiper-button-next", 672 prevEl: ".recent-posts-slider-nav .swiper-button-prev", 673 }, 674 pagination: { 675 el: ".recent-posts-slider-nav-pagination", 676 clickable: true, 677 }, 678 breakpoints: { 679 580: { 680 slidesPerView: 2, 681 }, 682 992: { 683 slidesPerView: 3, 684 }, 685 }, 686 }); 687 } 688 689 if (jQuery('.page-slider').length>0) { 690 jQuery('.page-slider').slick({ 691 autoplay: false, 692 infinite: true, 693 arrows: false, 694 dots: true, 695 slidesToScroll: 1, 696 adaptiveHeight: true 697 }); 698 } 699 700 701 if(jQuery('.description_tab').length === 0) { 702 jQuery('.wc-tabs').hide(); 703 } 704 705 706 var $accordParent; 707 if ($('.accord').hasClass('open-first')) { 708 $('.accord.open-first>li:first-child>div').addClass('active'); 709 } 710 $(document).on('click', '.accord-title', function (e) { 711 var $accordParent = $(this).closest('.accord'); 712 if(!$accordParent.hasClass('accord-noclose')) { 713 if (!$(this).hasClass('active')) { 714 $accordParent.find('.accord-content').slideUp('fast').removeClass('active'); 715 $accordParent.find('.accord-title').removeClass('active'); 716 $(this).addClass('active'); 717 $(this).next().slideDown('fast').addClass('active'); 718 $accordParent.removeClass('open-first'); 719 } else { 720 $accordParent.find('.accord-content').slideUp('fast').removeClass('active'); 721 $(this).removeClass('active'); 722 } 723 } else { 724 if (!$(this).hasClass('active')) { 725 $(this).addClass('active'); 726 $(this).next().slideDown('fast').addClass('active'); 727 $accordParent.removeClass('open-first'); 728 } else { 729 $(this).next().slideUp('fast').removeClass('active'); 730 $(this).removeClass('active'); 731 } 732 } 733 });
734 735 736 if (jQuery('.products.products-slider').length>0) { 737 var slidesShow = 2, 738 slidesShow1200 = 2; 739 if(jQuery('.products.products-slider').hasClass('items-3')) { 740 slidesShow = 3, 741 slidesShow1200 = 2; 742 } 743 jQuery('.products.products-slider').slick({ 744 arrows: true, 745 dots: true, 746 infinite: false, 747 slidesToShow: slidesShow, 748 slidesToScroll: 1, 749 prevArrow: '<button class="slick-prev"><svg width="48px" height="50px" viewBox="0 0 48 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="icon-arrow-left" fill="#959595"> <g id="icon-arrow-right" transform="translate(24.000000, 25.000000) rotate(180.000000) translate(-24.000000, -25.000000) "> <path d="M46.45,22.55 L24,0.05 L19.05,5 L35.55,21.5 L0.5,21.5 L0.5,28.5 L35.55,28.5 L19.05,45 L24,49.95 L46.45,27.5 C47.15,26.8 47.5,25.9666667 47.5,25 C47.5,24.0333333 47.15,23.2166667 46.45,22.55 Z" id="Shape" fill-rule="nonzero"></path> </g> </g> </g> </svg></button>', 750 nextArrow: '<button class="slick-next"><svg width="48px" height="50px" viewBox="0 0 48 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="icon-arrow-right" fill-rule="nonzero" fill="#959595"> <g id="Shape"> <path d="M46.45,22.55 L24,0.05 L19.05,5 L35.55,21.5 L0.5,21.5 L0.5,28.5 L35.55,28.5 L19.05,45 L24,49.95 L46.45,27.5 C47.15,26.8 47.5,25.9666667 47.5,25 C47.5,24.0333333 47.15,23.2166667 46.45,22.55 Z"></path> </g> </g> </g> </svg></button>', 751 responsive: [ 752 { 753 breakpoint: 1200, 754 settings: { 755 infinite: false, 756 arrows: false, 757 slidesToShow: slidesShow1200, 758 } 759 }, 760 { 761 breakpoint: 992, 762 settings: { 763 infinite: false, 764 arrows: false, 765 slidesToShow: 2, 766 slidesToScroll: 1, 767 } 768 }, 769 { 770 breakpoint: 768, 771 settings: { 772 infinite: false, 773 arrows: false, 774 slidesToShow: 1, 775 slidesToScroll: 1, 776 } 777 } 778 ] 779 }); 780 } 781 782 if (jQuery('.products.products-uslider').length>0) { 783 jQuery('.products.products-uslider').slick({ 784 arrows: false, 785 dots: true, 786 infinite: false, 787 slidesToShow: 1, 788 slidesToScroll: 1, 789 responsive: [ 790 { 791 breakpoint: 768, 792 settings: { 793 infinite: false, 794 arrows: false, 795 slidesToShow: 1, 796 slidesToScroll: 1, 797 } 798 } 799 ] 800 }); 801 } 802 803 // if (jQuery('.clients-slider').length>0) { 804 // jQuery('.clients-slider').slick({ 805 // arrows: true, 806 // dots: false, 807 // infinite: false, 808 // slidesToShow: 3, 809 // slidesToScroll: 1, 810 // prevArrow: '<button class="slick-prev"><svg width="48px" height="50px" viewBox="0 0 48 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="icon-arrow-left" fill="#959595"> <g id="icon-arrow-right" transform="translate(24.000000, 25.000000) rotate(180.000000) translate(-24.000000, -25.000000) "> <path d="M46.45,22.55 L24,0.05 L19.05,5 L35.55,21.5 L0.5,21.5 L0.5,28.5 L35.55,28.5 L19.05,45 L24,49.95 L46.45,27.5 C47.15,26.8 47.5,25.9666667 47.5,25 C47.5,24.0333333 47.15,23.2166667 46.45,22.55 Z" id="Shape" fill-rule="nonzero"></path> </g> </g> </g> </svg></button>', 811 // nextArrow: '<button class="slick-next"><svg width="48px" height="50px" viewBox="0 0 48 50" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g id="icon-arrow-right" fill-rule="nonzero" fill="#959595"> <g id="Shape"> <path d="M46.45,22.55 L24,0.05 L19.05,5 L35.55,21.5 L0.5,21.5 L0.5,28.5 L35.55,28.5 L19.05,45 L24,49.95 L46.45,27.5 C47.15,26.8 47.5,25.9666667 47.5,25 C47.5,24.0333333 47.15,23.2166667 46.45,22.55 Z"></path> </g> </g> </g> </svg></button>', 812 // responsive: [ 813 // { 814 // breakpoint: 992, 815 // settings: { 816 // slidesToShow: 2, 817 // slidesToScroll: 1,
818 // arrows: false, 819 // dots: true 820 // } 821 // }, 822 // { 823 // breakpoint: 768, 824 // settings: { 825 // slidesToShow: 1, 826 // slidesToScroll: 1, 827 // arrows: false, 828 // dots: true 829 // } 830 // } 831 // ] 832 // }); 833 // } 834 835 836 if($('.variations--photo').length>0) { 837 $('.variations-wrap .variations--photo .variant_pr').on('click', function(){ 838 var el = $(this); 839 if($('body').hasClass('single-product')) { 840 if (el.find('input').data('variation_image') !== '') { 841 var elImage = el.find('input').data('variation_image'); 842 $('.woocommerce-product-gallery__img a').attr("href", elImage); 843 $('.woocommerce-product-gallery__img img').attr("src", elImage); 844 } 845 } 846 }); 847 $('.recentCart .variations--photo .variant-pr').on('click', function(){ 848 var el = $(this); 849 if (el.find('input').data('variation_image') !== '') { 850 var elImage = el.find('input').data('variation_image') 851 el.parents('.product-wrap').find('.product-image img').attr("src", elImage); 852 } 853 }); 854 } 855 856 // Sticky add to cart (single product) 857 const StickyAddToCart = { 858 $originalBtn: null, 859 $stickyWrap: null, 860 $stickyBtn: null, 861 observer: null, 862 863 stateClasses: ['loading', 'added'], 864 classObserver: null, 865 866 init: function() { 867 this.$originalBtn = $('.single_add_to_cart_button'); 868 this.$stickyWrap = $('.sticky-add-to-cart'); 869 this.$stickyBtn = this.$stickyWrap.find('button'); 870 871 if (!this.$originalBtn.length || !this.$stickyWrap.length || !this.$stickyBtn.length) { 872 return; 873 } 874 875 this.bindObserver(); 876 this.bindClassSync(); 877 this.bindEvents(); 878 }, 879 880 bindObserver: function() { 881 const self = this; 882 883 this.observer = new IntersectionObserver(function(entries) { 884 const entry = entries[0]; 885 self.$stickyWrap.toggleClass('is-visible', entry.boundingClientRect.top < 0 && !entry.isIntersecting); 886 }, { threshold: 0 }); 887 888 this.observer.observe(this.$originalBtn.get(0)); 889 }, 890 891 bindClassSync: function() { 892 const self = this; 893 const originalEl = this.$originalBtn.get(0); 894 895 this.classObserver = new MutationObserver(function() { 896 self.stateClasses.forEach(function(stateClass) { 897 self.$stickyBtn.toggleClass(stateClass, originalEl.classList.contains(stateClass)); 898 }); 899 }); 900 901 this.classObserver.observe(originalEl, { attributes: true, attributeFilter: ['class'] }); 902 }, 903 904 bindEvents: function() { 905 const self = this; 906 907 this.$stickyBtn.on('click', function(e) { 908 e.preventDefault(); 909 self.$originalBtn.trigger('click'); 910 }); 911 } 912 }; 913 914 if ($('body').hasClass('single-product')) { 915 StickyAddToCart.init(); 916 } 917 918 // Show all reviews button 919 // if ($('.btn-reviews-show').length > 0) { 920 // $('.btn-reviews-show').on('click', function() { 921 // $('.review-hide').each(function(index, element) { 922 // $(element).fadeIn().removeClass('review-hide'); 923 // }); 924 // $(this).remove(); 925 // $('.btn-all-reviews').removeClass('hidden'); 926 // }); 927 // }; 928 929 // Fancybox for products 930 jQuery('.woocommerce-product-gallery__img a').fancybox({ 931 protect: true 932 }); 933 934 // Mail popup 935 // if ($('.popup-mail').length > 0) { 936 // $.fancybox.open( $('.popup-mail'), { 937 // animationEffect: 'fade' 938 // }); 939 // } 940 941 // $('.btn-popup-phones').on('click', function (event) { 942 // event.preventDefault(); 943 // $.fancybox.open({ 944 // src: '.popup-phones', 945 // type: 'inline', 946 // toolbar: false, 947 // smallBtn: true 948 // }); 949 // }); 950 951 $('.btn-popup-loc').on('click', function (event) { 952 event.preventDefault(); 953 $.fancybox.open({ 954 src: '.popup-loc', 955 type: 'inline', 956 toolbar: false, 957 smallBtn: true 958 }); 959 });
960 961 if ($('.popup-cart-off').length > 0) { 962 $.fancybox.open( $('.popup-cart-off'), { 963 animationEffect: 'fade' 964 }); 965 } 966 967 $('.not-link').on('click','>a',function(event){ 968 event.preventDefault(); 969 }); 970 if (window.matchMedia("screen and (max-width: 991px)").matches) { 971 $('li.product').on('click', function (event) { 972 $('.product-link').css('display','none'); 973 $productLink = $(this).find('.product-link'); 974 if(($productLink).is(':hidden')) { 975 $productLink.css('display','block'); 976 } 977 }); 978 } 979 if (window.matchMedia("screen and (min-width: 992px)").matches) { 980 $('.ingredients__toggle').on('click', function () { 981 $(this).toggleClass('active'); 982 $('.product-ingredients__list').slideToggle().toggleClass('show'); 983 }) 984 } 985 986 // Scroll link 987 $(".goto").on("click", function (event) { 988 event.preventDefault(); 989 var id = $(this).attr('href'), 990 top = $(id).offset().top; 991 if($(this).closest('.rest-menu__list').length>0) { 992 if (window.matchMedia("screen and (max-width: 479px)").matches) { 993 top = $(id).offset().top - 95; 994 console.log('1'); 995 } else { 996 top = $(id).offset().top - $(id).height() - 15; 997 console.log('2'); 998 } 999 } 1000 $('body,html').animate({scrollTop: top}, 500); 1001 }); 1002 1003 // Popup APP 1004 const APP_POPUP_CONFIG = { 1005 cookieName: 'app_download_banner', 1006 cookieDuration: 168, 1007 showDelay: 3000, 1008 appScheme: 'rollclub://' 1009 }; 1010 1011 function getCookie(name) { 1012 const matches = document.cookie.match(new RegExp( 1013 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 1014 )); 1015 return matches ? decodeURIComponent(matches[1]) : undefined; 1016 } 1017 1018 function setCookie(name, value, hours) { 1019 const date = new Date(); 1020 date.setHours(date.getHours() + hours); 1021 document.cookie = `${name}=${value};path=/;expires=${date.toUTCString()}`; 1022 } 1023 1024 function detectPlatform() { 1025 const userAgent = navigator.userAgent || navigator.vendor || window.opera; 1026 1027 if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { 1028 return 'ios'; 1029 } else if (/android/i.test(userAgent)) { 1030 return 'android'; 1031 } 1032 return 'desktop'; 1033 } 1034 1035 function checkIfAppInstalled() { 1036 return new Promise((resolve) => { 1037 const platform = detectPlatform(); 1038 1039 if (platform === 'desktop') { 1040 resolve(false); 1041 return; 1042 } 1043 1044 const startTime = Date.now(); 1045 let hasFocus = true; 1046 1047 const onBlur = () => { 1048 hasFocus = false; 1049 }; 1050 1051 const onVisibilityChange = () => { 1052 if (document.hidden) { 1053 hasFocus = false; 1054 } 1055 }; 1056 1057 window.addEventListener('blur', onBlur); 1058 document.addEventListener('visibilitychange', onVisibilityChange); 1059 1060 const iframe = document.createElement('iframe'); 1061 iframe.style.display = 'none'; 1062 iframe.src = APP_POPUP_CONFIG.appScheme; 1063 document.body.appendChild(iframe); 1064 1065 setTimeout(() => { 1066 document.body.removeChild(iframe); 1067 window.removeEventListener('blur', onBlur); 1068 document.removeEventListener('visibilitychange', onVisibilityChange); 1069 1070 const endTime = Date.now(); 1071 1072 if (!hasFocus || document.hidden) { 1073 resolve(true); 1074 } else if (endTime - startTime < 2000) { 1075 resolve(false); 1076 } else { 1077 resolve(true); 1078 } 1079 }, 1500); 1080 }); 1081 } 1082 1083 function updatePopupForPlatform(popup) { 1084 const platform = detectPlatform(); 1085 const mobileContent = popup.querySelector('.popup-bottom__mobile'); 1086 const desktopContent = popup.querySelector('.popup-bottom__desktop'); 1087 const appStoreLink = popup.querySelector('.app-store-link'); 1088 const playStoreLink = popup.querySelector('.play-store-link'); 1089 const imgsContainer = popup.querySelector('.popup-bottom__img'); 1090 1091 if (platform === 'desktop') { 1092 if (mobileContent) mobileContent.style.display = 'none'; 1093 if (desktopContent) desktopContent.style.display = 'block'; 1094 } else { 1095 if (mobileContent) mobileContent.style.display = 'block'; 1096 if (desktopContent) desktopContent.style.display = 'none'; 1097 1098 if (platform === 'ios' && playStoreLink) { 1099 playStoreLink.style.display = 'none'; 1100 if (imgsContainer) { 1101 imgsContainer.style.justifyContent = 'center'; 1102 } 1103 if (appStoreLink) { 1104 appStoreLink.style.width = 'auto'; 1105 } 1106 } else if (platform === 'android' && appStoreLink) { 1107 appStoreLink.style.display = 'none'; 1108 if (imgsContainer) { 1109 imgsContainer.style.justifyContent = 'center'; 1110 } 1111 if (playStoreLink) { 1112 playStoreLink.style.width = 'auto'; 1113 } 1114 } 1115 } 1116 } 1117 1118 async function initAppDownloadPopup() { 1119 const popup = document.querySelector('.popup-bottom'); 1120 1121 if (!popup || getCookie(APP_POPUP_CONFIG.cookieName) === 'true') { 1122 return; 1123 } 1124 1125 // const isAppInstalled = await checkIfAppInstalled(); 1126 // 1127 // if (isAppInstalled) { 1128 // return; 1129 // } 1130 1131 updatePopupForPlatform(popup); 1132 1133 setTimeout(function() { 1134 const closeButton = popup.querySelector('.popup-bottom__close'); 1135 1136 if (closeButton) { 1137 closeButton.addEventListener('click', function() {
1138 setCookie( 1139 APP_POPUP_CONFIG.cookieName, 1140 'true', 1141 APP_POPUP_CONFIG.cookieDuration 1142 ); 1143 popup.classList.remove('show'); 1144 }); 1145 } 1146 1147 popup.classList.add('show'); 1148 }, APP_POPUP_CONFIG.showDelay); 1149 } 1150 1151 if (document.readyState === 'loading') { 1152 document.addEventListener('DOMContentLoaded', initAppDownloadPopup); 1153 } else { 1154 initAppDownloadPopup(); 1155 } 1156 1157 // Adv popup 1158 function setPopupShown(days) { 1159 const expiry = new Date().getTime() + (days * 24 * 60 * 60 * 1000); 1160 1161 try { 1162 localStorage.setItem('popup_adv_shown', expiry); 1163 } catch (e) { 1164 console.log('localStorage unavailable'); 1165 } 1166 1167 const date = new Date(); 1168 date.setTime(expiry); 1169 document.cookie = "popup_adv_shown=yes; path=/; expires=" + date.toUTCString(); 1170 1171 try { 1172 sessionStorage.setItem('popup_adv_shown_session', 'yes'); 1173 } catch (e) { 1174 console.log('sessionStorage unavailable'); 1175 } 1176 } 1177 1178 function isPopupShown() { 1179 try { 1180 if (sessionStorage.getItem('popup_adv_shown_session') === 'yes') { 1181 return true; 1182 } 1183 } catch (e) {} 1184 1185 try { 1186 const expiry = localStorage.getItem('popup_adv_shown'); 1187 if (expiry) { 1188 const now = new Date().getTime(); 1189 if (now < parseInt(expiry)) { 1190 return true; 1191 } else { 1192 localStorage.removeItem('popup_adv_shown'); 1193 } 1194 } 1195 } catch (e) {} 1196 1197 if (getCookie('popup_adv_shown') === 'yes') { 1198 return true; 1199 } 1200 1201 return false; 1202 } 1203 1204 if (!isPopupShown() && $('.popup-adv').length > 0) { 1205 setTimeout(function() { 1206 setPopupShown(1); 1207 $.fancybox.open($('.popup-adv'), { 1208 animationEffect: 'fade', 1209 touch: false 1210 }); 1211 }, 3000); 1212 } 1213
1214 if ($('.woocommerce-additional-fields__field-wrapper').length > 0) { 1215 $('.field-form-quantity').on( 'click', '.plus, .minus', function() { 1216 let qty = $( this ).parent().find( '.qty' ); 1217 let val = parseFloat(qty.val()); 1218 let max = parseFloat(qty.attr( 'max' )); 1219 let min = parseFloat(qty.attr( 'min' )); 1220 if ( $( this ).is( '.plus' ) ) { 1221 if ( max && ( max <= val ) ) { 1222 qty.val( max ); 1223 } else { 1224 qty.val( val + 1 ); 1225 } 1226 } else { 1227 if ( min && ( min >= val ) ) { 1228 qty.val( min ); 1229 } else if ( val > 0 ) { 1230 qty.val( val - 1 ); 1231 } 1232 } 1233 }); 1234 } 1235 1236 const GiftChoice = { 1237 init: function() { 1238 if (typeof woocommerce_params === 'undefined') { 1239 return; 1240 } 1241 1242 this.bindEvents(); 1243 this.checkExistingChoice(); 1244 }, 1245 1246 bindEvents: function() { 1247 const self = this; 1248 1249 $(document).on('change', 'input[name="gift_choice"]', function() { 1250 self.saveChoice($(this)); 1251 }); 1252 1253 $(document.body).on('updated_cart_totals wc_fragments_refreshed', function() { 1254 self.checkExistingChoice(); 1255 }); 1256 }, 1257 1258 saveChoice: function($input) { 1259 const giftId = $input.val(); 1260 1261 $.ajax({
1262 url: woocommerce_params.ajax_url, 1263 type: 'POST', 1264 data: { 1265 action: 'save_gift_choice', 1266 gift_id: giftId, 1267 nonce: woocommerce_params.gift_choice_nonce 1268 }, 1269 success: function(response) { 1270 if (response.success) { 1271 console.log('Gift choice saved:', response.data.gift_id); 1272 } 1273 }, 1274 error: function(xhr, status, error) { 1275 console.error('AJAX error:', error); 1276 } 1277 }); 1278 }, 1279 1280 checkExistingChoice: function() { 1281 const $checkedGift = $('input[name="gift_choice"]:checked'); 1282 if ($checkedGift.length === 0) { 1283 $('input[name="gift_choice"]').prop('checked', false); 1284 } 1285 } 1286 }; 1287 1288 GiftChoice.init(); 1289 1290 const ReviewsShowMore = { 1291 init: function() { 1292 this.bindEvents(); 1293 }, 1294 1295 bindEvents: function() { 1296 $(document).on('click', '.js-review-more', function() { 1297 const $btn = $(this); 1298 const $desc = $btn.prev('.js-review-description'); 1299 1300 $desc.html($desc.data('full')); 1301 $btn.remove(); 1302 }); 1303 } 1304 }; 1305 1306 ReviewsShowMore.init(); 1307})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.