site-libsoc/Server/app/svelte/src/navbar/navbar-component.svelte

61 lines
1.5 KiB
Svelte
Raw Normal View History

2023-06-15 01:41:54 +07:00
<svelte:options tag="navbar-component" />
<script>
// Import statements
import { onMount } from 'svelte'
// Main code
let hambInput
let navbar
function changeNavbar() {
if (hambInput.checked) {
navbar.style.background = "white"
2023-06-24 20:44:16 +07:00
//navbar.style.boxShadow = "0 0 0.314rem rgb(187, 187, 187)"
2023-06-15 01:41:54 +07:00
}
else {
setTimeout(()=> {
navbar.style.position = "relative"
navbar.style.background = ""
navbar.style.boxShadow = ""
}
,510)
}
}
onMount(() => {
})
</script>
<!-- Navigation bar -->
<header bind:this={navbar} id="navbar">
<!-- Logo -->
<a id=logo-container href="/">
2023-06-24 04:39:41 +07:00
<img src="img/common/flag.png" id="navbar-logo" alt="logo">
<span id="navbar-logo-text">Libertarian socialists</span>
2023-06-15 01:41:54 +07:00
</a>
<!-- Hamburger icon -->
<input bind:this={hambInput} type="checkbox" id="side-menu" on:click={changeNavbar}>
<label id="hamb" for="side-menu"><span id="hamb-line"></span></label>
<!-- Menu -->
<nav id="nav">
<ul id="menu">
2023-06-24 04:39:41 +07:00
<li><a href="/manifesto">Manifesto</a></li>
<li><a href="/join-us">Join us</a></li>
<li><a href="/groups">Groups</a></li>
<li><a href="/communities">Communities</a></li>
<li><a href="/cooperatives">Cooperatives</a></li>
2023-06-15 01:41:54 +07:00
</ul>
</nav>
</header>
<style>
@import '/css/common.css';
@import '/css/navbar.css';
</style>