2020-10-17 14:12:00 +03:00
|
|
|
<template>
|
2020-11-17 07:59:15 +02:00
|
|
|
<div class="rsqzvsbo _section" v-if="meta">
|
2020-12-05 11:18:37 +02:00
|
|
|
<div class="overview _monospace" v-if="stats">
|
|
|
|
<div class="stats">
|
|
|
|
<div><span>Users</span><span>{{ number(stats.originalUsersCount) }}</span></div>
|
|
|
|
<div><span>Notes</span><span>{{ number(stats.originalNotesCount) }}</span></div>
|
|
|
|
<div><span>Reactions</span><span>{{ number(stats.reactionsCount) }}</span></div>
|
|
|
|
</div>
|
|
|
|
<div class="tags">
|
|
|
|
<MkA class="tag" v-for="tag in tags" :to="`/tags/${encodeURIComponent(tag.tag)}`">#{{ tag.tag }}</MkA>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<template v-if="meta.pinnedClipId">
|
2020-12-26 03:47:36 +02:00
|
|
|
<h2># {{ $ts.pinnedNotes }}</h2>
|
2020-12-05 11:18:37 +02:00
|
|
|
<MkPagination :pagination="clipPagination" #default="{items}">
|
|
|
|
<XNote class="kmkqjgkl" v-for="note in items" :note="note" :key="note.id"/>
|
|
|
|
</MkPagination>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
2020-12-26 03:47:36 +02:00
|
|
|
<h2># {{ $ts.featured }}</h2>
|
2020-12-05 11:18:37 +02:00
|
|
|
<MkPagination :pagination="featuredPagination" #default="{items}">
|
|
|
|
<XNote class="kmkqjgkl" v-for="note in items" :note="note" :key="note.id"/>
|
|
|
|
</MkPagination>
|
|
|
|
</template>
|
2020-10-17 14:12:00 +03:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
import { toUnicode } from 'punycode';
|
|
|
|
import XSigninDialog from '@/components/signin-dialog.vue';
|
|
|
|
import XSignupDialog from '@/components/signup-dialog.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
2020-12-05 09:05:40 +02:00
|
|
|
import XNote from '@/components/note.vue';
|
|
|
|
import MkPagination from '@/components/ui/pagination.vue';
|
2020-11-17 07:59:15 +02:00
|
|
|
import { host, instanceName } from '@/config';
|
2020-10-17 14:12:00 +03:00
|
|
|
import * as os from '@/os';
|
2020-12-05 11:18:37 +02:00
|
|
|
import number from '@/filters/number';
|
2020-10-17 14:12:00 +03:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
MkButton,
|
2020-12-05 09:05:40 +02:00
|
|
|
XNote,
|
|
|
|
MkPagination,
|
2020-10-17 14:12:00 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
host: toUnicode(host),
|
2020-11-17 07:59:15 +02:00
|
|
|
instanceName,
|
|
|
|
meta: null,
|
2020-12-05 11:18:37 +02:00
|
|
|
stats: null,
|
|
|
|
tags: [],
|
|
|
|
clipPagination: {
|
2020-12-05 09:05:40 +02:00
|
|
|
endpoint: 'clips/notes',
|
|
|
|
limit: 10,
|
|
|
|
params: () => ({
|
|
|
|
clipId: this.meta.pinnedClipId,
|
|
|
|
})
|
|
|
|
},
|
2020-12-05 11:18:37 +02:00
|
|
|
featuredPagination: {
|
|
|
|
endpoint: 'notes/featured',
|
|
|
|
limit: 10,
|
|
|
|
offsetMode: true
|
|
|
|
},
|
2020-10-17 14:12:00 +03:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
2020-11-17 07:59:15 +02:00
|
|
|
os.api('meta', { detail: true }).then(meta => {
|
|
|
|
this.meta = meta;
|
|
|
|
});
|
|
|
|
|
2020-10-17 14:12:00 +03:00
|
|
|
os.api('stats').then(stats => {
|
|
|
|
this.stats = stats;
|
|
|
|
});
|
2020-12-05 11:18:37 +02:00
|
|
|
|
|
|
|
os.api('hashtags/list', {
|
|
|
|
sort: '+mentionedLocalUsers',
|
|
|
|
limit: 8
|
|
|
|
}).then(tags => {
|
|
|
|
this.tags = tags;
|
|
|
|
});
|
2020-10-17 14:12:00 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
signin() {
|
|
|
|
os.popup(XSigninDialog, {
|
|
|
|
autoSet: true
|
|
|
|
}, {}, 'closed');
|
|
|
|
},
|
|
|
|
|
|
|
|
signup() {
|
|
|
|
os.popup(XSignupDialog, {
|
|
|
|
autoSet: true
|
|
|
|
}, {}, 'closed');
|
2020-12-05 11:18:37 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
number
|
2020-10-17 14:12:00 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rsqzvsbo {
|
2020-11-17 07:59:15 +02:00
|
|
|
text-align: center;
|
|
|
|
|
2020-12-05 09:05:40 +02:00
|
|
|
> h2 {
|
|
|
|
display: inline-block;
|
|
|
|
color: #fff;
|
|
|
|
margin: 16px;
|
|
|
|
padding: 8px 12px;
|
|
|
|
background: rgba(0, 0, 0, 0.5);
|
|
|
|
}
|
2020-12-05 11:18:37 +02:00
|
|
|
|
|
|
|
> .overview {
|
|
|
|
> .stats, > .tags {
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: top;
|
|
|
|
width: 530px;
|
|
|
|
padding: 32px;
|
|
|
|
margin: 16px;
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
@media (max-width: 800px) {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
margin: 12px 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .stats {
|
|
|
|
background: var(--accent);
|
|
|
|
border-radius: 12px;
|
|
|
|
color: #fff;
|
|
|
|
font-size: 1.5em;
|
|
|
|
|
|
|
|
> div {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
> span:first-child {
|
|
|
|
opacity: 0.7;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
> span:last-child {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
> .tags {
|
|
|
|
background: var(--panel);
|
|
|
|
border-radius: 12px;
|
|
|
|
color: var(--fg);
|
|
|
|
font-size: 1.5em;
|
|
|
|
|
|
|
|
> .tag {
|
|
|
|
margin-right: 1em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-05 09:05:40 +02:00
|
|
|
}
|
2020-11-17 07:59:15 +02:00
|
|
|
|
2020-12-05 09:05:40 +02:00
|
|
|
.kmkqjgkl {
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: middle;
|
2020-12-05 11:18:37 +02:00
|
|
|
width: 530px;
|
2020-12-05 09:05:40 +02:00
|
|
|
margin: 16px;
|
2020-12-05 11:18:37 +02:00
|
|
|
box-sizing: border-box;
|
2020-12-05 09:05:40 +02:00
|
|
|
text-align: left;
|
2020-12-05 11:18:37 +02:00
|
|
|
box-shadow: 0 6px 46px rgb(0 0 0 / 25%);
|
2020-12-05 09:05:40 +02:00
|
|
|
border-radius: 12px;
|
2020-10-17 14:12:00 +03:00
|
|
|
|
2020-12-05 09:05:40 +02:00
|
|
|
@media (max-width: 800px) {
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
margin: 12px 0;
|
2020-10-17 14:12:00 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|