koel/resources/assets/js/components/site-header/index.vue

93 lines
1.7 KiB
Vue
Raw Normal View History

2015-12-13 04:42:28 +00:00
<template>
2016-06-25 16:05:24 +00:00
<header id="mainHeader">
2016-06-26 16:31:32 +00:00
<h1 class="brand" v-once>{{ appTitle }}</h1>
2016-06-25 16:05:24 +00:00
<span class="hamburger" @click="toggleSidebar">
<i class="fa fa-bars"></i>
</span>
<span class="magnifier" @click="toggleSearchForm">
<i class="fa fa-search"></i>
</span>
<search-form></search-form>
<user-badge></user-badge>
</header>
2015-12-13 04:42:28 +00:00
</template>
<script>
2016-06-25 16:05:24 +00:00
import config from '../../config';
import { event } from '../../utils';
import searchForm from './search-form.vue';
import userBadge from './user-badge.vue';
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
export default {
components: { searchForm, userBadge },
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
data() {
return {
appTitle: config.appTitle,
};
},
2016-02-14 07:36:44 +00:00
2016-06-25 16:05:24 +00:00
methods: {
/**
* No I'm not documenting this.
*/
toggleSidebar() {
event.emit('sidebar:toggle');
},
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
/**
* or this.
*/
toggleSearchForm() {
event.emit('search:toggle');
},
},
};
2015-12-13 04:42:28 +00:00
</script>
<style lang="sass">
2016-06-25 16:05:24 +00:00
@import "../../../sass/partials/_vars.scss";
@import "../../../sass/partials/_mixins.scss";
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
#mainHeader {
height: $headerHeight;
background: $color2ndBgr;
display: flex;
border-bottom: 1px solid $colorMainBgr;
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
h1.brand {
flex: 1;
color: $colorMainText;
font-size: 1.7rem;
font-weight: $fontWeight_UltraThin;
opacity: 0;
line-height: $headerHeight;
text-align: center;
}
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
.hamburger, .magnifier {
font-size: 1.4rem;
flex: 0 0 48px;
order: -1;
line-height: $headerHeight;
text-align: center;
display: none;
}
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
@media only screen and (max-width: 667px) {
display: flex;
align-content: stretch;
justify-content: flext-start;
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
.hamburger, .magnifier {
display: inline-block;
}
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
h1.brand {
opacity: 1;
2015-12-13 04:42:28 +00:00
}
2016-06-25 16:05:24 +00:00
}
}
2015-12-13 04:42:28 +00:00
</style>