|
1 | 1 | @inherits LayoutComponentBase |
2 | 2 |
|
| 3 | +@inject NavigationManager NavigationManager |
| 4 | + |
3 | 5 | <MudThemeProvider Theme="@_theme" IsDarkMode="_isDarkMode" /> |
4 | 6 | <MudPopoverProvider /> |
5 | 7 | <MudDialogProvider /> |
|
9 | 11 | <MudAppBar Elevation="1"> |
10 | 12 | @* <MudText Typo="Typo.h6" Class="ml-3">CodingCodeSeb</MudText> *@ |
11 | 13 | <MudSpacer /> |
| 14 | + <MudStack Row Spacing="2"> |
| 15 | + <MudButton Href="/" Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Home" Color="@(NavigationButtonColorFromUri(""))">Home</MudButton> |
| 16 | + <MudButton Href="/books" Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Book" Color="@(NavigationButtonColorFromUri("books"))">Buchempfehlungen</MudButton> |
| 17 | + <MudButton Href="/talks" Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.Mic" Color="@(NavigationButtonColorFromUri("talks"))">Vorträge</MudButton> |
| 18 | + <MudButton Href="/projects" Variant="Variant.Filled" StartIcon="@Icons.Material.Filled.BarChart" Color="@(NavigationButtonColorFromUri("projects"))">Projekte</MudButton> |
| 19 | + </MudStack> |
| 20 | + <MudSpacer /> |
12 | 21 | <MudIconButton Icon="@(DarkLightModeButtonIcon)" Color="Color.Inherit" OnClick="@DarkModeToggle" /> |
13 | 22 | <MudIconButton Icon="@Icons.Custom.Brands.GitHub" Color="Color.Inherit" Href="https://github.com/CodingCodeSeb" Target="_blank" /> |
14 | 23 | </MudAppBar> |
|
20 | 29 | <MudMainContent Class="pt-16 pa-4"> |
21 | 30 | @Body |
22 | 31 | </MudMainContent> |
| 32 | + <MudScrollToTop> |
| 33 | + <MudFab Color="Color.Tertiary" StartIcon="@Icons.Material.Outlined.KeyboardArrowUp" /> |
| 34 | + </MudScrollToTop> |
23 | 35 | </MudLayout> |
24 | 36 |
|
25 | 37 | @code { |
|
30 | 42 | protected override void OnInitialized() |
31 | 43 | { |
32 | 44 | base.OnInitialized(); |
33 | | - |
34 | 45 | _theme = new() |
35 | 46 | { |
36 | 47 | PaletteLight = _lightPalette, |
|
39 | 50 | }; |
40 | 51 | } |
41 | 52 |
|
| 53 | + private Color NavigationButtonColorFromUri(string uri) |
| 54 | + { |
| 55 | + var u = NavigationManager.ToBaseRelativePath(NavigationManager.Uri); |
| 56 | + return uri.Equals(u, StringComparison.InvariantCultureIgnoreCase) ? Color.Primary : Color.Inherit; |
| 57 | + } |
| 58 | + |
42 | 59 | private void DrawerToggle() |
43 | 60 | { |
44 | 61 | _drawerOpen = !_drawerOpen; |
|
51 | 68 |
|
52 | 69 | private readonly PaletteLight _lightPalette = new() |
53 | 70 | { |
54 | | - Black = "#110e2d", |
55 | | - AppbarText = "#424242", |
56 | | - AppbarBackground = "rgba(255,255,255,0.8)", |
57 | | - DrawerBackground = "#ffffff", |
58 | | - GrayLight = "#e8e8e8", |
59 | | - GrayLighter = "#f9f9f9", |
| 71 | + Primary = MudBlazor.Colors.LightBlue.Darken3, |
| 72 | + Secondary = MudBlazor.Colors.Cyan.Darken2, |
| 73 | + Tertiary = MudBlazor.Colors.Pink.Darken1, |
| 74 | + Success = MudBlazor.Colors.Green.Darken2, |
| 75 | + Warning = MudBlazor.Colors.Orange.Darken3, // Etwas dunkler für bessere Lesbarkeit auf weiß |
| 76 | + Error = MudBlazor.Colors.Red.Darken1, |
| 77 | + Info = MudBlazor.Colors.LightBlue.Darken2, |
| 78 | + |
| 79 | + AppbarBackground = MudBlazor.Colors.Gray.Lighten4, |
| 80 | + AppbarText = MudBlazor.Colors.Gray.Darken4, |
| 81 | + |
| 82 | + Background = "#f4f4f7", // Ein Hauch von Blau-Grau, wirkt sauberer als reines Grau |
| 83 | + Surface = MudBlazor.Colors.Gray.Lighten5, |
| 84 | + DrawerBackground = MudBlazor.Colors.Gray.Lighten4, |
| 85 | + DrawerText = MudBlazor.Colors.Gray.Darken3, |
| 86 | + |
| 87 | + TableStriped = "rgba(0,0,0,0.02)", // Subtiler |
| 88 | + LinesDefault = MudBlazor.Colors.Gray.Lighten2, |
| 89 | + TextPrimary = MudBlazor.Colors.Gray.Darken4, |
| 90 | + TextSecondary = MudBlazor.Colors.Gray.Darken2, |
| 91 | + // Black = "#110e2d", |
| 92 | + // AppbarText = "#424242", |
| 93 | + // AppbarBackground = "rgba(255,255,255,0.8)", |
| 94 | + // DrawerBackground = "#ffffff", |
| 95 | + // GrayLight = "#e8e8e8", |
| 96 | + // GrayLighter = "#f9f9f9", |
60 | 97 | }; |
61 | 98 |
|
62 | 99 | private readonly PaletteDark _darkPalette = new() |
63 | 100 | { |
64 | | - Primary = "#7e6fff", |
65 | | - Surface = "#1e1e2d", |
66 | | - Background = "#1a1a27", |
67 | | - BackgroundGray = "#151521", |
68 | | - AppbarText = "#92929f", |
69 | | - AppbarBackground = "rgba(26,26,39,0.8)", |
70 | | - DrawerBackground = "#1a1a27", |
71 | | - ActionDefault = "#74718e", |
72 | | - ActionDisabled = "#9999994d", |
73 | | - ActionDisabledBackground = "#605f6d4d", |
74 | | - TextPrimary = "#b2b0bf", |
75 | | - TextSecondary = "#92929f", |
76 | | - TextDisabled = "#ffffff33", |
77 | | - DrawerIcon = "#92929f", |
78 | | - DrawerText = "#92929f", |
79 | | - GrayLight = "#2a2833", |
80 | | - GrayLighter = "#1e1e2d", |
81 | | - Info = "#4a86ff", |
82 | | - Success = "#3dcb6c", |
83 | | - Warning = "#ffb545", |
84 | | - Error = "#ff3f5f", |
85 | | - LinesDefault = "#33323e", |
86 | | - TableLines = "#33323e", |
87 | | - Divider = "#292838", |
88 | | - OverlayLight = "#1e1e2d80", |
| 101 | + Primary = "#1f7c98", |
| 102 | + Secondary = "#679e2a", |
| 103 | + Tertiary = MudBlazor.Colors.Pink.Lighten2, |
| 104 | + Success = MudBlazor.Colors.Green.Darken1, |
| 105 | + Warning = MudBlazor.Colors.Amber.Lighten1, |
| 106 | + Error = MudBlazor.Colors.Red.Lighten1, |
| 107 | + Info = MudBlazor.Colors.Blue.Lighten1, |
| 108 | + |
| 109 | + // 1. Hintergrund deutlich dunkler (Tiefe) |
| 110 | + Background = "#101b1e", |
| 111 | + Surface = "#0d353f", // Karten heben sich vom Hintergrund ab |
| 112 | + DrawerBackground = "#152429", |
| 113 | + AppbarBackground = "#0a2933", |
| 114 | + AppbarText = "rgba(245,245,245,0.80)", |
| 115 | + |
| 116 | + TableStriped = "rgba(255,255,255,0.05)", |
| 117 | + LinesDefault = "#424257", |
| 118 | + |
| 119 | + TextPrimary = "rgba(255,255,255,0.90)", // "Off-White" ist angenehmer für die Augen als 100% Weiß |
| 120 | + TextSecondary = "rgba(255,255,255,0.80)", |
| 121 | + ActionDefault = "rgba(255,255,255,0.80)", |
| 122 | + ActionDisabled = "rgba(255,255,255,0.35)", |
| 123 | + DrawerText = "rgba(255,255,255,0.90)", |
| 124 | + OverlayDark = "rgba(255,255,255,0.20)", |
| 125 | + // Primary = "#7e6fff", |
| 126 | + // Surface = "#1e1e2d", |
| 127 | + // Background = "#1a1a27", |
| 128 | + // BackgroundGray = "#151521", |
| 129 | + // AppbarText = "#92929f", |
| 130 | + // AppbarBackground = "rgba(26,26,39,0.8)", |
| 131 | + // DrawerBackground = "#1a1a27", |
| 132 | + // ActionDefault = "#74718e", |
| 133 | + // ActionDisabled = "#9999994d", |
| 134 | + // ActionDisabledBackground = "#605f6d4d", |
| 135 | + // TextPrimary = "#b2b0bf", |
| 136 | + // TextSecondary = "#92929f", |
| 137 | + // TextDisabled = "#ffffff33", |
| 138 | + // DrawerIcon = "#92929f", |
| 139 | + // DrawerText = "#92929f", |
| 140 | + // GrayLight = "#2a2833", |
| 141 | + // GrayLighter = "#1e1e2d", |
| 142 | + // Info = "#4a86ff", |
| 143 | + // Success = "#3dcb6c", |
| 144 | + // Warning = "#ffb545", |
| 145 | + // Error = "#ff3f5f", |
| 146 | + // LinesDefault = "#33323e", |
| 147 | + // TableLines = "#33323e", |
| 148 | + // Divider = "#292838", |
| 149 | + // OverlayLight = "#1e1e2d80", |
89 | 150 | }; |
90 | 151 |
|
91 | 152 | public string DarkLightModeButtonIcon => _isDarkMode switch |
92 | 153 | { |
93 | | - true => Icons.Material.Rounded.AutoMode, |
| 154 | + true => Icons.Material.Outlined.LightMode, |
94 | 155 | false => Icons.Material.Outlined.DarkMode, |
95 | 156 | }; |
96 | 157 | } |
0 commit comments