From 6edee6712d0f38d9d55ef61e090a02b503739b1a Mon Sep 17 00:00:00 2001 From: maksim Date: Tue, 24 Jun 2025 14:19:32 +0300 Subject: [PATCH] =?UTF-8?q?Andrei=20|=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D0=B9=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=B5=D0=BD=D1=87=D0=B5=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D0=B9=20js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/layout/assets/js/gp-main.js | 175 ------------------ .../catalog/assets/js/_gp-function.js | 77 -------- 2 files changed, 252 deletions(-) diff --git a/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js b/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js index b1b4c4a..ccda448 100644 --- a/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js +++ b/wp-content/themes/cosmopet/modules/layout/assets/js/gp-main.js @@ -1,133 +1,5 @@ 'use strict'; -jQuery(document).ready(function ($) { - // OVERLAY - // $('.product__main').on('click', '.open-overlay', function () { - // let product = $(this).closest('.product__item'), - // overlay = product.find('.product-item__overlay'); - - // $('.product__item').find('.product-item__overlay').css('top', '100%'); - // overlay.css('top', 0); - // }) - // END OVERLAY - - // $('.product__main').on('click', '.state__button', function(evt) { - // evt.preventDefault(); - // let product = $(this).closest('.product__item'); - // let price = $(this).data('product_price'); - // let id = $(this).data('product_id'); - // let qty = product.find('.counter__input').val(); - // product.find('.product-item-overlay__price').html(price * qty + ' '); - // product.find('.select__state').data('product_price', price).data('product_id', id).val($(this).text().trim()); - // product.find('.state__block').removeClass('expanded').css('height', '0'); - - // product.find('.add_to_cart_button').detach(); - // product.find('.product-item-overlay__button').prepend('Добавить в корзину'); - // }) - - // $('.product__main').on('click', '.counter__button', function(evt) { - // evt.preventDefault(); - // let product = $(this).closest('.product__item'); - // let price = parseFloat(product.find('.select__state').data('product_price')); - - // if (!price){ - // price = parseFloat(product.find('.product-item__price p').html()); - // } - // let qty = product.find('.counter__input'); - - // if ($(this).hasClass('minus') && parseInt(qty.val()) >= 2) { - // qty.val(parseInt(qty.val()) - 1); - // } else { - // if ($(this).hasClass('plus')) { - // qty.val(parseInt(qty.val()) + 1); - // } - // } - // product.find('.product-item-overlay__button a').attr('data-quantity', qty.val()) - // product.find('.product-item-overlay__price').html(price * qty.val() + ' '); - // }) - - // $('.product__main').on('click', '.select__state', function(evt) { - // evt.preventDefault(); - // let product = $(this).closest('.product__item'), - // listing = product.find('.state__block'); - - // if (listing.hasClass('expanded')) { - // listing.removeClass('expanded').css('height', '0'); - // } else { - // listing.addClass('expanded').css('height', 'auto'); - // } - - // product.find('.state__block').find('.state__button').removeClass('active'); - // product.find('.state__button').each(function () { - // if (product.find('.select__state').data('product_id') === $(this).data('product_id')) { - // $(this).addClass('active'); - // } - // }) - // }) - - - // let page = 1; - - // jQuery('body').on('click', '#load-more-products', function(e) { - // e.preventDefault(); - // page++; - - // let category = $(this).data('category_id'); - // let category_type = $(this).data('category_type'); - - // $.ajax({ - // type: 'POST', - // url: '/wp-admin/admin-ajax.php', - // dataType: 'html', - // data: { - // 'action' : 'get_products', - // 'get_page' : page, - // 'get_category' : category, - // 'get_category_type' : category_type, - // }, - // success: function(data) { - // // if($('
').html(data).find('.archive__item.ended').size() > 0) $('#load-more-products').parents('.cta').remove(); - // // else $('#load-more-products').parents('.cta').show(); - - // $('#load-more-products').detach(); - // $('.product__main').append(data); - // $('#load-more-products').prependTo('.product__footer'); - // }, - // error: function(data) { - // console.log(data); - // } - // }); - // }); - - // $('.wpfMainWrapper').prepend('
'); - // $('.wpfMainWrapper').find('.wpfFilterWrapper').appendTo($('.wpfFilters')); - - // $('.wpfFilterWrapper').each(function () { - // if ($(this).data('filter-type') === 'wpfPrice') { - // $(this).find('.wpfFilterContent').append('
'); - // $(this).find('.wpfPriceFilterRange').appendTo('.wpfExpandablePart'); - // $(this).find('.wpfPriceInputs').appendTo('.wpfExpandablePart'); - - // $(this).find('.wpfCurrencySymbol').detach(); - // $(this).find('.wpfFilterDelimeter').detach(); - // } - // }); - - // $('.wfpDescription').on('click', function () { - // $(this).closest('.wpfFilterWrapper').toggleClass('expanded').find('.wpfCheckboxHier').slideToggle(); - // $(this).parent().find('.wpfExpandablePart').slideToggle(); - // }) - - -}) - - - - - - - - // header toggleOpenX('.lang', '.lang__open', '.lang__list', '.lang__content', false); toggleHeader('#pc-menu','.header__menu-block','.header__pc-menu', '.white', 'white'); @@ -304,50 +176,3 @@ jQuery(document).ready(function($) { }); -// // Находим все элементы с классом login-open -// document.addEventListener('DOMContentLoaded', function() { -// const loginButtons = document.querySelectorAll('.login-open'); - -// loginButtons.forEach(button => { -// button.addEventListener('click', function(event) { -// event.preventDefault(); - -// const modal = document.querySelector('.modal'); -// const modalAside = document.querySelector('.modal__aside'); -// const modalLogin = document.querySelector('.modal__login'); - -// modal.classList.add('active'); -// modalLogin.classList.add('active'); - -// // Set width and slide in from right -// modalAside.style.width = '20vw'; -// modalAside.style.right = '0'; -// }); -// }); - -// const closeButtons = document.querySelectorAll('.modal-close'); -// const modal = document.querySelector('.modal'); - -// closeButtons.forEach(button => { -// button.addEventListener('click', closeModal); -// }); - -// modal.addEventListener('click', function(event) { -// if (event.target === modal) { -// closeModal(); -// } -// }); - -// function closeModal() { -// const modal = document.querySelector('.modal'); -// const modalAside = document.querySelector('.modal__aside'); -// const modalLogin = document.querySelector('.modal__login'); - -// modal.classList.remove('active'); -// modalLogin.classList.remove('active'); - -// // Reset styles -// modalAside.style.width = ''; -// modalAside.style.right = '-30vw'; -// } -// }); diff --git a/wp-content/themes/cosmopet/modules/shop/components/catalog/assets/js/_gp-function.js b/wp-content/themes/cosmopet/modules/shop/components/catalog/assets/js/_gp-function.js index 76766af..ed4f332 100644 --- a/wp-content/themes/cosmopet/modules/shop/components/catalog/assets/js/_gp-function.js +++ b/wp-content/themes/cosmopet/modules/shop/components/catalog/assets/js/_gp-function.js @@ -1,82 +1,5 @@ 'use strict'; -// // function -// export function modalOpen(buttonElement, contentElement){ -// let modal = document.querySelector('.modal'), -// aside = document.querySelector('.modal__aside'), -// elements = document.querySelectorAll(buttonElement), -// device = window.screen.width; - -// elements.forEach(e => { -// let thisContentElement = document.querySelector(contentElement); - -// e.onclick = function () { -// modal.classList.add('active'); -// thisContentElement.classList.add('active'); - -// let width = thisContentElement.clientWidth; - -// setTimeout(() => { -// if (device <= 720) { -// aside.style.width = `${device}px`; -// thisContentElement.style.opacity = 1; -// thisContentElement.style.filter = 'blur(0px)'; -// }else{ -// aside.style.width = `${width}px`; -// thisContentElement.style.opacity = 1; -// thisContentElement.style.filter = 'blur(0px)'; -// } -// }, 10); -// } -// }) -// } - -// export function modalClose(buttonElement) { -// let modal = document.querySelector('.modal'), -// aside = document.querySelector('.modal__aside'), -// asideItems = document.querySelectorAll('.modal__item'), -// elements = document.querySelectorAll(buttonElement); - -// elements.forEach(e => { -// e.onclick = function () { -// aside.style.width = '0px'; - -// asideItems.forEach(e => { -// if (e.classList.contains('active')) { -// e.style.filter = 'blur(10px)'; -// } -// }); - -// setTimeout(() => { -// asideItems.forEach(e => { -// if (e.classList.contains('active')) { -// e.classList.remove('active'); -// } -// }); - -// modal.classList.remove('active'); -// }, 300); -// } -// }) -// } - -// export function closeModalForm(close){ -// let buttons = document.querySelectorAll(close), -// modal = document.querySelector('.modal'); - -// buttons.forEach(button => { -// button.onclick = function (buttonEvent) { -// modal.classList.remove('active'); - -// if (!modal.querySelector('.modal-map.active')) { -// modal.querySelector('.modal-form.active').classList.remove('active'); -// }else{ -// modal.querySelector('.modal-map.active').classList.remove('active'); -// } -// } -// }) -// } - export function toggleOpenX(mainElement, buttonElement ,heightElement, contentElement, close) { let elements = document.querySelectorAll(mainElement);