2021-07-25 13:03:34 +02:00
|
|
|
<template>
|
|
|
|
<div id="nav">
|
2021-08-04 09:10:00 +02:00
|
|
|
<div class="container">
|
|
|
|
<div class="nav-app-name">
|
|
|
|
<span class="nav-item app-name">FitTrackee</span>
|
2021-07-25 17:08:22 +02:00
|
|
|
</div>
|
2021-08-04 09:10:00 +02:00
|
|
|
<div class="nav-icon-open" :class="{ 'menu-open': isMenuOpen }">
|
|
|
|
<i class="fa fa-bars hamburger-icon" @click="openMenu()"></i>
|
2021-07-25 17:08:22 +02:00
|
|
|
</div>
|
2021-08-04 09:10:00 +02:00
|
|
|
<div class="nav-items" :class="{ 'menu-open': isMenuOpen }">
|
|
|
|
<div class="nav-items-close">
|
|
|
|
<span class="app-name">FitTrackee</span>
|
|
|
|
<i
|
|
|
|
class="fa fa-close close-icon nav-item"
|
|
|
|
:class="{ 'menu-closed': !isMenuOpen }"
|
|
|
|
@click="closeMenu()"
|
|
|
|
></i>
|
|
|
|
</div>
|
|
|
|
<div class="nav-items-app-menu" @click="closeMenu()">
|
|
|
|
<router-link class="nav-item" to="/">Dashboard</router-link>
|
|
|
|
<span class="nav-item">Workout</span>
|
|
|
|
<span class="nav-item">Statistics</span>
|
|
|
|
<span class="nav-item">Admin</span>
|
|
|
|
<span class="nav-item">Add Workout</span>
|
|
|
|
</div>
|
|
|
|
<div class="nav-items-user-menu">
|
|
|
|
<span class="nav-item">User</span>
|
|
|
|
<span class="nav-item">Logout</span>
|
|
|
|
<span class="nav-item">Register</span>
|
|
|
|
<span class="nav-item">Login</span>
|
|
|
|
</div>
|
2021-07-25 17:08:22 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2021-07-25 13:03:34 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-07-25 17:08:22 +02:00
|
|
|
import { defineComponent, ref } from 'vue'
|
2021-07-25 13:03:34 +02:00
|
|
|
|
2021-07-25 13:23:25 +02:00
|
|
|
export default defineComponent({
|
|
|
|
name: 'NavBar',
|
2021-07-25 17:08:22 +02:00
|
|
|
setup() {
|
|
|
|
let isMenuOpen = ref(false)
|
|
|
|
function openMenu() {
|
|
|
|
isMenuOpen.value = true
|
|
|
|
}
|
|
|
|
function closeMenu() {
|
|
|
|
isMenuOpen.value = false
|
|
|
|
}
|
|
|
|
return { isMenuOpen, openMenu, closeMenu }
|
|
|
|
},
|
2021-07-25 13:23:25 +02:00
|
|
|
})
|
2021-07-25 13:03:34 +02:00
|
|
|
</script>
|
|
|
|
|
2021-07-25 17:08:22 +02:00
|
|
|
<style scoped lang="scss">
|
2021-08-04 09:10:00 +02:00
|
|
|
@import '~@/scss/base';
|
|
|
|
|
2021-07-25 17:08:22 +02:00
|
|
|
#nav {
|
2021-08-04 09:10:00 +02:00
|
|
|
background: var(--nav-bar-background-color);
|
2021-07-25 17:08:22 +02:00
|
|
|
display: flex;
|
2021-08-04 09:10:00 +02:00
|
|
|
padding: 15px 10px;
|
2021-07-25 17:08:22 +02:00
|
|
|
|
|
|
|
a {
|
|
|
|
&.router-link-exact-active {
|
2021-08-04 09:10:00 +02:00
|
|
|
color: var(--nav-bar-link-active);
|
2021-07-25 17:08:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.app-name {
|
|
|
|
font-size: 1.2em;
|
|
|
|
font-weight: bold;
|
2021-08-04 09:10:00 +02:00
|
|
|
margin-right: 10px;
|
|
|
|
line-height: 12px;
|
2021-07-25 17:08:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.fa {
|
|
|
|
font-size: 1.2em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-icon-open {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.hamburger-icon,
|
|
|
|
.close-icon {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-items {
|
|
|
|
display: flex;
|
|
|
|
flex: 1;
|
|
|
|
justify-content: space-between;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
.nav-items-close {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-item {
|
|
|
|
padding: 10px 10px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-04 09:10:00 +02:00
|
|
|
@media screen and (max-width: $medium-limit) {
|
2021-07-25 17:08:22 +02:00
|
|
|
.hamburger-icon {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
.nav-icon-open {
|
|
|
|
display: block;
|
|
|
|
text-align: right;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
.nav-icon-open.menu-open {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.close-icon {
|
|
|
|
display: block;
|
2021-08-04 09:10:00 +02:00
|
|
|
margin-right: 18px;
|
2021-07-25 17:08:22 +02:00
|
|
|
}
|
|
|
|
.close-icon.menu-closed {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-items {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
.nav-items.menu-open {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
|
2021-08-04 09:10:00 +02:00
|
|
|
background: var(--nav-bar-background-color);
|
2021-07-25 17:08:22 +02:00
|
|
|
|
|
|
|
.nav-items-close,
|
|
|
|
.nav-items-app-menu,
|
|
|
|
.nav-items-user-menu {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-items-close {
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
.app-name {
|
2021-08-04 09:10:00 +02:00
|
|
|
padding: 19px 25px;
|
2021-07-25 17:08:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|