From 4cf024c44ba8af1613f1c04924d528964588cd68 Mon Sep 17 00:00:00 2001 From: fynks <75840152+fynks@users.noreply.github.com> Date: Sun, 12 Oct 2025 17:42:44 +0500 Subject: [PATCH] hopefully fixed mobile nav --- dist/css/styles.css | 120 ++++++----- dist/index.html | 480 +++++++++++++++++++++++++++----------------- 2 files changed, 365 insertions(+), 235 deletions(-) diff --git a/dist/css/styles.css b/dist/css/styles.css index 3c22f5d..600ca20 100644 --- a/dist/css/styles.css +++ b/dist/css/styles.css @@ -963,6 +963,8 @@ button:focus-visible { font-weight: var(--font-medium); color: var(--text-secondary); min-height: 44px; + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; } .nav-dropdown-trigger:hover { @@ -977,30 +979,34 @@ button:focus-visible { visibility: visible; border: none; box-shadow: none; - padding: var(--space-xs) 0 var(--space-md) var(--space-2xl); - margin-top: 0; - background: rgba(99, 102, 241, 0.02); - border-left: 2px solid var(--border-primary); - margin-left: var(--space-lg); + padding: 0; + margin: 0; + background: transparent; border-radius: 0; backdrop-filter: none; display: none; - max-height: 0; overflow: hidden; - transition: max-height 0.3s ease; - /* Prevent layout shift and improve performance */ - will-change: max-height; - contain: layout; + /* Remove problematic animations */ + transition: none; + will-change: auto; } [data-theme="dark"] .nav-dropdown-menu { - background: rgba(99, 102, 241, 0.03); - border-left-color: var(--border-secondary); + background: transparent; } .nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown-menu { display: block; - max-height: 500px; + padding: var(--space-xs) 0 var(--space-md) var(--space-2xl); + margin-top: var(--space-xs); + margin-left: var(--space-lg); + border-left: 2px solid var(--border-primary); + background: rgba(99, 102, 241, 0.02); + } + + [data-theme="dark"] .nav-dropdown-trigger[aria-expanded="true"] + .nav-dropdown-menu { + background: rgba(99, 102, 241, 0.03); + border-left-color: var(--border-secondary); } .nav-dropdown-item { @@ -1009,80 +1015,91 @@ button:focus-visible { min-height: 44px; display: flex; align-items: center; + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; + transition: transform 0.2s ease, background 0.2s ease; } - .nav-dropdown-item:hover { + .nav-dropdown-item:hover, + .nav-dropdown-item:active { transform: translateX(4px); background: rgba(99, 102, 241, 0.05); } } +/* ===== MOBILE NAVIGATION OVERLAY ===== */ .nav-overlay { position: fixed; inset: 0; - background: rgba(0, 0, 0, .4); - backdrop-filter: blur(2px); + background: rgba(0, 0, 0, 0.4); z-index: 90; opacity: 0; visibility: hidden; - transition: opacity .3s ease; - pointer-events: none + transition: opacity 0.3s ease, visibility 0.3s ease; + pointer-events: none; + -webkit-tap-highlight-color: transparent; } -.nav-open #navOverlay { +.nav-open .nav-overlay { opacity: 1; visibility: visible; - pointer-events: auto + pointer-events: auto; } -@media (max-width:900px) { +/* ===== MOBILE NAVIGATION STYLES ===== */ +@media (max-width: 900px) { + /* Show nav toggle button */ .nav-toggle { display: inline-flex; width: 48px !important; - height: 48px !important + height: 48px !important; } + /* Hide nav by default on mobile */ .header-nav { - display: none - } - - .nav-open .header-nav { - display: flex; + display: none; position: fixed; top: var(--header-height); right: 0; width: min(340px, 85%); - background: rgba(255, 255, 255, .98); - backdrop-filter: blur(24px) saturate(180%); - -webkit-backdrop-filter: blur(24px) saturate(180%); + height: calc(100vh - var(--header-height)); + background: rgba(255, 255, 255, 0.98); border-left: 1px solid var(--border-primary); - border-bottom: 1px solid var(--border-primary); - box-shadow: 0 8px 32px 0 rgba(0, 0, 0, .08), 0 4px 16px 0 rgba(0, 0, 0, .04); + box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1); padding: var(--space-2xl) var(--space-xl) var(--space-3xl); flex-direction: column; gap: var(--space-sm); - max-height: calc(100vh - var(--header-height)); overflow-y: auto; + overflow-x: hidden; overscroll-behavior: contain; - transform: translate3d(100%, 0, 0); - transition: transform .4s cubic-bezier(.22, 1, .36, 1); - z-index: 120 - } - - [data-theme="dark"] .nav-open .header-nav { - background: rgba(15, 23, 42, .98); - border-color: rgba(52, 65, 85, .6); - box-shadow: 0 8px 32px 0 rgba(0, 0, 0, .2), 0 4px 16px 0 rgba(0, 0, 0, .1) + -webkit-overflow-scrolling: touch; + transform: translateX(100%); + transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); + z-index: 100; + will-change: transform; } + /* Show nav when open */ .nav-open .header-nav { - transform: translate3d(0, 0, 0) + display: flex; + transform: translateX(0); } + /* Dark theme mobile nav */ + [data-theme="dark"] .header-nav { + background: rgba(15, 23, 42, 0.98); + border-color: rgba(52, 65, 85, 0.6); + box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3); + } + + /* Prevent body scroll when nav is open */ body.nav-open { - overflow: hidden + overflow: hidden; + position: fixed; + width: 100%; } + /* Mobile nav links */ .nav-open .nav-link { font-size: var(--text-base); padding: var(--space-lg) var(--space-xl); @@ -1092,16 +1109,19 @@ button:focus-visible { min-height: 44px; display: flex; align-items: center; + -webkit-tap-highlight-color: transparent; + touch-action: manipulation; } .nav-open .nav-link::before { - display: none + display: none; } .nav-open .nav-link::after { - border-radius: var(--radius-lg) + border-radius: var(--radius-lg); } + /* Dark mode toggle positioning on mobile */ .dark-mode-toggle { display: flex; flex: 0 0 auto; @@ -1109,18 +1129,20 @@ button:focus-visible { height: 40px !important; order: 3; align-self: center; - z-index: 110 + z-index: 110; } + /* Nav toggle sizing */ .nav-toggle { width: 40px !important; - height: 40px !important + height: 40px !important; } + /* Disable transitions before JS is ready */ body:not(.js-ready) .header-nav, body:not(.js-ready) .nav-toggle-bar, body:not(.js-ready) .nav-overlay { - transition: none !important + transition: none !important; } } diff --git a/dist/index.html b/dist/index.html index 7996688..58bb459 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1733,187 +1733,233 @@