diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index 2b5c7d3..9fcb336 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -293,16 +293,6 @@ function include_component($module_name, $component_name) { } -function theme_enqueue_scripts() { - // Materialize CSS - wp_enqueue_style('materialize-css', 'https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css', [], '1.0.0'); - - // Materialize JS - wp_enqueue_script('materialize-js', 'https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js', [], '1.0.0', true); -} -add_action('wp_enqueue_scripts', 'theme_enqueue_scripts'); - - /** * Регистрируем шаблоны из всех подпапок /templates/ diff --git a/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css b/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css index 74411bd..ec42595 100644 --- a/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css +++ b/wp-content/themes/cosmopet/modules/layout/assets/css/gp-style-core.css @@ -2073,7 +2073,92 @@ textarea{ } } +.container, .container-fluid { + width: 100%; + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto; +} + +.about_slider .prev, .about_slider .next { + position: absolute; + top: 50%; + transform: translateY(-50%); + cursor: pointer; + z-index: 99; + background-color: unset; +} + +.about_slider .next { + right: 29vw; +} + +.about_slider .prev { + left: 29vw; +} + +.about_slider .carousel-item { + height: 546px; + padding: 35px 50px 25px 50px; + padding: 50px 53px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + /* background: var(--creme-white, #F4F1F0); */ + background: #ffffff30; + backdrop-filter: blur(6px); + z-index: 1; + box-shadow: -2px 5px 22.9px 0px rgba(0, 0, 0, 0.25); +} + +.about_slider .swiper-slide-active { + backdrop-filter: blur(6px); + width: 429px!important; + z-index: 3; +} + +.about_slider .carousel-item img { + width: auto; +} +.about_slider .slide_info { + display: flex; + flex-direction: column; + gap: 15px; +} + +.about_slider .carousel-item::after { + content: ''; + background-image: url(/wp-content/themes/cosmopet/static/front-page/img/border.png); + background-size: cover; + /* background: linear-gradient(21.69deg, #F44242 23.69%, #569EF0 66.57%); */ + display: block; + position: absolute; + width: calc(100% + 4px); + height: calc(100% + 4px); + border-radius: 60px; + top: -2px; + left: -2px; + z-index: -2; + transform: translateZ(-1px); +} + +.about_slider .slide_title { + text-transform: uppercase; + font-size: 24px; + font-weight: 700; + line-height: 28.8px; + color: #121212; +} + +.about_slider .slide_text { + font-size: 20px; + font-weight: 500; + line-height: 24px; + color:#121212; +} .discount_block .discount_cosmodog { margin-top: 60px; 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 14643bb..d6784a9 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 @@ -415,99 +415,41 @@ if (document.querySelector('.header').classList.contains('white')) { // scroll document.addEventListener('DOMContentLoaded', function () { - // Переводы для демонстрации - const translations = { - ru: { - 'slide1-title': 'МОС и ФОС пребиотики', - 'slide1-text': 'Поддерживают здоровый баланс микрофлоры кишечника и снижают риск заболеваний ЖКТ', - 'slide2-title': 'Омега 3 и жирные кислоты', - 'slide2-text': 'Улучшают работу мозга и сохраняют его активность, обеспечивают здоровье кожи и блеск шерсти', - 'slide3-title': 'Юкка Шидигера', - 'slide3-text': 'Стимулирует пищеварение, связывает вещества, вызывающие неприятный запах фекалий. Результат — регулярный стул с меньшим запахом', - 'slide4-title': 'Кальций, фосфор и витамин D', - 'slide4-text': 'В оптимальном соотношении поддерживают здоровье костей, способствуют восстановлению суставов и подвижности', - 'slide5-title': 'Энтопротеин', - 'slide5-text': 'Легкоперевариваемый энтопротеин, который к тому же превосходит по питательности традиционное мясо. Будучи новым источником белка, не вызывает аллергии у питомцев' + const aboutSwiper = new Swiper('.about_slider', { + loop: true, + centeredSlides: true, + grabCursor: true, + slidesPerView: 'auto', + spaceBetween: 30, + effect: 'coverflow', + coverflowEffect: { + rotate: 0, + stretch: 0, + depth: 150, + modifier: 2.5, + slideShadows: false, + }, + navigation: { + nextEl: '.about_slider_nav.next', + prevEl: '.about_slider_nav.prev', + }, + breakpoints: { + 0: { + slidesPerView: 1.5, }, - ae: { - 'slide1-title': 'MOS and FOS prebiotics', - 'slide1-text': 'Maintain a healthy balance of intestinal microflora and reduces the risk of intestinal diseases', - 'slide2-title': 'Omega 3 and fatty acids', - 'slide2-text': 'They improve the functioning of the brain and maintain its normal activity, preserve the health of the skin and the shine of the coat', - 'slide3-title': 'Yucca schidigera', - 'slide3-text': 'It stimulates digestion, even binding the substances responsible for the specific smell of dog and cat faeces. As a result bowel-emptying occurs like clockwork (and with less odour!)', - 'slide4-title': 'Calcium, phosphorus and vitamin D', - 'slide4-text': 'In their optimal ratio, they support bone health, promote joint restoration and help maintain mobility', - 'slide5-title': 'E-protein', - 'slide5-text': 'An easily digestible E-protein, nutritionally superior to traditional meat; being a novel source of protein, does not cause allergies in pets' - } - }; - - function switchLanguage(lang) { - const texts = translations[lang]; - for (const [id, text] of Object.entries(texts)) { - const element = document.getElementById(id); - if (element) { - element.textContent = text; - } - } - } - - // Инициализация слайдера - var slider = carousel_init(); - - function carousel_init() { - var carousel = document.querySelectorAll('.carousel'); - var options; - - if (window.innerWidth > 421) { - options = { - numVisible: 5, - shift: 50, - dist: -50, - padding: 20 - }; - } else { - options = { - numVisible: 3, - shift: 30, - dist: -30, - padding: 10 - }; - } - - var instances = M.Carousel.init(carousel, options); - - // Обработчики для кнопок навигации - document.querySelectorAll('.about_slider_nav').forEach(btn => { - btn.addEventListener('click', function (e) { - if (e.target.closest('button').classList.contains('next')) { - instances[0].next(); - } else { - instances[0].prev(); - } - }); - }); - - return instances; - } - - // Переинициализация при изменении размера экрана - window.addEventListener('resize', function() { - // Уничтожаем текущий экземпляр - var currentCarousel = M.Carousel.getInstance(document.querySelector('.carousel')); - if (currentCarousel) { - currentCarousel.destroy(); - } - - // Создаем новый с обновленными параметрами - setTimeout(() => { - slider = carousel_init(); - }, 100); - }); + 480: { + slidesPerView: 2.5, + }, + 768: { + slidesPerView: 3.5, + }, + 1024: { + slidesPerView: 5, + }, + }, + }); }); - document.addEventListener('DOMContentLoaded', function () { const petsSlider = new Swiper(".discount_cosmodog__slider", { slidesPerView: 1, diff --git a/wp-content/themes/cosmopet/templates/front-page/front-page.twig b/wp-content/themes/cosmopet/templates/front-page/front-page.twig index 28643a5..5a0501c 100644 --- a/wp-content/themes/cosmopet/templates/front-page/front-page.twig +++ b/wp-content/themes/cosmopet/templates/front-page/front-page.twig @@ -95,64 +95,75 @@ {% endif %}