public/components/Navbar.vue

79 lines
1.2 KiB
Vue
Raw Normal View History

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">
<a :href="item.href">{{ item.title }}</a>
</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 11:37:29 -04:00
<Hamburger />
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-07-22 17:16:27 -04:00
height: 4rem;
2022-07-21 22:03:35 -04:00
width: 100%;
border: 1px solid red;
padding: 1rem;
}
ul {
display: flex;
align-items: center;
gap: 3rem;
}
li {
font-size: large;
}
li.home-text {
font-size: x-large;
font-weight: bold;
}
2022-07-22 16:08:55 -04:00
.hamburger {
2022-08-07 11:37:29 -04:00
transform: scale(0);
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 11:37:29 -04:00
transition: opacity var(--trans), transform var(--trans);
2022-07-22 16:08:55 -04:00
}
@media screen and (max-width: 510px) {
.hamburger {
display: flex;
2022-08-07 11:37:29 -04:00
transform: none;
2022-07-22 16:08:55 -04:00
opacity: 1;
}
li:not(.home-text) {
2022-08-07 11:37:29 -04:00
transform: scale(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>