From 02c186260cbc37a0896fe14026fd3e4323e9ed87 Mon Sep 17 00:00:00 2001 From: "Anton.AE" Date: Sun, 12 Jul 2026 12:31:05 +0300 Subject: [PATCH] header fix1 --- .../assets/css/layout.css | 42 ++++++++++++++++++- .../sevastopol-tort-child/assets/js/site.js | 15 +++++++ .../themes/sevastopol-tort-child/header.php | 12 +++++- 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/wp-content/themes/sevastopol-tort-child/assets/css/layout.css b/wp-content/themes/sevastopol-tort-child/assets/css/layout.css index d487ac3..7d88b18 100644 --- a/wp-content/themes/sevastopol-tort-child/assets/css/layout.css +++ b/wp-content/themes/sevastopol-tort-child/assets/css/layout.css @@ -199,7 +199,7 @@ position: absolute; top: 0; right: 0; - width: min(360px, 100%); + width: 100%; height: 100%; overflow: auto; background: var(--color-bg); @@ -247,6 +247,46 @@ text-align: left; } +.mobile-menu__catalog-toggle { + justify-content: space-between; + width: 100%; +} + +.mobile-menu__catalog-toggle::after { + content: ""; + width: 9px; + height: 9px; + margin-right: 4px; + border-right: 2px solid currentColor; + border-bottom: 2px solid currentColor; + transform: rotate(45deg) translateY(-2px); + transition: transform 0.2s ease; +} + +.mobile-menu__catalog-toggle[aria-expanded="true"]::after { + transform: rotate(225deg) translate(-2px, -2px); +} + +.mobile-menu__catalog-list { + display: grid; + padding: 4px 0 10px 18px; + background: var(--color-surface-soft); +} + +.mobile-menu__catalog-list[hidden] { + display: none; +} + +.mobile-menu__catalog-link { + display: flex; + align-items: center; + min-height: 42px; + border-bottom: 1px solid var(--color-line); + color: var(--color-muted); + font-size: var(--fz-sm); + font-weight: 700; +} + .site-footer { background: var(--color-text); color: #ffffff; diff --git a/wp-content/themes/sevastopol-tort-child/assets/js/site.js b/wp-content/themes/sevastopol-tort-child/assets/js/site.js index 6e554b7..fdde515 100644 --- a/wp-content/themes/sevastopol-tort-child/assets/js/site.js +++ b/wp-content/themes/sevastopol-tort-child/assets/js/site.js @@ -3,6 +3,8 @@ var menu = document.querySelector('[data-mobile-menu]'); var toggle = document.querySelector('[data-menu-toggle]'); var closeNodes = document.querySelectorAll('[data-menu-close]'); + var mobileCatalogToggle = document.querySelector('[data-mobile-catalog-toggle]'); + var mobileCatalog = document.querySelector('[data-mobile-catalog]'); var catalogItem = document.querySelector('.site-header__menu-item--catalog'); var catalogButton = document.querySelector('.site-header__menu-button'); var cookieNote = document.querySelector('[data-cookie-note]'); @@ -22,6 +24,11 @@ body.classList.toggle('menu-is-open', isOpen); menu.setAttribute('aria-hidden', isOpen ? 'false' : 'true'); toggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false'); + + if (!isOpen && mobileCatalogToggle && mobileCatalog) { + mobileCatalogToggle.setAttribute('aria-expanded', 'false'); + mobileCatalog.hidden = true; + } } function setLeadModalState(isOpen, source) { @@ -97,6 +104,14 @@ }); } + if (mobileCatalogToggle && mobileCatalog) { + mobileCatalogToggle.addEventListener('click', function () { + var isOpen = mobileCatalogToggle.getAttribute('aria-expanded') === 'true'; + mobileCatalogToggle.setAttribute('aria-expanded', isOpen ? 'false' : 'true'); + mobileCatalog.hidden = isOpen; + }); + } + if (catalogItem && catalogButton) { catalogButton.addEventListener('click', function (event) { event.stopPropagation(); diff --git a/wp-content/themes/sevastopol-tort-child/header.php b/wp-content/themes/sevastopol-tort-child/header.php index 21d0f5d..3a9de5b 100644 --- a/wp-content/themes/sevastopol-tort-child/header.php +++ b/wp-content/themes/sevastopol-tort-child/header.php @@ -76,7 +76,17 @@ if ( ! defined( 'ABSPATH' ) ) {