Files
habitica/website/client/components/appMenu.vue
Matteo Pagliazzi 0af1203832 Client Redesign: Inventory pages, secondary menu, misc css and design items (#8631)
* add colors palette

* add secondary menu component and style it

* add box shadow to secondary menu

* misc css, fixes for secondary menu

* client: add equipment page with grouping, css: add some styles

* add typography

* more equipment

* stable: fix linting

* equipment: add styles (lots of general styles too)

* remove duplicate google fonts loading

* add dropdowns

* design: white search input background, remove gray from items

* start adding drawer and selected indicator

* wip equipment

* fix equipment

* equipment: correctly bind new properties on items.gear.equipped

* equipment: fix vue binding. version 2

* equipment: fix vue binding. version 3

* back to first fix for equip op, fix for sourcemaps, send http request when an item is equipped, load bootstrap-vue components where needed

* checkboxes and radio buttons

* correctly renders selected items in first postion during the first render

* add search

* general changes, constants part of app state, add popovers

* add toggle switch, rename css

* correct offset

* upgrade deps

* upgrade deps

* drawer and lot of other work

* update equipping mechanism

* finish equipment

* fix compilation and upgrade deps

* use v-show in place of v-if to fix ui issues

* v-show -> v-if

* fix linting in test/client

* fix es6 compilation in test/client

* fix babel compilation for tests

* fix groupsUtilities mixin tests

* client: buttons

* client: buttons: fix colors

* client: finish buttons and dropdowns

* upgrade bootstrap-vue, finish buttons and dropdowns

* fix tasks page layout

* misc fixes for buttons

* add textareas

* fix app menu

* add inputs

* fixes for toggleSwitch

* typography

* checkboxes and radio buttons

* add checkbox icon

* fix equip.js

* extract strings to newClient.json

* add Popover above 'Use Costume' / 'Auto Equip' slider - disable item select if costume-mode and 'useCostume' isn't active

* show "you have disabled your costume" error above the drawer items

* check errorMessage for null

* hide star if costume not enabled

* fix errorMessage (!errorMessage seems not to work for string)

* show minimize / expand icon - always centered by css

* drawer test

* drawer: fix centering on large screens

* fix show more button

* add margin when two dropdowns are next to each other

* adjust the page padding based on the drawer, misc fixes

* drawer fixes
2017-05-16 21:09:55 +02:00

158 lines
4.5 KiB
Vue

<template lang="pug">
nav.navbar.navbar-inverse.fixed-top.navbar-toggleable-sm
.navbar-header
// TODO srcset / svg images
img(src="~assets/header/png/logo@3x.png")
.collapse.navbar-collapse
ul.navbar-nav.mr-auto
router-link.nav-item(tag="li", :to="{name: 'tasks'}", exact)
a.nav-link(v-once) {{ $t('tasks') }}
router-link.nav-item.dropdown(tag="li", :to="{name: 'inventory'}", :class="{'active': $route.path.startsWith('/inventory')}")
a.nav-link(v-once) {{ $t('inventory') }}
.dropdown-menu
router-link.dropdown-item(:to="{name: 'inventory'}", exact) {{ $t('inventory') }}
router-link.dropdown-item(:to="{name: 'equipment'}") {{ $t('equipment') }}
router-link.dropdown-item(:to="{name: 'stable'}") {{ $t('stable') }}
router-link.nav-item(tag="li", :to="{name: 'market'}", exact)
a.nav-link(v-once) {{ $t('market') }}
router-link.nav-item.dropdown(tag="li", :to="{name: 'tavern'}", :class="{'active': $route.path.startsWith('/social')}")
a.nav-link(v-once) {{ $t('social') }}
.dropdown-menu
router-link.dropdown-item(:to="{name: 'tavern'}") {{ $t('tavern') }}
router-link.dropdown-item(:to="{name: 'inbox'}") {{ $t('inbox') }}
router-link.dropdown-item(:to="{name: 'challenges'}") {{ $t('challenges') }}
router-link.dropdown-item(:to="{name: 'party'}") {{ $t('party') }}
router-link.dropdown-item(:to="{name: 'guildsDiscovery'}") {{ $t('guilds') }}
router-link.nav-item.dropdown(tag="li", to="/help", :class="{'active': $route.path.startsWith('/help')}")
a.nav-link(v-once) {{ $t('help') }}
.dropdown-menu
router-link.dropdown-item(to="/help/faq") {{ $t('faq') }}
router-link.dropdown-item(to="/help/report-bug") {{ $t('reportBug') }}
router-link.dropdown-item(to="/help/request-feature") {{ $t('requestAF') }}
.item-with-icon
img(src="~assets/header/png/gem@3x.png")
span {{userGems}}
.item-with-icon
img(src="~assets/header/png/gold@3x.png")
span {{user.stats.gp | floor}}
.item-with-icon
img(src="~assets/header/png/notifications@3x.png")
router-link.dropdown.item-with-icon(:to="{name: 'avatar'}")
// TODO icons should be white when active
img(src="~assets/header/png/user@3x.png")
.dropdown-menu.dropdown-menu-right.user-dropdown
router-link.dropdown-item(:to="{name: 'avatar'}") {{ $t('editAvatar') }}
// .dropdown-divider
router-link.dropdown-item(:to="{name: 'stats'}") {{ $t('stats') }}
router-link.dropdown-item(:to="{name: 'achievements'}") {{ $t('achievements') }}
// .dropdown-divider
router-link.dropdown-item(:to="{name: 'settings'}") {{ $t('settings') }}
// .dropdown-divider
router-link.dropdown-item(to="/logout") {{ $t('logout') }}
</template>
<style lang="scss" scoped>
@import '~client/assets/scss/colors.scss';
nav.navbar {
background: $purple-100 url(~assets/header/png/bits.png) right no-repeat;
padding: 0 1.5rem;
height: 56px;
}
.navbar-header {
margin-right: 3rem;
img {
height: 28px;
}
}
.nav-item {
.nav-link {
font-size: 16px;
color: $white;
font-weight: bold;
line-height: 1.5;
padding: 1rem 1.5rem;
transition: none;
}
&:hover {
.nav-link {
color: $white;
background: $purple-300;
}
}
&.active,&:hover {
.nav-link {
box-shadow: 0px -4px 0px $purple-300 inset;
}
}
}
// Make the dropdown menu open on hover
.dropdown:hover .dropdown-menu {
display: block;
margin-top: 0; // remove the gap so it doesn't close
}
.dropdown-menu:not(.user-dropdown) {
background: $purple-300;
border-radius: 0px;
border: none;
box-shadow: none;
padding: 0px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
.dropdown-item {
font-size: 16px;
box-shadow: none;
color: $white;
border: none;
&.active {
background: $purple-300;
}
&:hover {
background: $purple-200;
&:last-child {
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
}
}
}
}
.item-with-icon {
color: $white;
font-weight: bold;
padding: 0.75rem 0;
padding-left: 1rem;
img {
vertical-align: middle;
width: 32px;
height: 32px;
margin-right: 0.5rem;
}
}
</style>
<script>
import { mapState, mapGetters } from 'client/libs/store';
export default {
computed: {
...mapGetters({
userGems: 'user:gems',
}),
...mapState({user: 'user.data'}),
},
};
</script>