2020-11-28 16:18:54 +01:00
|
|
|
<template>
|
|
|
|
<div class="sqxihjet">
|
2021-11-19 11:36:12 +01:00
|
|
|
<div v-if="narrow === false" class="wide">
|
2020-11-29 03:25:43 +01:00
|
|
|
<div class="content">
|
2021-04-20 16:22:59 +02:00
|
|
|
<MkA to="/" class="link" active-class="active"><i class="fas fa-home icon"></i>{{ $ts.home }}</MkA>
|
2022-07-03 13:03:57 +02:00
|
|
|
<MkA v-if="isTimelineAvailable" to="/timeline" class="link" active-class="active"><i class="fas fa-comments icon"></i>{{ $ts.timeline }}</MkA>
|
2021-04-20 16:22:59 +02:00
|
|
|
<MkA to="/explore" class="link" active-class="active"><i class="fas fa-hashtag icon"></i>{{ $ts.explore }}</MkA>
|
|
|
|
<MkA to="/channels" class="link" active-class="active"><i class="fas fa-satellite-dish icon"></i>{{ $ts.channel }}</MkA>
|
2022-07-02 13:55:20 +02:00
|
|
|
<MkA to="/pages" class="link" active-class="active"><i class="fas fa-file-alt icon"></i>{{ $ts.pages }}</MkA>
|
|
|
|
<MkA to="/gallery" class="link" active-class="active"><i class="fas fa-icons icon"></i>{{ $ts.gallery }}</MkA>
|
2021-11-19 11:36:12 +01:00
|
|
|
<div v-if="info" class="page active link">
|
2020-11-29 03:25:43 +01:00
|
|
|
<div class="title">
|
2021-04-20 16:22:59 +02:00
|
|
|
<i v-if="info.icon" class="icon" :class="info.icon"></i>
|
2021-04-17 16:52:54 +02:00
|
|
|
<MkAvatar v-else-if="info.avatar" class="avatar" :user="info.avatar" :disable-preview="true" :show-indicator="true"/>
|
2020-11-29 03:25:43 +01:00
|
|
|
<span v-if="info.title" class="text">{{ info.title }}</span>
|
|
|
|
<MkUserName v-else-if="info.userName" :user="info.userName" :nowrap="false" class="text"/>
|
|
|
|
</div>
|
2021-11-19 11:36:12 +01:00
|
|
|
<button v-if="info.action" class="_button action" @click.stop="info.action.handler"><!-- TODO --></button>
|
2020-11-29 03:25:43 +01:00
|
|
|
</div>
|
|
|
|
<div class="right">
|
2021-04-20 16:22:59 +02:00
|
|
|
<button class="_button search" @click="search()"><i class="fas fa-search icon"></i><span>{{ $ts.search }}</span></button>
|
2020-12-26 02:47:36 +01:00
|
|
|
<button class="_buttonPrimary signup" @click="signup()">{{ $ts.signup }}</button>
|
|
|
|
<button class="_button login" @click="signin()">{{ $ts.login }}</button>
|
2020-11-28 16:18:54 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-11-29 03:25:43 +01:00
|
|
|
</div>
|
2021-11-19 11:36:12 +01:00
|
|
|
<div v-else-if="narrow === true" class="narrow">
|
2020-11-29 03:25:43 +01:00
|
|
|
<button class="menu _button" @click="$parent.showMenu = true">
|
2021-04-20 16:22:59 +02:00
|
|
|
<i class="fas fa-bars icon"></i>
|
2020-11-29 03:25:43 +01:00
|
|
|
</button>
|
2021-11-19 11:36:12 +01:00
|
|
|
<div v-if="info" class="title">
|
2021-04-20 16:22:59 +02:00
|
|
|
<i v-if="info.icon" class="icon" :class="info.icon"></i>
|
2021-04-17 16:52:54 +02:00
|
|
|
<MkAvatar v-else-if="info.avatar" class="avatar" :user="info.avatar" :disable-preview="true" :show-indicator="true"/>
|
2020-11-29 03:25:43 +01:00
|
|
|
<span v-if="info.title" class="text">{{ info.title }}</span>
|
|
|
|
<MkUserName v-else-if="info.userName" :user="info.userName" :nowrap="false" class="text"/>
|
2020-11-28 16:18:54 +01:00
|
|
|
</div>
|
2021-11-19 11:36:12 +01:00
|
|
|
<button v-if="info && info.action" class="action _button" @click.stop="info.action.handler">
|
2021-04-20 16:22:59 +02:00
|
|
|
<!-- TODO -->
|
2020-11-29 03:25:43 +01:00
|
|
|
</button>
|
2020-11-28 16:18:54 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import XSigninDialog from '@/components/signin-dialog.vue';
|
|
|
|
import XSignupDialog from '@/components/signup-dialog.vue';
|
|
|
|
import * as os from '@/os';
|
2022-07-03 13:03:57 +02:00
|
|
|
import { instance } from '@/instance';
|
2021-11-11 18:02:25 +01:00
|
|
|
import { search } from '@/scripts/search';
|
2020-11-28 16:18:54 +01:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
props: {
|
|
|
|
info: {
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2020-11-29 03:25:43 +01:00
|
|
|
narrow: null,
|
|
|
|
showMenu: false,
|
2022-07-03 13:03:57 +02:00
|
|
|
isTimelineAvailable = !instance.disableLocalTimeline || !instance.disableGlobalTimeline,
|
2020-11-28 16:18:54 +01:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
mounted() {
|
|
|
|
this.narrow = this.$el.clientWidth < 1300;
|
|
|
|
},
|
|
|
|
|
2020-11-28 16:18:54 +01:00
|
|
|
methods: {
|
|
|
|
signin() {
|
|
|
|
os.popup(XSigninDialog, {
|
|
|
|
autoSet: true
|
|
|
|
}, {}, 'closed');
|
|
|
|
},
|
|
|
|
|
|
|
|
signup() {
|
|
|
|
os.popup(XSignupDialog, {
|
|
|
|
autoSet: true
|
|
|
|
}, {}, 'closed');
|
|
|
|
},
|
|
|
|
|
|
|
|
search
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.sqxihjet {
|
|
|
|
$height: 60px;
|
2020-11-29 03:25:43 +01:00
|
|
|
position: sticky;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
z-index: 1000;
|
2020-11-28 16:18:54 +01:00
|
|
|
line-height: $height;
|
2021-08-11 15:34:45 +02:00
|
|
|
-webkit-backdrop-filter: var(--blur, blur(32px));
|
|
|
|
backdrop-filter: var(--blur, blur(32px));
|
2020-11-29 03:25:43 +01:00
|
|
|
background-color: var(--X16);
|
|
|
|
|
|
|
|
> .wide {
|
|
|
|
> .content {
|
|
|
|
max-width: 1400px;
|
|
|
|
margin: 0 auto;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
> .link {
|
|
|
|
$line: 3px;
|
2020-11-28 16:18:54 +01:00
|
|
|
display: inline-block;
|
2020-11-29 03:25:43 +01:00
|
|
|
padding: 0 16px;
|
|
|
|
line-height: $height - ($line * 2);
|
|
|
|
border-top: solid $line transparent;
|
|
|
|
border-bottom: solid $line transparent;
|
|
|
|
|
|
|
|
> .icon {
|
|
|
|
margin-right: 0.5em;
|
2020-11-28 16:18:54 +01:00
|
|
|
}
|
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
&.page {
|
|
|
|
border-bottom-color: var(--accent);
|
2020-11-28 16:18:54 +01:00
|
|
|
}
|
2020-11-29 03:25:43 +01:00
|
|
|
}
|
2020-11-28 16:18:54 +01:00
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> .page {
|
|
|
|
> .title {
|
2020-11-28 16:18:54 +01:00
|
|
|
display: inline-block;
|
2020-11-29 03:25:43 +01:00
|
|
|
vertical-align: bottom;
|
|
|
|
white-space: nowrap;
|
2021-03-02 14:57:16 +01:00
|
|
|
overflow: hidden;
|
2020-11-29 03:25:43 +01:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
> .icon + .text {
|
|
|
|
margin-left: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .avatar {
|
|
|
|
$size: 32px;
|
|
|
|
display: inline-block;
|
|
|
|
width: $size;
|
|
|
|
height: $size;
|
|
|
|
vertical-align: middle;
|
|
|
|
margin-right: 8px;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
2020-11-28 16:18:54 +01:00
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
&._button {
|
|
|
|
&:hover {
|
|
|
|
color: var(--fgHighlighted);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.selected {
|
|
|
|
box-shadow: 0 -2px 0 0 var(--accent) inset;
|
2020-11-28 16:18:54 +01:00
|
|
|
color: var(--fgHighlighted);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> .action {
|
|
|
|
padding: 0 0 0 16px;
|
2020-11-28 16:18:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> .right {
|
|
|
|
margin-left: auto;
|
2020-11-28 16:18:54 +01:00
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> .search {
|
|
|
|
background: var(--bg);
|
|
|
|
border-radius: 999px;
|
|
|
|
width: 230px;
|
|
|
|
line-height: $height - 20px;
|
|
|
|
margin-right: 16px;
|
|
|
|
text-align: left;
|
2020-11-28 16:18:54 +01:00
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> * {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2020-11-28 16:18:54 +01:00
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> .icon {
|
|
|
|
padding: 0 16px;
|
|
|
|
}
|
2020-11-28 16:18:54 +01:00
|
|
|
}
|
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> .signup {
|
|
|
|
border-radius: 999px;
|
|
|
|
padding: 0 24px;
|
|
|
|
line-height: $height - 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .login {
|
2020-11-28 16:18:54 +01:00
|
|
|
padding: 0 16px;
|
|
|
|
}
|
|
|
|
}
|
2020-11-29 03:25:43 +01:00
|
|
|
}
|
|
|
|
}
|
2020-11-28 16:18:54 +01:00
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> .narrow {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
> .menu,
|
|
|
|
> .action {
|
|
|
|
width: $height;
|
|
|
|
height: $height;
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .title {
|
|
|
|
flex: 1;
|
|
|
|
white-space: nowrap;
|
2021-03-02 14:57:16 +01:00
|
|
|
overflow: hidden;
|
2020-11-29 03:25:43 +01:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
position: relative;
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
> .icon + .text {
|
|
|
|
margin-left: 8px;
|
2020-11-28 16:18:54 +01:00
|
|
|
}
|
|
|
|
|
2020-11-29 03:25:43 +01:00
|
|
|
> .avatar {
|
|
|
|
$size: 32px;
|
|
|
|
display: inline-block;
|
|
|
|
width: $size;
|
|
|
|
height: $size;
|
|
|
|
vertical-align: middle;
|
|
|
|
margin-right: 8px;
|
|
|
|
pointer-events: none;
|
2020-11-28 16:18:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|