Initial commit: NexusArchitect Professional Workstation Overhaul

This commit is contained in:
Debian
2026-04-24 20:27:22 +02:00
commit f3e94c4f42
193 changed files with 5809 additions and 0 deletions
@@ -0,0 +1,78 @@
@page "/"
@using NexusReader.UI.Shared.Services
@implements IAsyncDisposable
@inject IQuizStateService QuizState
@inject IFocusModeService FocusMode
@inject IJSRuntime JS
<PageTitle>Nexus E-Reader</PageTitle>
<div class="home-reader-container">
<ReaderCanvas @ref="readerCanvas" />
</div>
@code {
private ReaderCanvas? readerCanvas;
private string? _activeQuizBlockId;
private IJSObjectReference? _interopModule;
private IJSObjectReference? _keydownHandler;
private DotNetObjectReference<Home>? _dotNetRef;
protected override async Task OnInitializedAsync()
{
QuizState.OnQuizRequested += HandleQuizRequested;
FocusMode.OnFocusModeChanged += StateHasChanged;
await FocusMode.InitializeAsync();
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
try {
_interopModule = await JS.InvokeAsync<IJSObjectReference>("import", "./_content/NexusReader.UI.Shared/js/focusInterop.js");
_dotNetRef = DotNetObjectReference.Create(this);
_keydownHandler = await _interopModule.InvokeAsync<IJSObjectReference>("attachKeyboardListener", _dotNetRef);
} catch { } /* ignored dynamically */
}
}
[JSInvokable]
public async Task OnFocusKeypressed()
{
await FocusMode.ToggleAsync();
StateHasChanged();
}
private async Task HandleNodeSelected(string nodeId)
{
if (readerCanvas != null)
{
await readerCanvas.ScrollToNodeAsync(nodeId);
}
}
private void HandleQuizRequested(string blockId)
{
_activeQuizBlockId = blockId;
StateHasChanged();
}
public async ValueTask DisposeAsync()
{
QuizState.OnQuizRequested -= HandleQuizRequested;
FocusMode.OnFocusModeChanged -= StateHasChanged;
if (_interopModule != null && _keydownHandler != null)
{
try {
await _interopModule.InvokeVoidAsync("detachKeyboardListener", _keydownHandler);
await _interopModule.DisposeAsync();
await _keydownHandler.DisposeAsync();
} catch { } // Circuit disconnected catch explicitly
}
_dotNetRef?.Dispose();
}
}
@@ -0,0 +1,15 @@
.home-reader-container {
width: 100%;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.reader-pane::-webkit-scrollbar {
width: 6px;
}
.reader-pane::-webkit-scrollbar-thumb {
background-color: #ddd;
border-radius: 4px;
}
@@ -0,0 +1,5 @@
@page "/not-found"
@layout MainLayout
<h3>Not Found</h3>
<p>Sorry, the content you are looking for does not exist.</p>