website/src/lib/Nav.svelte

134 lines
2.2 KiB
Svelte
Raw Normal View History

2022-07-27 22:15:53 +05:30
<script>
2022-07-27 22:20:48 +05:30
import IconBars from "~icons/fa6-solid/bars";
2022-07-27 22:15:53 +05:30
</script>
<nav>
<a class="brand" href="/">
2022-07-03 01:23:41 +05:30
<img src="/logo.png" alt="Project Segfault logo" />
2022-08-04 20:00:24 +05:30
<span>Project Segfault</span>
</a>
2022-07-27 22:20:48 +05:30
<input type="checkbox" id="toggle-menu" />
2022-07-27 22:15:53 +05:30
<label class="menu-icon" for="toggle-menu">
2022-07-28 18:52:11 +05:30
<div id="menu-icon">
2022-07-27 22:15:53 +05:30
<IconBars />
2022-07-28 18:52:11 +05:30
</div>
2022-07-27 22:15:53 +05:30
</label>
2022-07-27 22:20:48 +05:30
<div class="links">
2022-08-04 20:00:24 +05:30
<a href="https://instances.projectsegfau.lt/">Hosted services</a
2022-07-06 18:40:25 +05:30
>
2022-07-03 01:23:41 +05:30
<a href="/minecraft">Minecraft</a>
<a href="/donate">Donate</a>
<a href="/faq">FAQ</a>
2022-08-04 20:00:24 +05:30
<a href="/contact">Contact us</a>
<a href="/members">Our team</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:20:48 +05:30
</div>
</nav>
<style>
nav {
2022-08-04 20:00:24 +05:30
background-color: var(--primary);
border-bottom: 1px solid var(--grey);
display: flex;
2022-08-04 20:00:24 +05:30
padding: .5rem;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
a.brand {
display: flex;
align-items: center;
text-decoration: none;
2022-08-04 20:00:24 +05:30
color: var(--text);
gap: 8px;
transition: opacity .25s;
}
a.brand:hover {
opacity: .6;
}
2022-07-27 22:20:48 +05:30
2022-07-27 22:15:53 +05:30
.links {
display: flex;
2022-07-27 22:20:48 +05:30
gap: 0.5rem;
2022-07-27 22:15:53 +05:30
}
.links > * {
2022-08-04 20:00:24 +05:30
padding: .5rem;
cursor: pointer;
color: var(--text);
text-decoration: none;
2022-08-04 20:00:24 +05:30
transition: color .25s;
font-size: 13px;
font-weight: 500;
}
2022-06-18 11:15:20 +05:30
.links > *:hover {
text-decoration: none;
2022-08-04 20:00:24 +05:30
color: var(--accent-primary);
}
img {
2022-08-04 20:00:24 +05:30
height: 30px;
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%;
2022-08-04 20:00:24 +05:30
padding-top: 12px;
2022-07-27 22:15:53 +05:30
}
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 {
2022-08-04 20:00:24 +05:30
display: flex;
align-items: center;
justify-content: center;
2022-07-27 22:15:53 +05:30
z-index: 1;
position: absolute;
right: 1rem;
2022-08-04 20:00:24 +05:30
top: .35rem;
2022-07-27 22:15:53 +05:30
border: none;
border-radius: 10px;
2022-08-04 20:00:24 +05:30
height: 30px;
width: 30px;
2022-07-27 22:15:53 +05:30
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:20:48 +05:30
</style>