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:
@@ -9,7 +9,7 @@
|
||||
|
||||
<div class="login-page-container">
|
||||
<div class="mesh-bg"></div>
|
||||
|
||||
|
||||
<div class="auth-card">
|
||||
<div class="auth-header">
|
||||
<div class="logo-box">
|
||||
@@ -21,9 +21,8 @@
|
||||
|
||||
<div class="social-auth">
|
||||
<button type="button" class="btn-google-auth" @onclick="HandleGoogleLogin">
|
||||
<img src="https://www.gstatic.com/images/branding/product/1x/gsa_512dp.png"
|
||||
alt="Google"
|
||||
style="width: 20px !important; height: 20px !important; flex-shrink: 0;" />
|
||||
<img src="https://www.gstatic.com/images/branding/product/1x/gsa_512dp.png" alt="Google"
|
||||
style="width: 20px !important; height: 20px !important; flex-shrink: 0;" />
|
||||
<span>Zaloguj się przez Google</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -47,7 +46,8 @@
|
||||
<div class="field-icon">
|
||||
<NexusIcon Name="lock" Size="18" />
|
||||
</div>
|
||||
<InputText id="password" type="@(_showPassword ? "text" : "password")" @bind-Value="_loginModel.Password" placeholder="Hasło" class="field-input" />
|
||||
<InputText id="password" type="@(_showPassword ? "text" : "password")"
|
||||
@bind-Value="_loginModel.Password" placeholder="Hasło" class="field-input" />
|
||||
<button type="button" class="toggle-visibility" @onclick="TogglePassword">
|
||||
<NexusIcon Name="@(_showPassword ? "eye-off" : "eye")" Size="18" />
|
||||
</button>
|
||||
@@ -84,7 +84,8 @@
|
||||
</div>
|
||||
|
||||
<div class="auth-legal">
|
||||
Korzystając z usługi, akceptujesz <a href="/terms">Regulamin</a> i <a href="/privacy">Politykę Prywatności</a>
|
||||
Korzystając z usługi, akceptujesz <a href="/terms">Regulamin</a> i <a href="/privacy">Politykę
|
||||
Prywatności</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -121,12 +122,24 @@
|
||||
|
||||
try
|
||||
{
|
||||
var success = await IdentityService.LoginAsync(_loginModel.Email, _loginModel.Password, _loginModel.RememberMe);
|
||||
if (success) NavigationManager.NavigateTo("/");
|
||||
else _errorMessage = "Nieprawidłowy e-mail lub hasło.";
|
||||
var result = await IdentityService.LoginAsync(_loginModel.Email, _loginModel.Password, _loginModel.RememberMe);
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
NavigationManager.NavigateTo("/");
|
||||
}
|
||||
else
|
||||
{
|
||||
_errorMessage = result.Errors.FirstOrDefault()?.Message ?? "Nieprawidłowy e-mail lub hasło.";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_errorMessage = $"Wystąpił błąd logowania: {ex.Message}.";
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isSubmitting = false;
|
||||
}
|
||||
catch (Exception) { _errorMessage = "Wystąpił błąd logowania."; }
|
||||
finally { _isSubmitting = false; }
|
||||
}
|
||||
|
||||
private void HandleGoogleLogin() => NavigationManager.NavigateTo("identity/login/google", forceLoad: true);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@page "/account/profile"
|
||||
@page "/profile"
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using NexusReader.UI.Shared.Services
|
||||
@using NexusReader.UI.Shared.Components.Atoms
|
||||
@@ -6,96 +7,102 @@
|
||||
@inject IIdentityService IdentityService
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
<div class="profile-dashboard">
|
||||
<div class="profile-page-container">
|
||||
<div class="background-radial"></div>
|
||||
<div class="mesh-overlay"></div>
|
||||
|
||||
@if (_profile == null)
|
||||
{
|
||||
<div class="loading-overlay">
|
||||
<div class="loading-state">
|
||||
<div class="nexus-loader"></div>
|
||||
<p>Ładowanie Twojego profilu...</p>
|
||||
<p>Ładowanie systemu...</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="dashboard-content">
|
||||
<header class="dashboard-header">
|
||||
<div class="user-meta">
|
||||
<div class="user-avatar">
|
||||
<div class="profile-content">
|
||||
<!-- Identity Section -->
|
||||
<section class="identity-section">
|
||||
<div class="avatar-container">
|
||||
<div class="avatar-glow"></div>
|
||||
<div class="avatar-inner">
|
||||
@(_profile.Email[0].ToString().ToUpper())
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<h1>@_profile.Email</h1>
|
||||
<div class="plan-info">
|
||||
<span class="badge @(_profile.CurrentPlan.ToLower())">@_profile.CurrentPlan Plan</span>
|
||||
<span class="tenant-id">ID: @_profile.TenantId.ToString()[..8]...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
<button class="btn-logout" @onclick="HandleLogout">
|
||||
<NexusIcon Name="lock" Size="16" />
|
||||
Wyloguj się
|
||||
</button>
|
||||
|
||||
<div class="user-titles">
|
||||
<h1 class="username">@_profile.Email.Split('@')[0]</h1>
|
||||
<span class="system-rank">[Nexus_Explorer_@(_profile.TenantId.ToString()[..4])]</span>
|
||||
</div>
|
||||
</header>
|
||||
</section>
|
||||
|
||||
<div class="stats-grid">
|
||||
<!-- AI Token Card -->
|
||||
<div class="stat-card usage-card">
|
||||
<div class="card-icon">
|
||||
<NexusIcon Name="robot" Size="24" />
|
||||
<!-- Metrics Grid -->
|
||||
<div class="metrics-grid">
|
||||
<!-- Intelligence Card -->
|
||||
<div class="metric-card glass-panel">
|
||||
<div class="card-header">
|
||||
<NexusIcon Name="robot" Size="24" Color="var(--nexus-neon)" />
|
||||
<h3>Interfejs AI</h3>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h3>Wykorzystanie AI</h3>
|
||||
<div class="token-numbers">
|
||||
<span class="tokens-used">@_profile.AITokensUsed</span>
|
||||
<span class="tokens-limit">/ @_profile.AITokenLimit tokenów</span>
|
||||
<div class="card-body">
|
||||
<div class="token-usage">
|
||||
<div class="usage-values">
|
||||
<span class="current">@_profile.AITokensUsed</span>
|
||||
<span class="separator">/</span>
|
||||
<span class="total">@_profile.AITokenLimit</span>
|
||||
</div>
|
||||
<div class="usage-progress">
|
||||
<div class="progress-bar" style="width: @(CalculateProgress())%"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="usage-bar">
|
||||
<div class="usage-fill" style="width: @(CalculateProgress())%"></div>
|
||||
</div>
|
||||
<p class="usage-desc">Limit odnawia się w następnym cyklu rozliczeniowym.</p>
|
||||
<span class="metric-label">Wykorzystane Jednostki Mocy</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Learning Progress Card -->
|
||||
<div class="stat-card learning-card">
|
||||
<div class="card-icon">
|
||||
<NexusIcon Name="mail" Size="24" />
|
||||
<!-- Sync Card -->
|
||||
<div class="metric-card glass-panel">
|
||||
<div class="card-header">
|
||||
<NexusIcon Name="activity" Size="24" Color="var(--nexus-neon)" />
|
||||
<h3>Wydajność Nauki</h3>
|
||||
</div>
|
||||
<div class="card-info">
|
||||
<h3>Aktywna Nauka</h3>
|
||||
<div class="learning-metrics">
|
||||
<div class="metric">
|
||||
<span class="label">Średni wynik quizów</span>
|
||||
<span class="value">@_profile.AverageQuizScore%</span>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<span class="label">Ostatnio czytane</span>
|
||||
<span class="value truncate">@_profile.LastReadBookTitle</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="score-display">
|
||||
<span class="score-value">@_profile.AverageQuizScore%</span>
|
||||
<span class="score-label">Średni Wynik Asymilacji</span>
|
||||
</div>
|
||||
<div class="last-book">
|
||||
<NexusIcon Name="book-open" Size="14" />
|
||||
<span class="truncate">@_profile.LastReadBookTitle</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Account Status Card -->
|
||||
<div class="metric-card glass-panel full-width">
|
||||
<div class="card-header">
|
||||
<NexusIcon Name="shield" Size="24" Color="var(--nexus-neon)" />
|
||||
<h3>Status Autoryzacji</h3>
|
||||
</div>
|
||||
<div class="card-body status-layout">
|
||||
<div class="status-info">
|
||||
<span class="plan-badge @(_profile.CurrentPlan.ToLower())">@_profile.CurrentPlan Protocol</span>
|
||||
<span class="tenant-tag">Node: @_profile.TenantId.ToString().ToUpper()</span>
|
||||
</div>
|
||||
<div class="profile-actions">
|
||||
<button class="btn-nexus secondary" @onclick="HandleUpgrade">Zarządzaj Subskrypcją</button>
|
||||
<button class="btn-nexus logout" @onclick="HandleLogout">
|
||||
<NexusIcon Name="log-out" Size="18" />
|
||||
Wyloguj
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="subscription-section">
|
||||
<div class="section-card">
|
||||
<div class="section-info">
|
||||
<h2>Zarządzaj subskrypcją</h2>
|
||||
<p>Zmień swój plan, aby zwiększyć limit tokenów AI i odblokować funkcje premium.</p>
|
||||
</div>
|
||||
<button class="btn-upgrade" @onclick="HandleUpgrade">
|
||||
Przejdź do panelu płatności
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="decoration-star top-left">✦</div>
|
||||
<div class="decoration-star bottom-right">✦</div>
|
||||
<div class="decoration decoration-top">NXS-SYS-v10</div>
|
||||
<div class="decoration decoration-bottom">IDENTITY-CORE-ENCRYPTED</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
@@ -103,7 +110,12 @@
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_profile = await IdentityService.GetProfileAsync();
|
||||
var result = await IdentityService.GetProfileAsync();
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
_profile = result.Value;
|
||||
}
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
private int CalculateProgress()
|
||||
|
||||
@@ -1,256 +1,367 @@
|
||||
.profile-dashboard {
|
||||
.profile-page-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
background-color: #121418;
|
||||
color: white;
|
||||
font-family: 'Inter', sans-serif;
|
||||
padding: 60px 20px;
|
||||
background-color: #0a0c10;
|
||||
color: #e0e6ed;
|
||||
overflow-x: hidden;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
overflow-x: hidden;
|
||||
padding: 80px 20px;
|
||||
font-family: var(--nexus-font-sans);
|
||||
}
|
||||
|
||||
.background-radial {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 800px;
|
||||
height: 800px;
|
||||
background: radial-gradient(circle, rgba(0, 255, 153, 0.05) 0%, transparent 70%);
|
||||
pointer-events: none;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.mesh-overlay {
|
||||
position: absolute;
|
||||
top: 0; left: 0; width: 100%; height: 100%;
|
||||
background-image: radial-gradient(circle at 2px 2px, rgba(255,255,255,0.02) 1px, transparent 0);
|
||||
background-size: 40px 40px;
|
||||
background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.02) 1px, transparent 0);
|
||||
background-size: 32px 32px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.dashboard-content {
|
||||
.profile-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.dashboard-header {
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 48px;
|
||||
padding: 0 10px;
|
||||
gap: 60px;
|
||||
}
|
||||
|
||||
.user-meta {
|
||||
/* Identity Section */
|
||||
.identity-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.user-avatar {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
background: linear-gradient(135deg, #44ff77 0%, #2ecc71 100%);
|
||||
border-radius: 24px;
|
||||
.avatar-container {
|
||||
position: relative;
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
|
||||
.avatar-inner {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
background: #151921;
|
||||
border: 2px solid var(--nexus-neon);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 3.5rem;
|
||||
font-weight: 800;
|
||||
color: #000;
|
||||
box-shadow: 0 10px 30px rgba(68, 255, 119, 0.2);
|
||||
color: var(--nexus-neon);
|
||||
z-index: 2;
|
||||
box-shadow: 0 0 30px rgba(0, 255, 153, 0.2), inset 0 0 20px rgba(0, 255, 153, 0.1);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.user-info h1 {
|
||||
font-size: 1.8rem;
|
||||
.avatar-glow {
|
||||
position: absolute;
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
border: 1px solid rgba(0, 255, 153, 0.3);
|
||||
border-radius: 50%;
|
||||
animation: pulse-ring 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-ring {
|
||||
0% { transform: scale(0.95); opacity: 0.8; }
|
||||
50% { transform: scale(1.1); opacity: 0.2; }
|
||||
100% { transform: scale(0.95); opacity: 0.8; }
|
||||
}
|
||||
|
||||
.username {
|
||||
font-family: var(--nexus-font-serif);
|
||||
font-size: 2.8rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 8px;
|
||||
letter-spacing: -0.02em;
|
||||
margin: 0;
|
||||
letter-spacing: -0.01em;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.plan-info {
|
||||
.system-rank {
|
||||
font-family: 'Inter', 'Courier New', Courier, monospace;
|
||||
font-size: 0.9rem;
|
||||
color: var(--nexus-neon);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.2em;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* Metrics Grid */
|
||||
.metrics-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 24px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.glass-panel {
|
||||
background: rgba(20, 20, 20, 0.8); /* Fallback */
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 24px;
|
||||
padding: 32px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
@supports (backdrop-filter: blur(12px)) {
|
||||
.glass-panel {
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
backdrop-filter: blur(12px);
|
||||
-webkit-backdrop-filter: blur(12px);
|
||||
}
|
||||
}
|
||||
|
||||
.glass-panel:hover {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-color: rgba(0, 255, 153, 0.2);
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
|
||||
.metric-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.full-width {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
padding: 4px 12px;
|
||||
border-radius: 8px;
|
||||
.card-header h3 {
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.1em;
|
||||
color: #a0aec0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* Usage Progress */
|
||||
.token-usage {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.usage-values {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.usage-values .current { font-size: 2.5rem; font-weight: 800; color: #fff; line-height: 1; }
|
||||
.usage-values .separator { font-size: 1.2rem; color: #4a5568; }
|
||||
.usage-values .total { font-size: 1.2rem; color: #718096; font-weight: 600; }
|
||||
|
||||
.usage-progress {
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 100%;
|
||||
background: var(--nexus-neon);
|
||||
box-shadow: 0 0 15px rgba(0, 255, 153, 0.5);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.metric-label {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
color: #718096;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.badge.pro { background: rgba(68, 255, 119, 0.1); color: #44ff77; border: 1px solid rgba(68, 255, 119, 0.2); }
|
||||
.badge.free { background: rgba(255, 255, 255, 0.05); color: #888; border: 1px solid rgba(255, 255, 255, 0.1); }
|
||||
/* Score Display */
|
||||
.score-display {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tenant-id { font-size: 0.8rem; color: #555; }
|
||||
.score-value {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 800;
|
||||
color: var(--nexus-neon);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.btn-logout {
|
||||
.score-label {
|
||||
font-size: 0.75rem;
|
||||
color: #718096;
|
||||
text-transform: uppercase;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.last-book {
|
||||
margin-top: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 18px;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
padding: 10px 16px;
|
||||
background: rgba(0, 255, 153, 0.05);
|
||||
border-radius: 12px;
|
||||
color: #888;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
font-size: 0.85rem;
|
||||
color: #cbd5e0;
|
||||
}
|
||||
|
||||
.btn-logout:hover {
|
||||
background: rgba(255, 77, 77, 0.05);
|
||||
border-color: rgba(255, 77, 77, 0.2);
|
||||
color: #ff4d4d;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
||||
gap: 24px;
|
||||
margin-bottom: 48px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background: #1c1f24;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 28px;
|
||||
padding: 32px;
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.stat-card:hover { transform: translateY(-5px); }
|
||||
|
||||
.card-icon {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #44ff77;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.card-info h3 {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
margin: 0 0 16px;
|
||||
color: #e0e0e0;
|
||||
}
|
||||
|
||||
.token-numbers {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.tokens-used { font-size: 2rem; font-weight: 800; color: white; }
|
||||
.tokens-limit { font-size: 1rem; color: #555; font-weight: 500; }
|
||||
|
||||
.usage-bar {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
background: #15181c;
|
||||
border-radius: 10px;
|
||||
.truncate {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
margin-bottom: 12px;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.usage-fill {
|
||||
height: 100%;
|
||||
background: #44ff77;
|
||||
box-shadow: 0 0 15px rgba(68, 255, 119, 0.3);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.usage-desc { font-size: 0.8rem; color: #555; margin: 0; }
|
||||
|
||||
.learning-metrics {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.metric {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.metric .label { font-size: 0.85rem; color: #666; font-weight: 500; }
|
||||
.metric .value { font-size: 1.2rem; font-weight: 700; color: white; }
|
||||
.metric .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
|
||||
|
||||
.subscription-section { margin-top: 48px; }
|
||||
|
||||
.section-card {
|
||||
background: linear-gradient(90deg, #1c1f24 0%, #23272e 100%);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
border-radius: 28px;
|
||||
padding: 40px;
|
||||
display: flex;
|
||||
/* Status Layout */
|
||||
.status-layout {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 40px;
|
||||
}
|
||||
|
||||
.section-info h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 12px; }
|
||||
.section-info p { color: #888; margin: 0; line-height: 1.6; max-width: 500px; }
|
||||
.status-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.btn-upgrade {
|
||||
padding: 16px 32px;
|
||||
background: #44ff77;
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
color: #000;
|
||||
font-size: 1rem;
|
||||
.plan-badge {
|
||||
padding: 6px 14px;
|
||||
border-radius: 8px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 800;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.plan-badge.pro {
|
||||
background: rgba(0, 255, 153, 0.1);
|
||||
color: var(--nexus-neon);
|
||||
border: 1px solid rgba(0, 255, 153, 0.2);
|
||||
}
|
||||
|
||||
.tenant-tag {
|
||||
font-family: monospace;
|
||||
font-size: 0.75rem;
|
||||
color: #4a5568;
|
||||
}
|
||||
|
||||
.profile-actions {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.btn-nexus {
|
||||
padding: 12px 24px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
white-space: nowrap;
|
||||
transition: all 0.2s ease;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.btn-upgrade:hover {
|
||||
transform: scale(1.05);
|
||||
box-shadow: 0 10px 30px rgba(68, 255, 119, 0.2);
|
||||
.btn-nexus.secondary {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
color: #fff;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.loading-overlay {
|
||||
.btn-nexus.secondary:hover {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.btn-nexus.logout {
|
||||
background: rgba(255, 71, 87, 0.1);
|
||||
color: #ff4757;
|
||||
border: 1px solid rgba(255, 71, 87, 0.2);
|
||||
}
|
||||
|
||||
.btn-nexus.logout:hover {
|
||||
background: #ff4757;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Decorations */
|
||||
.decoration {
|
||||
position: absolute;
|
||||
font-family: monospace;
|
||||
font-size: 0.7rem;
|
||||
color: rgba(255, 255, 255, 0.05);
|
||||
letter-spacing: 0.3em;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.decoration-top { top: 40px; left: 40px; }
|
||||
.decoration-bottom { bottom: 40px; right: 40px; }
|
||||
|
||||
/* Loading State */
|
||||
.loading-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.nexus-loader {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(68, 255, 119, 0.1);
|
||||
border-top-color: #44ff77;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border: 4px solid rgba(0, 255, 153, 0.1);
|
||||
border-top-color: var(--nexus-neon);
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
animation: spin 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
||||
filter: drop-shadow(0 0 10px var(--nexus-neon));
|
||||
}
|
||||
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
|
||||
.decoration-star {
|
||||
position: absolute;
|
||||
font-size: 48px;
|
||||
color: rgba(255, 255, 255, 0.03);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.top-left { top: 40px; left: 40px; }
|
||||
.bottom-right { bottom: 40px; right: 40px; }
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.dashboard-header { flex-direction: column; align-items: flex-start; gap: 24px; }
|
||||
.header-actions { width: 100%; }
|
||||
.btn-logout { width: 100%; justify-content: center; }
|
||||
.stats-grid { grid-template-columns: 1fr; }
|
||||
.section-card { flex-direction: column; text-align: center; }
|
||||
.metrics-grid { grid-template-columns: 1fr; }
|
||||
.full-width { grid-column: span 1; }
|
||||
.status-layout { flex-direction: column; align-items: flex-start; gap: 24px; }
|
||||
.profile-actions { width: 100%; flex-direction: column; }
|
||||
.btn-nexus { width: 100%; justify-content: center; }
|
||||
.username { font-size: 2.2rem; }
|
||||
}
|
||||
|
||||
@@ -81,17 +81,32 @@
|
||||
|
||||
try
|
||||
{
|
||||
var success = await IdentityService.RegisterAsync(_registerModel.Email, _registerModel.Password);
|
||||
if (success)
|
||||
var regResult = await IdentityService.RegisterAsync(_registerModel.Email, _registerModel.Password);
|
||||
if (regResult.IsSuccess)
|
||||
{
|
||||
var loginSuccess = await IdentityService.LoginAsync(_registerModel.Email, _registerModel.Password);
|
||||
if (loginSuccess) NavigationManager.NavigateTo("/");
|
||||
else NavigationManager.NavigateTo("/account/login");
|
||||
var loginResult = await IdentityService.LoginAsync(_registerModel.Email, _registerModel.Password);
|
||||
if (loginResult.IsSuccess)
|
||||
{
|
||||
NavigationManager.NavigateTo("/");
|
||||
}
|
||||
else
|
||||
{
|
||||
NavigationManager.NavigateTo("/account/login");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_errorMessage = regResult.Errors.FirstOrDefault()?.Message ?? "Rejestracja nie powiodła się.";
|
||||
}
|
||||
else { _errorMessage = "Rejestracja nie powiodła się."; }
|
||||
}
|
||||
catch (Exception) { _errorMessage = "Wystąpił błąd podczas rejestracji."; }
|
||||
finally { _isSubmitting = false; }
|
||||
catch (Exception)
|
||||
{
|
||||
_errorMessage = "Wystąpił błąd podczas rejestracji.";
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isSubmitting = false;
|
||||
}
|
||||
}
|
||||
|
||||
public class RegisterModel
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
@page "/"
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using NexusReader.UI.Shared.Components.Atoms
|
||||
@using NexusReader.UI.Shared.Services
|
||||
@inject IIdentityService IdentityService
|
||||
@inject NavigationManager NavigationManager
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageTitle>Dashboard | Nexus Reader</PageTitle>
|
||||
|
||||
<div class="dashboard-container">
|
||||
<!-- Top Profile Section -->
|
||||
<header class="profile-header">
|
||||
<div class="header-grid-bg"></div>
|
||||
<div class="profile-visual">
|
||||
<div class="avatar-wrapper">
|
||||
<img src="https://api.dicebear.com/7.x/bottts/svg?seed=Nexus" alt="Profile" class="profile-img" />
|
||||
<div class="avatar-glow"></div>
|
||||
</div>
|
||||
<h1 class="username">[User_Explorer1988]</h1>
|
||||
|
||||
<div class="status-pills">
|
||||
<div class="status-pill">
|
||||
<span class="pill-label">Books Read:</span>
|
||||
<span class="pill-value">12</span>
|
||||
</div>
|
||||
<div class="status-pill">
|
||||
<span class="pill-label">Concepts Mapped:</span>
|
||||
<span class="pill-value">450</span>
|
||||
</div>
|
||||
<div class="status-pill">
|
||||
<span class="pill-label">Quiz Mastery:</span>
|
||||
<span class="pill-value">88%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Main Content Area -->
|
||||
<main class="dashboard-content">
|
||||
<h2 class="section-title">Witaj, @(_profile?.Email.Split('@')[0] ?? "Użytkowniku")</h2>
|
||||
|
||||
<div class="main-grid">
|
||||
<!-- Current Reading Card -->
|
||||
<section class="reading-card glass-panel">
|
||||
@if (_profile?.LastReadBook != null)
|
||||
{
|
||||
<div class="card-header">
|
||||
<h3>Ostatnio czytane: @_profile.LastReadBook.Title</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="reading-thumb">
|
||||
<img src="@(_profile.LastReadBook.CoverUrl ?? "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg/402px-Mona_Lisa%2C_by_Leonardo_da_Vinci%2C_from_C2RMF_retouched.jpg")" alt="Current Book" />
|
||||
</div>
|
||||
<div class="reading-info">
|
||||
<div class="progress-section">
|
||||
<span class="chapter-label">@_profile.LastReadBook.LastChapter</span>
|
||||
<div class="progress-container">
|
||||
<div class="progress-bar" style="width: @(_profile.LastReadBook.Progress.ToString("F0", System.Globalization.CultureInfo.InvariantCulture))%">
|
||||
<div class="progress-bubble">@(_profile.LastReadBook.Progress.ToString("F1"))%</div>
|
||||
</div>
|
||||
</div>
|
||||
<span class="progress-detail">Postęp: @(_profile.LastReadBook.Progress.ToString("F2"))% - @_profile.LastReadBook.Author.Name</span>
|
||||
</div>
|
||||
<p class="reading-desc">
|
||||
Kontynuuj odkrywanie wiedzy w książce "@_profile.LastReadBook.Title".
|
||||
Twój cyfrowy asystent Nexus jest gotowy do analizy kolejnych rozdziałów i generowania interaktywnych map myśli.
|
||||
</p>
|
||||
<div class="card-actions">
|
||||
<button class="btn-nexus primary" @onclick='() => NavigationManager.NavigateTo($"/reader?chapter={_profile.LastReadBook.LastChapterIndex}")'>Kontynuuj Czytanie</button>
|
||||
<button class="btn-nexus secondary" @onclick='() => NavigationManager.NavigateTo("/library")'>Moja Biblioteka</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="card-header">
|
||||
<h3>Brak aktywnych lektur</h3>
|
||||
</div>
|
||||
<div class="card-body empty-state">
|
||||
<div class="empty-icon">
|
||||
<NexusIcon Name="book-open" Size="64" />
|
||||
</div>
|
||||
<div class="reading-info">
|
||||
<p class="reading-desc">
|
||||
Nie czytasz obecnie żadnej książki. Przejdź do biblioteki, aby przesłać swój pierwszy plik EPUB i rozpocząć przygodę z Nexus Reader.
|
||||
</p>
|
||||
<div class="card-actions">
|
||||
<button class="btn-nexus primary" @onclick='() => NavigationManager.NavigateTo("/library")'>Przejdź do Biblioteki</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</section>
|
||||
|
||||
<div class="secondary-grid">
|
||||
<!-- Knowledge Integration -->
|
||||
<section class="integration-card glass-panel">
|
||||
<div class="panel-header">
|
||||
<h4>Knowledge Integration Progress</h4>
|
||||
<NexusIcon Name="arrow-right" Size="16" />
|
||||
</div>
|
||||
<div class="graph-placeholder">
|
||||
<div class="graph-node central"></div>
|
||||
<div class="graph-node satellite" style="--angle: 0deg; --dist: 60px;"></div>
|
||||
<div class="graph-node satellite" style="--angle: 120deg; --dist: 50px;"></div>
|
||||
<div class="graph-node satellite" style="--angle: 240deg; --dist: 70px;"></div>
|
||||
<div class="active-node-label">TU JESTEŚ</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Quiz Summary -->
|
||||
<section class="quiz-card glass-panel">
|
||||
<div class="panel-header">
|
||||
<h4>Quiz Summary: Key Thinkers</h4>
|
||||
<NexusIcon Name="arrow-right" Size="16" />
|
||||
</div>
|
||||
<div class="quiz-preview">
|
||||
<p class="question">Który artysta namalował 'Ostatnią Wieczerzę'?</p>
|
||||
<div class="quiz-options">
|
||||
<div class="quiz-option active">
|
||||
<span class="option-letter">A)</span> Michal Anioł
|
||||
</div>
|
||||
<div class="quiz-option">
|
||||
<span class="option-letter">B)</span> Leonardo da Vinci
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private UserProfile? _profile;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var result = await IdentityService.GetProfileAsync();
|
||||
if (result.IsSuccess)
|
||||
{
|
||||
_profile = result.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
@page "/"
|
||||
@page "/reader"
|
||||
@layout ReaderLayout
|
||||
@attribute [Authorize]
|
||||
@using NexusReader.UI.Shared.Services
|
||||
@implements IAsyncDisposable
|
||||
@inject IQuizStateService QuizState
|
||||
@inject IFocusModeService FocusMode
|
||||
@inject IJSRuntime JS
|
||||
@inject NavigationManager NavManager
|
||||
@inject IReaderNavigationService NavService
|
||||
<PageTitle>Nexus E-Reader</PageTitle>
|
||||
|
||||
<div class="home-reader-container">
|
||||
@@ -25,6 +28,16 @@
|
||||
QuizState.OnQuizRequested += HandleQuizRequestedAsync;
|
||||
FocusMode.OnFocusModeChanged += HandleUpdate;
|
||||
await FocusMode.InitializeAsync();
|
||||
|
||||
// Handle deep-linking to a specific chapter
|
||||
var uri = NavManager.ToAbsoluteUri(NavManager.Uri);
|
||||
if (Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query).TryGetValue("chapter", out var chapterValue))
|
||||
{
|
||||
if (int.TryParse(chapterValue, out var chapterIndex))
|
||||
{
|
||||
await NavService.GoToChapter(chapterIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
@page "/library"
|
||||
@attribute [Authorize]
|
||||
|
||||
<div class="library-page">
|
||||
<h1>Biblioteka</h1>
|
||||
<p>Twoja kolekcja książek i dokumentów pojawi się tutaj wkrótce.</p>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.library-page {
|
||||
padding: 2rem;
|
||||
}
|
||||
h1 {
|
||||
margin-bottom: 1rem;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
@page "/not-found"
|
||||
@layout Layout.MainLayout
|
||||
@layout MainHubLayout
|
||||
|
||||
<div class="not-found-preloader">
|
||||
<div class="preloader-robot">
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
@page "/settings"
|
||||
@attribute [Authorize]
|
||||
|
||||
<div class="settings-page">
|
||||
<h1>Ustawienia</h1>
|
||||
<p>Konfiguracja Twojego konta i preferencji czytania.</p>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.settings-page {
|
||||
padding: 2rem;
|
||||
}
|
||||
h1 {
|
||||
margin-bottom: 1rem;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user