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>
2016-10-31 04:28:12 +00:00
<search-form/>
<user-badge/>
2016-06-25 16:05:24 +00:00
</header>
2015-12-13 04:42:28 +00:00
</template>
<script>
2016-11-26 03:25:35 +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-11-26 03:25:35 +00:00
data () {
2016-06-25 16:05:24 +00:00
return {
2016-11-26 03:25:35 +00:00
appTitle: config.appTitle
}
2016-06-25 16:05:24 +00:00
},
2016-02-14 07:36:44 +00:00
2016-06-25 16:05:24 +00:00
methods: {
/**
* No I'm not documenting this.
*/
2016-11-26 03:25:35 +00:00
toggleSidebar () {
event.emit('sidebar:toggle')
2016-06-25 16:05:24 +00:00
},
2015-12-13 04:42:28 +00:00
2016-06-25 16:05:24 +00:00
/**
* or this.
*/
2016-11-26 03:25:35 +00:00
toggleSearchForm () {
event.emit('search:toggle')
}
}
}
2015-12-13 04:42:28 +00:00
</script>
2017-02-14 06:53:02 +00:00
<style lang="scss">
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>