website/src/lib/Nav.svelte

146 lines
2.5 KiB
Svelte
Raw Normal View History

2022-07-27 22:15:53 +05:30
<script>
import IconBars from "~icons/fa6-solid/bars";
</script>
<nav>
<a class="brand" href="/">
2022-07-03 01:23:41 +05:30
<img src="/logo.png" alt="Project Segfault logo" />
<span
style="color: var(--accent-secondary); margin-left: 4px; margin-right: 4px;"
2022-07-03 01:23:41 +05:30
>Project</span
>
<span style="color: var(--accent-primary); margin-right: 8px;"
2022-07-03 01:23:41 +05:30
>Segfault</span
>
</a>
2022-07-27 22:15:53 +05:30
<input type="checkbox" id="toggle-menu">
<label class="menu-icon" for="toggle-menu">
<a id="menu-icon">
<IconBars />
</a>
</label>
<div class="links">
2022-07-06 18:40:25 +05:30
<a href="https://instances.projectsegfau.lt/">Instances & Gameservers</a
>
2022-07-03 01:23:41 +05:30
<a href="/minecraft">Minecraft</a>
<a href="/donate">Donate</a>
<a href="/faq">FAQ</a>
<a href="/contact">Contact</a>
2022-07-06 18:40:25 +05:30
<a href="/members">Members</a>
2022-07-03 01:23:41 +05:30
<a href="https://blog.projectsegfau.lt/">Blog</a>
<a href="/legal">Legal</a>
2022-07-27 22:15:53 +05:30
</div>
</nav>
<style>
nav {
background-color: var(--secondary);
padding: 1rem;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
a.brand {
display: flex;
align-items: center;
text-decoration: none;
}
2022-07-27 22:15:53 +05:30
.links {
display: flex;
gap: .5rem;
}
.links > * {
background-color: var(--tertiary);
border: none;
border-radius: 10px;
padding: 1rem;
cursor: pointer;
color: var(--text);
font-family: var(--font-primary);
text-decoration: none;
}
2022-06-18 11:15:20 +05:30
.links > *:hover {
background-color: var(--accent-tertiary);
text-decoration: none;
transition: all 0.5s;
color: var(--secondary);
}
.links > *:active {
background-color: var(--accent-primary);
text-decoration: none;
transition: all 0.5s;
color: var(--secondary);
}
img {
height: 36px;
border-radius: 50%;
}
2022-07-27 22:15:53 +05:30
.menu-icon {
cursor: pointer;
display: none;
}
#toggle-menu {
display: none;
}
2022-07-27 22:15:53 +05:30
@media screen and (max-width: 1150px) {
.links {
display: none;
width: 100%;
background-color: var(--secondary);
padding-top: 2rem;
}
nav {
2022-07-27 22:15:53 +05:30
display: flex;
flex-direction: column;
align-items: flex-start;
}
2022-07-27 22:15:53 +05:30
.links a {
display: block;
}
.menu-icon {
display: block;
z-index: 1;
position: absolute;
top: .45rem;
right: 1rem;
background-color: var(--tertiary);
border: none;
border-radius: 10px;
padding: 1rem;
cursor: pointer;
line-height: 1;
}
#menu-icon {
display: flex;
align-items: center;
color: var(--text);
}
#toggle-menu:checked ~ .links {
display: flex;
flex-direction: column;
2022-07-27 22:15:53 +05:30
gap: 1rem;
}
2022-07-27 22:15:53 +05:30
}
2022-07-27 22:15:53 +05:30
</style>