website/src/lib/Nav.svelte

145 lines
2.6 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-08-04 21:20:02 +05:30
import IconMatrix from "~icons/simple-icons/matrix";
import IconGitHub from "~icons/simple-icons/github";
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-05 19:31:15 +05:30
<a href="https://instances.projectsegfau.lt/">Instances</a>
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>
2022-08-04 21:20:02 +05:30
<a href="/team">Our team</a>
2022-08-05 18:16:54 +05:30
<a href="/timeline">Timeline</a>
2022-07-03 01:23:41 +05:30
<a href="https://blog.projectsegfau.lt/">Blog</a>
<a href="/legal">Legal</a>
2022-08-04 21:20:02 +05:30
<a href="https://status.projectsegfau.lt/">Status</a>
<a href="https://matrix.to/#/#project-segfault:projectsegfau.lt/">
<IconMatrix />
</a>
<a href="https://github.com/ProjectSegfault/">
<IconGitHub />
</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-05 19:31:15 +05:30
padding: 0.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;
2022-08-05 19:31:15 +05:30
transition: opacity 0.25s;
2022-08-04 20:00:24 +05:30
}
a.brand:hover {
2022-08-05 19:31:15 +05:30
opacity: 0.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-05 19:31:15 +05:30
padding: 0.5rem;
cursor: pointer;
color: var(--text);
text-decoration: none;
2022-08-05 19:31:15 +05:30
transition: color 0.25s;
2022-08-04 20:00:24 +05:30
font-size: 13px;
font-weight: 500;
2022-08-04 21:20:02 +05:30
display: flex;
align-items: center;
}
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-08-05 19:54:38 +05:30
@media screen and (max-width: 945px) {
2022-07-27 22:15:53 +05:30
.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-05 19:31:15 +05:30
top: 0.5rem;
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>