feat(ui): Hub Navigation, Profile Dashboard and Auth Stability Fixes (#31)
This PR implements the Hub Navigation system and the Profile Dashboard, while resolving critical session synchronization issues. ### Key Changes - **Hub Navigation**: Introduced `MainHubLayout` with a premium glassmorphism sidebar, providing access to Dashboard, Library, Concepts Map, and Profile. - **Profile Dashboard**: Implemented a high-fidelity Profile page (#27) with learning metrics, AI token usage tracking, and system rank visualization. - **Stability Fixes**: - Resolved an infinite network loop on the `/profile` page by implementing request deduplication and in-memory caching in `IdentityService`. - Added environment-aware guards to prevent illegal JavaScript interop calls during server-side prerendering. - Implemented automatic session invalidation on `401 Unauthorized` responses to handle stale authentication states gracefully. - **Reader Integration**: Added a "Return to Dashboard" option in the reader toolbar (#26). Closes #26 Closes #27 Reviewed-on: #31 Co-authored-by: Marek Jasiński <jasins.marek@gmail.com> Co-committed-by: Marek Jasiński <jasins.marek@gmail.com>
This commit was merged in pull request #31.
This commit is contained in:
@@ -0,0 +1,406 @@
|
||||
.dashboard-container {
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
animation: fade-in 0.8s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
@keyframes fade-in {
|
||||
from { opacity: 0; transform: translateY(20px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
/* --- Profile Header --- */
|
||||
.profile-header {
|
||||
position: relative;
|
||||
padding: 4rem 2rem 3rem;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
background: #0D0D0D;
|
||||
}
|
||||
|
||||
.header-grid-bg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image:
|
||||
linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
|
||||
background-size: 60px 60px;
|
||||
background-position: center;
|
||||
mask-image: radial-gradient(circle at center, black, transparent 80%);
|
||||
}
|
||||
|
||||
.profile-visual {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.avatar-wrapper {
|
||||
position: relative;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
|
||||
.profile-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
border: 3px solid #1a1a1a;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
background: #222;
|
||||
}
|
||||
|
||||
.avatar-glow {
|
||||
position: absolute;
|
||||
inset: -5px;
|
||||
border-radius: 50%;
|
||||
background: var(--nexus-neon);
|
||||
filter: blur(20px);
|
||||
opacity: 0.4;
|
||||
z-index: 1;
|
||||
animation: pulse-glow 3s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-glow {
|
||||
0%, 100% { transform: scale(1); opacity: 0.4; }
|
||||
50% { transform: scale(1.05); opacity: 0.6; }
|
||||
}
|
||||
|
||||
.username {
|
||||
font-family: var(--nexus-font-sans);
|
||||
font-size: 1.25rem;
|
||||
font-weight: 500;
|
||||
color: #ffffff;
|
||||
letter-spacing: 1px;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
.username::before {
|
||||
content: '[';
|
||||
color: var(--nexus-neon);
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.username::after {
|
||||
content: ']';
|
||||
color: var(--nexus-neon);
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.status-pills {
|
||||
display: flex;
|
||||
gap: 1.5rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.status-pill {
|
||||
padding: 0.6rem 1.25rem;
|
||||
background: rgba(0, 255, 153, 0.05);
|
||||
border: 1px solid rgba(0, 255, 153, 0.3);
|
||||
border-radius: 100px;
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.9rem;
|
||||
box-shadow: 0 0 15px rgba(0, 255, 153, 0.1);
|
||||
}
|
||||
|
||||
.pill-label { color: #A0A0A0; }
|
||||
.pill-value { color: #ffffff; font-weight: 600; }
|
||||
|
||||
/* --- Dashboard Content --- */
|
||||
.dashboard-content {
|
||||
padding: 3rem 2rem;
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-family: var(--nexus-font-serif);
|
||||
font-size: 2rem;
|
||||
margin-bottom: 2rem;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.main-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1.5fr 1fr;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.glass-panel {
|
||||
background: rgba(20, 20, 20, 0.8); /* Fallback for browsers without backdrop-filter */
|
||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||
border-radius: 20px;
|
||||
padding: 1.5rem;
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
@supports (backdrop-filter: blur(10px)) {
|
||||
.glass-panel {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
}
|
||||
|
||||
.glass-panel:hover {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-color: rgba(0, 255, 153, 0.2);
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
/* Reading Card */
|
||||
.reading-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.reading-card h3 {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
color: #E0E0E0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.reading-thumb {
|
||||
width: 120px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.reading-thumb img {
|
||||
width: 100%;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.reading-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.progress-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.chapter-label {
|
||||
font-size: 0.85rem;
|
||||
color: #A0A0A0;
|
||||
}
|
||||
|
||||
.progress-container {
|
||||
height: 8px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 4px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 100%;
|
||||
background: var(--nexus-neon);
|
||||
border-radius: 4px;
|
||||
position: relative;
|
||||
box-shadow: 0 0 10px rgba(0, 255, 153, 0.3);
|
||||
}
|
||||
|
||||
.progress-bubble {
|
||||
position: absolute;
|
||||
right: -20px;
|
||||
top: -30px;
|
||||
background: var(--nexus-neon);
|
||||
color: #000;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.progress-detail {
|
||||
font-size: 0.8rem;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.reading-desc {
|
||||
font-size: 0.85rem;
|
||||
line-height: 1.6;
|
||||
color: #888;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card-actions {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
/* Secondary Grid Items */
|
||||
.secondary-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.panel-header h4 {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: #E0E0E0;
|
||||
}
|
||||
|
||||
/* Graph Placeholder */
|
||||
.graph-placeholder {
|
||||
height: 180px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.graph-node {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
background: #333;
|
||||
border: 1px solid rgba(255,255,255,0.1);
|
||||
}
|
||||
|
||||
.graph-node.central {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: var(--nexus-neon);
|
||||
box-shadow: 0 0 20px rgba(0, 255, 153, 0.4);
|
||||
}
|
||||
|
||||
.graph-node.satellite {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
transform: rotate(var(--angle)) translateY(var(--dist));
|
||||
}
|
||||
|
||||
.active-node-label {
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
padding: 4px 12px;
|
||||
background: rgba(0, 255, 153, 0.1);
|
||||
border: 1px solid var(--nexus-neon);
|
||||
border-radius: 4px;
|
||||
font-size: 0.7rem;
|
||||
color: var(--nexus-neon);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* Quiz Preview */
|
||||
.quiz-preview {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.question {
|
||||
font-size: 0.95rem;
|
||||
color: #E0E0E0;
|
||||
}
|
||||
|
||||
.quiz-options {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.quiz-option {
|
||||
padding: 0.75rem 1rem;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||
border-radius: 10px;
|
||||
font-size: 0.9rem;
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.quiz-option.active {
|
||||
background: rgba(0, 255, 153, 0.05);
|
||||
border-color: var(--nexus-neon);
|
||||
color: var(--nexus-neon);
|
||||
}
|
||||
|
||||
.option-letter {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn-nexus {
|
||||
padding: 0.75rem 1.25rem;
|
||||
border-radius: 10px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn-nexus.primary {
|
||||
background: var(--nexus-neon);
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.btn-nexus.secondary {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
color: #fff;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.btn-nexus:hover {
|
||||
transform: translateY(-2px);
|
||||
filter: brightness(1.1);
|
||||
}
|
||||
|
||||
/* Empty State */
|
||||
.empty-state {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 3rem 1rem;
|
||||
text-align: center;
|
||||
gap: 1.5rem !important;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
opacity: 0.3;
|
||||
color: var(--nexus-neon);
|
||||
filter: drop-shadow(0 0 10px rgba(0, 255, 153, 0.2));
|
||||
}
|
||||
|
||||
.empty-state .reading-info {
|
||||
align-items: center;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
.main-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user