Onboarding
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="nav-container">
|
||||
<div class="nav-container onboarding-nav-menu">
|
||||
@* --- Brand / Logo Section --- *@
|
||||
<div class="nav-header">
|
||||
<div class="logo-wrapper">
|
||||
|
||||
@@ -119,26 +119,54 @@
|
||||
}
|
||||
|
||||
/* NavLink active state (Fixes active color contrast issue) */
|
||||
::deep .custom-nav-link.active,
|
||||
::deep .custom-nav-link .active {
|
||||
background: linear-gradient(90deg, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0.04) 100%) !important;
|
||||
font-weight: 600 !important;
|
||||
box-shadow: inset 3px 0 0 #0EA5E9 !important;
|
||||
}
|
||||
|
||||
::deep .custom-nav-link.active,
|
||||
::deep .custom-nav-link .active,
|
||||
::deep .custom-nav-link.active .mud-nav-link-text,
|
||||
::deep .custom-nav-link .active .mud-nav-link-text,
|
||||
::deep .custom-nav-link.active .mud-nav-link-icon-default,
|
||||
::deep .custom-nav-link .active .mud-nav-link-icon-default {
|
||||
color: #0EA5E9 !important; /* Sky 500 */
|
||||
}
|
||||
|
||||
/* Admin link color overrides */
|
||||
/* Admin link color overrides & active state */
|
||||
::deep .admin-link .mud-nav-link-icon-default {
|
||||
color: rgba(239, 68, 68, 0.7) !important; /* Red 500 */
|
||||
}
|
||||
|
||||
::deep .admin-link.active,
|
||||
::deep .admin-link .active {
|
||||
background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.04) 100%) !important;
|
||||
box-shadow: inset 3px 0 0 #EF4444 !important;
|
||||
}
|
||||
|
||||
::deep .admin-link.active,
|
||||
::deep .admin-link .active,
|
||||
::deep .admin-link.active .mud-nav-link-text,
|
||||
::deep .admin-link .active .mud-nav-link-text,
|
||||
::deep .admin-link.active .mud-nav-link-icon-default,
|
||||
::deep .admin-link .active .mud-nav-link-icon-default {
|
||||
color: #EF4444 !important;
|
||||
}
|
||||
|
||||
/* Version link active state */
|
||||
::deep .version-link.active,
|
||||
::deep .version-link .active {
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
::deep .version-link.active .version-text,
|
||||
::deep .version-link .active .version-text {
|
||||
color: #0EA5E9 !important;
|
||||
}
|
||||
|
||||
|
||||
/* Footer Section */
|
||||
.nav-footer {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
||||
|
||||
@@ -71,8 +71,9 @@
|
||||
new("1.4", "08.06.2026", true,
|
||||
[
|
||||
new("Neu", "Timebot implementiert"),
|
||||
new("Neu", "Onboarding Tour"),
|
||||
new("Upgrade", "Security hardening"),
|
||||
new("Upgrade", "Changed coloring")
|
||||
new("Upgrade", "Changed coloring"),
|
||||
]),
|
||||
new("1.3", "08.06.2026", false,
|
||||
[
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
@inject IHolidayService HolidayService
|
||||
@inject ISnackbar Snackbar
|
||||
@inject AuthenticationStateProvider AuthStateProvider
|
||||
@inject IJSRuntime JSRuntime
|
||||
|
||||
<PageTitle>KW @_kw – Wochenübersicht – Timetracker</PageTitle>
|
||||
|
||||
@@ -20,7 +21,7 @@ else
|
||||
<MudStack Spacing="3">
|
||||
|
||||
@* ── Wochen-Header ── *@
|
||||
<MudPaper Elevation="4" Class="pa-5 rounded-xl"
|
||||
<MudPaper Elevation="4" Class="pa-5 rounded-xl onboarding-week-header"
|
||||
Style="background: #1E293B; color: white;">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.ChevronLeft"
|
||||
@@ -93,7 +94,7 @@ else
|
||||
else
|
||||
{
|
||||
@* ── Arbeitstag: vollständige Karte ── *@
|
||||
<MudCard @key="@day.Date" Elevation="@(isToday ? 6 : 2)" Class="rounded-xl"
|
||||
<MudCard @key="@day.Date" Elevation="@(isToday ? 6 : 2)" Class="rounded-xl onboarding-day-card"
|
||||
Style="@($"border-left: 4px solid {borderColor};")">
|
||||
<MudCardHeader Style="@(isToday ? "background: linear-gradient(90deg, rgba(14,165,233,0.07) 0%, transparent 100%);" : "")">
|
||||
<CardHeaderContent>
|
||||
@@ -269,7 +270,7 @@ else
|
||||
}
|
||||
|
||||
@* ── Wochensumme ── *@
|
||||
<MudPaper Elevation="4" Class="pa-5 rounded-xl"
|
||||
<MudPaper Elevation="4" Class="pa-5 rounded-xl onboarding-week-summary"
|
||||
Style="background: #0F172A; color:white;">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2" Class="mb-4">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Summarize" Style="color:rgba(255,255,255,0.8)" />
|
||||
@@ -306,7 +307,7 @@ else
|
||||
</MudPaper>
|
||||
|
||||
@* ── Gleitzeitkonto ── *@
|
||||
<MudPaper Elevation="3" Class="pa-5 rounded-xl"
|
||||
<MudPaper Elevation="3" Class="pa-5 rounded-xl onboarding-overtime-balance"
|
||||
Style="@($"border-left: 6px solid {(_totalOvertime >= TimeSpan.Zero ? "#4CAF50" : "#FF9800")};")">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Wrap="Wrap.Wrap" Spacing="3">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
@@ -328,6 +329,11 @@ else
|
||||
</MudPaper>
|
||||
|
||||
</MudStack>
|
||||
|
||||
@if (_showOnboarding)
|
||||
{
|
||||
<OnboardingTour OnFinished="HandleOnboardingFinished" />
|
||||
}
|
||||
}
|
||||
|
||||
@code {
|
||||
@@ -347,6 +353,7 @@ else
|
||||
private TimeSpan _totalOvertime;
|
||||
private Dictionary<DateOnly, string> _holidays = [];
|
||||
private int _holidayYear = -1;
|
||||
private bool _showOnboarding;
|
||||
|
||||
private bool IsCurrentWeek => _monday == GetMonday(DateOnly.FromDateTime(DateTime.Today));
|
||||
|
||||
@@ -364,9 +371,26 @@ else
|
||||
|
||||
await Task.WhenAll(loadWeekTask, overtimeTask);
|
||||
_totalOvertime = await overtimeTask;
|
||||
|
||||
try
|
||||
{
|
||||
var showOnb = await JSRuntime.InvokeAsync<string>("localStorage.getItem", "showOnboarding");
|
||||
_showOnboarding = showOnb == "true";
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignored during prerendering/SSR
|
||||
}
|
||||
|
||||
_loading = false;
|
||||
}
|
||||
|
||||
private async Task HandleOnboardingFinished()
|
||||
{
|
||||
_showOnboarding = false;
|
||||
await JSRuntime.InvokeVoidAsync("localStorage.setItem", "showOnboarding", "false");
|
||||
}
|
||||
|
||||
private async Task LoadWeek()
|
||||
{
|
||||
Task<List<PublicHoliday>> holidaysTask;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
@attribute [AllowAnonymous]
|
||||
@inject IAuthService AuthService
|
||||
@inject NavigationManager Nav
|
||||
@inject IJSRuntime JSRuntime
|
||||
|
||||
<PageTitle>Anmelden – Timetracker</PageTitle>
|
||||
|
||||
@@ -207,6 +208,7 @@
|
||||
var (user, error) = await AuthService.RegisterAsync(_registerModel.Username, _registerModel.Password, _honeypot);
|
||||
if (user != null)
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("localStorage.setItem", "showOnboarding", "true");
|
||||
Nav.NavigateTo("/", forceLoad: true);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
@inject IJSRuntime JS
|
||||
|
||||
@if (_active)
|
||||
{
|
||||
@* Dark Backdrop Overlay *@
|
||||
<div class="onboarding-backdrop"></div>
|
||||
|
||||
@* Onboarding Instruction Card *@
|
||||
<div class="onboarding-card-container">
|
||||
<MudCard Class="onboarding-info-card pa-5 rounded-xl shadow-2xl">
|
||||
<MudCardContent Class="pa-0">
|
||||
<MudStack Spacing="3">
|
||||
@* Header / Title *@
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.AutoAwesome" Style="color: #0EA5E9;" />
|
||||
<MudText Typo="Typo.h6" Style="font-weight: 700; color: white;">
|
||||
@_steps[_currentStep].Title
|
||||
</MudText>
|
||||
</MudStack>
|
||||
|
||||
@* Explanation Text *@
|
||||
<MudText Typo="Typo.body2" Style="color: #CBD5E1; line-height: 1.6; min-height: 60px;">
|
||||
@_steps[_currentStep].Content
|
||||
</MudText>
|
||||
|
||||
@* Footer / Progress & Buttons *@
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Class="mt-2">
|
||||
@* Step Count *@
|
||||
<MudText Typo="Typo.caption" Style="color: #94A3B8; font-weight: 600;">
|
||||
Schritt @(_currentStep + 1) von @_steps.Count
|
||||
</MudText>
|
||||
|
||||
@* Navigation Button Stack *@
|
||||
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
|
||||
@if (_currentStep > 0)
|
||||
{
|
||||
<MudButton Variant="Variant.Text"
|
||||
Style="color: #94A3B8; text-transform: none; border-radius: 12px;"
|
||||
OnClick="PrevStep"
|
||||
Size="Size.Small">
|
||||
Zurück
|
||||
</MudButton>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudButton Variant="Variant.Text"
|
||||
Style="color: #94A3B8; text-transform: none; border-radius: 12px;"
|
||||
OnClick="CompleteTour"
|
||||
Size="Size.Small">
|
||||
Überspringen
|
||||
</MudButton>
|
||||
}
|
||||
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Secondary"
|
||||
Style="text-transform: none; border-radius: 12px; font-weight: 700; min-width: 80px;"
|
||||
OnClick="NextStep"
|
||||
Size="Size.Small">
|
||||
@(_currentStep == _steps.Count - 1 ? "Fertig" : "Weiter")
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
</div>
|
||||
}
|
||||
|
||||
<style>
|
||||
/* Backdrop behind cards but below the spotlight highlight */
|
||||
.onboarding-backdrop {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(15, 23, 42, 0.4);
|
||||
backdrop-filter: blur(2px);
|
||||
z-index: 9999;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
/* Fixed positioned instruction box at the bottom center */
|
||||
.onboarding-card-container {
|
||||
position: fixed;
|
||||
bottom: 32px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 90%;
|
||||
max-width: 480px;
|
||||
z-index: 10001;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
/* Dark theme styling for the instruction card */
|
||||
.onboarding-info-card {
|
||||
background: rgba(15, 23, 42, 0.9) !important;
|
||||
backdrop-filter: blur(16px) !important;
|
||||
-webkit-backdrop-filter: blur(16px) !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08) !important;
|
||||
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
[Parameter] public EventCallback OnFinished { get; set; }
|
||||
|
||||
private bool _active = true;
|
||||
private int _currentStep = 0;
|
||||
|
||||
private readonly List<OnboardingStep> _steps =
|
||||
[
|
||||
new(".onboarding-nav-menu", "Die Navigation", "Hier auf der linken Seite findest du das Hauptmenü. Du kannst ganz einfach zwischen der Wochen- und Monatsübersicht wechseln oder deine Statistiken einsehen."),
|
||||
new(".onboarding-week-header", "Kalenderwoche blättern", "Hier siehst du die aktuell ausgewählte Woche. Verwende die Pfeiltasten links und rechts, um in vergangenen oder zukünftigen Wochen deine Zeiten zu erfassen."),
|
||||
new(".onboarding-day-card", "Zeiterfassung pro Tag", "Das Herzstück des Timetrackers. Trage hier deine täglichen Start- und Endzeiten sowie deine Pausen ein. Das System errechnet die Zeiten und Überstunden in Echtzeit."),
|
||||
new(".onboarding-week-summary", "Wochenzusammenfassung", "Hier siehst du auf einen Blick, wie viele Stunden du in dieser Woche gearbeitet hast, wie viel Pause du gemacht hast und wie sich dein Stundensaldo verändert hat."),
|
||||
new(".onboarding-overtime-balance", "Gleitzeitkonto", "Hier wird dein gesamtes Gleitzeitkonto über das Jahr hinweg zusammengerechnet. So weißt du immer genau, wie viele Überstunden du angesammelt hast.")
|
||||
];
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await HighlightStep();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task HighlightStep()
|
||||
{
|
||||
if (_active && _steps.Count > 0)
|
||||
{
|
||||
var step = _steps[_currentStep];
|
||||
await JS.InvokeVoidAsync("window.onboarding.highlight", step.TargetSelector);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task NextStep()
|
||||
{
|
||||
if (_currentStep < _steps.Count - 1)
|
||||
{
|
||||
_currentStep++;
|
||||
await HighlightStep();
|
||||
}
|
||||
else
|
||||
{
|
||||
await CompleteTour();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task PrevStep()
|
||||
{
|
||||
if (_currentStep > 0)
|
||||
{
|
||||
_currentStep--;
|
||||
await HighlightStep();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task CompleteTour()
|
||||
{
|
||||
_active = false;
|
||||
await JS.InvokeVoidAsync("window.onboarding.clear");
|
||||
await OnFinished.InvokeAsync();
|
||||
}
|
||||
|
||||
private class OnboardingStep
|
||||
{
|
||||
public string TargetSelector { get; }
|
||||
public string Title { get; }
|
||||
public string Content { get; }
|
||||
|
||||
public OnboardingStep(string targetSelector, string title, string content)
|
||||
{
|
||||
TargetSelector = targetSelector;
|
||||
Title = title;
|
||||
Content = content;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,9 @@
|
||||
@inject IHolidayService HolidayService
|
||||
@inject ISnackbar Snackbar
|
||||
@inject AuthenticationStateProvider AuthStateProvider
|
||||
@inject IJSRuntime JSRuntime
|
||||
@inject NavigationManager Nav
|
||||
|
||||
|
||||
<PageTitle>Einstellungen – Timetracker</PageTitle>
|
||||
|
||||
@@ -187,6 +190,33 @@ else
|
||||
</MudCard>
|
||||
</MudItem>
|
||||
|
||||
@* ── Hilfe & Einführung ── *@
|
||||
<MudItem xs="12" md="6">
|
||||
<MudCard Elevation="3" Class="rounded-xl h-100">
|
||||
<MudCardHeader>
|
||||
<CardHeaderContent>
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.HelpOutline" Color="Color.Primary" />
|
||||
<MudText Typo="Typo.h6" Style="font-weight:600">Hilfe & Einführung</MudText>
|
||||
</MudStack>
|
||||
</CardHeaderContent>
|
||||
</MudCardHeader>
|
||||
<MudCardContent>
|
||||
<MudStack Spacing="4">
|
||||
<MudText Typo="Typo.body2" Color="Color.Secondary">
|
||||
Wenn du die interaktive Einführung (Onboarding Tour) noch einmal sehen möchtest, kannst du sie hier zurücksetzen und neu starten.
|
||||
</MudText>
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Primary"
|
||||
StartIcon="@Icons.Material.Filled.PlayCircleOutline"
|
||||
OnClick="RepeatOnboarding"
|
||||
Style="max-width:250px;">
|
||||
Onboarding wiederholen
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
</MudItem>
|
||||
|
||||
</MudGrid>
|
||||
|
||||
@* ── Speichern-Button ── *@
|
||||
@@ -578,6 +608,20 @@ else
|
||||
Snackbar.Add("Feiertag entfernt", Severity.Info);
|
||||
}
|
||||
|
||||
private async Task RepeatOnboarding()
|
||||
{
|
||||
try
|
||||
{
|
||||
await JSRuntime.InvokeVoidAsync("localStorage.setItem", "showOnboarding", "true");
|
||||
Snackbar.Add("Onboarding zurückgesetzt. Leite weiter zur Startseite...", Severity.Info);
|
||||
Nav.NavigateTo("/");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Snackbar.Add($"Fehler beim Zurücksetzen des Onboardings: {ex.Message}", Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private static string FormatHours(double hours)
|
||||
{
|
||||
var ts = TimeSpan.FromHours(hours);
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
<ImportMap />
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
||||
<link rel="alternate icon" type="image/png" href="favicon.png" />
|
||||
<style>
|
||||
.onboarding-active-target {
|
||||
position: relative !important;
|
||||
z-index: 10000 !important;
|
||||
box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.75), 0 0 15px rgba(14, 165, 233, 0.5) !important;
|
||||
pointer-events: none !important;
|
||||
transition: all 0.3s ease !important;
|
||||
}
|
||||
</style>
|
||||
<HeadOutlet @rendermode="InteractiveWebAssembly" />
|
||||
</head>
|
||||
|
||||
@@ -20,6 +29,25 @@
|
||||
<Routes />
|
||||
<script src="@Assets["_framework/blazor.web.js"]"></script>
|
||||
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
|
||||
<script>
|
||||
window.onboarding = {
|
||||
highlight: function (selector) {
|
||||
document.querySelectorAll('.onboarding-active-target').forEach(function(el) {
|
||||
el.classList.remove('onboarding-active-target');
|
||||
});
|
||||
var target = document.querySelector(selector);
|
||||
if (target) {
|
||||
target.classList.add('onboarding-active-target');
|
||||
target.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
},
|
||||
clear: function () {
|
||||
document.querySelectorAll('.onboarding-active-target').forEach(function(el) {
|
||||
el.classList.remove('onboarding-active-target');
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user