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