feat: implement epub service, navigation service, and global error boundary with updated reader UI layouts

This commit is contained in:
2026-04-25 16:16:36 +02:00
parent f3e94c4f42
commit 59074a05a0
23 changed files with 726 additions and 157 deletions
@@ -1,21 +1,49 @@
@using NexusReader.UI.Shared.Services
@inject IReaderNavigationService NavigationService
@implements IDisposable
<footer class="reader-footer">
<div class="footer-content">
<div class="page-info">
<span class="label">Postęp:</span>
<span class="value">@Progress%</span>
<div class="navigation-controls">
<button class="nav-btn" @onclick="NavigationService.GoToPreviousChapter" disabled="@(NavigationService.CurrentChapterIndex == 0)">
<NexusIcon Name="arrow-left" Size="14" />
</button>
<div class="chapter-info">
<span class="chapter-title">@NavigationService.ChapterTitle</span>
<span class="chapter-count">(@(NavigationService.CurrentChapterIndex + 1) / @NavigationService.TotalChapters)</span>
</div>
<button class="nav-btn" @onclick="NavigationService.GoToNextChapter" disabled="@(NavigationService.CurrentChapterIndex >= NavigationService.TotalChapters - 1)">
<NexusIcon Name="arrow-right" Size="14" />
</button>
</div>
<div class="progress-container">
<div class="progress-bar" style="width: @Progress%"></div>
<div class="progress-bar" style="width: @CalculateProgress()%"></div>
</div>
<div class="meta-info">
<span class="time">1:30</span>
<span class="battery">45% 🔋</span>
<span class="time">@DateTime.Now.ToString("HH:mm")</span>
</div>
</div>
</footer>
@code {
[Parameter] public int Progress { get; set; } = 45;
protected override void OnInitialized()
{
NavigationService.OnNavigationChanged += StateHasChanged;
}
private int CalculateProgress()
{
if (NavigationService.TotalChapters <= 1) return 0;
return (int)((NavigationService.CurrentChapterIndex / (float)(NavigationService.TotalChapters - 1)) * 100);
}
public void Dispose()
{
NavigationService.OnNavigationChanged -= StateHasChanged;
}
}