diff --git a/dev-docs.html b/dev-docs.html index bcf0d85..a350f4e 100644 --- a/dev-docs.html +++ b/dev-docs.html @@ -7,7 +7,7 @@ - + @@ -1427,6 +1427,6 @@ cmake --build build/quirrel-cli --config Release --target sq - + diff --git a/index.html b/index.html index 21baeb7..ff06a8c 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - + @@ -399,6 +399,6 @@ - + diff --git a/mod-docs.html b/mod-docs.html index e1ca7a1..565c76a 100644 --- a/mod-docs.html +++ b/mod-docs.html @@ -7,7 +7,7 @@ - + @@ -1916,6 +1916,6 @@ openUrl("http://{{LOCAL_ENDPOINT}}/mods/demo.my-mod/panel", false, fal - + diff --git a/releases.html b/releases.html index 2f4c7bc..336169f 100644 --- a/releases.html +++ b/releases.html @@ -7,7 +7,7 @@ - + @@ -134,6 +134,6 @@ - + diff --git a/site/home.css b/site/home.css index 95f193f..bd28f56 100644 --- a/site/home.css +++ b/site/home.css @@ -250,6 +250,8 @@ body.leaving { display: inline-flex; align-items: center; gap: 10px; + flex-shrink: 0; + white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 16px; @@ -263,6 +265,7 @@ body.leaving { width: 28px; height: 28px; display: block; + flex-shrink: 0; } .brand-accent { @@ -274,6 +277,7 @@ body.leaving { display: flex; align-items: center; gap: 4px; + min-width: 0; } .nav-links a { @@ -283,9 +287,19 @@ body.leaving { text-decoration: none; font-size: 13.5px; font-weight: 500; + white-space: nowrap; + flex-shrink: 0; transition: color 0.2s var(--ease), background 0.2s var(--ease); } +.nav-menu-btn { + display: none; +} + +.nav-drawer { + display: none; +} + .nav-links a:hover, .nav-links a.active { color: var(--text); @@ -1723,8 +1737,93 @@ footer { /* ---------------- Responsive ---------------- */ -@media (max-width: 680px) { - .nav-links a.hide-sm { display: none; } - .grid { background-size: 44px 44px; } - .foot .right { margin-left: 0; } +@media (max-width: 880px) { + .nav { + gap: var(--s2); + padding: 11px clamp(14px, 4vw, 24px); + } + .nav-links a { + padding: 6px 8px; + font-size: 13px; + } +} + +@media (max-width: 740px) { + .nav { + position: sticky; + top: 0; + padding: 10px 14px; + } + .nav-links { + gap: 6px; + } + .nav-links > a { + display: none; + } + .nav-menu-btn { + display: inline-flex; + } + .nav-drawer { + position: fixed; + top: 53px; + left: 0; + right: 0; + z-index: 49; + display: flex; + flex-direction: column; + gap: 4px; + padding: 10px 14px 14px; + background: color-mix(in srgb, var(--page) 94%, transparent); + -webkit-backdrop-filter: blur(20px) saturate(1.2); + backdrop-filter: blur(20px) saturate(1.2); + border-bottom: 1px solid var(--border-2); + box-shadow: var(--shadow-md); + opacity: 0; + transform: translateY(-8px); + pointer-events: none; + transition: opacity 0.22s var(--ease), transform 0.22s var(--ease); + } + .nav-drawer.open { + opacity: 1; + transform: translateY(0); + pointer-events: auto; + } + .nav-drawer a { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 42px; + padding: 8px 12px; + border-radius: var(--r-sm); + color: var(--text-dim); + text-decoration: none; + font-size: 14.5px; + font-weight: 500; + border: 1px solid transparent; + transition: color 0.18s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease); + } + .nav-drawer a:hover, + .nav-drawer a.active { + color: var(--text); + background: var(--surface); + border-color: var(--border); + } + .nav-drawer a.active { + color: var(--accent); + border-color: rgba(229, 57, 53, 0.35); + background: var(--accent-soft); + } + .grid { + background-size: 44px 44px; + } + .foot .right { + margin-left: 0; + } + .hero-wordmark { + height: clamp(84px, 22vw, 132px); + } + .doc-pager-btn { + width: 100%; + min-width: 0; + } } diff --git a/site/home.js b/site/home.js index 70f8ab5..212e83a 100644 --- a/site/home.js +++ b/site/home.js @@ -235,13 +235,72 @@ }); })(); - // ---- Sticky header border ---- + // ---- Sticky header border & responsive mobile drawer ---- (function initStickyNav() { var nav = document.querySelector('.nav'); if (!nav) return; var update = function () { nav.classList.toggle('stuck', window.scrollY > 8); }; update(); window.addEventListener('scroll', update, { passive: true }); + + var navLinks = nav.querySelector('.nav-links'); + if (!navLinks) return; + var linkNodes = Array.prototype.slice.call(navLinks.querySelectorAll(':scope > a')); + if (!linkNodes.length) return; + + var MENU_SVG = + '' + + ''; + var CLOSE_SVG = + '' + + ''; + + var menuBtn = document.createElement('button'); + menuBtn.type = 'button'; + menuBtn.className = 'ui-btn ui-iconbtn nav-menu-btn'; + menuBtn.setAttribute('aria-label', 'Toggle navigation menu'); + menuBtn.setAttribute('aria-expanded', 'false'); + menuBtn.innerHTML = MENU_SVG; + navLinks.appendChild(menuBtn); + + var drawer = document.createElement('nav'); + drawer.className = 'nav-drawer'; + drawer.setAttribute('aria-label', 'Mobile navigation'); + linkNodes.forEach(function (orig) { + var clone = orig.cloneNode(true); + clone.classList.remove('hide-sm'); + drawer.appendChild(clone); + }); + nav.insertAdjacentElement('afterend', drawer); + + function setOpen(open) { + drawer.classList.toggle('open', open); + menuBtn.setAttribute('aria-expanded', open ? 'true' : 'false'); + menuBtn.innerHTML = open ? CLOSE_SVG : MENU_SVG; + } + + menuBtn.addEventListener('click', function (e) { + e.stopPropagation(); + setOpen(!drawer.classList.contains('open')); + }); + + drawer.addEventListener('click', function (e) { + if (e.target.closest('a')) setOpen(false); + }); + + document.addEventListener('click', function (e) { + if (drawer.classList.contains('open') && !e.target.closest('.nav') && !e.target.closest('.nav-drawer')) { + setOpen(false); + } + }); + + document.addEventListener('keydown', function (e) { + if (e.key === 'Escape' && drawer.classList.contains('open')) setOpen(false); + }); + + window.addEventListener('resize', function () { + if (window.innerWidth > 740 && drawer.classList.contains('open')) setOpen(false); + }); })(); // ---- Resolve extensionless routes cleanly when previewed via file:// ----