Spookie/assets/js/components/TheNavbar.vue

74 lines
1.8 KiB
Vue
Raw Normal View History

2022-05-06 13:52:18 +02:00
<template>
2022-05-25 14:41:58 +02:00
<nav
class="
grid fixed inset-x-0 top-0 flex-wrap justify-between items-center py-0 leading-6 border-b
@border-orange-400 opacity-90 md:flex-nowrap md:justify-start md:px-24 box-border
bg-neutral-800 text-stone-300 grid-cols-2 place-content-around"
style="z-index: 1030;"
>
<div>
<router-link
class="py-1 mr-4 text-xl leading-7 text-white whitespace-nowrap cursor-pointer box-border
hover:text-white focus:text-white"
:to="{ name: 'Home' }"
2022-05-06 13:52:18 +02:00
>
2022-05-25 14:41:58 +02:00
<img
src="/build/images/24unix/24_logo_bg_96x96.png"
class="align-middle box-border"
alt="24unix.net"
>
</router-link>
</div>
<div class="text-end">
<router-link
id="buttonLogin"
class="inline-block py-1 px-3 mt-6 text-base font-normal leading-normal text-center
text-black align-middle bg-orange-400 rounded border border-orange-400 border-solid
cursor-pointer select-none box-border hover:border-orange-400 hover:bg-orange-400 hover:text-black
focus:border-orange-400 focus:bg-orange-400 focus:text-black"
:to="{ name: 'LoginForm' }"
role="button"
style="text-decoration: none; transition: none 0s ease 0s; list-style: outside none none;"
>
<span class="fa fa-sign-in fa-lg fa-fw"></span>&nbsp;Log In
</router-link>
2022-05-11 14:48:04 +02:00
</div>
2022-05-25 14:41:58 +02:00
2022-05-11 14:48:04 +02:00
</nav>
2022-05-06 13:52:18 +02:00
</template>
2022-05-23 16:25:55 +02:00
<script setup>
2022-05-25 14:41:58 +02:00
import { ref } from 'vue'
2022-05-11 14:48:04 +02:00
import axios from 'axios'
import 'vue-navigation-bar/dist/vue-navigation-bar.css'
2022-05-06 13:52:18 +02:00
2022-05-23 16:25:55 +02:00
const props = defineProps({
user: {
type: Object,
default() {
return {
username: 'tracer'
}
2022-05-06 13:52:18 +02:00
}
}
2022-05-23 16:25:55 +02:00
})
2022-05-06 13:52:18 +02:00
2022-05-23 16:25:55 +02:00
const isLoggedIn = () => (!!this.user)
2022-05-25 14:41:58 +02:00
let showDropdown = ref(false)
const toggleDropDown = () => {
console.log('toggle', showDropdown)
showDropdown.value = !showDropdown.value
}
2022-05-23 16:25:55 +02:00
/*
const logout = () => ({
axios
.get('/logout')
.then(this.$emit('invalidate-user'))
})
*/
</script>