Compare commits
5 Commits
2029524379
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9824616323 | |||
| 94c10aebdd | |||
| ddb2b4af9f | |||
| 8bd7423209 | |||
| 1def618e34 |
@@ -2,27 +2,36 @@
|
||||
@inject AuthenticationStateProvider AuthStateProvider
|
||||
@inject NavigationManager Nav
|
||||
@inject IUserNotificationService UserNotificationService
|
||||
@inject IJSRuntime JSRuntime
|
||||
@implements IDisposable
|
||||
@using System.Security.Claims
|
||||
|
||||
<MudThemeProvider Theme="_theme" />
|
||||
<MudThemeProvider Theme="_theme" @bind-IsDarkMode="_isDarkMode" />
|
||||
<MudPopoverProvider />
|
||||
<MudDialogProvider />
|
||||
<MudSnackbarProvider />
|
||||
|
||||
<MudLayout>
|
||||
<MudAppBar Elevation="2" Style="background: #0F172A;">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="ToggleDrawer" />
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="2" Class="ml-2">
|
||||
<MudIcon Icon="@Icons.Material.Filled.AccessTime" Style="color:white; font-size:1.6rem" />
|
||||
<MudText Typo="Typo.h6" Style="color:white; font-weight:700; letter-spacing:0.5px">Timetracker</MudText>
|
||||
</MudStack>
|
||||
<MudAppBar Elevation="0" Style="background: #0F172A; border-bottom: 1px solid rgba(255, 255, 255, 0.08);">
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="ToggleDrawer" Class="d-flex d-md-none mr-2" />
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<MudSpacer />
|
||||
<MudIconButton Icon="@(_isDarkMode ? Icons.Material.Filled.LightMode : Icons.Material.Filled.DarkMode)"
|
||||
Color="Color.Inherit"
|
||||
OnClick="ToggleDarkMode"
|
||||
Class="mr-2" />
|
||||
</MudAppBar>
|
||||
|
||||
<MudDrawer @bind-Open="_drawerOpen" ClipMode="DrawerClipMode.Always" Elevation="2">
|
||||
<NavMenu />
|
||||
</MudDrawer>
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<MudDrawer @bind-Open="_drawerOpen" ClipMode="DrawerClipMode.Never" Elevation="0" Variant="DrawerVariant.Mini" OpenMiniOnHover="false" Class="modern-drawer">
|
||||
<NavMenu OnToggleDrawer="ToggleDrawer" />
|
||||
</MudDrawer>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
|
||||
<MudMainContent>
|
||||
<MudContainer MaxWidth="MaxWidth.Large" Class="mt-4 pb-8">
|
||||
@@ -39,12 +48,39 @@
|
||||
|
||||
@code {
|
||||
private bool _drawerOpen = true;
|
||||
private bool _isDarkMode;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
UserNotificationService.OnUserDeleted += HandleUserDeleted;
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
try
|
||||
{
|
||||
var saved = await JSRuntime.InvokeAsync<string>("localStorage.getItem", "darkMode");
|
||||
if (!string.IsNullOrEmpty(saved))
|
||||
{
|
||||
_isDarkMode = bool.Parse(saved);
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignored during prerendering/SSR
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ToggleDarkMode()
|
||||
{
|
||||
_isDarkMode = !_isDarkMode;
|
||||
await JSRuntime.InvokeVoidAsync("localStorage.setItem", "darkMode", _isDarkMode.ToString().ToLower());
|
||||
}
|
||||
|
||||
private async Task HandleUserDeleted(int deletedUserId)
|
||||
{
|
||||
var state = await AuthStateProvider.GetAuthenticationStateAsync();
|
||||
@@ -71,10 +107,31 @@
|
||||
SecondaryDarken = "#0284C7",
|
||||
AppbarBackground = "#0F172A",
|
||||
Background = "#F8FAFC",
|
||||
DrawerBackground = "#FFFFFF",
|
||||
DrawerBackground = "#0F172A",
|
||||
DrawerText = "#94A3B8",
|
||||
DrawerIcon = "#94A3B8",
|
||||
Surface = "#FFFFFF",
|
||||
TextPrimary = "#0F172A",
|
||||
TextSecondary = "#475569",
|
||||
},
|
||||
PaletteDark = new PaletteDark
|
||||
{
|
||||
Primary = "#0EA5E9",
|
||||
PrimaryDarken = "#0284C7",
|
||||
PrimaryLighten = "#38BDF8",
|
||||
Secondary = "#0EA5E9",
|
||||
SecondaryDarken = "#0284C7",
|
||||
AppbarBackground = "#0F172A",
|
||||
AppbarText = "#F8FAFC",
|
||||
Background = "#0B0F19",
|
||||
DrawerBackground = "#0F172A",
|
||||
DrawerText = "#94A3B8",
|
||||
DrawerIcon = "#94A3B8",
|
||||
Surface = "#1E293B",
|
||||
TextPrimary = "#F8FAFC",
|
||||
TextSecondary = "#94A3B8",
|
||||
ActionDefault = "#94A3B8",
|
||||
Divider = "rgba(255, 255, 255, 0.08)",
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,81 +1,39 @@
|
||||
.page {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* Custom scrollbar for the modern drawer */
|
||||
::deep .modern-drawer .mud-drawer-content::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
::deep .modern-drawer .mud-drawer-content::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
::deep .modern-drawer .mud-drawer-content::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
::deep .modern-drawer .mud-drawer-content::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
main {
|
||||
flex: 1;
|
||||
::deep .modern-drawer {
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
|
||||
box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1) !important;
|
||||
transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
|
||||
/* Glassmorphism for the appbar */
|
||||
::deep .mud-appbar {
|
||||
background: rgba(15, 23, 42, 0.85) !important;
|
||||
backdrop-filter: blur(12px) !important;
|
||||
-webkit-backdrop-filter: blur(12px) !important;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
background-color: #f7f7f7;
|
||||
border-bottom: 1px solid #d6d5d5;
|
||||
justify-content: flex-end;
|
||||
height: 3.5rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
white-space: nowrap;
|
||||
margin-left: 1.5rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.top-row ::deep a:first-child {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
@media (max-width: 640.98px) {
|
||||
.top-row {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.top-row ::deep a, .top-row ::deep .btn-link {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.page {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
width: 250px;
|
||||
height: 100vh;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.top-row.auth ::deep a:first-child {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.top-row, article {
|
||||
padding-left: 2rem !important;
|
||||
padding-right: 1.5rem !important;
|
||||
}
|
||||
/* Smooth transition in main layout content */
|
||||
::deep .mud-main-content {
|
||||
transition: padding-left 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
||||
background-color: #F8FAFC;
|
||||
}
|
||||
|
||||
/* Blazor Error UI */
|
||||
#blazor-error-ui {
|
||||
color-scheme: light only;
|
||||
background: lightyellow;
|
||||
@@ -90,9 +48,9 @@ main {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
#blazor-error-ui .dismiss {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 0.5rem;
|
||||
}
|
||||
|
||||
@@ -1,41 +1,97 @@
|
||||
<div style="display:flex; flex-direction:column; height:100%;">
|
||||
<MudNavMenu Style="flex:1">
|
||||
<MudDivider Class="mb-2" />
|
||||
<MudNavLink Href="" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.CalendarMonth">Wochenübersicht</MudNavLink>
|
||||
<MudNavLink Href="month" Icon="@Icons.Material.Filled.CalendarViewMonth">Monatsübersicht</MudNavLink>
|
||||
<MudNavLink Href="stats" Icon="@Icons.Material.Filled.BarChart">Statistiken</MudNavLink>
|
||||
<MudNavLink Href="feiertage" Icon="@Icons.Material.Filled.Celebration">Feiertage</MudNavLink>
|
||||
<MudNavLink Href="urlaub-maximizer" Icon="@Icons.Material.Filled.AutoAwesome">Urlaubs-Maximizer</MudNavLink>
|
||||
<MudNavLink Href="settings" Icon="@Icons.Material.Filled.Settings">Einstellungen</MudNavLink>
|
||||
<MudDivider Class="mt-2 mb-2" />
|
||||
<AuthorizeView Policy="AdminOnly">
|
||||
<MudNavLink Href="admin/users" Icon="@Icons.Material.Filled.AdminPanelSettings" IconColor="Color.Error">
|
||||
Benutzerverwaltung
|
||||
</MudNavLink>
|
||||
</AuthorizeView>
|
||||
</MudNavMenu>
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<MudDivider />
|
||||
@* Username Display - Styled to match NavLink layout exactly *@
|
||||
<div class="mud-nav-link px-4 py-3" style="display: flex; align-items: center; color: var(--mud-palette-text-secondary); cursor: default; user-select: none;">
|
||||
<MudIcon Icon="@Icons.Material.Filled.AccountCircle" Class="mr-6" Size="Size.Medium" Style="color: var(--mud-palette-text-secondary);" />
|
||||
<MudText Typo="Typo.body2" Style="font-weight: 600; color: var(--mud-palette-text-primary);">@context.User.Identity?.Name</MudText>
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<div class="nav-container onboarding-nav-menu">
|
||||
@* --- Brand / Logo Section --- *@
|
||||
<div class="nav-header">
|
||||
<div class="logo-wrapper">
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" OnClick="OnToggleDrawer" Class="drawer-toggle-btn mr-1" />
|
||||
<MudIcon Icon="@Icons.Material.Filled.AccessTime" Class="logo-icon" />
|
||||
<span class="brand-text">Timetracker</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<MudNavMenu>
|
||||
@* --- Navigation Links --- *@
|
||||
<div class="nav-content">
|
||||
<MudNavMenu Class="custom-nav-menu">
|
||||
<MudTooltip Text="Wochenübersicht" Placement="Placement.Right">
|
||||
<MudNavLink Href="" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.CalendarMonth" Class="custom-nav-link">Wochenübersicht</MudNavLink>
|
||||
</MudTooltip>
|
||||
<MudTooltip Text="Monatsübersicht" Placement="Placement.Right">
|
||||
<MudNavLink Href="month" Icon="@Icons.Material.Filled.CalendarViewMonth" Class="custom-nav-link">Monatsübersicht</MudNavLink>
|
||||
</MudTooltip>
|
||||
<MudTooltip Text="Statistiken" Placement="Placement.Right">
|
||||
<MudNavLink Href="stats" Icon="@Icons.Material.Filled.BarChart" Class="custom-nav-link">Statistiken</MudNavLink>
|
||||
</MudTooltip>
|
||||
<MudTooltip Text="Feiertage" Placement="Placement.Right">
|
||||
<MudNavLink Href="feiertage" Icon="@Icons.Material.Filled.Celebration" Class="custom-nav-link">Feiertage</MudNavLink>
|
||||
</MudTooltip>
|
||||
<MudTooltip Text="Urlaubs-Maximizer" Placement="Placement.Right">
|
||||
<MudNavLink Href="urlaub-maximizer" Icon="@Icons.Material.Filled.AutoAwesome" Class="custom-nav-link">Urlaubs-Maximizer</MudNavLink>
|
||||
</MudTooltip>
|
||||
<MudTooltip Text="Einstellungen" Placement="Placement.Right">
|
||||
<MudNavLink Href="settings" Icon="@Icons.Material.Filled.Settings" Class="custom-nav-link">Einstellungen</MudNavLink>
|
||||
</MudTooltip>
|
||||
|
||||
<AuthorizeView Policy="AdminOnly">
|
||||
<Authorized>
|
||||
<div class="admin-divider-container">
|
||||
<span class="admin-divider-text">Admin</span>
|
||||
<hr class="admin-divider-line" />
|
||||
</div>
|
||||
<MudTooltip Text="Benutzerverwaltung" Placement="Placement.Right">
|
||||
<MudNavLink Href="admin/users" Icon="@Icons.Material.Filled.AdminPanelSettings" Class="custom-nav-link admin-link">
|
||||
Benutzerverwaltung
|
||||
</MudNavLink>
|
||||
</MudTooltip>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
</MudNavMenu>
|
||||
</div>
|
||||
|
||||
@* --- Footer (User Profile & Action Info) --- *@
|
||||
<div class="nav-footer">
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<MudNavLink Href="/auth/logout" Icon="@Icons.Material.Filled.Logout">Abmelden</MudNavLink>
|
||||
<div class="user-profile-card">
|
||||
<div class="avatar-container">
|
||||
<MudAvatar Class="user-avatar">
|
||||
@GetInitials(context.User.Identity?.Name)
|
||||
</MudAvatar>
|
||||
<span class="status-dot"></span>
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<span class="user-name">@context.User.Identity?.Name</span>
|
||||
<span class="user-status">Online</span>
|
||||
</div>
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<MudTooltip Text="Changelog anzeigen" Placement="Placement.Top">
|
||||
<MudNavLink Href="/changelog" Icon="@Icons.Material.Filled.NewReleases"
|
||||
Style="color: var(--mud-palette-text-disabled); font-size:0.75rem;">
|
||||
Version 1.4
|
||||
</MudNavLink>
|
||||
</MudTooltip>
|
||||
</MudNavMenu>
|
||||
</div>
|
||||
|
||||
<MudNavMenu Class="footer-nav-menu">
|
||||
<AuthorizeView>
|
||||
<Authorized>
|
||||
<MudTooltip Text="Abmelden" Placement="Placement.Right">
|
||||
<MudNavLink Href="/auth/logout" Icon="@Icons.Material.Filled.Logout" Class="custom-nav-link logout-link">Abmelden</MudNavLink>
|
||||
</MudTooltip>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
<MudTooltip Text="Changelog anzeigen" Placement="Placement.Right">
|
||||
<MudNavLink Href="/changelog" Icon="@Icons.Material.Filled.NewReleases" Class="custom-nav-link version-link">
|
||||
<span class="version-text">Version 1.4</span>
|
||||
</MudNavLink>
|
||||
</MudTooltip>
|
||||
</MudNavMenu>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter] public EventCallback OnToggleDrawer { get; set; }
|
||||
|
||||
private string GetInitials(string? name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
return "U";
|
||||
var parts = name.Split(' ', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (parts.Length == 1)
|
||||
return parts[0][..Math.Min(2, parts[0].Length)].ToUpper();
|
||||
return $"{parts[0][0]}{parts[1][0]}".ToUpper();
|
||||
}
|
||||
}
|
||||
@@ -1,105 +1,314 @@
|
||||
.navbar-toggler {
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
width: 3.5rem;
|
||||
height: 2.5rem;
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: 0.5rem;
|
||||
right: 1rem;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
|
||||
/* Base container covering full height */
|
||||
.nav-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
color: #94A3B8; /* Slate 400 */
|
||||
}
|
||||
|
||||
.navbar-toggler:checked {
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
/* Ensure tooltips wrapper spans full width of menu */
|
||||
::deep .mud-tooltip-root {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.top-row {
|
||||
min-height: 3.5rem;
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
/* Header with logo and title */
|
||||
.nav-header {
|
||||
height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 20px;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
margin-bottom: 8px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
.logo-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
transition: all 0.25s ease;
|
||||
}
|
||||
|
||||
::deep .drawer-toggle-btn {
|
||||
color: #94A3B8 !important;
|
||||
padding: 8px !important;
|
||||
margin-left: -8px !important;
|
||||
transition: all 0.2s ease !important;
|
||||
}
|
||||
|
||||
::deep .drawer-toggle-btn:hover {
|
||||
color: #FFFFFF !important;
|
||||
background-color: rgba(255, 255, 255, 0.05) !important;
|
||||
}
|
||||
|
||||
::deep .logo-icon {
|
||||
color: #0EA5E9 !important; /* Sky 500 */
|
||||
font-size: 1.6rem !important;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.brand-text {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 800;
|
||||
color: #FFFFFF;
|
||||
letter-spacing: 0.5px;
|
||||
white-space: nowrap;
|
||||
opacity: 1;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.bi {
|
||||
display: inline-block;
|
||||
/* Navigation scrollable content */
|
||||
.nav-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
/* Divider inside navigation list */
|
||||
.admin-divider-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 16px 20px 8px 20px;
|
||||
box-sizing: border-box;
|
||||
transition: padding 0.25s ease;
|
||||
}
|
||||
|
||||
.admin-divider-text {
|
||||
font-size: 0.65rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1.5px;
|
||||
color: #475569; /* Slate 600 */
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.admin-divider-line {
|
||||
flex: 1;
|
||||
border: none;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.06);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Standard NavLink customization */
|
||||
::deep .custom-nav-link {
|
||||
margin: 4px 12px !important;
|
||||
border-radius: 12px !important;
|
||||
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Normal (inactive) text and icon colors */
|
||||
::deep .custom-nav-link,
|
||||
::deep .custom-nav-link .mud-nav-link-text,
|
||||
::deep .custom-nav-link .mud-nav-link-icon-default {
|
||||
color: #94A3B8 !important; /* Slate 400 */
|
||||
}
|
||||
|
||||
/* NavLink hover */
|
||||
::deep .custom-nav-link:hover {
|
||||
background-color: rgba(255, 255, 255, 0.05) !important;
|
||||
}
|
||||
|
||||
::deep .custom-nav-link:hover,
|
||||
::deep .custom-nav-link:hover .mud-nav-link-text,
|
||||
::deep .custom-nav-link:hover .mud-nav-link-icon-default {
|
||||
color: #F8FAFC !important; /* Slate 50 */
|
||||
}
|
||||
|
||||
/* 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 & 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);
|
||||
padding: 12px 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: rgba(15, 23, 42, 0.2);
|
||||
}
|
||||
|
||||
/* User profile card */
|
||||
.user-profile-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 8px 20px;
|
||||
margin-bottom: 8px;
|
||||
box-sizing: border-box;
|
||||
transition: all 0.25s ease;
|
||||
}
|
||||
|
||||
.avatar-container {
|
||||
position: relative;
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
margin-right: 0.75rem;
|
||||
top: -1px;
|
||||
background-size: cover;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.bi-house-door-fill-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
|
||||
::deep .user-avatar {
|
||||
width: 36px !important;
|
||||
height: 36px !important;
|
||||
background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%) !important;
|
||||
color: #FFFFFF !important;
|
||||
font-weight: 700 !important;
|
||||
font-size: 0.875rem !important;
|
||||
border: 2px solid rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
.bi-plus-square-fill-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
|
||||
.status-dot {
|
||||
position: absolute;
|
||||
bottom: -1px;
|
||||
right: -1px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #10B981; /* Emerald 500 */
|
||||
border: 2px solid #0F172A;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.bi-list-nested-nav-menu {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
|
||||
.user-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
font-size: 0.9rem;
|
||||
padding-bottom: 0.5rem;
|
||||
.user-name {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.nav-item:first-of-type {
|
||||
padding-top: 1rem;
|
||||
}
|
||||
|
||||
.nav-item:last-of-type {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.nav-item ::deep .nav-link {
|
||||
color: #d7d7d7;
|
||||
background: none;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
height: 3rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 3rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-item ::deep a.active {
|
||||
background-color: rgba(255,255,255,0.37);
|
||||
color: white;
|
||||
.user-status {
|
||||
font-size: 0.7rem;
|
||||
color: #10B981;
|
||||
}
|
||||
|
||||
.nav-item ::deep .nav-link:hover {
|
||||
background-color: rgba(255,255,255,0.1);
|
||||
color: white;
|
||||
/* Special links in footer */
|
||||
::deep .logout-link .mud-nav-link-icon-default {
|
||||
color: rgba(148, 163, 184, 0.6) !important;
|
||||
}
|
||||
::deep .logout-link:hover .mud-nav-link-icon-default {
|
||||
color: #EF4444 !important;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
display: none;
|
||||
::deep .version-link {
|
||||
opacity: 0.7;
|
||||
}
|
||||
::deep .version-link .mud-nav-link-text {
|
||||
font-size: 0.75rem !important;
|
||||
}
|
||||
|
||||
.navbar-toggler:checked ~ .nav-scrollable {
|
||||
display: block;
|
||||
/* --- COLLAPSED DRAWER (MINI STATE) STYLES --- */
|
||||
|
||||
/* Parent matches the mini drawer element (Note the correct Blazor CSS isolation placement) */
|
||||
.mud-drawer--closed ::deep .logo-icon,
|
||||
.mud-drawer--closed ::deep .brand-text {
|
||||
display: none !important;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@media (min-width: 641px) {
|
||||
.navbar-toggler {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-scrollable {
|
||||
/* Never collapse the sidebar for wide screens */
|
||||
display: block;
|
||||
|
||||
/* Allow sidebar to scroll for tall menus */
|
||||
height: calc(100vh - 3.5rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.mud-drawer--closed ::deep .logo-wrapper {
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.mud-drawer--closed ::deep .drawer-toggle-btn {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.mud-drawer--closed ::deep .admin-divider-container {
|
||||
padding: 16px 0 8px 0 !important;
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.mud-drawer--closed ::deep .admin-divider-text {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.mud-drawer--closed ::deep .admin-divider-line {
|
||||
width: 24px !important;
|
||||
flex: none !important;
|
||||
}
|
||||
|
||||
.mud-drawer--closed ::deep .user-profile-card {
|
||||
justify-content: center !important;
|
||||
padding: 8px 0 !important;
|
||||
}
|
||||
|
||||
.mud-drawer--closed ::deep .user-info {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.mud-drawer--closed ::deep .version-text {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Ensure link text is hidden in mini mode to prevent clunky clipping */
|
||||
.mud-drawer--closed ::deep .custom-nav-link .mud-nav-link-text {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Center link icons when mini and adjust spacing */
|
||||
.mud-drawer--closed ::deep .custom-nav-link {
|
||||
margin: 4px 6px !important;
|
||||
padding: 8px 0 !important;
|
||||
justify-content: center !important;
|
||||
min-height: 40px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
.mud-drawer--closed ::deep .custom-nav-link .mud-nav-link-icon-default {
|
||||
margin-right: 0 !important;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
@page "/agb"
|
||||
@rendermode InteractiveWebAssembly
|
||||
@attribute [AllowAnonymous]
|
||||
|
||||
<PageTitle>AGB – Timetracker</PageTitle>
|
||||
|
||||
<MudContainer MaxWidth="MaxWidth.Medium" Class="mt-8 pb-8">
|
||||
<MudStack Spacing="4">
|
||||
|
||||
@* ── Header ── *@
|
||||
<MudPaper Elevation="4" Class="pa-5 rounded-xl" Style="background: #1E293B; color: white;">
|
||||
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="3">
|
||||
<MudIcon Icon="@Icons.Material.Filled.Gavel" Style="color: white; font-size: 2.2rem;" />
|
||||
<MudStack Spacing="0">
|
||||
<MudText Typo="Typo.h5" Style="color: white; font-weight: 700;">Allgemeine Geschäftsbedingungen (AGB)</MudText>
|
||||
<MudText Typo="Typo.caption" Style="color: rgba(255,255,255,0.72);">
|
||||
Rechtlich absolut unverbindliches Kauderwelsch und Flachwitze
|
||||
</MudText>
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
</MudPaper>
|
||||
|
||||
@* ── Paragraphs with Flachwitze ── *@
|
||||
<MudCard Elevation="2" Class="rounded-xl">
|
||||
<MudCardContent>
|
||||
<MudText Typo="Typo.h6" Style="font-weight: 700; color: var(--mud-palette-primary);" Class="mb-2">
|
||||
§ 1 Geltungsbereich & Transparenz
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mb-3">
|
||||
Diese Bedingungen gelten für die gesamte Nutzung dieses Zeiterfassungs-Tools. Transparenz ist uns extrem wichtig.
|
||||
</MudText>
|
||||
<MudAlert Severity="Severity.Info" Dense="true" Class="rounded-lg">
|
||||
<b>Warum können Geister eigentlich so schlecht lügen?</b><br />
|
||||
Weil sie einfach extrem leicht zu durchschauen sind!
|
||||
</MudAlert>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
|
||||
<MudCard Elevation="2" Class="rounded-xl">
|
||||
<MudCardContent>
|
||||
<MudText Typo="Typo.h6" Style="font-weight: 700; color: var(--mud-palette-primary);" Class="mb-2">
|
||||
§ 2 Pflichten des Nutzers & Gärtnerklauseln
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mb-3">
|
||||
Jeder Nutzer verpflichtet sich, seine Arbeitszeiten wahrheitsgemäß und pünktlich einzutragen. Bei Zuwiderhandlung behalten wir uns vor, den Garten des Nutzers aufzuräumen.
|
||||
</MudText>
|
||||
<MudAlert Severity="Severity.Normal" Dense="true" Class="rounded-lg" Style="border-left: 4px solid #EF6C00; background: rgba(239, 108, 0, 0.05);">
|
||||
<b>Was sagt ein Gärtner, wenn er seinen Arbeitsplatz vorzeitig verlässt?</b><br />
|
||||
"Ich mach mich dann mal vom Acker!"
|
||||
</MudAlert>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
|
||||
<MudCard Elevation="2" Class="rounded-xl">
|
||||
<MudCardContent>
|
||||
<MudText Typo="Typo.h6" Style="font-weight: 700; color: var(--mud-palette-primary);" Class="mb-2">
|
||||
§ 3 Haftungsausschluss & Straßenverkehr
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mb-3">
|
||||
Wir übernehmen keinerlei Haftung für vergessene Pausenzeiten, verpasste Feierabende oder schlechtes Wetter.
|
||||
</MudText>
|
||||
<MudAlert Severity="Severity.Warning" Dense="true" Class="rounded-lg">
|
||||
<b>Was ist rot, rund und steht am Straßenrand?</b><br />
|
||||
Eine Spargelampel!<br /><br />
|
||||
<b>Und warum dürfen Bienen eigentlich nicht in die Kirche?</b><br />
|
||||
Weil sie in der Sekte sind!
|
||||
</MudAlert>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
|
||||
<MudCard Elevation="2" Class="rounded-xl">
|
||||
<MudCardContent>
|
||||
<MudText Typo="Typo.h6" Style="font-weight: 700; color: var(--mud-palette-primary);" Class="mb-2">
|
||||
§ 4 Datensicherheit & Physikalische Grundgesetze
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mb-3">
|
||||
Ihre Daten werden nach modernsten Verschlüsselungsstandards (nicht) an Dritte weitergegeben. Unsere Magnetbänder sind streng gesichert.
|
||||
</MudText>
|
||||
<MudAlert Severity="Severity.Normal" Dense="true" Class="rounded-lg" Style="border-left: 4px solid #00897B; background: rgba(0, 137, 123, 0.05);">
|
||||
<b>Treffen sich zwei Magnete im Rechenzentrum. Sagt der eine ganz verzweifelt:</b><br />
|
||||
"Du, sag mal... Was soll ich heute bloß anziehen?"
|
||||
</MudAlert>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
|
||||
<MudCard Elevation="2" Class="rounded-xl">
|
||||
<MudCardContent>
|
||||
<MudText Typo="Typo.h6" Style="font-weight: 700; color: var(--mud-palette-primary);" Class="mb-2">
|
||||
§ 5 Rückgaberecht & Büroalltag
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mb-3">
|
||||
Erfasste Arbeitszeiten können nicht zurückgenommen, umgetauscht oder bar ausgezahlt werden.
|
||||
</MudText>
|
||||
<MudAlert Severity="Severity.Normal" Dense="true" Class="rounded-lg" Style="border-left: 4px solid #5E35B1; background: rgba(94, 53, 177, 0.05);">
|
||||
<b>Was macht ein gelangweilter Clown im Büro?</b><br />
|
||||
Er macht Faxen!<br /><br />
|
||||
<b>Und warum steht ein einsamer Pilz mitten im tiefen Wald?</b><br />
|
||||
Weil die Tannen zapfen!
|
||||
</MudAlert>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
|
||||
<MudCard Elevation="2" Class="rounded-xl">
|
||||
<MudCardContent>
|
||||
<MudText Typo="Typo.h6" Style="font-weight: 700; color: var(--mud-palette-primary);" Class="mb-2">
|
||||
§ 6 Schlussbestimmungen & Salatgesetze
|
||||
</MudText>
|
||||
<MudText Typo="Typo.body2" Class="mb-3">
|
||||
Sollten einzelne Bestimmungen dieser AGB unwirksam sein, bleibt die Fröhlichkeit aller anderen Bestimmungen unberührt.
|
||||
</MudText>
|
||||
<MudAlert Severity="Severity.Success" Dense="true" Class="rounded-lg">
|
||||
<b>Wie nennt man ein plötzlich spurlos verschwundenes Stück Rindfleisch?</b><br />
|
||||
Gulasch!<br /><br />
|
||||
<b>Was ist grün, gesund und klopft nachts an die Haustür?</b><br />
|
||||
Ein Klopfsalat!<br /><br />
|
||||
<b>Und zu guter Letzt: Warum fliegen Vögel im Winter eigentlich nach Süden?</b><br />
|
||||
Weil es zu Fuß einfach viel zu weit wäre!
|
||||
</MudAlert>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
|
||||
@* ── Back Button ── *@
|
||||
<MudStack Row="true" Justify="Justify.Center" Class="mt-4">
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" StartIcon="@Icons.Material.Filled.ArrowBack" OnClick="GoBack" Style="border-radius: 20px;">
|
||||
Zurück zur Anmeldung
|
||||
</MudButton>
|
||||
</MudStack>
|
||||
|
||||
</MudStack>
|
||||
</MudContainer>
|
||||
|
||||
@code {
|
||||
[Inject] private NavigationManager Nav { get; set; } = default!;
|
||||
|
||||
private void GoBack()
|
||||
{
|
||||
Nav.NavigateTo("/login");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
@page "/changelog"
|
||||
@rendermode InteractiveWebAssembly
|
||||
@attribute [Authorize]
|
||||
@attribute [AllowAnonymous]
|
||||
|
||||
<PageTitle>Changelog – Timetracker</PageTitle>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -107,6 +108,11 @@
|
||||
Required="true"
|
||||
HelperText="Mindestens 6 Zeichen" />
|
||||
<input type="text" style="display: none;" tabindex="-1" autocomplete="off" @bind="_honeypot" />
|
||||
|
||||
<MudCheckBox @bind-Value="_acceptAgb" Color="Color.Secondary" Class="mt-1">
|
||||
<MudText Typo="Typo.body2">Ich akzeptiere die <a href="/agb" target="_blank" style="color: var(--mud-palette-secondary); text-decoration: underline; font-weight: 600;">AGB</a>.</MudText>
|
||||
</MudCheckBox>
|
||||
|
||||
<MudButton ButtonType="ButtonType.Submit"
|
||||
Variant="Variant.Filled"
|
||||
Color="Color.Secondary"
|
||||
@@ -114,7 +120,7 @@
|
||||
Size="Size.Large"
|
||||
StartIcon="@Icons.Material.Filled.PersonAdd"
|
||||
Class="mt-2"
|
||||
Disabled="_loading">
|
||||
Disabled="_loading || !_acceptAgb">
|
||||
@if (_loading)
|
||||
{
|
||||
<MudProgressCircular Size="Size.Small" Indeterminate="true" Class="mr-2" />
|
||||
@@ -134,6 +140,7 @@
|
||||
private string? _error;
|
||||
private bool _loading;
|
||||
private string _honeypot = "";
|
||||
private bool _acceptAgb;
|
||||
|
||||
private readonly AuthModel _loginModel = new();
|
||||
private readonly AuthModel _registerModel = new();
|
||||
@@ -189,6 +196,11 @@
|
||||
|
||||
private async Task HandleRegister()
|
||||
{
|
||||
if (!_acceptAgb)
|
||||
{
|
||||
_error = "Du musst die AGB akzeptieren.";
|
||||
return;
|
||||
}
|
||||
_loading = true;
|
||||
_error = null;
|
||||
try
|
||||
@@ -196,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