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,44 @@
using Microsoft.JSInterop;
namespace NexusReader.UI.Shared.Services;
public sealed class FocusModeService : IFocusModeService
{
private readonly IJSRuntime _jsRuntime;
public bool IsFocusModeActive { get; private set; }
public event Action? OnFocusModeChanged;
public FocusModeService(IJSRuntime jsRuntime)
{
_jsRuntime = jsRuntime;
}
public async Task InitializeAsync()
{
try
{
var value = await _jsRuntime.InvokeAsync<string>("localStorage.getItem", "nexus_focus_mode");
if (value == "true" && !IsFocusModeActive)
{
IsFocusModeActive = true;
OnFocusModeChanged?.Invoke();
}
}
catch
{
// Ignored during pre-rendering or unsupported environments
}
}
public async Task ToggleAsync()
{
IsFocusModeActive = !IsFocusModeActive;
OnFocusModeChanged?.Invoke();
try
{
await _jsRuntime.InvokeVoidAsync("localStorage.setItem", "nexus_focus_mode", IsFocusModeActive ? "true" : "false");
}
catch { }
}
}