2020-08-18 13:44:21 +00:00
|
|
|
<template>
|
2020-10-18 03:16:42 +00:00
|
|
|
<div v-if="channel" class="_section">
|
2021-04-10 09:17:42 +00:00
|
|
|
<div class="wpgynlbz _content _panel _gap" :class="{ hide: !showBanner }">
|
2020-10-18 03:16:42 +00:00
|
|
|
<XChannelFollowButton :channel="channel" :full="true" class="subscribe"/>
|
2020-08-18 13:44:21 +00:00
|
|
|
<button class="_button toggle" @click="() => showBanner = !showBanner">
|
2021-04-20 14:22:59 +00:00
|
|
|
<template v-if="showBanner"><i class="fas fa-angle-up"></i></template>
|
|
|
|
<template v-else><i class="fas fa-angle-down"></i></template>
|
2020-08-18 13:44:21 +00:00
|
|
|
</button>
|
2021-11-19 10:36:12 +00:00
|
|
|
<div v-if="!showBanner" class="hideOverlay">
|
2020-08-18 13:44:21 +00:00
|
|
|
</div>
|
|
|
|
<div :style="{ backgroundImage: channel.bannerUrl ? `url(${channel.bannerUrl})` : null }" class="banner">
|
|
|
|
<div class="status">
|
2021-04-20 14:22:59 +00:00
|
|
|
<div><i class="fas fa-users fa-fw"></i><I18n :src="$ts._channel.usersCount" tag="span" style="margin-left: 4px;"><template #n><b>{{ channel.usersCount }}</b></template></I18n></div>
|
|
|
|
<div><i class="fas fa-pencil-alt fa-fw"></i><I18n :src="$ts._channel.notesCount" tag="span" style="margin-left: 4px;"><template #n><b>{{ channel.notesCount }}</b></template></I18n></div>
|
2020-08-18 13:44:21 +00:00
|
|
|
</div>
|
|
|
|
<div class="fade"></div>
|
|
|
|
</div>
|
2021-11-19 10:36:12 +00:00
|
|
|
<div v-if="channel.description" class="description">
|
2020-12-19 01:55:52 +00:00
|
|
|
<Mfm :text="channel.description" :is-note="false" :i="$i"/>
|
2020-08-18 13:44:21 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2021-11-19 10:36:12 +00:00
|
|
|
<XPostForm v-if="$i" :channel="channel" class="post-form _content _panel _gap" fixed/>
|
2020-08-18 13:44:21 +00:00
|
|
|
|
2021-11-19 10:36:12 +00:00
|
|
|
<XTimeline :key="channelId" class="_content _gap" src="channel" :channel="channelId" @before="before" @after="after"/>
|
2020-08-18 13:44:21 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 11:12:00 +00:00
|
|
|
import { computed, defineComponent } from 'vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import MkContainer from '@/components/ui/container.vue';
|
|
|
|
import XPostForm from '@/components/post-form.vue';
|
|
|
|
import XTimeline from '@/components/timeline.vue';
|
|
|
|
import XChannelFollowButton from '@/components/channel-follow-button.vue';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
2020-08-18 13:44:21 +00:00
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
export default defineComponent({
|
2020-08-18 13:44:21 +00:00
|
|
|
components: {
|
|
|
|
MkContainer,
|
|
|
|
XPostForm,
|
|
|
|
XTimeline,
|
|
|
|
XChannelFollowButton
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
channelId: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 03:54:12 +00:00
|
|
|
[symbols.PAGE_INFO]: computed(() => this.channel ? {
|
2020-11-03 11:36:12 +00:00
|
|
|
title: this.channel.name,
|
2021-04-20 14:22:59 +00:00
|
|
|
icon: 'fas fa-satellite-dish',
|
2020-10-17 11:12:00 +00:00
|
|
|
} : null),
|
2020-08-18 13:44:21 +00:00
|
|
|
channel: null,
|
|
|
|
showBanner: true,
|
|
|
|
pagination: {
|
|
|
|
endpoint: 'channels/timeline',
|
|
|
|
limit: 10,
|
|
|
|
params: () => ({
|
|
|
|
channelId: this.channelId,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
channelId: {
|
|
|
|
async handler() {
|
2020-10-17 11:12:00 +00:00
|
|
|
this.channel = await os.api('channels/show', {
|
2020-08-18 13:44:21 +00:00
|
|
|
channelId: this.channelId,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
immediate: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.wpgynlbz {
|
2020-10-18 03:16:42 +00:00
|
|
|
position: relative;
|
|
|
|
|
2020-08-18 13:44:21 +00:00
|
|
|
> .subscribe {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 1;
|
|
|
|
top: 16px;
|
|
|
|
left: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .toggle {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 2;
|
|
|
|
top: 8px;
|
|
|
|
right: 8px;
|
|
|
|
font-size: 1.2em;
|
|
|
|
width: 48px;
|
|
|
|
height: 48px;
|
|
|
|
color: #fff;
|
|
|
|
background: rgba(0, 0, 0, 0.5);
|
|
|
|
border-radius: 100%;
|
|
|
|
|
2021-04-20 14:22:59 +00:00
|
|
|
> i {
|
2020-08-18 13:44:21 +00:00
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .banner {
|
|
|
|
position: relative;
|
|
|
|
height: 200px;
|
|
|
|
background-position: center;
|
|
|
|
background-size: cover;
|
|
|
|
|
|
|
|
> .fade {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 64px;
|
|
|
|
background: linear-gradient(0deg, var(--panel), var(--X15));
|
|
|
|
}
|
|
|
|
|
|
|
|
> .status {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 1;
|
|
|
|
bottom: 16px;
|
|
|
|
right: 16px;
|
|
|
|
padding: 8px 12px;
|
|
|
|
font-size: 80%;
|
|
|
|
background: rgba(0, 0, 0, 0.7);
|
|
|
|
border-radius: 6px;
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .description {
|
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .hideOverlay {
|
|
|
|
position: absolute;
|
|
|
|
z-index: 1;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2021-08-11 13:34:45 +00:00
|
|
|
-webkit-backdrop-filter: var(--blur, blur(16px));
|
|
|
|
backdrop-filter: var(--blur, blur(16px));
|
2020-08-18 13:44:21 +00:00
|
|
|
background: rgba(0, 0, 0, 0.3);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.hide {
|
|
|
|
> .subscribe {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .toggle {
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
height: 100%;
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .banner {
|
|
|
|
height: 42px;
|
|
|
|
filter: blur(8px);
|
|
|
|
|
|
|
|
> * {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .description {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|