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

76 lines
1.6 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-13 18:43:19 +02:00
export let active = false
export let opened = false
</script>
2023-07-15 18:15:17 +02:00
<div class="header" class:sticky="{!opened}">
2023-08-17 11:11:09 +02:00
<div
class="logo"
on:keydown
on:click="{() => {
2023-08-17 11:13:08 +02:00
active = false
2023-08-17 11:11:09 +02:00
navigate('/')
}}"
>
2023-07-13 18:43:19 +02:00
<img src="/media/Logo Quer.svg" alt="Logo Quer" />
</div>
<button class="menu" on:click="{() => (active = !active)}">
2023-07-19 17:22:20 +02:00
<div class="text">MENÜ</div>
2023-07-13 18:43:19 +02:00
{#if opened}
<img src="/media/ei close.svg" alt="Logo" />
{:else}
<img src="/media/BurgerMenu.svg" alt="Menu" />
{/if}
</button>
</div>
<style lang="less">
@import "../../assets/css/main.less";
2023-07-15 18:15:17 +02:00
.sticky {
position: sticky;
2023-07-14 21:32:33 +02:00
top: 0px;
z-index: 100;
}
2023-07-13 18:43:19 +02:00
.header {
2023-07-14 21:32:33 +02:00
background-color: @bg-color;
2023-07-13 18:43:19 +02:00
width: 100%;
2023-08-15 14:48:43 +02:00
padding: 25.4px calc(2.5vw + 10px);
2023-07-13 18:43:19 +02:00
display: flex;
align-items: center;
justify-content: space-between;
2023-08-15 14:48:43 +02:00
gap: 35px;
2023-07-13 18:43:19 +02:00
.logo {
2023-07-15 18:15:17 +02:00
cursor: pointer;
2023-07-13 18:43:19 +02:00
flex-grow: 0;
flex-shrink: 1;
img {
width: 100%;
}
}
.menu {
flex-grow: 0;
flex-shrink: 0;
display: flex;
align-items: center;
gap: 4px;
font-weight: bold;
2023-07-19 17:22:20 +02:00
.text {
display: none;
}
2023-07-13 18:43:19 +02:00
@media @tablet {
gap: 10px;
2023-07-19 17:22:20 +02:00
.text {
display: block;
}
2023-07-13 18:43:19 +02:00
}
}
}
</style>