Improved main layout, now fully responsive

This commit is contained in:
Mia Rose Winter 2024-01-16 16:08:00 +01:00
parent c63b60a7de
commit 97c4e1294e
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
4 changed files with 102 additions and 87 deletions

View file

@ -1,16 +1,39 @@
@inherits LayoutComponentBase @inherits LayoutComponentBase
<div class="flex flex-col h-screen"> <div class="drawer md:drawer-open drawer-end">
<NavMenu /> <input id="main-drawer" type="checkbox" class="drawer-toggle" />
<div class="drawer-content">
</div>
<div class="drawer-content">
<div class="flex flex-col h-screen overflow-x-auto">
<header class="md:hidden p-4 flex justify-between bg-base-200">
<div class="h-12">
<LogoPartial />
</div>
<label for="main-drawer" class="btn btn-square btn-ghost drawer-button" title="open navigation">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" />
</svg>
</label>
</header>
<main class="flex-1 container mx-auto px-12 py-8"> <main class="flex-1 container mx-auto px-12 py-8">
@Body @Body
</main> </main>
<footer class="footer footer-center p-4 bg-base-300 text-base-content"> <footer class="footer footer-center p-4 bg-base-300 text-base-content">
<span class="block"> <span class="block">
Powered by Powered by
<a class="link link-primary" target="_blank" href="https://github.com/miawinter98/Wave">Wave</a> <a class="link link-primary" target="_blank" href="https://github.com/miawinter98/Wave">Wave</a>
</span> </span>
</footer> </footer>
</div>
</div>
<div class="drawer-side">
<label for="main-drawer" aria-label="close sidebar" class="drawer-overlay"></label>
<div class="bg-base-200 p-4 h-full flex flex-col gap-4">
<NavMenu />
</div>
</div>
</div> </div>

View file

@ -3,24 +3,32 @@
@inject NavigationManager NavigationManager @inject NavigationManager NavigationManager
<header> <header class="h-12 hidden md:block">
<div class="navbar bg-base-200"> <LogoPartial />
<div class="navbar-start"> </header>
<picture class="h-12"> <nav class="flex-1">
<source type="image/jxl" srcset="img/logo.jxl" /> <ul class="menu">
<source type="image/webp" srcset="img/logo.webp" /> <li><NavLink href="" Match="NavLinkMatch.All">Home</NavLink></li>
<source type="image/svg+xml" scrset="img/logo.svg" /> <li><NavLink href="weather">Weather</NavLink></li>
<img class="max-h-full object-contain object-left" src="img/logo.png" alt="Wave" /> <li><NavLink href="auth">Auth Required</NavLink></li>
</picture> <AuthorizeView Policy="ArticleEditPermissions">
</div> <Authorized>
<div class="navbar-center"></div> <li><NavLink href="article/new">New Article</NavLink></li>
<div class="navbar-end"> </Authorized>
<ul class="menu menu-horizontal gap-2"> </AuthorizeView>
</ul>
</nav>
<ul class="menu gap-2">
<AuthorizeView> <AuthorizeView>
<Authorized> <Authorized>
<li> <li class="flex content-center gap-2">
<NavLink ActiveClass="tab-active" href="Account/Manage"> <NavLink href="Account/Manage">
@context.User.Identity?.Name @context.User.Identity?.Name
@if (context.User.FindFirst(ClaimTypes.NameIdentifier)?.Value is { } id) {
<div class="w-8">
<ProfilePictureComponent ProfileId="@id" />
</div>
}
</NavLink> </NavLink>
</li> </li>
<li> <li>
@ -54,29 +62,7 @@
</li> </li>
</NotAuthorized> </NotAuthorized>
</AuthorizeView> </AuthorizeView>
</ul> </ul>
<AuthorizeView>
@if (context.User.FindFirst(ClaimTypes.NameIdentifier)?.Value is { } id) {
<div class="w-8">
<ProfilePictureComponent ProfileId="@id" />
</div>
}
</AuthorizeView>
</div>
</div>
<div class="flex justify-center bg-base-300">
<nav class="tabs tabs-bordered">
<NavLink ActiveClass="tab-active" class="tab" href="" Match="NavLinkMatch.All">Home</NavLink>
<NavLink ActiveClass="tab-active" class="tab" href="weather">Weather</NavLink>
<NavLink ActiveClass="tab-active" class="tab" href="auth">Auth Required</NavLink>
<AuthorizeView Policy="ArticleEditPermissions">
<Authorized>
<NavLink ActiveClass="tab-active" class="tab" href="article/new">New Article</NavLink>
</Authorized>
</AuthorizeView>
</nav>
</div>
</header>
@code { @code {
private string? _currentUrl; private string? _currentUrl;

View file

@ -0,0 +1,6 @@
<picture>
<source type="image/jxl" srcset="img/logo.jxl" />
<source type="image/webp" srcset="img/logo.webp" />
<source type="image/svg+xml" scrset="img/logo.svg" />
<img class="max-h-full object-contain object-left" src="img/logo.png" alt="Wave" />
</picture>

File diff suppressed because one or more lines are too long