diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index 9fcb336..2b5c7d3 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -293,6 +293,16 @@ 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 ec42595..74411bd 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,92 +2073,7 @@ 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 d6784a9..7cc2a7b 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,41 +415,28 @@ if (document.querySelector('.header').classList.contains('white')) { // scroll document.addEventListener('DOMContentLoaded', function () { - 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, - }, - 480: { - slidesPerView: 2.5, - }, - 768: { - slidesPerView: 3.5, - }, - 1024: { - slidesPerView: 5, - }, - }, - }); + var carousels = document.querySelectorAll('.carousel'); + + if (carousels.length) { + var options = { + numVisible: window.innerWidth > 421 ? 5 : 3, + }; + var instances = M.Carousel.init(carousels, options); + + document.querySelectorAll('.about_slider_nav').forEach(function (btn) { + btn.addEventListener('click', function (e) { + const instance = instances[0]; + if (btn.classList.contains('next')) { + instance.next(); + } else { + instance.prev(); + } + }); + }); + } }); + 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 5a0501c..20133d3 100644 --- a/wp-content/themes/cosmopet/templates/front-page/front-page.twig +++ b/wp-content/themes/cosmopet/templates/front-page/front-page.twig @@ -95,75 +95,73 @@ {% endif %}