2018-02-09 22:56:33 -07:00
|
|
|
<template>
|
2018-06-06 14:14:37 -06:00
|
|
|
<div class="mk-ui" :style="style">
|
2018-05-31 01:44:11 -06:00
|
|
|
<x-header class="header"/>
|
2018-02-12 03:59:24 -07:00
|
|
|
<div class="content">
|
|
|
|
<slot></slot>
|
|
|
|
</div>
|
2018-05-26 22:49:09 -06:00
|
|
|
<mk-stream-indicator v-if="$store.getters.isSignedIn"/>
|
2018-02-09 22:56:33 -07:00
|
|
|
</div>
|
|
|
|
</template>
|
2018-02-12 03:59:24 -07:00
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2018-02-20 06:53:34 -07:00
|
|
|
import XHeader from './ui.header.vue';
|
2018-02-12 03:59:24 -07:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-02-20 06:53:34 -07:00
|
|
|
components: {
|
2018-02-20 09:39:51 -07:00
|
|
|
XHeader
|
2018-02-20 06:53:34 -07:00
|
|
|
},
|
2018-06-06 14:14:37 -06:00
|
|
|
computed: {
|
|
|
|
style(): any {
|
|
|
|
if (!this.$store.getters.isSignedIn || this.$store.state.i.wallpaperUrl == null) return {};
|
|
|
|
return {
|
|
|
|
backgroundColor: this.$store.state.i.wallpaperColor && this.$store.state.i.wallpaperColor.length == 3 ? `rgb(${ this.$store.state.i.wallpaperColor.join(',') })` : null,
|
|
|
|
backgroundImage: `url(${ this.$store.state.i.wallpaperUrl })`
|
|
|
|
};
|
|
|
|
}
|
|
|
|
},
|
2018-02-12 03:59:24 -07:00
|
|
|
mounted() {
|
|
|
|
document.addEventListener('keydown', this.onKeydown);
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
|
|
|
document.removeEventListener('keydown', this.onKeydown);
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onKeydown(e) {
|
|
|
|
if (e.target.tagName == 'INPUT' || e.target.tagName == 'TEXTAREA') return;
|
|
|
|
|
|
|
|
if (e.which == 80 || e.which == 78) { // p or n
|
|
|
|
e.preventDefault();
|
2018-02-20 06:53:34 -07:00
|
|
|
(this as any).apis.post();
|
2018-02-12 03:59:24 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2018-05-31 01:44:11 -06:00
|
|
|
<style lang="stylus" scoped>
|
|
|
|
.mk-ui
|
2018-06-05 06:36:21 -06:00
|
|
|
display flex
|
|
|
|
flex-direction column
|
|
|
|
flex 1
|
2018-06-06 14:14:37 -06:00
|
|
|
background-size cover
|
|
|
|
background-position center
|
|
|
|
background-attachment fixed
|
2018-06-05 06:36:21 -06:00
|
|
|
|
2018-05-31 01:44:11 -06:00
|
|
|
> .header
|
|
|
|
@media (max-width 1000px)
|
|
|
|
display none
|
2018-06-05 06:36:21 -06:00
|
|
|
|
|
|
|
> .content
|
|
|
|
display flex
|
|
|
|
flex-direction column
|
|
|
|
flex 1
|
2018-06-06 11:06:32 -06:00
|
|
|
overflow hidden
|
2018-05-31 01:44:11 -06:00
|
|
|
</style>
|