wm-fontis-tibi-2023/frontend/src/lib/components/Menu/Menu.svelte

180 lines
6.8 KiB
Svelte
Raw Normal View History

2023-07-13 18:43:19 +02:00
<script lang="ts">
2023-07-15 18:15:17 +02:00
import { navigate } from "svelte-routing/src/history"
2023-07-16 08:21:49 +02:00
import { navigation, pages, rerender } from "../../store"
2023-07-13 18:43:19 +02:00
import Header from "./Header.svelte"
export let active = false
</script>
<div class="menu" class:active="{active}">
<div class="menu-container">
<Header bind:active="{active}" opened="{true}" />
<div class="menu-content">
2023-07-15 18:15:17 +02:00
{#if $navigation}
<div class="container">
<div class="inner-container">
<div class="pages">
{#each $navigation.pages as page}
<button
2023-07-16 08:21:49 +02:00
class="page underline"
2023-07-15 18:15:17 +02:00
on:click="{() => {
active = false
2023-07-16 08:21:49 +02:00
$rerender = $rerender + 1
2023-07-15 18:15:17 +02:00
navigate(Object.values($pages)?.find((o) => o.id == page.page)?.path || '/')
}}"
>
{page.name}
</button>
{/each}
2023-07-13 22:45:49 +02:00
</div>
2023-07-15 18:15:17 +02:00
<div class="footer-infos">
<div class="upper">
2023-07-16 08:21:49 +02:00
<button class="underline">Datenschutz</button>
<button class="underline">Impressum</button>
2023-07-15 18:15:17 +02:00
</div>
<div class="lower">
2023-07-16 08:21:49 +02:00
<button>0711&nbsp;644&nbsp;700-0</button>
2023-07-16 13:50:53 +02:00
<button>
<a href="mailto:info@fontis.de" class="button"> info@fontis.de </a>
</button>
2023-07-15 18:15:17 +02:00
</div>
2023-07-13 22:45:49 +02:00
</div>
</div>
2023-07-13 18:43:19 +02:00
</div>
2023-07-15 18:15:17 +02:00
{/if}
2023-07-13 18:43:19 +02:00
</div>
</div>
</div>
<style lang="less">
@import "../../assets/css/main.less";
.menu {
2023-07-14 21:32:33 +02:00
position: fixed;
2023-07-13 18:43:19 +02:00
background-color: @bg-color;
z-index: 1000;
top: 110vh;
left: 0px;
right: 0px;
height: 100vh;
&.active {
top: 0px;
}
.menu-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
.menu-content {
background-color: @bg-color-secondary;
color: @font-color-secondary;
width: 100%;
display: flex;
justify-content: center;
flex-grow: 1;
.container {
display: flex;
flex-direction: column;
2023-07-16 08:21:49 +02:00
justify-content: flex-start;
2023-07-13 18:43:19 +02:00
align-items: flex-end;
width: 80%;
margin: 10vw 0px;
2023-07-16 08:21:49 +02:00
@media @tablet {
justify-content: flex-end;
}
2023-07-13 22:45:49 +02:00
.inner-container {
2023-07-13 18:43:19 +02:00
width: 100%;
display: flex;
2023-07-16 08:21:49 +02:00
flex-direction: column;
align-items: center;
height: 100%;
justify-content: space-between;
@media @tablet {
justify-content: initial;
height: initial;
}
2023-07-13 22:45:49 +02:00
2023-07-13 18:43:19 +02:00
.footer-infos {
2023-07-13 22:45:49 +02:00
width: 100%;
display: flex;
2023-07-16 08:21:49 +02:00
flex-wrap: wrap;
@media @tablet {
flex-wrap: initial;
flex-direction: column;
height: 100%;
}
2023-07-13 22:45:49 +02:00
justify-content: space-between;
2023-07-16 08:21:49 +02:00
text-align: start;
2023-07-13 22:45:49 +02:00
.upper {
display: flex;
flex-direction: column;
2023-07-16 08:21:49 +02:00
align-items: flex-start;
2023-07-13 22:45:49 +02:00
gap: 15px;
2023-07-16 08:21:49 +02:00
margin-top: 15px;
@media @tablet {
margin-top: 0px;
align-items: flex-start;
}
@media @desktop {
align-items: flex-end;
}
2023-07-13 22:45:49 +02:00
}
.lower {
2023-07-16 08:21:49 +02:00
margin-top: 15px;
2023-07-13 22:45:49 +02:00
display: flex;
flex-direction: column;
2023-07-16 08:21:49 +02:00
align-items: flex-start;
@media @tablet {
align-items: flex-start;
}
2023-07-13 22:45:49 +02:00
@media @desktop {
flex-direction: row;
justify-content: flex-end;
}
gap: 20px;
}
button {
color: @font-color-secondary;
2023-07-16 13:50:53 +02:00
a {
color: @font-color-secondary;
font-weight: normal;
}
2023-07-13 22:45:49 +02:00
}
@media @desktop {
.lower {
gap: 40px;
}
}
2023-07-13 18:43:19 +02:00
}
.pages {
2023-07-13 22:45:49 +02:00
width: 100%;
display: flex;
2023-07-13 18:43:19 +02:00
align-items: flex-start;
2023-07-13 22:45:49 +02:00
flex-direction: column;
2023-07-16 08:21:49 +02:00
font-family: "Libre Caslon Text", serif;
2023-07-13 22:45:49 +02:00
gap: 20px;
.page {
font-size: 1.6rem;
color: @font-color-secondary;
}
}
@media @tablet {
flex-direction: row;
.footer-infos {
width: 50%;
}
.pages {
align-items: flex-start;
width: 50%;
}
2023-07-13 18:43:19 +02:00
}
}
}
}
}
}
</style>