wip
This commit is contained in:
parent
31f00040a4
commit
c16a234311
|
@ -1100,6 +1100,7 @@ export interface Locale {
|
|||
"iHaveReadXCarefullyAndAgree": string;
|
||||
"dialog": string;
|
||||
"icon": string;
|
||||
"forYou": string;
|
||||
"_announcement": {
|
||||
"forExistingUsers": string;
|
||||
"forExistingUsersDescription": string;
|
||||
|
|
|
@ -1097,6 +1097,7 @@ beSureToReadThisAsItIsImportant: "重要ですので必ずお読みください
|
|||
iHaveReadXCarefullyAndAgree: "「{x}」の内容をよく読み、同意します。"
|
||||
dialog: "ダイアログ"
|
||||
icon: "アイコン"
|
||||
forYou: "あなたへ"
|
||||
|
||||
_announcement:
|
||||
forExistingUsers: "既存ユーザーのみ"
|
||||
|
|
|
@ -4,8 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
-->
|
||||
|
||||
<template>
|
||||
<MkModal ref="modal" :zPriority="'middle'" @closed="$emit('closed')">
|
||||
<div :class="$style.root">
|
||||
<MkModal ref="modal" :zPriority="'middle'" @closed="$emit('closed')" @click="onBgClick">
|
||||
<div ref="rootEl" :class="$style.root">
|
||||
<div :class="$style.header">
|
||||
<span :class="$style.icon">
|
||||
<i v-if="announcement.icon === 'info'" class="ti ti-info-circle"></i>
|
||||
|
@ -34,6 +34,7 @@ const props = withDefaults(defineProps<{
|
|||
}>(), {
|
||||
});
|
||||
|
||||
const rootEl = shallowRef<HTMLDivElement>();
|
||||
const modal = shallowRef<InstanceType<typeof MkModal>>();
|
||||
|
||||
function ok() {
|
||||
|
@ -41,6 +42,21 @@ function ok() {
|
|||
os.api('i/read-announcement', { announcementId: props.announcement.id });
|
||||
}
|
||||
|
||||
function onBgClick() {
|
||||
rootEl.value.animate([{
|
||||
offset: 0,
|
||||
transform: 'scale(1)',
|
||||
}, {
|
||||
offset: 0.5,
|
||||
transform: 'scale(1.1)',
|
||||
}, {
|
||||
offset: 1,
|
||||
transform: 'scale(1)',
|
||||
}], {
|
||||
duration: 100,
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -172,7 +172,6 @@ import { showMovedDialog } from '@/scripts/show-moved-dialog';
|
|||
|
||||
const props = defineProps<{
|
||||
note: misskey.entities.Note;
|
||||
pinned?: boolean;
|
||||
}>();
|
||||
|
||||
const inChannel = inject('inChannel', null);
|
||||
|
|
|
@ -37,7 +37,6 @@ import { userPage } from '@/filters/user';
|
|||
|
||||
defineProps<{
|
||||
note: misskey.entities.Note;
|
||||
pinned?: boolean;
|
||||
}>();
|
||||
</script>
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ import { $i } from '@/account';
|
|||
|
||||
const props = defineProps<{
|
||||
note: misskey.entities.Note;
|
||||
pinned?: boolean;
|
||||
}>();
|
||||
|
||||
const showContent = $ref(false);
|
||||
|
|
|
@ -7,14 +7,18 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkStickyContainer>
|
||||
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
||||
<MkSpacer :contentMax="800">
|
||||
<MkPagination ref="paginationEl" v-slot="{items}" :pagination="pagination" class="ruryvtyk _gaps_m">
|
||||
<section v-for="announcement in items" :key="announcement.id" class="announcement _panel">
|
||||
<div class="header"><span v-if="$i && !announcement.isRead">🆕 </span>{{ announcement.title }}</div>
|
||||
<div class="content">
|
||||
<MkPagination ref="paginationEl" v-slot="{items}" :pagination="pagination" class="_gaps_m">
|
||||
<section v-for="announcement in items" :key="announcement.id" class="_panel" :class="$style.announcement">
|
||||
<div v-if="announcement.forYou" :class="$style.forYou"><i class="ti ti-pin"></i> {{ i18n.ts.forYou }}</div>
|
||||
<div :class="$style.header"><span v-if="$i && !announcement.isRead">🆕 </span>{{ announcement.title }}</div>
|
||||
<div :class="$style.content">
|
||||
<Mfm :text="announcement.text"/>
|
||||
<img v-if="announcement.imageUrl" :src="announcement.imageUrl"/>
|
||||
<div style="opacity: 0.7; font-size: 85%;">
|
||||
<MkTime :time="announcement.updatedAt ?? announcement.createdAt" mode="detail"/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="$i && !announcement.isRead" class="footer">
|
||||
<div v-if="$i && !announcement.isRead" :class="$style.footer">
|
||||
<MkButton primary @click="read(announcement.id)"><i class="ti ti-check"></i> {{ i18n.ts.gotIt }}</MkButton>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -58,27 +62,35 @@ definePageMetadata({
|
|||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.ruryvtyk {
|
||||
> .announcement {
|
||||
padding: 16px;
|
||||
<style lang="scss" module>
|
||||
.announcement {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
> .header {
|
||||
margin-bottom: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.forYou {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16px 32px 8px 32px;
|
||||
line-height: 24px;
|
||||
font-size: 90%;
|
||||
white-space: pre;
|
||||
color: #d28a3f;
|
||||
}
|
||||
|
||||
> .content {
|
||||
> img {
|
||||
display: block;
|
||||
max-height: 300px;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
.header {
|
||||
margin-bottom: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
> .footer {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.content {
|
||||
> img {
|
||||
display: block;
|
||||
max-height: 300px;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
margin-top: 16px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<template>
|
||||
<div :class="$style.root">
|
||||
<div
|
||||
v-for="announcement in $i.unreadAnnouncements" :key="announcement.id" :class="$style.item"
|
||||
v-for="announcement in $i.unreadAnnouncements.filter(x => x.display === 'banner')" :key="announcement.id" :class="$style.item"
|
||||
>
|
||||
<span :class="$style.icon">
|
||||
<i v-if="announcement.icon === 'info'" class="ti ti-info-circle"></i>
|
||||
|
@ -45,6 +45,10 @@ import { $i } from '@/account';
|
|||
color: var(--fgOnAccent);
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
padding: 0 10px;
|
||||
font-weight: bold;
|
||||
|
|
Loading…
Reference in New Issue