diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-11-01 12:39:07 +0100 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-11-01 12:39:07 +0100 |
| commit | 8388b18df9502dfa4b7147ba10c695014e206391 (patch) | |
| tree | b8d1d55f92529efde1536e966191c015c39f54d5 /packages/frontend/src | |
| parent | upd: remove tools from more (diff) | |
| parent | 2023.11.0-beta.7 (diff) | |
| download | sharkey-8388b18df9502dfa4b7147ba10c695014e206391.tar.gz sharkey-8388b18df9502dfa4b7147ba10c695014e206391.tar.bz2 sharkey-8388b18df9502dfa4b7147ba10c695014e206391.zip | |
merge: upstream
Diffstat (limited to 'packages/frontend/src')
18 files changed, 137 insertions, 33 deletions
diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 800a3b079f..b11d0db043 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -226,11 +226,18 @@ export async function mainBoot() { }); main.on('readAllNotifications', () => { - updateAccount({ hasUnreadNotification: false }); + updateAccount({ + hasUnreadNotification: false, + unreadNotificationsCount: 0, + }); }); main.on('unreadNotification', () => { - updateAccount({ hasUnreadNotification: true }); + const unreadNotificationsCount = ($i?.unreadNotificationsCount ?? 0) + 1; + updateAccount({ + hasUnreadNotification: true, + unreadNotificationsCount, + }); }); main.on('unreadMention', () => { diff --git a/packages/frontend/src/components/MkLaunchPad.vue b/packages/frontend/src/components/MkLaunchPad.vue index 8425c258a8..0f951ec0b9 100644 --- a/packages/frontend/src/components/MkLaunchPad.vue +++ b/packages/frontend/src/components/MkLaunchPad.vue @@ -7,16 +7,18 @@ SPDX-License-Identifier: AGPL-3.0-only <MkModal ref="modal" v-slot="{ type, maxHeight }" :preferType="preferedModalType" :anchor="anchor" :transparentBg="true" :src="src" @click="modal.close()" @closed="emit('closed')"> <div class="szkkfdyq _popup _shadow" :class="{ asDrawer: type === 'drawer' }" :style="{ maxHeight: maxHeight ? maxHeight + 'px' : '' }"> <div class="main"> - <template v-for="item in items"> + <template v-for="item in items" :key="item.text"> <button v-if="item.action" v-click-anime class="_button item" @click="$event => { item.action($event); close(); }"> <i class="icon" :class="item.icon"></i> <div class="text">{{ item.text }}</div> - <span v-if="item.indicate" class="indicator"><i class="_indicatorCircle"></i></span> + <span v-if="item.indicate && item.indicateValue" class="_indicateCounter indicatorWithValue">{{ item.indicateValue }}</span> + <span v-else-if="item.indicate" class="indicator"><i class="_indicatorCircle"></i></span> </button> <MkA v-else v-click-anime :to="item.to" class="item" @click.passive="close()"> <i class="icon" :class="item.icon"></i> <div class="text">{{ item.text }}</div> - <span v-if="item.indicate" class="indicator"><i class="_indicatorCircle"></i></span> + <span v-if="item.indicate && item.indicateValue" class="_indicateCounter indicatorWithValue">{{ item.indicateValue }}</span> + <span v-else-if="item.indicate" class="indicator"><i class="_indicatorCircle"></i></span> </MkA> </template> </div> @@ -27,7 +29,7 @@ SPDX-License-Identifier: AGPL-3.0-only <script lang="ts" setup> import { } from 'vue'; import MkModal from '@/components/MkModal.vue'; -import { navbarItemDef } from '@/navbar'; +import { navbarItemDef } from '@/navbar.js'; import { defaultStore } from '@/store.js'; import { deviceKind } from '@/scripts/device-kind.js'; @@ -57,6 +59,7 @@ const items = Object.keys(navbarItemDef).filter(k => !menu.includes(k)).map(k => to: def.to, action: def.action, indicate: def.indicated, + indicateValue: def.indicateValue, })); function close() { @@ -116,6 +119,17 @@ function close() { line-height: 1.5em; } + > .indicatorWithValue { + position: absolute; + top: 32px; + left: 16px; + + @media (max-width: 500px) { + top: 16px; + left: 8px; + } + } + > .indicator { position: absolute; top: 32px; diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 9e1c5cb9e3..0b9e4b0d38 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -61,7 +61,7 @@ SPDX-License-Identifier: AGPL-3.0-only <div :class="$style.text"> <span v-if="appearNote.isHidden" style="opacity: 0.5">({{ i18n.ts.private }})</span> <MkA v-if="appearNote.replyId" :class="$style.replyIcon" :to="`/notes/${appearNote.replyId}`"><i class="ph-arrow-bend-left-up ph-bold pg-lg"></i></MkA> - <Mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :nyaize="'account'" :i="$i" :emojiUrls="appearNote.emojis"/> + <Mfm v-if="appearNote.text" :parsedNodes="parsed" :text="appearNote.text" :author="appearNote.user" :nyaize="'account'" :i="$i" :emojiUrls="appearNote.emojis"/> <div v-if="translating || translation" :class="$style.translation"> <MkLoading v-if="translating" mini/> <div v-else> @@ -85,7 +85,7 @@ SPDX-License-Identifier: AGPL-3.0-only </div> <MkA v-if="appearNote.channel && !inChannel" :class="$style.channel" :to="`/channels/${appearNote.channel.id}`"><i class="ph-television ph-bold ph-lg"></i> {{ appearNote.channel.name }}</MkA> </div> - <MkReactionsViewer :note="appearNote" :maxNumber="16" v-on:click.stop> + <MkReactionsViewer v-show="appearNote.cw == null || showContent" :note="appearNote" :maxNumber="16" v-on:click.stop> <template #more> <div :class="$style.reactionOmitted">{{ i18n.ts.more }}</div> </template> @@ -240,8 +240,9 @@ const renoteUri = appearNote.renote ? appearNote.renote.uri : null; const isMyRenote = $i && ($i.id === note.userId); const showContent = ref(false); -const urls = appearNote.text ? extractUrlFromMfm(mfm.parse(appearNote.text)).filter(u => u !== renoteUrl && u !== renoteUri) : null; -const isLong = shouldCollapsed(appearNote); +const parsed = appearNote.text ? mfm.parse(appearNote.text) : null; +const urls = parsed ? extractUrlFromMfm(parsed) : null; +const isLong = shouldCollapsed(appearNote, urls ?? []); const collapsed = ref(appearNote.cw == null && isLong); const isDeleted = ref(false); const renoted = ref(false); diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index 4ecfd014bc..2633ce2d6b 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -74,7 +74,7 @@ SPDX-License-Identifier: AGPL-3.0-only <div v-show="appearNote.cw == null || showContent"> <span v-if="appearNote.isHidden" style="opacity: 0.5">({{ i18n.ts.private }})</span> <MkA v-if="appearNote.replyId" :class="$style.noteReplyTarget" :to="`/notes/${appearNote.replyId}`"><i class="ph-arrow-bend-left-up ph-bold pg-lg"></i></MkA> - <Mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :nyaize="'account'" :i="$i" :emojiUrls="appearNote.emojis"/> + <Mfm v-if="appearNote.text" :parsedNodes="parsed" :text="appearNote.text" :author="appearNote.user" :nyaize="'account'" :i="$i" :emojiUrls="appearNote.emojis"/> <a v-if="appearNote.renote != null" :class="$style.rn">RN:</a> <div v-if="translating || translation" :class="$style.translation"> <MkLoading v-if="translating" mini/> @@ -295,7 +295,8 @@ const quoted = ref(false); const muted = ref($i ? checkWordMute(appearNote, $i, $i.mutedWords) : false); const translation = ref(null); const translating = ref(false); -const urls = appearNote.text ? extractUrlFromMfm(mfm.parse(appearNote.text)).filter(u => u !== renoteUrl && u !== renoteUri) : null; +const parsed = appearNote.text ? mfm.parse(appearNote.text) : null; +const urls = parsed ? extractUrlFromMfm(parsed) : null; const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance); const conversation = ref<Misskey.entities.Note[]>([]); const replies = ref<Misskey.entities.Note[]>([]); diff --git a/packages/frontend/src/components/MkNotifications.vue b/packages/frontend/src/components/MkNotifications.vue index 263e0aa1c2..896f97a48d 100644 --- a/packages/frontend/src/components/MkNotifications.vue +++ b/packages/frontend/src/components/MkNotifications.vue @@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <script lang="ts" setup> -import { onUnmounted, onMounted, computed, shallowRef } from 'vue'; +import { onUnmounted, onDeactivated, onMounted, computed, shallowRef } from 'vue'; import MkPagination, { Paging } from '@/components/MkPagination.vue'; import XNotification from '@/components/MkNotification.vue'; import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue'; @@ -68,6 +68,10 @@ onMounted(() => { onUnmounted(() => { if (connection) connection.dispose(); }); + +onDeactivated(() => { + if (connection) connection.dispose(); +}); </script> <style lang="scss" module> diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue index d1d4cef066..8f6dc6aee3 100644 --- a/packages/frontend/src/components/MkSubNoteContent.vue +++ b/packages/frontend/src/components/MkSubNoteContent.vue @@ -60,7 +60,7 @@ function noteclick(id: string) { router.push(`/notes/${id}`); } -const isLong = shouldCollapsed(props.note); +const isLong = shouldCollapsed(props.note, []); const collapsed = $ref(isLong); </script> diff --git a/packages/frontend/src/components/global/MkFooterSpacer.vue b/packages/frontend/src/components/global/MkFooterSpacer.vue index 07df76b256..e78df6b8d9 100644 --- a/packages/frontend/src/components/global/MkFooterSpacer.vue +++ b/packages/frontend/src/components/global/MkFooterSpacer.vue @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only --> <template> -<div :class="[$style.spacer, defaultStore.reactiveState.darkMode ? $style.dark : $style.light]"></div> +<div :class="[$style.spacer, defaultStore.reactiveState.darkMode.value ? $style.dark : $style.light]"></div> </template> <script lang="ts" setup> @@ -22,7 +22,7 @@ import { defaultStore } from '@/store.js'; background-color: rgba(255, 255, 255, 0); &.light { - background-image: repeating-linear-gradient(135deg, transparent, transparent 16px, #00000026 16px, #00000026 20px ); + background-image: repeating-linear-gradient(135deg, transparent, transparent 16px, #00000010 16px, #00000010 20px ); } &.dark { diff --git a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts index fa1c09d84e..912388a7d8 100644 --- a/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts +++ b/packages/frontend/src/components/global/MkMisskeyFlavoredMarkdown.ts @@ -38,6 +38,7 @@ type MfmProps = { emojiUrls?: string[]; rootScale?: number; nyaize: boolean | 'account'; + parsedNodes?: mfm.MfmNode[] | null; }; // eslint-disable-next-line import/no-default-export @@ -48,7 +49,7 @@ export default function(props: MfmProps) { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (props.text == null || props.text === '') return; - const rootAst = (props.plain ? mfm.parseSimple : mfm.parse)(props.text); + const rootAst = props.parsedNodes ?? (props.plain ? mfm.parseSimple : mfm.parse)(props.text); const validTime = (t: string | null | undefined) => { if (t == null) return null; diff --git a/packages/frontend/src/navbar.ts b/packages/frontend/src/navbar.ts index 5243931554..0ef856a1d5 100644 --- a/packages/frontend/src/navbar.ts +++ b/packages/frontend/src/navbar.ts @@ -20,6 +20,15 @@ export const navbarItemDef = reactive({ icon: 'ph-bell ph-bold ph-lg', show: computed(() => $i != null), indicated: computed(() => $i != null && $i.hasUnreadNotification), + indicateValue: computed(() => { + if (!$i || $i.unreadNotificationsCount === 0) return ''; + + if ($i.unreadNotificationsCount > 99) { + return '99+'; + } else { + return $i.unreadNotificationsCount.toString(); + } + }), to: '/my/notifications', }, drive: { diff --git a/packages/frontend/src/pages/settings/notifications.vue b/packages/frontend/src/pages/settings/notifications.vue index 25227e1dd9..36f91e74f9 100644 --- a/packages/frontend/src/pages/settings/notifications.vue +++ b/packages/frontend/src/pages/settings/notifications.vue @@ -74,11 +74,11 @@ let sendReadMessage = $computed(() => pushRegistrationInServer?.sendReadMessage const userLists = await os.api('users/lists/list'); async function readAllUnreadNotes() { - await os.api('i/read-all-unread-notes'); + await os.apiWithDialog('i/read-all-unread-notes'); } async function readAllNotifications() { - await os.api('notifications/mark-all-as-read'); + await os.apiWithDialog('notifications/mark-all-as-read'); } async function updateReceiveConfig(type, value) { diff --git a/packages/frontend/src/scripts/collapsed.ts b/packages/frontend/src/scripts/collapsed.ts index c3c767bcfa..57e6ecf5b5 100644 --- a/packages/frontend/src/scripts/collapsed.ts +++ b/packages/frontend/src/scripts/collapsed.ts @@ -3,12 +3,9 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import * as mfm from 'mfm-js'; import * as Misskey from 'misskey-js'; -import { extractUrlFromMfm } from './extract-url-from-mfm.js'; -export function shouldCollapsed(note: Misskey.entities.Note): boolean { - const urls = note.text ? extractUrlFromMfm(mfm.parse(note.text)) : null; +export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): boolean { const collapsed = note.cw == null && note.text != null && ( (note.text.includes('$[x2')) || (note.text.includes('$[x3')) || @@ -17,7 +14,7 @@ export function shouldCollapsed(note: Misskey.entities.Note): boolean { (note.text.split('\n').length > 9) || (note.text.length > 500) || (note.files.length >= 5) || - (!!urls && urls.length >= 4) + (urls.length >= 4) ); return collapsed; diff --git a/packages/frontend/src/style.scss b/packages/frontend/src/style.scss index 2945ae9a80..4d0b3a8beb 100644 --- a/packages/frontend/src/style.scss +++ b/packages/frontend/src/style.scss @@ -163,6 +163,19 @@ hr { background: currentColor; } +._indicateCounter { + display: inline-flex; + color: var(--fgOnAccent); + font-weight: 700; + background: var(--indicator); + height: 1.5em; + min-width: 1.5em; + align-items: center; + justify-content: center; + border-radius: 99rem; + padding: 0.3em 0.5em; +} + ._noSelect { user-select: none; -webkit-user-select: none; diff --git a/packages/frontend/src/ui/_common_/common.vue b/packages/frontend/src/ui/_common_/common.vue index 732a4cfeaa..7f8556d8d2 100644 --- a/packages/frontend/src/ui/_common_/common.vue +++ b/packages/frontend/src/ui/_common_/common.vue @@ -67,7 +67,8 @@ let notifications = $ref<Misskey.entities.Notification[]>([]); function onNotification(notification: Misskey.entities.Notification, isClient = false) { if (document.visibilityState === 'visible') { - if (!isClient) { + if (!isClient && notification.type !== 'test') { + // サーバーサイドのテスト通知の際は自動で既読をつけない(テストできないので) useStream().send('readNotification'); } diff --git a/packages/frontend/src/ui/_common_/navbar-for-mobile.vue b/packages/frontend/src/ui/_common_/navbar-for-mobile.vue index 70dbc7e0b3..9ad3cf8b2c 100644 --- a/packages/frontend/src/ui/_common_/navbar-for-mobile.vue +++ b/packages/frontend/src/ui/_common_/navbar-for-mobile.vue @@ -19,7 +19,10 @@ SPDX-License-Identifier: AGPL-3.0-only <div v-if="item === '-'" :class="$style.divider"></div> <component :is="navbarItemDef[item].to ? 'MkA' : 'button'" v-else-if="navbarItemDef[item] && (navbarItemDef[item].show !== false)" class="_button" :class="[$style.item, { [$style.active]: navbarItemDef[item].active }]" :activeClass="$style.active" :to="navbarItemDef[item].to" v-on="navbarItemDef[item].action ? { click: navbarItemDef[item].action } : {}"> <i class="ti-fw" :class="[$style.itemIcon, navbarItemDef[item].icon]"></i><span :class="$style.itemText">{{ navbarItemDef[item].title }}</span> - <span v-if="navbarItemDef[item].indicated" :class="$style.itemIndicator"><i class="_indicatorCircle"></i></span> + <span v-if="navbarItemDef[item].indicated" :class="$style.itemIndicator"> + <span v-if="navbarItemDef[item].indicateValue" class="_indicateCounter" :class="$style.itemIndicateValueIcon">{{ navbarItemDef[item].indicateValue }}</span> + <i v-else class="_indicatorCircle"></i> + </span> </component> </template> <div :class="$style.divider"></div> @@ -252,6 +255,12 @@ function more() { color: var(--navIndicator); font-size: 8px; animation: blink 1s infinite; + + &:has(.itemIndicateValueIcon) { + animation: none; + left: auto; + right: 20px; + } } .itemText { diff --git a/packages/frontend/src/ui/_common_/navbar.vue b/packages/frontend/src/ui/_common_/navbar.vue index 4e04b1690b..33c91f12df 100644 --- a/packages/frontend/src/ui/_common_/navbar.vue +++ b/packages/frontend/src/ui/_common_/navbar.vue @@ -29,7 +29,10 @@ SPDX-License-Identifier: AGPL-3.0-only v-on="navbarItemDef[item].action ? { click: navbarItemDef[item].action } : {}" > <i class="ti-fw" :class="[$style.itemIcon, navbarItemDef[item].icon]"></i><span :class="$style.itemText">{{ navbarItemDef[item].title }}</span> - <span v-if="navbarItemDef[item].indicated" :class="$style.itemIndicator"><i class="_indicatorCircle"></i></span> + <span v-if="navbarItemDef[item].indicated" :class="$style.itemIndicator"> + <span v-if="navbarItemDef[item].indicateValue" class="_indicateCounter" :class="$style.itemIndicateValueIcon">{{ navbarItemDef[item].indicateValue }}</span> + <i v-else class="_indicatorCircle"></i> + </span> </component> </template> <div :class="$style.divider"></div> @@ -106,7 +109,7 @@ function more(ev: MouseEvent) { <style lang="scss" module> .root { --nav-width: 250px; - --nav-icon-only-width: 72px; + --nav-icon-only-width: 80px; flex: 0 0 var(--nav-width); width: var(--nav-width); @@ -312,6 +315,13 @@ function more(ev: MouseEvent) { color: var(--navIndicator); font-size: 8px; animation: blink 1s infinite; + + &:has(.itemIndicateValueIcon) { + animation: none; + left: auto; + right: 40px; + font-size: 10px; + } } .itemText { @@ -475,6 +485,14 @@ function more(ev: MouseEvent) { color: var(--navIndicator); font-size: 8px; animation: blink 1s infinite; + + &:has(.itemIndicateValueIcon) { + animation: none; + top: 4px; + left: auto; + right: 4px; + font-size: 10px; + } } } </style> diff --git a/packages/frontend/src/ui/classic.sidebar.vue b/packages/frontend/src/ui/classic.sidebar.vue index 3e501db91b..3a4c8501ce 100644 --- a/packages/frontend/src/ui/classic.sidebar.vue +++ b/packages/frontend/src/ui/classic.sidebar.vue @@ -21,7 +21,10 @@ SPDX-License-Identifier: AGPL-3.0-only <div v-if="item === '-'" class="divider"></div> <component :is="navbarItemDef[item].to ? 'MkA' : 'button'" v-else-if="navbarItemDef[item] && (navbarItemDef[item].show !== false)" v-click-anime class="item _button" :class="item" activeClass="active" :to="navbarItemDef[item].to" v-on="navbarItemDef[item].action ? { click: navbarItemDef[item].action } : {}"> <i class="ti-fw" :class="navbarItemDef[item].icon"></i><span class="text">{{ navbarItemDef[item].title }}</span> - <span v-if="navbarItemDef[item].indicated" class="indicator"><i class="_indicatorCircle"></i></span> + <span v-if="navbarItemDef[item].indicated" class="indicator"> + <span v-if="navbarItemDef[item].indicateValue" class="_indicateCounter itemIndicateValueIcon">{{ navbarItemDef[item].indicateValue }}</span> + <i v-else class="_indicatorCircle"></i> + </span> </component> </template> <div class="divider"></div> @@ -218,6 +221,12 @@ watch(defaultStore.reactiveState.menuDisplay, () => { color: var(--navIndicator); font-size: 8px; animation: blink 1s infinite; + + &:has(.itemIndicateValueIcon) { + animation: none; + left: auto; + right: 20px; + } } &:hover { diff --git a/packages/frontend/src/ui/deck.vue b/packages/frontend/src/ui/deck.vue index 9482930578..e10e1e4e3f 100644 --- a/packages/frontend/src/ui/deck.vue +++ b/packages/frontend/src/ui/deck.vue @@ -52,8 +52,13 @@ SPDX-License-Identifier: AGPL-3.0-only <div v-if="isMobile" :class="$style.nav"> <button :class="$style.navButton" class="_button" @click="drawerMenuShowing = true"><i :class="$style.navButtonIcon" class="ph-list ph-bold ph-lg-2"></i><span v-if="menuIndicated" :class="$style.navButtonIndicator"><i class="_indicatorCircle"></i></span></button> <button :class="$style.navButton" class="_button" @click="mainRouter.push('/')"><i :class="$style.navButtonIcon" class="ph-house ph-bold ph-lg"></i></button> - <button :class="$style.navButton" class="_button" @click="mainRouter.push('/my/notifications')"><i :class="$style.navButtonIcon" class="ph-bell ph-bold pg-lg"></i><span v-if="$i?.hasUnreadNotification" :class="$style.navButtonIndicator"><i class="_indicatorCircle"></i></span></button> - <button :class="$style.postButton" class="_button" @click="os.post()"><i :class="$style.navButtonIcon" class="ph-pencil ph-bold ph-lg"></i></button> + <button :class="$style.navButton" class="_button" @click="mainRouter.push('/my/notifications')"> + <i :class="$style.navButtonIcon" class="ph-bell ph-bold pg-lg"></i> + <span v-if="$i?.hasUnreadNotification" :class="$style.navButtonIndicator"> + <span class="_indicateCounter" :class="$style.itemIndicateValueIcon">{{ $i.unreadNotificationsCount > 99 ? '99+' : $i.unreadNotificationsCount }}</span> + </span> + </button> + <button :class="$style.postButton" class="_button" @click="os.post()"><i :class="$style.navButtonIcon" class="ph-pencil ph-bold pg-lg"></i></button> </div> <Transition @@ -485,5 +490,10 @@ body { color: var(--indicator); font-size: 16px; animation: blink 1s infinite; + + &:has(.itemIndicateValueIcon) { + animation: none; + font-size: 12px; + } } </style> diff --git a/packages/frontend/src/ui/universal.vue b/packages/frontend/src/ui/universal.vue index a23ce2b04b..ecdc1a79e4 100644 --- a/packages/frontend/src/ui/universal.vue +++ b/packages/frontend/src/ui/universal.vue @@ -27,9 +27,14 @@ SPDX-License-Identifier: AGPL-3.0-only <div v-if="isMobile" ref="navFooter" :class="$style.nav"> <button :class="$style.navButton" class="_button" @click="drawerMenuShowing = true"><i :class="$style.navButtonIcon" class="ph-list ph-bold ph-lg-2"></i><span v-if="menuIndicated" :class="$style.navButtonIndicator"><i class="_indicatorCircle"></i></span></button> <button :class="$style.navButton" class="_button" @click="mainRouter.currentRoute.value.name === 'index' ? top() : mainRouter.push('/')"><i :class="$style.navButtonIcon" class="ph-house ph-bold ph-lg"></i></button> - <button :class="$style.navButton" class="_button" @click="mainRouter.push('/my/notifications')"><i :class="$style.navButtonIcon" class="ph-bell ph-bold pg-lg"></i><span v-if="$i?.hasUnreadNotification" :class="$style.navButtonIndicator"><i class="_indicatorCircle"></i></span></button> + <button :class="$style.navButton" class="_button" @click="mainRouter.push('/my/notifications')"> + <i :class="$style.navButtonIcon" class="ph-bell ph-bold pg-lg"></i> + <span v-if="$i?.hasUnreadNotification" :class="$style.navButtonIndicator"> + <span class="_indicateCounter" :class="$style.itemIndicateValueIcon">{{ $i.unreadNotificationsCount > 99 ? '99+' : $i.unreadNotificationsCount }}</span> + </span> + </button> <button :class="$style.navButton" class="_button" @click="widgetsShowing = true"><i :class="$style.navButtonIcon" class="ph-squares-four ph-bold pg-lg"></i></button> - <button :class="$style.postButton" class="_button" @click="os.post()"><i :class="$style.navButtonIcon" class="ph-pencil ph-bold ph-lg"></i></button> + <button :class="$style.postButton" class="_button" @click="os.post()"><i :class="$style.navButtonIcon" class="ph-pencil ph-bold pg-lg"></i></button> </div> <Transition @@ -444,6 +449,11 @@ $widgets-hide-threshold: 1090px; color: var(--indicator); font-size: 16px; animation: blink 1s infinite; + + &:has(.itemIndicateValueIcon) { + animation: none; + font-size: 12px; + } } .menuDrawerBg { |