2023-07-27 07:31:52 +02:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-12-30 16:22:20 +01:00
|
|
|
<template>
|
2023-02-17 04:38:30 +01:00
|
|
|
<div :class="$style.root">
|
|
|
|
<div ref="scrollEl" :class="[$style.scrollbox, { [$style.scroll]: isScrolling }]">
|
|
|
|
<div v-for="note in notes" :key="note.id" :class="$style.note">
|
|
|
|
<div class="_panel" :class="$style.content">
|
2023-06-01 10:19:46 +02:00
|
|
|
<div>
|
2023-09-30 21:53:52 +02:00
|
|
|
<MkA v-if="note.replyId" class="reply" :to="`/notes/${note.replyId}`"><i class="ph-arrow-u-up-left ph-bold pg-lg"></i></MkA>
|
2023-04-01 06:52:07 +02:00
|
|
|
<Mfm v-if="note.text" :text="note.text" :author="note.user" :i="$i"/>
|
2021-11-19 11:36:12 +01:00
|
|
|
<MkA v-if="note.renoteId" class="rp" :to="`/notes/${note.renoteId}`">RN: ...</MkA>
|
2021-07-09 19:55:12 +02:00
|
|
|
</div>
|
2023-02-17 04:38:30 +01:00
|
|
|
<div v-if="note.files.length > 0" :class="$style.richcontent">
|
2023-05-19 09:20:53 +02:00
|
|
|
<MkMediaList :mediaList="note.files"/>
|
2021-07-09 19:55:12 +02:00
|
|
|
</div>
|
|
|
|
<div v-if="note.poll">
|
2023-05-19 09:20:53 +02:00
|
|
|
<MkPoll :note="note" :readOnly="true"/>
|
2021-07-09 19:55:12 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-01 06:52:07 +02:00
|
|
|
<MkReactionsViewer ref="reactionsViewer" :note="note"/>
|
2020-12-30 16:22:20 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
<script lang="ts" setup>
|
2023-09-04 06:33:38 +02:00
|
|
|
import * as Misskey from 'misskey-js';
|
2023-04-01 06:52:07 +02:00
|
|
|
import { onUpdated } from 'vue';
|
2022-12-30 05:56:22 +01:00
|
|
|
import MkReactionsViewer from '@/components/MkReactionsViewer.vue';
|
|
|
|
import MkMediaList from '@/components/MkMediaList.vue';
|
|
|
|
import MkPoll from '@/components/MkPoll.vue';
|
2023-09-19 09:37:43 +02:00
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { getScrollContainer } from '@/scripts/scroll.js';
|
|
|
|
import { $i } from '@/account.js';
|
2020-12-30 16:22:20 +01:00
|
|
|
|
2023-09-04 06:33:38 +02:00
|
|
|
let notes = $ref<Misskey.entities.Note[]>([]);
|
2023-02-17 04:38:30 +01:00
|
|
|
let isScrolling = $ref(false);
|
2023-04-23 01:13:12 +02:00
|
|
|
let scrollEl = $shallowRef<HTMLElement>();
|
2020-12-30 16:22:20 +01:00
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
os.apiGet('notes/featured').then(_notes => {
|
|
|
|
notes = _notes;
|
|
|
|
});
|
2021-07-09 19:55:12 +02:00
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
onUpdated(() => {
|
|
|
|
if (!scrollEl) return;
|
|
|
|
const container = getScrollContainer(scrollEl);
|
|
|
|
const containerHeight = container ? container.clientHeight : window.innerHeight;
|
|
|
|
if (scrollEl.offsetHeight > containerHeight) {
|
|
|
|
isScrolling = true;
|
|
|
|
}
|
2020-12-30 16:22:20 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
<style lang="scss" module>
|
2021-07-09 19:55:12 +02: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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
.root {
|
2020-12-30 16:22:20 +01:00
|
|
|
text-align: right;
|
2023-02-17 04:38:30 +01:00
|
|
|
}
|
2020-12-30 16:22:20 +01:00
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
.scrollbox {
|
|
|
|
&.scroll {
|
|
|
|
animation: scroll 45s linear infinite;
|
|
|
|
}
|
|
|
|
}
|
2021-07-09 19:55:12 +02:00
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
.note {
|
|
|
|
margin: 16px 0 16px auto;
|
|
|
|
}
|
2021-07-09 19:55:12 +02:00
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
.content {
|
|
|
|
padding: 16px;
|
|
|
|
margin: 0 0 0 auto;
|
|
|
|
max-width: max-content;
|
2023-10-31 19:26:03 +01:00
|
|
|
border-radius: 16px;
|
2023-02-17 04:38:30 +01:00
|
|
|
}
|
2020-12-30 16:22:20 +01:00
|
|
|
|
2023-02-17 04:38:30 +01:00
|
|
|
.richcontent {
|
|
|
|
min-width: 250px;
|
2020-12-30 16:22:20 +01:00
|
|
|
}
|
|
|
|
</style>
|