firq-dev-website/src/components/navbar.astro

127 lines
2.4 KiB
Text
Raw Normal View History

2023-03-04 13:48:57 +01:00
---
---
<header>
<a href="/" rel="noopener noreferrer" aria-label="Home">
<img src="/logo.svg" alt="">
2023-03-04 13:48:57 +01:00
</a>
2023-03-04 20:11:51 +01:00
<ul class="desktop">
2023-03-04 19:11:52 +01:00
<slot />
2023-03-04 13:48:57 +01:00
</ul>
<button class="mobile" aria-label="Navigation Button">
2023-03-04 20:11:51 +01:00
<ul>
<slot />
</ul>
<div class="placeholder"></div>
<i class="iconoir-menu"></i>
</button>
2023-03-04 13:48:57 +01:00
</header>
<style>
header {
2023-03-05 21:58:01 +01:00
background-color: var(--c-darkgray);
2023-03-04 13:48:57 +01:00
display: flex;
2023-03-04 20:11:51 +01:00
height: auto;
2023-03-04 13:48:57 +01:00
width: 100%;
align-items: flex-start;
2023-03-04 13:48:57 +01:00
line-height: 1.5em;
}
header > a {
padding-left: 16px;
padding-top: 8px;
2023-03-04 13:48:57 +01:00
display: block;
height: 48px;
width: 48px;
}
a > img {
height: 100%;
width: 100%;
object-fit: contain;
}
2023-03-04 20:11:51 +01:00
.desktop {
2023-03-04 13:48:57 +01:00
align-items: center;
justify-content: space-around;
2023-03-04 20:11:51 +01:00
display: none;
2023-03-04 13:48:57 +01:00
flex-wrap: wrap;
flex-direction: row;
height: 64px;
width: 100%;
list-style-type: none;
row-gap: 0.5em;
column-gap: 0.5ch;
margin: 0px;
2023-03-04 13:48:57 +01:00
line-height: 1.5em;
}
2023-03-04 20:11:51 +01:00
.mobile > ul {
2023-03-05 21:58:01 +01:00
background-color: var(--c-darkgray);
2023-03-04 20:11:51 +01:00
align-items: center;
flex-wrap: wrap;
flex-direction: column;
display: flex;
width: 100%;
list-style-type: none;
line-height: 3em;
}
.placeholder {
display: flex;
width: 100%;
}
.mobile {
display:flex;
2023-03-05 21:58:01 +01:00
background-color: var(--c-darkgray);
2023-03-04 20:11:51 +01:00
border: 0px;
width: 100%;
height: 64px;
}
.mobile > i {
color: white;
font-weight: bold;
font-size: 2em;
align-self: flex-start;
2023-03-04 20:11:51 +01:00
padding-right: 1em;
padding-top: 16px;
2023-03-04 20:11:51 +01:00
}
.mobile > ul {
display: none;
padding: 0px;
}
.mobile:focus-within > ul{
display: flex;
}
.mobile:focus-within > .placeholder{
display: none;
}
.mobile:focus-within {
justify-content: top;
height: auto;
}
header:focus-within > a {
display: flex;
justify-self: top;
2023-03-04 20:11:51 +01:00
}
@media (min-width: 1120px) {
.mobile {
display:none;
}
.desktop {
display: flex;
}
header {
height: 64px;
align-items: center;
}
header > a {
padding-top: 0px;
2023-03-04 20:11:51 +01:00
}
}
2023-03-04 13:48:57 +01:00
</style>