2020-12-30 15:22:20 +00:00
|
|
|
<template>
|
|
|
|
<div class="civpbkhh">
|
2021-07-09 17:55:12 +00:00
|
|
|
<div class="scrollbox" ref="scroll" v-bind:class="{ scroll: isScrolling }">
|
|
|
|
<div v-for="note in notes" class="note">
|
|
|
|
<div class="content _panel">
|
|
|
|
<div class="body">
|
|
|
|
<MkA class="reply" v-if="note.replyId" :to="`/notes/${note.replyId}`"><i class="fas fa-reply"></i></MkA>
|
|
|
|
<Mfm v-if="note.text" :text="note.text" :author="note.user" :i="$i" :custom-emojis="note.emojis"/>
|
|
|
|
<MkA class="rp" v-if="note.renoteId" :to="`/notes/${note.renoteId}`">RN: ...</MkA>
|
|
|
|
</div>
|
|
|
|
<div v-if="note.files.length > 0" class="richcontent">
|
|
|
|
<XMediaList :media-list="note.files"/>
|
|
|
|
</div>
|
|
|
|
<div v-if="note.poll">
|
|
|
|
<XPoll :note="note" :readOnly="true" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<XReactionsViewer :note="note" ref="reactionsViewer"/>
|
2020-12-30 15:22:20 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2021-03-23 08:30:14 +00:00
|
|
|
import XReactionsViewer from '@client/components/reactions-viewer.vue';
|
2021-07-09 17:55:12 +00:00
|
|
|
import XMediaList from '@client/components/media-list.vue';
|
|
|
|
import XPoll from '@client/components/poll.vue';
|
2021-03-23 08:30:14 +00:00
|
|
|
import * as os from '@client/os';
|
2020-12-30 15:22:20 +00:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
2021-07-09 17:55:12 +00:00
|
|
|
XReactionsViewer,
|
|
|
|
XMediaList,
|
|
|
|
XPoll
|
2020-12-30 15:22:20 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
notes: [],
|
2021-07-09 17:55:12 +00:00
|
|
|
isScrolling: false,
|
2020-12-30 15:22:20 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
created() {
|
|
|
|
os.api('notes/featured').then(notes => {
|
|
|
|
this.notes = notes;
|
|
|
|
});
|
2021-07-09 17:55:12 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
updated() {
|
|
|
|
if (this.$refs.scroll.clientHeight > window.innerHeight) {
|
|
|
|
this.isScrolling = true;
|
|
|
|
}
|
2020-12-30 15:22:20 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-07-09 17:55:12 +00:00
|
|
|
@keyframes scroll {
|
|
|
|
0% {
|
|
|
|
transform: translate3d(0, 0, 0);
|
|
|
|
}
|
|
|
|
5% {
|
|
|
|
transform: translate3d(0, 0, 0);
|
|
|
|
}
|
|
|
|
75% {
|
|
|
|
transform: translate3d(0, calc(-100% + 90vh), 0);
|
|
|
|
}
|
|
|
|
90% {
|
|
|
|
transform: translate3d(0, calc(-100% + 90vh), 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-30 15:22:20 +00:00
|
|
|
.civpbkhh {
|
|
|
|
text-align: right;
|
|
|
|
|
2021-07-09 17:55:12 +00:00
|
|
|
> .scrollbox {
|
|
|
|
&.scroll {
|
|
|
|
animation: scroll 45s linear infinite;
|
|
|
|
}
|
|
|
|
|
|
|
|
> .note {
|
|
|
|
margin: 16px 0 16px auto;
|
|
|
|
|
|
|
|
> .content {
|
|
|
|
padding: 16px;
|
|
|
|
margin: 0 0 0 auto;
|
|
|
|
max-width: max-content;
|
|
|
|
border-radius: 16px;
|
2020-12-30 15:22:20 +00:00
|
|
|
|
2021-07-09 17:55:12 +00:00
|
|
|
> .richcontent {
|
|
|
|
min-width: 250px;
|
|
|
|
}
|
|
|
|
}
|
2020-12-30 15:22:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|