boredgame/src/lib/components/header/Header.svelte
2022-07-28 17:07:23 -07:00

120 lines
2.1 KiB
Svelte

<script lang="ts">
import { page } from '$app/stores';
import Themes from '$lib/components/preferences/themes.svelte';
import Profile from '../preferences/profile.svelte';
import logo from './bored-game.png';
// let theme: CarbonTheme = "white";
</script>
<header>
<div class="corner">
<a href="/">
<img src={logo} alt="Bored Game Home" />
</a>
</div>
<nav>
<div><Themes /></div>
<!-- <div><Profile /></div> -->
</nav>
</header>
<style lang="scss">
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 var(--containerPadding);
font-size: 1.6rem;
@media (max-width: 1000px) {
padding-top: 1.25rem;
}
}
.corner {
width: 3em;
height: 3em;
}
.corner a {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.corner img {
width: 2em;
height: 2em;
object-fit: contain;
}
nav {
display: flex;
justify-content: center;
align-items: center;
margin: 1rem;
--background: rgba(255, 255, 255, 0.7);
}
svg {
width: 2em;
height: 3em;
display: block;
}
path {
fill: var(--background);
}
ul {
position: relative;
padding: 0;
margin: 0;
height: 3em;
display: flex;
justify-content: center;
align-items: center;
list-style: none;
background: var(--background);
background-size: contain;
}
li {
position: relative;
height: 100%;
}
li.active::before {
--size: 6px;
content: '';
width: 0;
height: 0;
position: absolute;
top: 0;
left: calc(50% - var(--size));
border: var(--size) solid transparent;
border-top: var(--size) solid var(--accent-color);
}
nav a {
display: flex;
height: 100%;
align-items: center;
padding: 0 1em;
color: var(--heading-color);
font-weight: 700;
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.1em;
text-decoration: none;
transition: color 0.2s linear;
}
a:hover {
color: var(--accent-color);
}
</style>