feat(ui): unify header and implement navigation drawer (Task 17)

- Redesign top header into clean, uncluttered layout with hamburger drawer trigger, clickable logo, central SRS focus badge, theme toggle and profile avatar
- Implement unified responsive Navigation Drawer for both desktop and mobile with touch swipe-to-dismiss, backdrop blur, keyboard Esc support and background scroll lock
- Streamline mobile bottom tab bar to 4 core actions (Dictionary, SRS, Reader, Menu) with Menu opening the unified drawer
- Synchronize real-time SRS due badges and dictionary word statistics between header, bottom tabs, and drawer
- Eliminate obsolete separate mobile-menu-modal in favor of unified drawer
- Bump Service Worker cache version to notes-v5.7
This commit is contained in:
Antigravity committed 2026-10-06 21:28:25 +03:00
1 parent 0ff4465d34
commit e73d3470b3
8 files changed
+707 -195

No files matched your search

+341 -22
View File
@@ -245,13 +245,15 @@ body {
min-height: 100vh;
}
/* App Navbar (Unified Layout) */
.navbar {
background-color: var(--bg-surface);
border-bottom: 1px solid var(--border-color);
padding: 12px 24px;
padding: 8px 20px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
position: sticky;
top: 0;
z-index: 100;
@@ -259,10 +261,46 @@ body {
box-sizing: border-box;
}
.nav-left {
display: flex;
align-items: center;
gap: 10px;
flex-shrink: 0;
}
.drawer-toggle-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
border-radius: var(--radius-sm);
background-color: transparent;
border: 1px solid transparent;
color: var(--text-main);
cursor: pointer;
font-size: 20px;
line-height: 1;
transition: var(--transition);
}
.drawer-toggle-btn:hover {
background-color: var(--bg-surface-hover);
border-color: var(--border-color);
color: var(--primary);
}
.nav-brand {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
user-select: none;
transition: opacity 0.15s ease;
}
.nav-brand:hover {
opacity: 0.85;
}
.brand-icon {
@@ -286,9 +324,18 @@ body {
margin-left: 4px;
}
.nav-center {
display: flex;
align-items: center;
justify-content: center;
gap: 14px;
flex: 1;
min-width: 0;
}
.nav-stats {
display: flex;
gap: 12px;
gap: 8px;
}
.stat-badge {
@@ -311,22 +358,286 @@ body {
.nav-actions {
display: flex;
align-items: center;
gap: 12px;
gap: 10px;
flex-shrink: 0;
}
.user-profile {
display: flex;
.user-profile-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 5px 12px;
border-radius: var(--radius-full);
background-color: var(--bg-surface-hover);
border: 1px solid var(--border-color);
color: var(--text-main);
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: var(--transition);
}
.user-profile-btn:hover {
border-color: var(--primary);
color: var(--primary);
background-color: var(--primary-dim);
}
.user-avatar-icon {
font-size: 15px;
}
.user-badge {
font-size: 13px;
color: var(--text-muted);
color: var(--text-main);
font-weight: 600;
background-color: var(--bg-surface-hover);
padding: 4px 10px;
}
/* -----------------------------------------------------------------------
Unified Navigation Drawer (Desktop & Mobile)
----------------------------------------------------------------------- */
.drawer-backdrop {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.65);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
z-index: 1999;
opacity: 0;
pointer-events: none;
transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer-backdrop.active {
opacity: 1;
pointer-events: auto;
}
.app-drawer {
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: min(340px, 86vw);
background-color: var(--bg-surface);
border-right: 1px solid var(--border-color);
box-shadow: 4px 0 28px rgba(0, 0, 0, 0.5);
z-index: 2000;
display: flex;
flex-direction: column;
transform: translateX(-100%);
transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
will-change: transform;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.app-drawer.active {
transform: translateX(0);
}
body.drawer-open {
overflow: hidden !important;
}
.drawer-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: calc(16px + env(safe-area-inset-top, 0px)) 16px 14px 18px;
border-bottom: 1px solid var(--border-color);
background-color: var(--bg-surface);
position: sticky;
top: 0;
z-index: 10;
}
.drawer-user-card {
display: flex;
align-items: center;
gap: 12px;
min-width: 0;
}
.drawer-user-avatar {
width: 42px;
height: 42px;
border-radius: var(--radius-full);
background: linear-gradient(135deg, var(--primary), #6366f1);
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
flex-shrink: 0;
box-shadow: var(--shadow-sm);
}
.drawer-user-info {
display: flex;
flex-direction: column;
min-width: 0;
}
.drawer-user-name {
font-size: 15px;
font-weight: 700;
color: var(--text-main);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.drawer-user-desc {
font-size: 12px;
color: var(--text-muted);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.drawer-close-btn {
width: 34px;
height: 34px;
border-radius: var(--radius-sm);
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: var(--text-muted);
background: transparent;
border: none;
cursor: pointer;
transition: var(--transition);
}
.drawer-close-btn:hover {
background-color: var(--bg-surface-hover);
color: var(--text-main);
}
.drawer-stats-summary {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
padding: 12px 14px;
margin: 12px 14px 4px 14px;
background-color: var(--bg-main);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
text-align: center;
}
.drawer-stat-item {
display: flex;
flex-direction: column;
gap: 2px;
}
.drawer-stat-val {
font-size: 16px;
font-weight: 800;
color: var(--text-main);
}
.drawer-stat-lbl {
font-size: 10px;
font-weight: 600;
color: var(--text-dim);
text-transform: uppercase;
letter-spacing: 0.3px;
}
.drawer-nav {
flex: 1;
padding: 8px 12px;
display: flex;
flex-direction: column;
gap: 4px;
}
.drawer-section-title {
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.6px;
color: var(--text-dim);
padding: 12px 8px 4px 8px;
}
.drawer-nav-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: column;
gap: 3px;
}
.drawer-nav-item {
width: 100%;
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
border-radius: var(--radius-sm);
background: transparent;
border: 1px solid transparent;
color: var(--text-main);
font-size: 14px;
font-weight: 500;
text-align: left;
cursor: pointer;
transition: var(--transition);
text-decoration: none;
}
.drawer-nav-item:hover {
background-color: var(--bg-surface-hover);
color: var(--primary);
border-color: var(--border-color);
}
.drawer-nav-item.active {
background-color: var(--primary-dim);
color: var(--primary);
border-color: rgba(56, 189, 248, 0.3);
font-weight: 700;
}
.drawer-item-icon {
font-size: 18px;
width: 24px;
text-align: center;
flex-shrink: 0;
}
.drawer-item-label {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.drawer-badge {
padding: 2px 7px;
font-size: 11px;
font-weight: 700;
border-radius: var(--radius-full);
background-color: var(--primary);
color: #0f172a;
line-height: 1.2;
}
.drawer-footer {
padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)) 16px;
border-top: 1px solid var(--border-color);
font-size: 12px;
color: var(--text-dim);
text-align: center;
}
/* Buttons */
@@ -2493,27 +2804,35 @@ body {
padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
}
/* 3. Header & Navigation: Clean iOS App Header */
/* 3. Header & Navigation: Unified Responsive Header */
.navbar {
padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px 12px;
position: sticky;
top: 0;
padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px 10px;
gap: 8px;
}
.brand-sub,
.nav-center,
.nav-actions #nav-reader-btn,
.nav-actions #srs-trainer-btn,
.nav-actions #stats-open-btn,
.nav-actions #export-open-btn,
.nav-actions .user-profile {
.nav-stats {
display: none !important;
}
.mobile-only-btn {
display: inline-flex !important;
align-items: center;
justify-content: center;
.btn-trainer .trainer-text {
display: none !important;
}
.btn-trainer {
padding: 6px 10px !important;
font-size: 13px !important;
min-height: 36px;
}
.user-profile-btn #user-display-name {
display: none !important;
}
.user-profile-btn {
padding: 6px 10px !important;
border-radius: var(--radius-sm);
min-height: 36px;
}
.mobile-tab-bar {