Default layout, Responsive sidebar
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
<Blazorise.ThemeProvider Theme="@theme">
|
<Blazorise.ThemeProvider Theme="@theme">
|
||||||
<Router AppAssembly="@typeof(App).Assembly">
|
<Router AppAssembly="@typeof(App).Assembly">
|
||||||
<Found Context="routeData">
|
<Found Context="routeData">
|
||||||
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
|
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(DefaultLayout)">
|
||||||
</AuthorizeRouteView>
|
</AuthorizeRouteView>
|
||||||
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
|
<FocusOnNavigate RouteData="@routeData" Selector="h1"/>
|
||||||
</Found>
|
</Found>
|
||||||
<NotFound>
|
<NotFound>
|
||||||
<PageTitle>Not found</PageTitle>
|
<PageTitle>Not found</PageTitle>
|
||||||
<LayoutView Layout="@typeof(MainLayout)">
|
<LayoutView Layout="@typeof(DefaultLayout)">
|
||||||
<p role="alert">Sorry, there's nothing at this address.</p>
|
<p role="alert">Sorry, there's nothing at this address.</p>
|
||||||
</LayoutView>
|
</LayoutView>
|
||||||
</NotFound>
|
</NotFound>
|
||||||
|
|||||||
30
FoodsharingSiegen.Server/Shared/DefaultLayout.razor
Normal file
30
FoodsharingSiegen.Server/Shared/DefaultLayout.razor
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
@inherits LayoutComponentBase
|
||||||
|
|
||||||
|
<PageTitle>FoodsharingSiegen.Server</PageTitle>
|
||||||
|
|
||||||
|
<AuthorizeView>
|
||||||
|
<Authorized>
|
||||||
|
<div class="page">
|
||||||
|
<input type="checkbox" id="menu-toggler"/>
|
||||||
|
<label id="menu-toggler-label" for="menu-toggler">
|
||||||
|
|
||||||
|
<span class="menu-toggler-line"></span>
|
||||||
|
<span class="menu-toggler-line"></span>
|
||||||
|
<span class="menu-toggler-line"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<aside>
|
||||||
|
<NavMenu/>
|
||||||
|
</aside>
|
||||||
|
<main>
|
||||||
|
@Body
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</Authorized>
|
||||||
|
<NotAuthorized>
|
||||||
|
<RedirectToLogin/>
|
||||||
|
</NotAuthorized>
|
||||||
|
</AuthorizeView>
|
||||||
|
|
||||||
|
<NotificationAlert/>
|
||||||
|
<MessageAlert/>
|
||||||
102
FoodsharingSiegen.Server/Shared/DefaultLayout.razor.css
Normal file
102
FoodsharingSiegen.Server/Shared/DefaultLayout.razor.css
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
.page {
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page aside {
|
||||||
|
background-color: #f1e7c9;
|
||||||
|
width: 0;
|
||||||
|
box-shadow: 5px 5px 5px #acacac;
|
||||||
|
transition: width 250ms;
|
||||||
|
overflow: hidden auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 992px) {
|
||||||
|
.page aside {
|
||||||
|
width: 250px;
|
||||||
|
min-width: 250px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.page main {
|
||||||
|
flex: 1;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden auto;
|
||||||
|
padding: 60px 10px 10px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 992px) {
|
||||||
|
.page main {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-toggler {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-toggler-label {
|
||||||
|
position: fixed;
|
||||||
|
top: 15px;
|
||||||
|
left: 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 992px) {
|
||||||
|
#menu-toggler-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-toggler-label span {
|
||||||
|
height: 6px;
|
||||||
|
background-color: #64ae24;
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 3px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
transition: all 0.25s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-toggler-label span:nth-child(2) {
|
||||||
|
top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-toggler-label span:nth-child(3) {
|
||||||
|
top: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked ~ aside {
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked ~ #menu-toggler-label span:nth-child(1) {
|
||||||
|
transform: translateY(12px) rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked ~ #menu-toggler-label span:nth-child(2) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked ~ #menu-toggler-label span:nth-child(3) {
|
||||||
|
transform: translateY(-12px) rotate(-45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
::deep h2 {
|
||||||
|
font-size: 7.8vw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 576px) {
|
||||||
|
::deep h2 {
|
||||||
|
font-size: 4.8vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 576px) {
|
||||||
|
::deep h2 {
|
||||||
|
font-size: 3.6vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
96
FoodsharingSiegen.Server/Shared/DefaultLayout.razor.scss
Normal file
96
FoodsharingSiegen.Server/Shared/DefaultLayout.razor.scss
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
@import '../Style/_variables';
|
||||||
|
|
||||||
|
$sidebarBreakpoint: $breakpointM;
|
||||||
|
|
||||||
|
.page {
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
aside {
|
||||||
|
background-color: #f1e7c9;
|
||||||
|
width: 0;
|
||||||
|
box-shadow: 5px 5px 5px #acacac;
|
||||||
|
transition: width 250ms;
|
||||||
|
overflow: hidden auto;
|
||||||
|
|
||||||
|
@media screen and (min-width: #{$sidebarBreakpoint}px) {
|
||||||
|
width: 250px;
|
||||||
|
min-width: 250px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
flex: 1;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden auto;
|
||||||
|
padding: 60px 10px 10px 10px;
|
||||||
|
|
||||||
|
@media screen and (min-width: #{$sidebarBreakpoint}px) {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-toggler {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-toggler-label {
|
||||||
|
|
||||||
|
position: fixed;
|
||||||
|
top: 15px;
|
||||||
|
left: 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
z-index: 1;
|
||||||
|
|
||||||
|
@media screen and (min-width: #{$sidebarBreakpoint}px) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
height: 6px;
|
||||||
|
background-color: #64ae24;
|
||||||
|
position: absolute;
|
||||||
|
border-radius: 3px;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
transition: all 0.25s ease-out;
|
||||||
|
|
||||||
|
&:nth-child(2) {
|
||||||
|
top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-child(3) {
|
||||||
|
top: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked ~ aside {
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input:checked ~ #menu-toggler-label span {
|
||||||
|
&:nth-child(1) {
|
||||||
|
transform: translateY(12px) rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-child(2) {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-child(3) {
|
||||||
|
transform: translateY(-12px) rotate(-45deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
::deep {
|
||||||
|
h2 {
|
||||||
|
font-size: 7.8vw;
|
||||||
|
@media screen and (min-width: #{$breakpointXS}px) { font-size: 4.8vw; }
|
||||||
|
@media screen and (min-width: #{$breakpointXS}px) { font-size: 3.6vw; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,4 @@
|
|||||||
<div class="top-row ps-3 navbar navbar-dark">
|
<nav class="flex-column">
|
||||||
<div class="container-fluid">
|
|
||||||
<a class="navbar-brand" href="">Foodsharing Siegen</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
|
|
||||||
<nav class="flex-column">
|
|
||||||
<div class="nav-item px-3">
|
<div class="nav-item px-3">
|
||||||
<NavLink class="nav-link" href="profile" Match="NavLinkMatch.All">
|
<NavLink class="nav-link" href="profile" Match="NavLinkMatch.All">
|
||||||
<span class="fas fa-user mr-1" aria-hidden="true" style="font-size: 1.4em;"></span> Profil
|
<span class="fas fa-user mr-1" aria-hidden="true" style="font-size: 1.4em;"></span> Profil
|
||||||
@@ -31,17 +24,4 @@
|
|||||||
<span class="fa-solid fa-door-open mr-1" aria-hidden="true" style="font-size: 1.4em;"></span> Ausloggen
|
<span class="fa-solid fa-door-open mr-1" aria-hidden="true" style="font-size: 1.4em;"></span> Ausloggen
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
|
||||||
|
|
||||||
@code {
|
|
||||||
private bool collapseNavMenu = true;
|
|
||||||
|
|
||||||
private string? NavMenuCssClass => collapseNavMenu ? "" : null;
|
|
||||||
|
|
||||||
private void ToggleNavMenu()
|
|
||||||
{
|
|
||||||
collapseNavMenu = !collapseNavMenu;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
.navbar-toggler {
|
nav {
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
padding-top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-row {
|
@media screen and (min-width: 992px) {
|
||||||
height: 60px;
|
nav {
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-brand {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.oi {
|
.oi {
|
||||||
@@ -49,13 +46,3 @@
|
|||||||
background-color: rgba(255, 255, 255, 0.1);
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
color: #64ae24;
|
color: #64ae24;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 641px) {
|
|
||||||
.navbar-toggler {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.collapse {
|
|
||||||
/* Never collapse the sidebar for wide screens */
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
.navbar-toggler {
|
@import '../Style/_variables';
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-row {
|
nav {
|
||||||
height: 60px;
|
padding-top: 50px;
|
||||||
background-color: rgba(0,0,0,0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.navbar-brand {
|
@media screen and (min-width: #{$breakpointM}px) {
|
||||||
font-size: 1.1rem;
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.oi {
|
.oi {
|
||||||
@@ -49,14 +46,3 @@
|
|||||||
background-color: rgba(255,255,255,0.1);
|
background-color: rgba(255,255,255,0.1);
|
||||||
color: #64ae24;
|
color: #64ae24;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 641px) {
|
|
||||||
.navbar-toggler {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.collapse {
|
|
||||||
/* Never collapse the sidebar for wide screens */
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user