2018-10-19 05:15:28 +00:00
|
|
|
<template lang="html">
|
2018-12-21 21:52:11 +00:00
|
|
|
<nav :class="{ dark: darkModeEnabled }">
|
2018-11-21 02:43:10 +00:00
|
|
|
<router-link
|
|
|
|
tag="button"
|
|
|
|
class="logo"
|
2019-05-08 22:38:30 +00:00
|
|
|
:to="{ name: logoRoute }"
|
2018-11-21 02:43:10 +00:00
|
|
|
>
|
2019-01-11 21:27:07 +00:00
|
|
|
<img src='/static/gamebrary-logo.png' />
|
2019-03-28 21:23:09 +00:00
|
|
|
|
|
|
|
{{ title }}
|
2018-11-21 02:43:10 +00:00
|
|
|
</router-link>
|
|
|
|
|
2019-07-10 23:25:58 +00:00
|
|
|
<modal large title="Settings">
|
2019-08-09 19:12:26 +00:00
|
|
|
<button class="small info">
|
2019-07-10 23:25:58 +00:00
|
|
|
<i class="fas fa-cog" />
|
|
|
|
</button>
|
2019-03-28 21:23:09 +00:00
|
|
|
|
2019-07-10 23:25:58 +00:00
|
|
|
<settings slot="content" />
|
2019-03-28 21:23:09 +00:00
|
|
|
</modal>
|
2019-07-10 23:25:58 +00:00
|
|
|
|
2018-10-19 05:15:28 +00:00
|
|
|
</nav>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-07-10 23:25:58 +00:00
|
|
|
import Settings from '@/pages/Settings';
|
2019-08-06 22:45:59 +00:00
|
|
|
import Modal from '@/components/Modal';
|
2019-07-10 23:25:58 +00:00
|
|
|
import { mapState, mapGetters } from 'vuex';
|
2018-10-19 05:15:28 +00:00
|
|
|
|
|
|
|
export default {
|
2019-02-05 07:31:40 +00:00
|
|
|
components: {
|
|
|
|
Modal,
|
2019-07-10 23:25:58 +00:00
|
|
|
Settings,
|
2019-02-05 07:31:40 +00:00
|
|
|
},
|
|
|
|
|
2018-10-19 05:15:28 +00:00
|
|
|
computed: {
|
2019-02-21 18:54:13 +00:00
|
|
|
...mapState(['user', 'platform', 'settings']),
|
2018-12-21 21:52:11 +00:00
|
|
|
...mapGetters(['darkModeEnabled']),
|
2018-10-25 06:33:15 +00:00
|
|
|
|
2019-05-08 22:38:30 +00:00
|
|
|
isLoggedIn() {
|
|
|
|
return this.user && this.user.email;
|
|
|
|
},
|
|
|
|
|
|
|
|
hasSettings() {
|
|
|
|
return this.settings && this.user;
|
|
|
|
},
|
|
|
|
|
2019-03-28 21:23:09 +00:00
|
|
|
title() {
|
|
|
|
if (this.$route.name === 'share-list') {
|
|
|
|
return this.$route.query && this.$route.query.list
|
|
|
|
? this.$route.query.list.split('-').join(' ')
|
|
|
|
: 'GAMEBRARY';
|
|
|
|
}
|
2019-02-16 04:45:14 +00:00
|
|
|
|
2019-02-21 03:05:18 +00:00
|
|
|
return this.$route.name === 'game-board' && this.platform
|
|
|
|
? this.platform.name
|
2019-07-10 23:25:58 +00:00
|
|
|
: 'Gamebrary';
|
2019-02-21 03:05:18 +00:00
|
|
|
},
|
|
|
|
|
2019-05-08 22:38:30 +00:00
|
|
|
logoRoute() {
|
2019-03-28 21:23:09 +00:00
|
|
|
if (this.$route.name === 'share-list') {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2019-02-06 06:57:20 +00:00
|
|
|
if (this.$route.name === 'game-detail' && this.platform) {
|
|
|
|
return 'game-board';
|
|
|
|
}
|
|
|
|
|
2019-07-10 23:25:58 +00:00
|
|
|
if (this.$route.name === 'settings' && this.platform) {
|
|
|
|
return 'game-board';
|
|
|
|
}
|
|
|
|
|
2019-02-06 06:57:20 +00:00
|
|
|
if (this.$route.name === 'game-board') {
|
|
|
|
return 'platforms';
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
2019-01-11 21:52:08 +00:00
|
|
|
},
|
2018-10-19 05:15:28 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" rel="stylesheet/scss" scoped>
|
2019-04-05 19:16:32 +00:00
|
|
|
@import "~styles/styles.scss";
|
2018-10-19 05:15:28 +00:00
|
|
|
nav {
|
2018-11-08 03:49:04 +00:00
|
|
|
user-select: none;
|
|
|
|
width: 100vw;
|
2018-11-17 22:23:33 +00:00
|
|
|
height: $navHeight;
|
2018-10-19 05:15:28 +00:00
|
|
|
display: flex;
|
2019-01-17 06:22:30 +00:00
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
2019-02-08 05:46:29 +00:00
|
|
|
padding: 0 $gp;
|
2019-03-28 21:23:09 +00:00
|
|
|
color: $color-darkest-gray;
|
2018-10-25 06:33:15 +00:00
|
|
|
|
2018-10-29 23:53:49 +00:00
|
|
|
.logo {
|
2018-11-08 03:49:04 +00:00
|
|
|
height: $navHeight;
|
2018-10-29 23:53:49 +00:00
|
|
|
font-weight: bold;
|
2019-01-11 21:27:07 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2019-02-08 05:46:29 +00:00
|
|
|
margin-left: -$gp;
|
2019-03-28 21:23:09 +00:00
|
|
|
text-transform: capitalize;
|
2019-01-11 21:27:07 +00:00
|
|
|
|
|
|
|
img {
|
|
|
|
height: 24px;
|
|
|
|
margin-right: $gp / 4;
|
|
|
|
}
|
2018-11-08 03:49:04 +00:00
|
|
|
}
|
|
|
|
|
2018-11-17 22:23:33 +00:00
|
|
|
&.dark {
|
|
|
|
color: $color-gray !important;
|
2018-10-19 05:15:28 +00:00
|
|
|
}
|
2019-03-28 21:23:09 +00:00
|
|
|
}
|
2019-02-08 05:46:29 +00:00
|
|
|
|
2019-03-28 21:23:09 +00:00
|
|
|
img.avatar {
|
|
|
|
width: 30px;
|
|
|
|
height: 30px;
|
2019-03-29 20:51:30 +00:00
|
|
|
border-radius: $border-radius;
|
2019-03-28 21:23:09 +00:00
|
|
|
|
|
|
|
@media($small) {
|
|
|
|
width: 30px;
|
|
|
|
height: 30px;
|
2019-02-08 05:46:29 +00:00
|
|
|
}
|
2018-10-19 05:15:28 +00:00
|
|
|
}
|
|
|
|
</style>
|
2018-11-21 02:39:49 +00:00
|
|
|
|