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