diff --git a/assets/css/design-system.css b/assets/css/design-system.css index 2282c183..22eb54f6 100644 --- a/assets/css/design-system.css +++ b/assets/css/design-system.css @@ -323,24 +323,45 @@ code { } .burger { display: inline-flex; } -/* ---------- MOBILE PANEL ---------- */ -.mobile-panel { +/* ---------- MOBILE BACKDROP ---------- */ +.neo-mobile-backdrop { position: fixed; inset: 0; - z-index: 140; - background: rgba(15,23,42,.55); - backdrop-filter: blur(6px); - -webkit-backdrop-filter: blur(6px); + z-index: 80; + background: rgba(0,0,0,.45); + backdrop-filter: blur(2px); + -webkit-backdrop-filter: blur(2px); + opacity: 0; + pointer-events: none; + transition: opacity .25s ease; +} +.neo-mobile-backdrop.open { + opacity: 1; + pointer-events: auto; +} +/* Slide-in side panel: slides from left, below the sticky header. */ +.mobile-panel { + position: fixed; + top: 0; + left: 0; + bottom: 0; + z-index: 90; + width: min(320px, 80vw); + background: var(--paper-2); + border-right: 1px solid var(--line); + transform: translateX(-100%); + transition: transform .25s ease; + overflow-y: auto; } .mobile-panel[hidden] { display: none; } +.mobile-panel.open { + transform: translateX(0); +} .mobile-panel-inner { + display: flex; + flex-direction: column; height: 100%; - width: min(100%, 320px); - margin-left: auto; - background: var(--paper-2); - border-left: 1px solid var(--line); padding: var(--space-6); - overflow-y: auto; } .mobile-panel-head { display: flex; diff --git a/assets/css/neo.css b/assets/css/neo.css index 920496d1..19280ff6 100644 --- a/assets/css/neo.css +++ b/assets/css/neo.css @@ -216,147 +216,6 @@ body::before{ @media(max-width:900px){ .neo-menu{display:none} .neo-burger{display:flex} - /* Mobile menu: slide-in side panel (NOT fullscreen) so page content stays - visible and tappable behind the nav overlay. z-index sits below the - sticky header (z-50) so the header row is never covered. */ - .neo-mobile-nav{ - display:none; - flex-direction:column; - gap:.5rem; - padding:5.5rem 1.25rem 2rem; - background:var(--panel); - border-right:1px solid var(--line); - border-radius:0; - position:fixed; - top:0; - left:0; - bottom:0; - z-index:100; - max-width:calc(100vw - 1rem); - width:min(320px,80vw); - max-height:none; - overflow-y:auto; - opacity:0; - transform:translateX(-100%); - transition:transform .25s ease,opacity .25s ease; - } - .neo-mobile-nav.open{ - display:flex; - opacity:1; - transform:translateX(0); - } - .neo-mobile-backdrop{ - display:none; - position:fixed; - inset:0; - z-index:95; - background:rgba(0,0,0,.45); - backdrop-filter:blur(2px); - -webkit-backdrop-filter:blur(2px); - } - .neo-mobile-backdrop.open{ - display:block; - } - [data-theme="light"] .neo-mobile-nav.open{ - background:rgba(246,248,251,.88); - } - [data-theme="solar"] .neo-mobile-nav.open{ - background:rgba(28,25,23,.88); - } - [data-theme="mono"] .neo-mobile-nav.open{ - background:rgba(10,10,10,.88); - } - [data-theme="dracula"] .neo-mobile-nav.open{ - background:rgba(40,42,54,.88); - } - .neo-mobile-head{ - width:100%; - max-width:460px; - display: flex; - align-items: center; - justify-content: space-between; - gap: 1rem; - margin-bottom: .5rem; - } - .neo-mobile-title { - font-family: var(--mono); - font-size: 11px; - color: var(--accent); - letter-spacing: 1px; - text-transform: uppercase; - } - .neo-mobile-close { - margin-left: auto; - } - .neo-tree { - width: 100%; - max-width: 460px; - border: 1px solid var(--line); - border-radius: 12px; - background: color-mix(in srgb, var(--panel) 92%, transparent); - backdrop-filter: blur(6px); - overflow: hidden; - } - .neo-tree + .neo-tree { - margin-top: .6rem; - } - .neo-tree summary { - list-style: none; - display: flex; - align-items: center; - justify-content: space-between; - gap: 1rem; - padding: .7rem .9rem; - cursor: pointer; - font-weight: 600; - color: var(--text); - user-select: none; - } - .neo-tree summary::-webkit-details-marker { - display: none; - } - .neo-tree summary::after { - content: "+"; - font-family: var(--mono); - font-size: 13px; - color: var(--muted); - transition: transform .15s ease; - } - .neo-tree[open] > summary::after { - content: "−"; - } - .neo-tree-body { - display: flex; - flex-direction: column; - gap: .2rem; - padding: .4rem .9rem .8rem; - border-top: 1px solid var(--line); - } - .neo-tree-body a { - font-size: .95rem; - padding: .45rem .5rem; - border-radius: 10px; - color: var(--muted); - text-align: left; - background: transparent; - border: 1px solid transparent; - } - .neo-tree-body a:hover { - border-color: var(--accent); - color: var(--accent); - } - .neo-mobile-footer { - width: 100%; - max-width: 460px; - margin-top: .8rem; - display: flex; - flex-wrap: wrap; - gap: .5rem; - justify-content: center; - } - .neo-mobile-footer .neo-theme-opt { - flex: 1 1 140px; - } } @media(min-width:901px){ .neo-burger{display:none} diff --git a/assets/js/custom.js b/assets/js/custom.js index 7726f870..aca9e514 100644 --- a/assets/js/custom.js +++ b/assets/js/custom.js @@ -87,11 +87,11 @@ mnav.classList.toggle('open', isopen); if (mBackdrop) mBackdrop.classList.toggle('open', isopen); if (burger) burger.setAttribute('aria-expanded', String(isopen)); - if (mnav) { mnav.hidden = !isopen; } + mnav.hidden = !isopen; return isopen; } if (burger && mnav) { - mnav.hidden = false; + mnav.hidden = true; burger.addEventListener('click', function (e) { e.stopPropagation(); toggleMobileNav(); @@ -103,17 +103,9 @@ mBackdrop.addEventListener('click', function () { toggleMobileNav(false); }); } mnav.addEventListener('click', function (e) { - if (e.target.tagName === 'A' || e.target.tagName === 'BUTTON') { - if (!e.target.closest('#neo-mobile-close')) toggleMobileNav(false); - } - }); - document.addEventListener('click', function (e) { - if (!mnav.contains(e.target) && e.target !== burger && !mBackdrop?.contains(e.target)) { - toggleMobileNav(false); - } + if (e.target.tagName === 'A') toggleMobileNav(false); }); } - // expose for palette favorites shortcut window.__toggleMobileNav = toggleMobileNav; // Reduced-motion quick toggle (header ✦ button) diff --git a/layouts/partials/neo-header.html b/layouts/partials/neo-header.html index bb06a7cc..298a9056 100644 --- a/layouts/partials/neo-header.html +++ b/layouts/partials/neo-header.html @@ -1,8 +1,7 @@ {{/* - Neo header — presentation layer. The primary navigation is auto-generated - from the site's categories taxonomy (raw data -> categories -> common menu), - so adding a category needs no menu edit. A settings drawer (theme/appearance/ - accessibility/search) is wired by custom.js. EN is disabled, so no RU/EN. + Neo header — presentation layer. + Desktop: 6 primary links + search + theme toggle. + Mobile: slide-in side panel with grouped links, no accordion. */}}