feat(ui): Implement adaptive navigation system (Stage 1)
- Added useDisplay hook for breakpoint-based layout - Added useScrollDirection hook for hide-on-scroll logic - Implemented three-tier navigation: - Navigation Bar (Compact < 600px) with auto-hide - Navigation Rail (Medium 600-1240px) - Expanded Navigation Rail (Expanded > 1240px) - Added support for sub-menus in expanded rail - Added notification badges support - Integrated ThemeProvider into App Refs #3 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,8 +14,9 @@
|
||||
--md-sys-color-outline: #73777f;
|
||||
--md-sys-color-error: #ba1a1a;
|
||||
|
||||
--nav-width: 80px;
|
||||
--bottom-nav-height: 80px;
|
||||
--nav-rail-width: 80px;
|
||||
--nav-rail-expanded-width: 280px;
|
||||
--nav-bar-height: 80px;
|
||||
}
|
||||
|
||||
:root.dark {
|
||||
@@ -49,7 +50,41 @@ body {
|
||||
transition: background-color 0.3s, color 0.3s;
|
||||
}
|
||||
|
||||
/* Material 3 Components */
|
||||
/* M3 Components */
|
||||
|
||||
.m3-badge {
|
||||
position: absolute;
|
||||
top: -4px;
|
||||
right: -4px;
|
||||
background-color: var(--md-sys-color-error);
|
||||
color: white;
|
||||
font-size: 10px;
|
||||
font-weight: 500;
|
||||
min-width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--md-sys-color-on-surface-variant);
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.icon-button:hover {
|
||||
background-color: var(--md-sys-color-surface-variant);
|
||||
}
|
||||
|
||||
.m3-button {
|
||||
display: inline-flex;
|
||||
@@ -65,6 +100,7 @@ body {
|
||||
transition: box-shadow 0.2s, background-color 0.2s;
|
||||
background-color: transparent;
|
||||
color: var(--md-sys-color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.m3-button-filled {
|
||||
@@ -97,12 +133,7 @@ body {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.m3-text-field:focus {
|
||||
outline: none;
|
||||
border-bottom: 2px solid var(--md-sys-color-primary);
|
||||
}
|
||||
|
||||
/* Layout and Navigation */
|
||||
/* Layout */
|
||||
|
||||
.app-container {
|
||||
display: flex;
|
||||
@@ -111,59 +142,107 @@ body {
|
||||
|
||||
.main-content {
|
||||
flex: 1;
|
||||
padding-bottom: var(--bottom-nav-height);
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.main-content {
|
||||
padding-bottom: 0;
|
||||
margin-left: var(--nav-width);
|
||||
}
|
||||
}
|
||||
|
||||
.navigation-rail {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: var(--nav-width);
|
||||
background-color: var(--md-sys-color-surface);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 16px 0;
|
||||
border-right: 1px solid var(--md-sys-color-outline);
|
||||
z-index: 100;
|
||||
}
|
||||
/* Navigation Bar (Mobile) */
|
||||
|
||||
.navigation-bar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: var(--bottom-nav-height);
|
||||
height: var(--nav-bar-height);
|
||||
background-color: var(--md-sys-color-surface-variant);
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
padding: 0 8px;
|
||||
z-index: 100;
|
||||
transition: transform 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.navigation-bar.hidden {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.navigation-bar { display: none; }
|
||||
.main-content { margin-left: var(--nav-rail-width); }
|
||||
}
|
||||
|
||||
@media (min-width: 1240px) {
|
||||
.main-content.with-expanded-rail { margin-left: var(--nav-rail-expanded-width); }
|
||||
}
|
||||
|
||||
@media (max-width: 599px) {
|
||||
.main-content { padding-bottom: calc(var(--nav-bar-height) + 16px); }
|
||||
}
|
||||
|
||||
/* Navigation Rail (Tablet/Desktop) */
|
||||
|
||||
.navigation-rail {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: var(--nav-rail-width);
|
||||
background-color: var(--md-sys-color-surface);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 16px 0;
|
||||
border-right: 1px solid var(--md-sys-color-outline);
|
||||
z-index: 100;
|
||||
transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.navigation-rail.expanded {
|
||||
width: var(--nav-rail-expanded-width);
|
||||
}
|
||||
|
||||
.rail-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 16px;
|
||||
height: 56px;
|
||||
gap: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.rail-title {
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rail-items {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
/* Nav Items Shared */
|
||||
|
||||
.nav-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-decoration: none;
|
||||
color: var(--md-sys-color-on-surface-variant);
|
||||
gap: 4px;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
border-radius: 16px;
|
||||
height: 56px;
|
||||
padding: 0 12px;
|
||||
position: relative;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.navigation-bar .nav-item {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
gap: 4px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.nav-item-icon-wrapper {
|
||||
width: 64px;
|
||||
height: 32px;
|
||||
@@ -172,6 +251,7 @@ body {
|
||||
justify-content: center;
|
||||
border-radius: 16px;
|
||||
transition: background-color 0.2s;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-item.active .nav-item-icon-wrapper {
|
||||
@@ -182,16 +262,47 @@ body {
|
||||
.nav-item-label {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@media (min-width: 600px) {
|
||||
.navigation-bar {
|
||||
display: none;
|
||||
}
|
||||
.navigation-rail.expanded .nav-item {
|
||||
height: 56px;
|
||||
border-radius: 28px;
|
||||
margin: 0 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 599px) {
|
||||
.navigation-rail {
|
||||
display: none;
|
||||
}
|
||||
.navigation-rail.expanded .nav-item-label {
|
||||
font-size: 14px;
|
||||
margin-left: 12px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* Submenu */
|
||||
|
||||
.submenu {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding-left: 56px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.submenu-item {
|
||||
height: 48px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text-decoration: none;
|
||||
color: var(--md-sys-color-on-surface-variant);
|
||||
font-size: 14px;
|
||||
border-radius: 24px;
|
||||
margin: 0 12px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.submenu-item.active {
|
||||
background-color: var(--md-sys-color-secondary-container);
|
||||
color: var(--md-sys-color-on-secondary-container);
|
||||
}
|
||||
|
||||
.submenu-arrow {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user