1 Commits

Author SHA1 Message Date
6d486f49 6b925c8fc9 ... 2026-06-04 14:12:39 -04:00
2 changed files with 56 additions and 81 deletions
+50 -69
View File
@@ -11,46 +11,33 @@
<MudDialogProvider/>
<MudSnackbarProvider/>
<MudHidden Breakpoint="Breakpoint.MdAndUp">
<MudIconButton Icon="@Icons.Material.Filled.Menu"
Color="Color.Inherit"
Class="mobile-menu-fab"
OnClick="@(() => _drawerOpen = true)"/>
</MudHidden>
<MudLayout>
<MudAppBar Elevation="1">
<MudHidden Breakpoint="Breakpoint.SmAndDown" Invert="true">
<MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start"
OnClick="@(e => DrawerToggle())"/>
</MudHidden>
<MudButton Class="ml-3 mr-8"
Href="/"
Target="_self"
Variant="Variant.Text"
Color="Color.Default">
<MudText Typo="Typo.h5"> IGP Fan Reference</MudText>
</MudButton>
<MudHidden Breakpoint="Breakpoint.MdAndUp" Invert="true">
@foreach (var page in WebsiteData.GetPages())
{
<MudButton Href="@(page.Href)"
Variant="Variant.Text"
Color="Color.Default"
Class="mr-4">
<MudIcon Icon="@(page.Icon)" Class="mr-2"/>
@(page.Name)
</MudButton>
}
</MudHidden>
<MudSpacer/>
<SearchButtonComponent Id="desktop-searchButton"/>
</MudAppBar>
<MudHidden Breakpoint="Breakpoint.SmAndDown" Invert="true">
<MudDrawer @bind-Open="_drawerOpen" ClipMode="DrawerClipMode.Always" Elevation="2">
<MudPaper Width="250px" Class="d-inline-flex py-3" Elevation="0">
<MudNavMenu Class="mud-width-full flex-grow-1">
<MudDrawer @bind-Open="_drawerOpen"
Variant="DrawerVariant.Responsive"
ResponsiveBreakpoint="Breakpoint.Md"
ClipMode="DrawerClipMode.Always"
Elevation="2">
<div class="drawerHeader">
<MudText Typo="Typo.h5" Class="drawerTitle">IGP Fan Reference</MudText>
</div>
<MudNavMenu Class="drawerNav">
@foreach (var page in WebsiteData.GetPages())
{
<MudNavLink Href="@(page.Href)" Icon="@(page.Icon)">@(page.Name)</MudNavLink>
}
</MudNavMenu>
</MudPaper>
<MudSpacer/>
<div class="drawerFooter">
<SearchButtonComponent/>
</div>
</MudDrawer>
</MudHidden>
<MudMainContent>
<MudContainer Class="px-8" MaxWidth="MaxWidth.False">
@@ -61,9 +48,38 @@
</MudMainContent>
</MudLayout>
<FooterComponent></FooterComponent>
<FooterComponent/>
<style>
.mobile-menu-fab {
position: fixed;
top: 12px;
left: 12px;
z-index: 999;
background-color: var(--accent);
border-radius: 8px;
padding: 8px;
color: white;
}
.drawerHeader {
padding: 20px 16px 16px;
border-bottom: 1px solid var(--paper-border);
}
.drawerTitle {
font-weight: 700;
color: white;
}
.drawerNav {
padding: 8px 0;
}
.drawerFooter {
padding: 16px;
}
</style>
@code {
@@ -72,15 +88,9 @@
bool _drawerOpen = true;
void DrawerToggle()
{
_drawerOpen = !_drawerOpen;
}
protected override void OnInitialized()
{
base.OnInitialized();
CollectFirstPageLoaded();
}
@@ -108,36 +118,7 @@
new Dictionary<string, string> { { "page", rootUrl } });
}
protected override async Task OnInitializedAsync()
{
await Focus();
}
private async Task Focus()
{
// await jsRuntime.InvokeVoidAsync("SetFocusToElement", pageContents);
}
protected override async void OnAfterRender(bool firstRender)
{
// await jsRuntime.InvokeVoidAsync("SetFocusToElement", pageContents);
}
void IDisposable.Dispose()
{
}
void HasChanged()
{
StateHasChanged();
}
private void HandleKeyDown(KeyboardEventArgs keyboardEventArgs)
{
if ((keyboardEventArgs.CtrlKey || keyboardEventArgs.MetaKey) && keyboardEventArgs.Key.ToLower() == "k")
{
SearchService.Show();
}
}
}
+2 -8
View File
@@ -1,13 +1,7 @@
.layoutContainer {
height: 100vh;
overflow-y: scroll;
overflow-x: hidden;
}
.content {
margin-bottom: 64px;
.content {
display: flex;
min-width: 100%;
min-height: 100%;
flex-direction: column;
padding-top: 16px;
}