hippofish/packages/client/src/components/MkNote.vue

1190 lines
27 KiB
Vue
Raw Normal View History

<template>
2023-05-22 17:23:00 +02:00
<div
v-if="!muted.muted"
2024-05-02 18:22:25 +02:00
v-show="!isDeleted && renotes?.length !== 0"
2024-03-31 21:21:55 +02:00
:id="appearNote.historyId || appearNote.id"
2023-05-22 17:23:00 +02:00
ref="el"
v-hotkey="keymap"
2023-06-13 06:04:36 +02:00
v-size="{ max: [500, 350] }"
2023-09-17 23:59:09 +02:00
v-vibrate="5"
2023-09-02 01:27:33 +02:00
:aria-label="accessibleLabel"
2023-05-22 17:23:00 +02:00
class="tkcbzcuz note-container"
2024-04-12 10:37:32 +02:00
:tabindex="!isDeleted ? '-1' : undefined"
2024-05-02 18:22:25 +02:00
:class="{ renote: isRenote || (renotesSliced && renotesSliced.length > 0) }"
2023-05-22 17:23:00 +02:00
>
<MkNoteSub
2024-05-02 18:22:25 +02:00
v-if="appearNote.reply && !detailedView && !collapsedReply && !parents"
2023-05-22 17:23:00 +02:00
:note="appearNote.reply"
class="reply-to"
/>
2024-05-02 18:22:25 +02:00
<MkNoteSub
v-else-if="!detailedView && !collapsedReply && parents"
v-for="n of parents"
:key="n.id"
:note="n"
class="reply-to"
/>
<div
v-if="!detailedView"
2023-06-22 23:04:57 +02:00
class="note-context"
:class="{
collapsedReply: collapsedReply && appearNote.reply,
2023-06-22 23:04:57 +02:00
}"
2023-09-02 01:27:33 +02:00
@click="noteClick"
2023-06-22 23:04:57 +02:00
>
2024-02-15 15:15:59 +01:00
<div v-if="!collapsedReply" class="line"></div>
2023-04-08 02:01:42 +02:00
<div v-if="appearNote._prId_" class="info">
<i :class="icon('ph-megaphone-simple-bold')"></i>
2023-04-08 02:01:42 +02:00
{{ i18n.ts.promotion
}}<button class="_textButton hide" @click.stop="readPromo()">
{{ i18n.ts.hideThisNote }}
<i :class="icon('ph-x')"></i>
2023-01-21 20:36:05 +01:00
</button>
</div>
2023-04-08 02:01:42 +02:00
<div v-if="appearNote._featuredId_" class="info">
<i :class="icon('ph-lightning')"></i>
2023-04-08 02:01:42 +02:00
{{ i18n.ts.featured }}
2023-01-05 17:08:23 +01:00
</div>
2023-04-08 02:01:42 +02:00
<div v-if="pinned" class="info">
<i :class="icon('ph-push-pin')"></i>{{ i18n.ts.pinnedNote }}
2023-04-08 02:01:42 +02:00
</div>
2024-05-02 18:22:25 +02:00
<div v-if="collapsedReply && appearNote.reply" class="info">
<MkAvatar class="avatar" :user="appearNote.reply.user" />
<MkUserName
class="username"
:user="appearNote.reply.user"
></MkUserName>
<Mfm
class="summary"
:text="getNoteSummary(appearNote.reply)"
:plain="true"
:nowrap="true"
:lang="appearNote.reply.lang"
:custom-emojis="note.emojis"
/>
</div>
<div v-if="isRenote || (renotesSliced && renotesSliced.length > 0)" class="renote">
<i :class="icon('ph-rocket-launch')"></i>
2024-05-02 18:22:25 +02:00
<I18n
v-if="renotesSliced == null"
:src="i18n.ts.renotedBy"
tag="span"
>
2023-04-08 02:01:42 +02:00
<template #user>
2024-05-02 18:22:25 +02:00
<MkAvatar class="avatar" :user="note.user" />
2023-05-22 17:23:00 +02:00
<MkA
v-user-preview="note.userId"
class="name"
:to="userPage(note.user)"
@click.stop
>
2023-04-08 02:01:42 +02:00
<MkUserName :user="note.user" />
</MkA>
</template>
</I18n>
2024-05-02 18:22:25 +02:00
<I18n
v-else
:src="i18n.ts.renotedBy"
tag="span"
>
<template #user>
<template
v-for="(renote, index) in renotesSliced"
>
<MkAvatar
class="avatar"
:user="renote.user"
/>
<MkA
v-user-preview="renote.userId"
class="name"
:to="userPage(renote.user)"
@click.stop
>
<MkUserName :user="renote.user" />
</MkA>
{{
index !== renotesSliced.length - 1
? ", "
: renotesSliced.length < renotes!.length
? "..."
: ""
}}
</template>
</template>
</I18n>
2023-04-08 02:01:42 +02:00
<div class="info">
2023-05-22 17:23:00 +02:00
<button
ref="renoteTime"
class="_button time"
@click.stop="showRenoteMenu()"
>
<i
2024-05-02 18:22:25 +02:00
v-if="isMyNote"
:class="icon('ph-dots-three-outline dropdownIcon')"
2023-05-22 17:23:00 +02:00
></i>
2023-04-08 02:01:42 +02:00
<MkTime :time="note.createdAt" />
</button>
<MkVisibility :note="note" />
</div>
2023-01-05 17:08:23 +01:00
</div>
2023-04-08 02:01:42 +02:00
</div>
2023-05-22 17:23:00 +02:00
<article
class="article"
2023-06-02 23:53:28 +02:00
:style="{
cursor: expandOnNoteClick && !detailedView ? 'pointer' : '',
}"
2024-03-31 21:21:55 +02:00
:class="{
history: appearNote.historyId,
}"
2023-09-02 01:27:33 +02:00
@contextmenu.stop="onContextmenu"
@click="noteClick"
2023-05-22 17:23:00 +02:00
>
2023-04-08 02:01:42 +02:00
<div class="main">
<div class="header-container">
<MkAvatar class="avatar" :user="appearNote.user" />
2023-09-22 05:21:15 +02:00
<XNoteHeader
class="header"
:note="appearNote"
:can-open-server-info="true"
/>
2023-04-08 02:01:42 +02:00
</div>
<div class="body">
2023-05-22 17:23:00 +02:00
<MkSubNoteContent
class="text"
:note="appearNote"
:detailed="true"
2023-09-02 01:27:33 +02:00
:detailed-view="detailedView"
2024-04-12 10:37:32 +02:00
:parent-id="appearNote.id"
:is-long-judger="isLongJudger"
2023-05-22 17:23:00 +02:00
@push="(e) => router.push(notePage(e))"
2024-04-12 10:37:32 +02:00
@focusfooter="footerEl!.focus()"
2023-05-22 17:23:00 +02:00
@expanded="(e) => setPostExpanded(e)"
></MkSubNoteContent>
2023-04-23 02:22:53 +02:00
<div v-if="translating || translation" class="translation">
<MkLoading v-if="translating" mini />
2023-09-03 23:29:18 +02:00
<div v-else-if="translation != null" class="translated">
2023-05-22 17:23:00 +02:00
<b
>{{
i18n.t("translatedFrom", {
x: translation.sourceLang,
})
}}:
</b>
2023-05-22 17:23:00 +02:00
<Mfm
:text="translation.text"
:author="appearNote.user"
2024-03-07 03:06:45 +01:00
:i="me"
:lang="targetLang"
2023-05-22 17:23:00 +02:00
:custom-emojis="appearNote.emojis"
/>
</div>
</div>
2023-05-19 19:02:41 +02:00
</div>
2023-07-06 03:28:27 +02:00
<div
v-if="detailedView || (appearNote.channel && !inChannel)"
class="info"
>
<MkA
v-if="detailedView"
class="created-at"
:to="notePage(appearNote)"
>
2023-05-19 19:02:41 +02:00
<MkTime :time="appearNote.createdAt" mode="absolute" />
</MkA>
2023-04-08 02:01:42 +02:00
<MkA
v-if="appearNote.channel && !inChannel"
class="channel"
:to="`/channels/${appearNote.channel.id}`"
@click.stop
><i :class="icon('ph-television', false)"></i>
2023-04-08 02:01:42 +02:00
{{ appearNote.channel.name }}</MkA
>
</div>
2024-03-26 09:59:42 +01:00
<footer
2024-03-31 21:24:30 +02:00
v-show="!hideFooter"
2024-03-26 09:59:42 +01:00
ref="footerEl"
class="footer"
tabindex="-1"
>
2023-04-08 02:01:42 +02:00
<XReactionsViewer
2024-04-25 03:32:59 +02:00
v-if="enableEmojiReactions && !hideEmojiViewer"
2023-04-08 02:01:42 +02:00
ref="reactionsViewer"
:note="appearNote"
/>
<button
v-tooltip.noDelay.bottom="i18n.ts.reply"
class="button _button"
@click.stop="reply()"
2023-04-08 02:01:42 +02:00
>
<i :class="icon('ph-arrow-u-up-left')"></i>
2023-05-20 00:41:59 +02:00
<template
v-if="appearNote.repliesCount > 0 && !detailedView"
>
2023-04-08 02:01:42 +02:00
<p class="count">{{ appearNote.repliesCount }}</p>
</template>
2020-12-30 01:58:57 +01:00
</button>
2023-04-08 02:01:42 +02:00
<XRenoteButton
ref="renoteButton"
class="button"
:note="appearNote"
:count="appearNote.renoteCount"
2023-09-02 01:27:33 +02:00
:detailed-view="detailedView"
2023-04-08 02:01:42 +02:00
/>
<XStarButtonNoEmoji
v-if="!enableEmojiReactions"
class="button"
:note="appearNote"
2024-04-25 03:32:59 +02:00
:count="reactionCount"
:reacted="appearNote.myReaction != null"
/>
2023-04-08 02:01:42 +02:00
<XStarButton
v-if="
enableEmojiReactions &&
appearNote.myReaction == null
"
2023-04-08 02:01:42 +02:00
ref="starButton"
class="button"
:note="appearNote"
/>
<button
v-if="
enableEmojiReactions &&
appearNote.myReaction == null
"
2023-04-08 02:01:42 +02:00
ref="reactButton"
v-tooltip.noDelay.bottom="i18n.ts.reaction"
class="button _button"
@click.stop="react()"
2023-04-08 02:01:42 +02:00
>
<i :class="icon('ph-smiley')"></i>
2024-04-29 04:56:31 +02:00
<p v-if="reactionCount > 0 && hideEmojiViewer" class="count">{{reactionCount}}</p>
</button>
2023-04-08 02:01:42 +02:00
<button
v-if="
enableEmojiReactions &&
appearNote.myReaction != null
"
2023-04-08 02:01:42 +02:00
ref="reactButton"
2023-09-02 01:27:33 +02:00
v-tooltip.noDelay.bottom="i18n.ts.removeReaction"
2023-04-08 02:01:42 +02:00
class="button _button reacted"
@click.stop="undoReact(appearNote)"
2023-04-08 02:01:42 +02:00
>
<i :class="icon('ph-minus')"></i>
2024-04-29 04:56:31 +02:00
<p v-if="reactionCount > 0 && hideEmojiViewer" class="count">{{reactionCount}}</p>
2023-04-08 02:01:42 +02:00
</button>
<XQuoteButton class="button" :note="appearNote" />
<button
v-if="
2024-04-22 04:32:41 +02:00
isSignedIn(me) &&
isForeignLanguage &&
translation == null
"
2023-09-17 23:59:09 +02:00
v-tooltip.noDelay.bottom="i18n.ts.translate"
class="button _button"
@click.stop="translate"
>
<i :class="icon('ph-translate')"></i>
</button>
2023-04-08 02:01:42 +02:00
<button
ref="menuButton"
v-tooltip.noDelay.bottom="i18n.ts.more"
class="button _button"
@click.stop="menu()"
2023-04-08 02:01:42 +02:00
>
<i :class="icon('ph-dots-three-outline')"></i>
2023-04-08 02:01:42 +02:00
</button>
</footer>
</div>
2023-04-08 02:01:42 +02:00
</article>
</div>
2023-07-01 08:35:45 +02:00
<button
v-else
class="muted _button"
@click="muted.muted = false"
@contextmenu.stop.prevent
>
2023-05-04 07:13:13 +02:00
<I18n :src="softMuteReasonI18nSrc(muted.what)" tag="small">
2023-04-08 02:01:42 +02:00
<template #name>
<MkA
2023-05-05 03:38:56 +02:00
v-user-preview="note.userId"
2023-04-08 02:01:42 +02:00
class="name"
2023-05-05 03:38:56 +02:00
:to="userPage(note.user)"
2023-04-08 02:01:42 +02:00
>
2023-05-05 03:38:56 +02:00
<MkUserName :user="note.user" />
2023-04-08 02:01:42 +02:00
</MkA>
</template>
<template #reason>
<b class="_blur_text">{{ muted.matched.join(", ") }}</b>
</template>
</I18n>
2023-05-10 23:44:08 +02:00
</button>
</template>
<script lang="ts" setup>
2024-05-02 18:22:25 +02:00
import { computed, inject, onMounted, ref, watch } from "vue";
2023-04-08 02:01:42 +02:00
import type { Ref } from "vue";
import type { entities } from "firefish-js";
import MkSubNoteContent from "./MkSubNoteContent.vue";
2023-09-02 01:27:33 +02:00
import MkNoteSub from "@/components/MkNoteSub.vue";
2023-04-08 02:01:42 +02:00
import XNoteHeader from "@/components/MkNoteHeader.vue";
import XRenoteButton from "@/components/MkRenoteButton.vue";
import XReactionsViewer from "@/components/MkReactionsViewer.vue";
import XStarButton from "@/components/MkStarButton.vue";
import XStarButtonNoEmoji from "@/components/MkStarButtonNoEmoji.vue";
2023-04-08 02:01:42 +02:00
import XQuoteButton from "@/components/MkQuoteButton.vue";
import MkVisibility from "@/components/MkVisibility.vue";
import copyToClipboard from "@/scripts/copy-to-clipboard";
import { detectLanguage } from "@/scripts/language-utils";
import { url } from "@/config";
2023-04-08 02:01:42 +02:00
import { pleaseLogin } from "@/scripts/please-login";
2023-09-02 01:27:33 +02:00
import { focusNext, focusPrev } from "@/scripts/focus";
import { getWordSoftMute } from "@/scripts/check-word-mute";
2023-04-08 02:01:42 +02:00
import { useRouter } from "@/router";
import { userPage } from "@/filters/user";
import * as os from "@/os";
import { defaultStore, noteViewInterruptors } from "@/store";
import { reactionPicker } from "@/scripts/reaction-picker";
2024-03-16 16:49:12 +01:00
import { isSignedIn, me } from "@/me";
2023-04-08 02:01:42 +02:00
import { i18n } from "@/i18n";
import { getNoteMenu } from "@/scripts/get-note-menu";
import { useNoteCapture } from "@/scripts/use-note-capture";
import { notePage } from "@/filters/note";
import { deepClone } from "@/scripts/clone";
import { getNoteSummary } from "@/scripts/get-note-summary";
import icon from "@/scripts/icon";
2024-05-02 18:22:25 +02:00
import type { NoteTranslation, NoteType } from "@/types/note";
import { isRenote as _isRenote, isDeleted as _isDeleted } from "@/scripts/note";
2024-04-12 10:37:32 +02:00
const props = defineProps<{
2024-04-12 10:37:32 +02:00
note: NoteType;
2024-05-02 18:22:25 +02:00
parents?: NoteType[];
renotes?: entities.Note[];
pinned?: boolean;
detailedView?: boolean;
collapsedReply?: boolean;
2024-03-26 09:59:42 +01:00
hideFooter?: boolean;
2024-04-25 03:32:59 +02:00
hideEmojiViewer?: boolean;
isLongJudger?: (note: entities.Note) => boolean;
}>();
2024-05-02 18:22:25 +02:00
//#region Constants
const router = useRouter();
2023-04-08 02:01:42 +02:00
const inChannel = inject("inChannel", null);
2024-05-02 18:22:25 +02:00
const keymap = {
r: () => reply(true),
"e|a|plus": () => react(true),
q: () => renoteButton.value!.renote(true),
"up|k": focusBefore,
"down|j": focusAfter,
esc: blur,
"m|o": () => menu(true),
// FIXME: What's this?
// s: () => showContent.value !== showContent.value,
2023-05-04 07:41:18 +02:00
};
2024-04-12 10:37:32 +02:00
const el = ref<HTMLElement | null>(null);
2023-04-30 22:27:27 +02:00
const footerEl = ref<HTMLElement>();
const menuButton = ref<HTMLElement>();
2022-10-26 05:20:41 +02:00
const starButton = ref<InstanceType<typeof XStarButton>>();
2024-04-12 10:37:32 +02:00
const renoteButton = ref<InstanceType<typeof XRenoteButton> | null>(null);
const renoteTime = ref<HTMLElement>();
2024-04-12 10:37:32 +02:00
const reactButton = ref<HTMLElement | null>(null);
2024-05-02 18:22:25 +02:00
const enableEmojiReactions = defaultStore.reactiveState.enableEmojiReactions;
const expandOnNoteClick = defaultStore.reactiveState.expandOnNoteClick;
const lang = localStorage.getItem("lang");
const translateLang = localStorage.getItem("translateLang");
const targetLang = (translateLang || lang || navigator.language)?.slice(0, 2);
const currentClipPage = inject<Ref<entities.Clip> | null>(
"currentClipPage",
null,
2023-04-08 02:01:42 +02:00
);
2024-05-02 18:22:25 +02:00
//#endregion
//#region Variables bound to Notes
let capture: ReturnType<typeof useNoteCapture> | undefined;
const note = ref(deepClone(props.note));
const postIsExpanded = ref(false);
const translation = ref<NoteTranslation | null>(null);
const translating = ref(false);
const isDeleted = ref(false);
2024-05-02 18:22:25 +02:00
const renotes = ref(props.renotes?.filter((rn) => !_isDeleted(rn.id)));
//#endregion
//#region computed
const renotesSliced = computed(() => renotes.value?.slice(0, 5));
const isRenote = computed(() => _isRenote(note.value));
const appearNote = computed(() =>
isRenote.value ? (note.value.renote as NoteType) : note.value,
);
const isMyNote = computed(
() => isSignedIn(me) && me.id === note.value.userId && props.renotes == null,
);
const muted = computed(() =>
getWordSoftMute(
note.value,
2024-03-07 03:06:45 +01:00
me?.id,
2024-05-02 18:22:25 +02:00
defaultStore.reactiveState.mutedWords.value,
defaultStore.reactiveState.mutedLangs.value,
),
);
2024-05-02 18:22:25 +02:00
const isForeignLanguage = computed(
() =>
defaultStore.state.detectPostLanguage &&
appearNote.value.text != null &&
(() => {
const postLang = detectLanguage(appearNote.value.text);
return postLang !== "" && postLang !== targetLang;
})(),
);
2024-04-25 03:32:59 +02:00
const reactionCount = computed(() =>
Object.values(appearNote.value.reactions).reduce(
(partialSum, val) => partialSum + val,
0,
),
);
2024-05-02 18:22:25 +02:00
const accessibleLabel = computed(() => {
let label = `${appearNote.value.user.username}; `;
if (appearNote.value.renote) {
label += `${i18n.ts.renoted} ${appearNote.value.renote.user.username}; `;
if (appearNote.value.renote.cw) {
label += `${i18n.ts.cw}: ${appearNote.value.renote.cw}; `;
if (postIsExpanded.value) {
label += `${appearNote.value.renote.text}; `;
}
} else {
label += `${appearNote.value.renote.text}; `;
}
} else {
if (appearNote.value.cw) {
label += `${i18n.ts.cw}: ${appearNote.value.cw}; `;
if (postIsExpanded.value) {
label += `${appearNote.value.text}; `;
}
} else {
label += `${appearNote.value.text}; `;
}
}
const date = new Date(appearNote.value.createdAt);
label += `${date.toLocaleTimeString()}`;
return label;
});
//#endregion
async function pluginInit(newNote: NoteType) {
// plugin
if (noteViewInterruptors.length > 0) {
let result = deepClone(newNote);
for (const interruptor of noteViewInterruptors) {
result = await interruptor.handler(result);
}
note.value = result;
}
}
function recalculateRenotes() {
renotes.value = props.renotes?.filter((rn) => !_isDeleted(rn.id));
}
async function init(newNote: NoteType, first = false) {
if (!first) {
// plugin
if (noteViewInterruptors.length > 0) {
await pluginInit(newNote);
} else {
note.value = deepClone(newNote);
}
}
translation.value = null;
translating.value = false;
postIsExpanded.value = false;
isDeleted.value = _isDeleted(note.value.id);
if (appearNote.value.historyId == null) {
capture?.close();
capture = useNoteCapture({
rootEl: el,
note: appearNote,
isDeletedRef: isDeleted,
});
if (isRenote.value === true) {
useNoteCapture({
rootEl: el,
note,
isDeletedRef: isDeleted,
});
}
if (props.renotes) {
const renoteDeletedTrigger = ref(false);
for (const renote of props.renotes) {
useNoteCapture({
rootEl: el,
note: ref(renote),
isDeletedRef: renoteDeletedTrigger,
});
}
watch(renoteDeletedTrigger, recalculateRenotes);
}
}
}
init(props.note, true);
onMounted(() => {
pluginInit(note.value);
});
watch(isDeleted, () => {
if (isDeleted.value === true) {
if (props.parents && props.parents.length > 0) {
let noteTakePlace: NoteType | null = null;
while (noteTakePlace == null || _isDeleted(noteTakePlace.id)) {
if (props.parents.length === 0) {
return;
}
noteTakePlace = props.parents[props.parents.length - 1];
props.parents.pop();
}
noteTakePlace.repliesCount -= 1;
init(noteTakePlace);
isDeleted.value = false;
}
}
});
watch(
() => props.note.id,
(o, n) => {
if (o !== n && _isDeleted(note.value.id) !== true) {
init(props.note);
}
},
);
watch(() => props.renotes?.length, recalculateRenotes);
2024-04-25 03:32:59 +02:00
2024-04-12 10:37:32 +02:00
async function translate_(noteId: string, targetLang: string) {
return await os.api("notes/translate", {
2023-09-17 23:59:09 +02:00
noteId,
targetLang,
});
}
async function translate() {
if (translation.value != null) return;
translating.value = true;
translation.value = await translate_(
appearNote.value.id,
translateLang || lang || navigator.language,
);
// use UI language as the second translation language
if (
translateLang != null &&
lang != null &&
translateLang !== lang &&
(!translation.value ||
2024-03-28 17:26:52 +01:00
translation.value.sourceLang.toLowerCase() === translateLang.slice(0, 2))
)
translation.value = await translate_(appearNote.value.id, lang);
translating.value = false;
}
2024-05-02 18:22:25 +02:00
function softMuteReasonI18nSrc(what?: string) {
if (what === "note") return i18n.ts.userSaysSomethingReason;
if (what === "reply") return i18n.ts.userSaysSomethingReasonReply;
if (what === "renote") return i18n.ts.userSaysSomethingReasonRenote;
if (what === "quote") return i18n.ts.userSaysSomethingReasonQuote;
2024-05-02 18:22:25 +02:00
// I don't think here is reachable, but just in case
return i18n.ts.userSaysSomething;
2024-03-31 21:21:55 +02:00
}
Migrate to Vue3 (#6587) * Update reaction.vue * fix bug * wip * wip * wjio * wip * Revert "wip" This reverts commit e427f2160adf4e8a4147006e25a89854edab0033. * wip * wip * wip * Update init.ts * Update drive-window.vue * wip * wip * Use PascalCase for components * Use PascalCase for components * update dep * wip * wip * wip * Update init.ts * wip * Update paging.ts * Update test.vue * watch deep * wip * lint * wip * wip * wip * wip * wiop * wip * Update webpack.config.ts * alllow null poll * wip * wip * wip * wiop * UI redesign & refactor (#6714) * wip * wip * wip * wip * wip * Update drive.vue * Update word-mute.vue * wip * wip * wip * clean up * wip * Update default.vue * wip * Update notes.vue * Update mfm.ts * Update index.home.vue * Update post-form.vue * Update post-form-attaches.vue * wip * Update post-form.vue * Update sidebar.vue * wip * wip * Update index.vue * wip * Update default.vue * Update index.vue * Update index.vue * wip * Update post-form-attaches.vue * Update note.vue * wip * clean up * Update notes.vue * wip * wip * Update ja-JP.yml * wip * wip * Update index.vue * wip * wip * wip * wip * wip * wip * wip * wip * Update default.vue * wip * Update _dark.json5 * wip * wip * wip * clean up * wip * wip * Update index.vue * Update test.vue * wip * wip * fix * wip * wip * wip * wip * clena yop * wip * wip * Update store.ts * Update messaging-room.vue * Update default.widgets.vue * fix * wip * wip * Update modal.vue * wip * Update os.ts * Update os.ts * Update deck.vue * Update init.ts * wip * Update ja-JP.yml * v-sizeは単にwindowのresizeを監視するだけで良いかもしれない * Update modal.vue * wip * Update tooltip.ts * wip * wip * wip * wip * wip * Update image-viewer.vue * wip * wip * Update style.scss * Update style.scss * Update visitor.vue * wip * Update init.ts * Update init.ts * wip * wip * Update visitor.vue * Update visitor.vue * Update visitor.vue * Update visitor.vue * wip * wip * Update modal.vue * Update header.vue * Update menu.vue * Update about.vue * Update about-misskey.vue * wip * wip * Update visitor.vue * Update tooltip.ts * wip * Update drive.vue * wip * Update style.scss * Update header.vue * wip * wip * Update users.user.vue * Update announcements.vue * wip * wip * wip * Update emojis.vue * wip * Update emojis.vue * Update style.scss * Update users.vue * wip * Update style.scss * wip * Update welcome.entrance.vue * Update radio.vue * Update size.ts * Update emoji-edit-dialog.vue * wip * Update emojis.vue * wip * Update emojis.vue * Update emojis.vue * Update emojis.vue * wip * wip * wip * wip * Update file-dialog.vue * wip * wip * Update token-generate-window.vue * Update notification-setting-window.vue * wip * wip * Update _error_.vue * Update ja-JP.yml * wip * wip * Update store.ts * Update emojis.vue * Update emojis.vue * Update emojis.vue * Update announcements.vue * Update store.ts * wip * Update page-editor.vue * wip * wip * Update modal.vue * wip * Update select-file.ts * Update timeline.vue * Update emojis.vue * Update os.ts * wip * Update user-select.vue * Update mfm.ts * Update get-file-info.ts * Update drive.vue * Update init.ts * Update mfm.ts * wip * wip * Update window.vue * Update note.vue * wip * wip * Update user-info.vue * wip * wip * wip * wip * wip * Update header.vue * Update header.vue * wip * Update explore.vue * wip * wip * wip * Update webpack.config.ts * wip * wip * wip * wip * wip * wip * Update autocomplete.ts * wip * wip * wip * Update toast.vue * wip * Update post-form-dialog.vue * wip * wip * wip * wip * wip * Update users.vue * wip * Update explore.vue * wip * wip * wip * Update package.json * wip * Update icon-dialog.vue * wip * wip * Update user-preview.ts * wip * wip * wip * wip * wip * Update instance.vue * Update user-name.vue * Update federation.vue * Update instance.vue * wip * wip * Update tag.vue * wip * wip * wip * wip * wip * Update instance.vue * wip * Update os.ts * Update os.ts * wip * wip * wip * Update router.ts * wip * Update init.ts * Update note.vue * Update messages.vue * wip * wip * wip * wip * wip * google * wip * wip * wip * wip * Update theme-editor.vue * wip * wip * Update room.vue * Update channel-editor.vue * wip * Update window.vue * Update window.vue * wip * Update window.vue * Update window.vue * wip * Update menu.vue * wip * wip * wip * wip * Update messaging-room.vue * wip * Update post-form.vue * Update default.widgets.vue * Update window.vue * wip
2020-10-17 13:12:00 +02:00
2024-04-12 10:37:32 +02:00
function reply(_viaKeyboard = false): void {
pleaseLogin();
2023-04-08 02:01:42 +02:00
os.post(
{
reply: appearNote.value,
2024-04-12 10:37:32 +02:00
// animation: !viaKeyboard,
2023-04-08 02:01:42 +02:00
},
() => {
focus();
2023-07-06 03:28:27 +02:00
},
2023-04-08 02:01:42 +02:00
);
}
2024-04-12 10:37:32 +02:00
function react(_viaKeyboard = false): void {
pleaseLogin();
blur();
2023-04-08 02:01:42 +02:00
reactionPicker.show(
2024-04-12 10:37:32 +02:00
reactButton.value!,
2023-04-08 02:01:42 +02:00
(reaction) => {
os.api("notes/reactions/create", {
noteId: appearNote.value.id,
2023-09-02 01:27:33 +02:00
reaction,
2023-04-08 02:01:42 +02:00
});
},
() => {
focus();
2023-07-06 03:28:27 +02:00
},
2023-04-08 02:01:42 +02:00
);
}
2024-04-12 10:37:32 +02:00
function undoReact(note: NoteType): void {
const oldReaction = note.myReaction;
if (!oldReaction) return;
2023-04-08 02:01:42 +02:00
os.api("notes/reactions/delete", {
2022-06-05 05:26:36 +02:00
noteId: note.id,
});
}
2022-01-18 13:35:57 +01:00
function onContextmenu(ev: MouseEvent): void {
2024-04-12 10:37:32 +02:00
const isLink = (el: HTMLElement): boolean => {
2023-04-08 02:01:42 +02:00
if (el.tagName === "A") return true;
// The Audio element's context menu is the browser default, such as for selecting playback speed.
2023-06-03 05:06:04 +02:00
if (el.tagName === "AUDIO") return true;
if (el.parentElement) {
return isLink(el.parentElement);
}
2024-04-12 10:37:32 +02:00
return false;
};
2024-04-12 10:37:32 +02:00
if (isLink(ev.target as HTMLElement)) return;
if (window.getSelection()?.toString() !== "") return;
if (defaultStore.state.useReactionPickerForContextMenu) {
2022-01-18 13:35:57 +01:00
ev.preventDefault();
react();
} else {
2023-04-08 02:01:42 +02:00
os.contextMenu(
[
{
type: "label",
text: notePage(appearNote.value),
},
{
icon: `${icon("ph-browser")}`,
text: i18n.ts.openInWindow,
action: () => {
os.pageWindow(notePage(appearNote.value));
},
},
2024-04-12 10:37:32 +02:00
notePage(appearNote.value) !== location.pathname
2023-05-26 04:47:10 +02:00
? {
icon: `${icon("ph-arrows-out-simple")}`,
2023-05-26 04:47:10 +02:00
text: i18n.ts.showInPage,
action: () => {
2024-03-28 17:26:52 +01:00
router.push(notePage(appearNote.value), "forcePage");
2023-05-26 04:47:10 +02:00
},
2024-02-11 18:50:57 +01:00
}
2023-05-26 04:47:10 +02:00
: undefined,
null,
{
type: "a",
icon: `${icon("ph-arrow-square-out")}`,
text: i18n.ts.openInNewTab,
href: notePage(appearNote.value),
target: "_blank",
},
{
icon: `${icon("ph-link-simple")}`,
text: i18n.ts.copyLink,
action: () => {
copyToClipboard(`${url}${notePage(appearNote.value)}`);
os.success();
},
},
appearNote.value.user.host != null
2023-05-26 04:47:10 +02:00
? {
type: "a",
icon: `${icon("ph-arrow-square-up-right")}`,
2023-05-26 04:47:10 +02:00
text: i18n.ts.showOnRemote,
2024-03-28 17:26:52 +01:00
href: appearNote.value.url ?? appearNote.value.uri ?? "",
2023-05-26 04:47:10 +02:00
target: "_blank",
2024-02-11 18:50:57 +01:00
}
2023-05-26 04:47:10 +02:00
: undefined,
],
2023-07-06 03:28:27 +02:00
ev,
);
}
}
function menu(viaKeyboard = false): void {
2023-04-08 02:01:42 +02:00
os.popupMenu(
getNoteMenu({
note: note.value,
2023-04-08 02:01:42 +02:00
translating,
translation,
menuButton,
isDeleted,
currentClipPage,
}),
menuButton.value,
{
viaKeyboard,
2023-07-06 03:28:27 +02:00
},
2023-04-08 02:01:42 +02:00
).then(focus);
}
function showRenoteMenu(viaKeyboard = false): void {
2024-05-02 18:22:25 +02:00
if (!isMyNote.value) return;
2023-04-08 02:01:42 +02:00
os.popupMenu(
[
{
text: i18n.ts.unrenote,
icon: `${icon("ph-trash")}`,
2023-04-08 02:01:42 +02:00
danger: true,
action: () => {
os.api("notes/delete", {
noteId: note.value.id,
2023-04-08 02:01:42 +02:00
});
isDeleted.value = true;
},
},
],
renoteTime.value,
{
2023-09-02 01:27:33 +02:00
viaKeyboard,
2023-07-06 03:28:27 +02:00
},
2023-04-08 02:01:42 +02:00
);
}
function focus() {
2024-04-12 10:37:32 +02:00
el.value!.focus();
}
function blur() {
2024-04-12 10:37:32 +02:00
el.value!.blur();
}
function focusBefore() {
focusPrev(el.value);
}
function focusAfter() {
focusNext(el.value);
}
2023-05-19 19:02:41 +02:00
function scrollIntoView() {
2024-04-12 10:37:32 +02:00
el.value!.scrollIntoView();
2023-05-19 19:02:41 +02:00
}
function noteClick(e) {
2023-06-02 23:53:28 +02:00
if (
2024-04-12 10:37:32 +02:00
document.getSelection()?.type === "Range" ||
2023-06-02 23:53:28 +02:00
props.detailedView ||
!expandOnNoteClick
) {
e.stopPropagation();
} else {
router.push(notePage(appearNote.value));
}
}
function readPromo() {
2023-04-08 02:01:42 +02:00
os.api("promo/read", {
noteId: appearNote.value.id,
});
isDeleted.value = true;
}
2023-05-19 19:02:41 +02:00
2023-05-22 12:18:17 +02:00
function setPostExpanded(val: boolean) {
postIsExpanded.value = val;
2023-05-22 12:18:17 +02:00
}
2023-05-19 19:02:41 +02:00
defineExpose({
focus,
blur,
scrollIntoView,
});
</script>
<style lang="scss" scoped>
2021-02-15 09:17:19 +01:00
.tkcbzcuz {
position: relative;
transition: box-shadow 0.1s ease;
2021-11-28 12:07:37 +01:00
font-size: 1.05em;
2022-07-13 14:41:06 +02:00
overflow: clip;
Migrate to Vue3 (#6587) * Update reaction.vue * fix bug * wip * wip * wjio * wip * Revert "wip" This reverts commit e427f2160adf4e8a4147006e25a89854edab0033. * wip * wip * wip * Update init.ts * Update drive-window.vue * wip * wip * Use PascalCase for components * Use PascalCase for components * update dep * wip * wip * wip * Update init.ts * wip * Update paging.ts * Update test.vue * watch deep * wip * lint * wip * wip * wip * wip * wiop * wip * Update webpack.config.ts * alllow null poll * wip * wip * wip * wiop * UI redesign & refactor (#6714) * wip * wip * wip * wip * wip * Update drive.vue * Update word-mute.vue * wip * wip * wip * clean up * wip * Update default.vue * wip * Update notes.vue * Update mfm.ts * Update index.home.vue * Update post-form.vue * Update post-form-attaches.vue * wip * Update post-form.vue * Update sidebar.vue * wip * wip * Update index.vue * wip * Update default.vue * Update index.vue * Update index.vue * wip * Update post-form-attaches.vue * Update note.vue * wip * clean up * Update notes.vue * wip * wip * Update ja-JP.yml * wip * wip * Update index.vue * wip * wip * wip * wip * wip * wip * wip * wip * Update default.vue * wip * Update _dark.json5 * wip * wip * wip * clean up * wip * wip * Update index.vue * Update test.vue * wip * wip * fix * wip * wip * wip * wip * clena yop * wip * wip * Update store.ts * Update messaging-room.vue * Update default.widgets.vue * fix * wip * wip * Update modal.vue * wip * Update os.ts * Update os.ts * Update deck.vue * Update init.ts * wip * Update ja-JP.yml * v-sizeは単にwindowのresizeを監視するだけで良いかもしれない * Update modal.vue * wip * Update tooltip.ts * wip * wip * wip * wip * wip * Update image-viewer.vue * wip * wip * Update style.scss * Update style.scss * Update visitor.vue * wip * Update init.ts * Update init.ts * wip * wip * Update visitor.vue * Update visitor.vue * Update visitor.vue * Update visitor.vue * wip * wip * Update modal.vue * Update header.vue * Update menu.vue * Update about.vue * Update about-misskey.vue * wip * wip * Update visitor.vue * Update tooltip.ts * wip * Update drive.vue * wip * Update style.scss * Update header.vue * wip * wip * Update users.user.vue * Update announcements.vue * wip * wip * wip * Update emojis.vue * wip * Update emojis.vue * Update style.scss * Update users.vue * wip * Update style.scss * wip * Update welcome.entrance.vue * Update radio.vue * Update size.ts * Update emoji-edit-dialog.vue * wip * Update emojis.vue * wip * Update emojis.vue * Update emojis.vue * Update emojis.vue * wip * wip * wip * wip * Update file-dialog.vue * wip * wip * Update token-generate-window.vue * Update notification-setting-window.vue * wip * wip * Update _error_.vue * Update ja-JP.yml * wip * wip * Update store.ts * Update emojis.vue * Update emojis.vue * Update emojis.vue * Update announcements.vue * Update store.ts * wip * Update page-editor.vue * wip * wip * Update modal.vue * wip * Update select-file.ts * Update timeline.vue * Update emojis.vue * Update os.ts * wip * Update user-select.vue * Update mfm.ts * Update get-file-info.ts * Update drive.vue * Update init.ts * Update mfm.ts * wip * wip * Update window.vue * Update note.vue * wip * wip * Update user-info.vue * wip * wip * wip * wip * wip * Update header.vue * Update header.vue * wip * Update explore.vue * wip * wip * wip * Update webpack.config.ts * wip * wip * wip * wip * wip * wip * Update autocomplete.ts * wip * wip * wip * Update toast.vue * wip * Update post-form-dialog.vue * wip * wip * wip * wip * wip * Update users.vue * wip * Update explore.vue * wip * wip * wip * Update package.json * wip * Update icon-dialog.vue * wip * wip * Update user-preview.ts * wip * wip * wip * wip * wip * Update instance.vue * Update user-name.vue * Update federation.vue * Update instance.vue * wip * wip * Update tag.vue * wip * wip * wip * wip * wip * Update instance.vue * wip * Update os.ts * Update os.ts * wip * wip * wip * Update router.ts * wip * Update init.ts * Update note.vue * Update messages.vue * wip * wip * wip * wip * wip * google * wip * wip * wip * wip * Update theme-editor.vue * wip * wip * Update room.vue * Update channel-editor.vue * wip * Update window.vue * Update window.vue * wip * Update window.vue * Update window.vue * wip * Update menu.vue * wip * wip * wip * wip * Update messaging-room.vue * wip * Update post-form.vue * Update default.widgets.vue * Update window.vue * wip
2020-10-17 13:12:00 +02:00
contain: content;
2023-06-03 16:47:41 +02:00
-webkit-tap-highlight-color: transparent;
2020-12-26 14:56:01 +01:00
// これらの指定はパフォーマンス向上には有効だが、ノートの高さは一定でないため、
// 下の方までスクロールすると上のノートの高さがここで決め打ちされたものに変化し、表示しているノートの位置が変わってしまう
// ノートがマウントされたときに自身の高さを取得し contain-intrinsic-size を設定しなおせばほぼ解決できそうだが、
// 今度はその処理自体がパフォーマンス低下の原因にならないか懸念される。また、被リアクションでも高さは変化するため、やはり多少のズレは生じる
// 一度レンダリングされた要素はブラウザがよしなにサイズを覚えておいてくれるような実装になるまで待った方が良さそう(なるのか?)
//content-visibility: auto;
2023-04-08 02:01:42 +02:00
//contain-intrinsic-size: 0 128px;
2020-12-26 14:56:01 +01:00
2021-10-02 19:46:58 +02:00
&:focus-visible {
outline: none;
Migrate to Vue3 (#6587) * Update reaction.vue * fix bug * wip * wip * wjio * wip * Revert "wip" This reverts commit e427f2160adf4e8a4147006e25a89854edab0033. * wip * wip * wip * Update init.ts * Update drive-window.vue * wip * wip * Use PascalCase for components * Use PascalCase for components * update dep * wip * wip * wip * Update init.ts * wip * Update paging.ts * Update test.vue * watch deep * wip * lint * wip * wip * wip * wip * wiop * wip * Update webpack.config.ts * alllow null poll * wip * wip * wip * wiop * UI redesign & refactor (#6714) * wip * wip * wip * wip * wip * Update drive.vue * Update word-mute.vue * wip * wip * wip * clean up * wip * Update default.vue * wip * Update notes.vue * Update mfm.ts * Update index.home.vue * Update post-form.vue * Update post-form-attaches.vue * wip * Update post-form.vue * Update sidebar.vue * wip * wip * Update index.vue * wip * Update default.vue * Update index.vue * Update index.vue * wip * Update post-form-attaches.vue * Update note.vue * wip * clean up * Update notes.vue * wip * wip * Update ja-JP.yml * wip * wip * Update index.vue * wip * wip * wip * wip * wip * wip * wip * wip * Update default.vue * wip * Update _dark.json5 * wip * wip * wip * clean up * wip * wip * Update index.vue * Update test.vue * wip * wip * fix * wip * wip * wip * wip * clena yop * wip * wip * Update store.ts * Update messaging-room.vue * Update default.widgets.vue * fix * wip * wip * Update modal.vue * wip * Update os.ts * Update os.ts * Update deck.vue * Update init.ts * wip * Update ja-JP.yml * v-sizeは単にwindowのresizeを監視するだけで良いかもしれない * Update modal.vue * wip * Update tooltip.ts * wip * wip * wip * wip * wip * Update image-viewer.vue * wip * wip * Update style.scss * Update style.scss * Update visitor.vue * wip * Update init.ts * Update init.ts * wip * wip * Update visitor.vue * Update visitor.vue * Update visitor.vue * Update visitor.vue * wip * wip * Update modal.vue * Update header.vue * Update menu.vue * Update about.vue * Update about-misskey.vue * wip * wip * Update visitor.vue * Update tooltip.ts * wip * Update drive.vue * wip * Update style.scss * Update header.vue * wip * wip * Update users.user.vue * Update announcements.vue * wip * wip * wip * Update emojis.vue * wip * Update emojis.vue * Update style.scss * Update users.vue * wip * Update style.scss * wip * Update welcome.entrance.vue * Update radio.vue * Update size.ts * Update emoji-edit-dialog.vue * wip * Update emojis.vue * wip * Update emojis.vue * Update emojis.vue * Update emojis.vue * wip * wip * wip * wip * Update file-dialog.vue * wip * wip * Update token-generate-window.vue * Update notification-setting-window.vue * wip * wip * Update _error_.vue * Update ja-JP.yml * wip * wip * Update store.ts * Update emojis.vue * Update emojis.vue * Update emojis.vue * Update announcements.vue * Update store.ts * wip * Update page-editor.vue * wip * wip * Update modal.vue * wip * Update select-file.ts * Update timeline.vue * Update emojis.vue * Update os.ts * wip * Update user-select.vue * Update mfm.ts * Update get-file-info.ts * Update drive.vue * Update init.ts * Update mfm.ts * wip * wip * Update window.vue * Update note.vue * wip * wip * Update user-info.vue * wip * wip * wip * wip * wip * Update header.vue * Update header.vue * wip * Update explore.vue * wip * wip * wip * Update webpack.config.ts * wip * wip * wip * wip * wip * wip * Update autocomplete.ts * wip * wip * wip * Update toast.vue * wip * Update post-form-dialog.vue * wip * wip * wip * wip * wip * Update users.vue * wip * Update explore.vue * wip * wip * wip * Update package.json * wip * Update icon-dialog.vue * wip * wip * Update user-preview.ts * wip * wip * wip * wip * wip * Update instance.vue * Update user-name.vue * Update federation.vue * Update instance.vue * wip * wip * Update tag.vue * wip * wip * wip * wip * wip * Update instance.vue * wip * Update os.ts * Update os.ts * wip * wip * wip * Update router.ts * wip * Update init.ts * Update note.vue * Update messages.vue * wip * wip * wip * wip * wip * google * wip * wip * wip * wip * Update theme-editor.vue * wip * wip * Update room.vue * Update channel-editor.vue * wip * Update window.vue * Update window.vue * wip * Update window.vue * Update window.vue * wip * Update menu.vue * wip * wip * wip * wip * Update messaging-room.vue * wip * Update post-form.vue * Update default.widgets.vue * Update window.vue * wip
2020-10-17 13:12:00 +02:00
&:after {
content: "";
pointer-events: none;
display: block;
position: absolute;
z-index: 10;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
width: calc(100% - 8px);
height: calc(100% - 8px);
2022-07-27 19:07:52 +02:00
border: solid 1px var(--focus);
Migrate to Vue3 (#6587) * Update reaction.vue * fix bug * wip * wip * wjio * wip * Revert "wip" This reverts commit e427f2160adf4e8a4147006e25a89854edab0033. * wip * wip * wip * Update init.ts * Update drive-window.vue * wip * wip * Use PascalCase for components * Use PascalCase for components * update dep * wip * wip * wip * Update init.ts * wip * Update paging.ts * Update test.vue * watch deep * wip * lint * wip * wip * wip * wip * wiop * wip * Update webpack.config.ts * alllow null poll * wip * wip * wip * wiop * UI redesign & refactor (#6714) * wip * wip * wip * wip * wip * Update drive.vue * Update word-mute.vue * wip * wip * wip * clean up * wip * Update default.vue * wip * Update notes.vue * Update mfm.ts * Update index.home.vue * Update post-form.vue * Update post-form-attaches.vue * wip * Update post-form.vue * Update sidebar.vue * wip * wip * Update index.vue * wip * Update default.vue * Update index.vue * Update index.vue * wip * Update post-form-attaches.vue * Update note.vue * wip * clean up * Update notes.vue * wip * wip * Update ja-JP.yml * wip * wip * Update index.vue * wip * wip * wip * wip * wip * wip * wip * wip * Update default.vue * wip * Update _dark.json5 * wip * wip * wip * clean up * wip * wip * Update index.vue * Update test.vue * wip * wip * fix * wip * wip * wip * wip * clena yop * wip * wip * Update store.ts * Update messaging-room.vue * Update default.widgets.vue * fix * wip * wip * Update modal.vue * wip * Update os.ts * Update os.ts * Update deck.vue * Update init.ts * wip * Update ja-JP.yml * v-sizeは単にwindowのresizeを監視するだけで良いかもしれない * Update modal.vue * wip * Update tooltip.ts * wip * wip * wip * wip * wip * Update image-viewer.vue * wip * wip * Update style.scss * Update style.scss * Update visitor.vue * wip * Update init.ts * Update init.ts * wip * wip * Update visitor.vue * Update visitor.vue * Update visitor.vue * Update visitor.vue * wip * wip * Update modal.vue * Update header.vue * Update menu.vue * Update about.vue * Update about-misskey.vue * wip * wip * Update visitor.vue * Update tooltip.ts * wip * Update drive.vue * wip * Update style.scss * Update header.vue * wip * wip * Update users.user.vue * Update announcements.vue * wip * wip * wip * Update emojis.vue * wip * Update emojis.vue * Update style.scss * Update users.vue * wip * Update style.scss * wip * Update welcome.entrance.vue * Update radio.vue * Update size.ts * Update emoji-edit-dialog.vue * wip * Update emojis.vue * wip * Update emojis.vue * Update emojis.vue * Update emojis.vue * wip * wip * wip * wip * Update file-dialog.vue * wip * wip * Update token-generate-window.vue * Update notification-setting-window.vue * wip * wip * Update _error_.vue * Update ja-JP.yml * wip * wip * Update store.ts * Update emojis.vue * Update emojis.vue * Update emojis.vue * Update announcements.vue * Update store.ts * wip * Update page-editor.vue * wip * wip * Update modal.vue * wip * Update select-file.ts * Update timeline.vue * Update emojis.vue * Update os.ts * wip * Update user-select.vue * Update mfm.ts * Update get-file-info.ts * Update drive.vue * Update init.ts * Update mfm.ts * wip * wip * Update window.vue * Update note.vue * wip * wip * Update user-info.vue * wip * wip * wip * wip * wip * Update header.vue * Update header.vue * wip * Update explore.vue * wip * wip * wip * Update webpack.config.ts * wip * wip * wip * wip * wip * wip * Update autocomplete.ts * wip * wip * wip * Update toast.vue * wip * Update post-form-dialog.vue * wip * wip * wip * wip * wip * Update users.vue * wip * Update explore.vue * wip * wip * wip * Update package.json * wip * Update icon-dialog.vue * wip * wip * Update user-preview.ts * wip * wip * wip * wip * wip * Update instance.vue * Update user-name.vue * Update federation.vue * Update instance.vue * wip * wip * Update tag.vue * wip * wip * wip * wip * wip * Update instance.vue * wip * Update os.ts * Update os.ts * wip * wip * wip * Update router.ts * wip * Update init.ts * Update note.vue * Update messages.vue * wip * wip * wip * wip * wip * google * wip * wip * wip * wip * Update theme-editor.vue * wip * wip * Update room.vue * Update channel-editor.vue * wip * Update window.vue * Update window.vue * wip * Update window.vue * Update window.vue * wip * Update menu.vue * wip * wip * wip * wip * Update messaging-room.vue * wip * Update post-form.vue * Update default.widgets.vue * Update window.vue * wip
2020-10-17 13:12:00 +02:00
border-radius: var(--radius);
box-sizing: border-box;
}
}
2023-02-25 06:39:43 +01:00
& > .article > .main {
2023-04-08 02:01:42 +02:00
&:hover,
&:focus-within {
2023-02-25 06:39:43 +01:00
:deep(.footer .button) {
opacity: 1;
}
}
}
2020-03-20 11:19:28 +01:00
> .reply-to {
2023-01-07 00:58:52 +01:00
& + .note-context {
.line::before {
content: "";
display: block;
2023-06-17 22:35:11 +02:00
margin-bottom: -4px;
2023-03-16 00:18:26 +01:00
margin-top: 16px;
2023-06-17 22:35:11 +02:00
border-left: 2px solid currentColor;
2023-03-16 00:18:26 +01:00
margin-left: calc((var(--avatarSize) / 2) - 1px);
2023-06-19 03:36:34 +02:00
opacity: 0.25;
2023-01-07 00:58:52 +01:00
}
}
2020-03-20 11:19:28 +01:00
}
2023-01-07 00:58:52 +01:00
.note-context {
2023-05-24 02:30:55 +02:00
position: relative;
2023-01-07 00:58:52 +01:00
padding: 0 32px 0 32px;
display: flex;
2024-05-02 18:22:25 +02:00
flex-wrap: wrap;
z-index: 1;
2023-01-07 00:58:52 +01:00
&:first-child {
2023-01-08 08:30:42 +01:00
margin-top: 20px;
}
2023-01-07 00:58:52 +01:00
> :not(.line) {
width: 0;
flex-grow: 1;
position: relative;
line-height: 28px;
}
2023-01-07 00:58:52 +01:00
> .line {
2023-05-24 02:30:55 +02:00
position: relative;
z-index: 2;
2024-02-15 15:15:59 +01:00
width: 0;
2023-01-07 00:58:52 +01:00
display: flex;
2024-02-15 15:15:59 +01:00
margin-right: 0;
2023-01-07 00:58:52 +01:00
margin-top: 0;
flex-grow: 0;
pointer-events: none;
2023-01-07 00:58:52 +01:00
}
2023-04-08 02:01:42 +02:00
2023-01-07 00:58:52 +01:00
> div > i {
2023-04-08 02:01:42 +02:00
margin-left: -0.5px;
2023-01-07 00:58:52 +01:00
}
> .info {
display: flex;
align-items: center;
font-size: 90%;
white-space: pre;
color: #f6c177;
> i {
margin-right: 4px;
}
2023-01-07 00:58:52 +01:00
> .hide {
margin-left: auto;
color: inherit;
}
}
2023-01-07 00:58:52 +01:00
> .renote {
display: flex;
align-items: center;
white-space: pre;
color: var(--renote);
cursor: pointer;
2023-01-07 00:58:52 +01:00
> i {
margin-right: 4px;
}
2024-05-02 18:22:25 +02:00
.avatar {
width: 1.2em;
height: 1.2em;
border-radius: 2em;
overflow: hidden;
margin-right: 0.4em;
background: var(--panelHighlight);
transform: translateY(-4px);
}
2023-01-07 00:58:52 +01:00
> span {
overflow: hidden;
flex-shrink: 1;
text-overflow: ellipsis;
white-space: nowrap;
2023-04-08 02:01:42 +02:00
2023-01-07 00:58:52 +01:00
> .name {
font-weight: bold;
}
}
> .info {
margin-left: auto;
font-size: 0.9em;
display: flex;
2023-01-07 00:58:52 +01:00
> .time {
flex-shrink: 0;
color: inherit;
display: inline-flex;
align-items: center;
> .dropdownIcon {
margin-right: 4px;
}
}
}
}
&.collapsedReply {
.line {
opacity: 0.25;
&::after {
content: "";
position: absolute;
border-left: 2px solid currentColor;
border-top: 2px solid currentColor;
margin-left: calc(var(--avatarSize) / 2 - 1px);
width: calc(var(--avatarSize) / 2 + 14px);
border-top-left-radius: calc(var(--avatarSize) / 4);
top: calc(50% - 1px);
height: calc(50% + 5px);
}
}
.info {
color: var(--fgTransparentWeak);
transition: color 0.2s;
}
.avatar {
width: 1.2em;
height: 1.2em;
border-radius: 2em;
overflow: hidden;
margin-right: 0.4em;
background: var(--panelHighlight);
}
.username {
font-weight: 700;
flex-shrink: 0;
max-width: 30%;
&::after {
content: ": ";
}
}
&:hover,
&:focus-within {
.info {
color: var(--fg);
}
}
}
}
> .article {
2023-05-28 22:21:00 +02:00
position: relative;
2023-05-24 04:09:24 +02:00
overflow: clip;
padding: 20px 32px 10px;
margin-top: -16px;
2024-03-31 21:21:55 +02:00
&.history {
margin-top: -90px !important;
}
2022-11-27 06:37:23 +01:00
2023-05-24 03:02:52 +02:00
&:first-child,
&:nth-child(2) {
2023-05-24 02:30:55 +02:00
margin-top: -100px;
padding-top: 104px;
}
2022-12-02 07:39:50 +01:00
@media (pointer: coarse) {
cursor: default;
}
2023-01-05 17:08:23 +01:00
.header-container {
display: flex;
position: relative;
z-index: 2;
2023-01-05 17:08:23 +01:00
> .avatar {
flex-shrink: 0;
display: block;
2023-01-07 00:58:52 +01:00
margin: 0 14px 0 0;
width: var(--avatarSize);
height: var(--avatarSize);
2023-01-05 17:08:23 +01:00
position: relative;
top: 0;
left: 0;
}
> .header {
width: 0;
flex-grow: 1;
}
}
> .main {
flex: 1;
min-width: 0;
2023-01-03 19:16:02 +01:00
> .body {
2023-04-08 02:01:42 +02:00
margin-top: 0.7em;
2023-05-02 20:52:05 +02:00
> .translation {
border: solid 0.5px var(--divider);
border-radius: var(--radius);
padding: 12px;
margin-top: 8px;
}
> .renote {
padding-top: 8px;
> * {
padding: 16px;
border: solid 1px var(--renote);
border-radius: 8px;
transition: background 0.2s;
&:hover,
&:focus-within {
background-color: var(--panelHighlight);
}
}
}
}
> .info {
2023-05-19 19:02:41 +02:00
display: flex;
justify-content: space-between;
flex-wrap: wrap;
2023-05-20 00:41:59 +02:00
gap: 0.7em;
2023-05-19 19:02:41 +02:00
margin-top: 16px;
opacity: 0.7;
font-size: 0.9em;
}
> .footer {
position: relative;
z-index: 2;
2023-01-10 01:55:40 +01:00
display: flex;
flex-wrap: wrap;
2023-04-23 02:22:53 +02:00
margin-top: 0.4em;
2023-05-24 02:30:55 +02:00
> :deep(.button) {
position: relative;
margin: 0;
padding: 8px;
opacity: 0.7;
&:disabled {
opacity: 0.3 !important;
}
2023-01-10 01:55:40 +01:00
flex-grow: 1;
max-width: 3.5em;
width: max-content;
2023-01-10 01:55:40 +01:00
min-width: max-content;
2023-05-24 02:30:55 +02:00
height: auto;
2023-04-08 02:01:42 +02:00
transition: opacity 0.2s;
2023-05-24 02:30:55 +02:00
&::before {
content: "";
position: absolute;
inset: 0;
bottom: 2px;
background: var(--panel);
z-index: -1;
2023-05-24 03:02:52 +02:00
transition: background 0.2s;
2023-05-24 02:30:55 +02:00
}
2023-01-10 03:53:39 +01:00
&:first-of-type {
2023-04-08 02:01:42 +02:00
margin-left: -0.5em;
2023-05-24 02:30:55 +02:00
&::before {
border-radius: 100px 0 0 100px;
}
}
&:last-of-type {
&::before {
border-radius: 0 100px 100px 0;
}
2023-01-10 03:53:39 +01:00
}
&:hover {
2020-02-14 17:18:48 +01:00
color: var(--fgHighlighted);
}
2023-06-03 18:57:51 +02:00
> i {
display: inline !important;
}
> .count {
display: inline;
margin: 0 0 0 8px;
opacity: 0.7;
}
&.reacted {
color: var(--accent);
}
}
}
}
}
2020-03-21 04:32:40 +01:00
> .reply {
border-top: solid 0.5px var(--divider);
2020-03-21 04:32:40 +01:00
}
&.max-width_500px {
2023-06-13 06:04:36 +02:00
font-size: 0.975em;
--avatarSize: 46px;
2023-02-03 21:44:40 +01:00
padding-top: 6px;
2023-01-07 00:58:52 +01:00
> .note-context {
padding-inline: 16px;
margin-top: 8px;
> :not(.line) {
margin-top: 0px;
2023-02-03 21:44:40 +01:00
}
> .line {
2024-02-15 15:15:59 +01:00
margin-right: 0;
&::before {
margin-top: 8px;
}
}
}
> .article {
2023-06-23 23:41:39 +02:00
padding: 18px 16px 8px;
2023-05-24 03:02:52 +02:00
&:first-child,
&:nth-child(2) {
2023-05-24 02:49:56 +02:00
padding-top: 104px;
}
2023-01-07 00:58:52 +01:00
> .main > .header-container > .avatar {
margin-right: 10px;
2022-11-22 20:01:25 +01:00
// top: calc(14px + var(--stickyTop, 0px));
}
}
}
&.max-width_300px {
--avatarSize: 40px;
}
}
.muted {
padding: 8px;
text-align: center;
opacity: 0.7;
2023-05-10 23:44:08 +02:00
width: 100%;
._blur_text {
pointer-events: auto;
}
&:active ._blur_text {
filter: blur(0px);
}
}
</style>