2022-07-21 22:03:35 -04:00
|
|
|
<script setup lang="ts">
|
|
|
|
import ColourPicker from "./ColourPicker.vue";
|
2022-08-07 11:37:29 -04:00
|
|
|
import { navItems } from "@/data/navItems";
|
2022-07-21 22:03:35 -04:00
|
|
|
</script>
|
2022-08-07 11:37:29 -04:00
|
|
|
|
2022-07-21 22:03:35 -04:00
|
|
|
<template>
|
|
|
|
<nav class="flex items-center justify-between">
|
|
|
|
<ul>
|
|
|
|
<li class="home-text"><a href="/">Eggworld</a></li>
|
2022-08-07 11:37:29 -04:00
|
|
|
<li v-for="(item, index) in navItems" :key="index">
|
2022-08-07 21:14:19 -04:00
|
|
|
<a :href="item.href" class="flex gap-2">
|
|
|
|
<img :src="`/nav/${item.title.toLowerCase()}.svg`" />
|
|
|
|
{{ item.title }}</a
|
|
|
|
>
|
2022-08-07 11:37:29 -04:00
|
|
|
</li>
|
2022-07-21 22:03:35 -04:00
|
|
|
</ul>
|
2022-07-22 16:08:55 -04:00
|
|
|
<div class="flex items-center">
|
|
|
|
<ColourPicker />
|
2022-07-22 16:15:24 -04:00
|
|
|
<div class="hamburger">
|
2022-08-07 12:40:18 -04:00
|
|
|
<HamburgerMenu />
|
2022-07-22 16:15:24 -04:00
|
|
|
</div>
|
2022-07-22 16:08:55 -04:00
|
|
|
</div>
|
2022-07-21 22:03:35 -04:00
|
|
|
</nav>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
nav {
|
2022-08-07 20:25:25 -04:00
|
|
|
--nav-drop-color: lightgray;
|
2022-07-22 17:16:27 -04:00
|
|
|
height: 4rem;
|
2022-07-21 22:03:35 -04:00
|
|
|
width: 100%;
|
2022-08-07 20:25:25 -04:00
|
|
|
box-shadow: 0 0.25rem 0.5rem 0 var(--nav-drop-color);
|
2022-07-21 22:03:35 -04:00
|
|
|
padding: 1rem;
|
2022-08-07 20:08:44 -04:00
|
|
|
/* main stuff is z-index 1 and the hamburger must be above everything else */
|
|
|
|
z-index: 2;
|
2022-07-21 22:03:35 -04:00
|
|
|
}
|
|
|
|
|
2022-08-07 20:25:25 -04:00
|
|
|
html.dark nav {
|
|
|
|
--nav-drop-color: black;
|
|
|
|
}
|
|
|
|
|
2022-08-07 21:45:53 -04:00
|
|
|
html.dark nav img {
|
|
|
|
filter: invert(1);
|
|
|
|
}
|
|
|
|
|
2022-07-21 22:03:35 -04:00
|
|
|
ul {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2022-08-08 11:03:16 -04:00
|
|
|
gap: 1rem;
|
2022-07-21 22:03:35 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
li {
|
|
|
|
font-size: large;
|
2022-08-08 11:03:16 -04:00
|
|
|
border-radius: 0.5rem;
|
|
|
|
padding: 0.5rem;
|
|
|
|
padding-left: 1rem;
|
|
|
|
padding-right: 1rem;
|
2022-07-21 22:03:35 -04:00
|
|
|
}
|
2022-08-08 11:03:16 -04:00
|
|
|
|
|
|
|
li:hover:not(.home-text) {
|
|
|
|
--nav-active-color: lightgray;
|
|
|
|
background: var(--nav-active-color);
|
|
|
|
}
|
|
|
|
|
|
|
|
html.dark li:hover {
|
|
|
|
--nav-active-color: darkslategray;
|
|
|
|
}
|
|
|
|
|
2022-07-21 22:03:35 -04:00
|
|
|
li.home-text {
|
|
|
|
font-size: x-large;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2022-07-22 16:08:55 -04:00
|
|
|
|
|
|
|
.hamburger {
|
2022-08-07 20:08:44 -04:00
|
|
|
width: 0rem;
|
2022-07-22 16:08:55 -04:00
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
* {
|
2022-07-22 16:53:39 -04:00
|
|
|
--trans: 0.2s ease;
|
2022-08-07 20:25:25 -04:00
|
|
|
--box-trans-time: 0.4s;
|
2022-08-07 20:08:44 -04:00
|
|
|
transition: opacity var(--trans), transform var(--trans), gap var(--trans),
|
2022-08-07 21:45:53 -04:00
|
|
|
width var(--trans), box-shadow var(--box-trans-time) ease,
|
|
|
|
filter var(--trans);
|
2022-07-22 16:08:55 -04:00
|
|
|
}
|
|
|
|
|
2022-08-07 21:14:19 -04:00
|
|
|
@media screen and (max-width: 600px) {
|
2022-07-22 16:08:55 -04:00
|
|
|
.hamburger {
|
|
|
|
display: flex;
|
2022-08-07 20:08:44 -04:00
|
|
|
width: 3rem;
|
2022-07-22 16:08:55 -04:00
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
li:not(.home-text) {
|
2022-08-07 20:08:44 -04:00
|
|
|
width: 0;
|
2022-07-22 16:08:55 -04:00
|
|
|
opacity: 0;
|
|
|
|
/* accessibility? screw accessibility
|
|
|
|
* i want my pretty animations
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
ul {
|
|
|
|
gap: 0rem;
|
|
|
|
}
|
|
|
|
}
|
2022-07-22 16:53:39 -04:00
|
|
|
|
|
|
|
html.dark svg {
|
|
|
|
fill: white;
|
|
|
|
}
|
2022-07-21 22:03:35 -04:00
|
|
|
</style>
|