diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-03-30 01:58:17 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-03-30 01:58:17 -0400 |
| commit | 4ae26e6e185e52ac186ac10ccd4eda7718bf6e26 (patch) | |
| tree | 8d556072f3876f0bfbab9d24e7cd209ca6bd091a /packages/frontend/src/components/MkNotes.vue | |
| parent | restore following feed deck UI (diff) | |
| parent | New Crowdin updates (#15721) (diff) | |
| download | sharkey-4ae26e6e185e52ac186ac10ccd4eda7718bf6e26.tar.gz sharkey-4ae26e6e185e52ac186ac10ccd4eda7718bf6e26.tar.bz2 sharkey-4ae26e6e185e52ac186ac10ccd4eda7718bf6e26.zip | |
Merge branch 'misskey-develop' into merge/2025-03-24
Diffstat (limited to 'packages/frontend/src/components/MkNotes.vue')
| -rw-r--r-- | packages/frontend/src/components/MkNotes.vue | 85 |
1 files changed, 53 insertions, 32 deletions
diff --git a/packages/frontend/src/components/MkNotes.vue b/packages/frontend/src/components/MkNotes.vue index 928a143a72..bc72351552 100644 --- a/packages/frontend/src/components/MkNotes.vue +++ b/packages/frontend/src/components/MkNotes.vue @@ -13,38 +13,34 @@ SPDX-License-Identifier: AGPL-3.0-only </template> <template #default="{ items: notes }"> - <div :class="[$style.root, { [$style.noGap]: noGap }]"> - <MkDateSeparatedList - ref="notes" - v-slot="{ item: note }" - :items="notes" - :direction="pagination.reversed ? 'up' : 'down'" - :reversed="pagination.reversed" - :noGap="noGap" - :ad="true" - :class="$style.notes" - > - <MkNote :key="note._featuredId_ || note._prId_ || note.id" :class="$style.note" :note="note" :withHardMute="true"/> - </MkDateSeparatedList> - </div> + <component + :is="prefer.s.animation ? TransitionGroup : 'div'" :class="[$style.root, { [$style.noGap]: noGap, '_gaps': !noGap }]" + :enterActiveClass="$style.transition_x_enterActive" + :leaveActiveClass="$style.transition_x_leaveActive" + :enterFromClass="$style.transition_x_enterFrom" + :leaveToClass="$style.transition_x_leaveTo" + :moveClass=" $style.transition_x_move" + tag="div" + > + <template v-for="(note, i) in notes" :key="note.id"> + <DynamicNote :class="$style.note" :note="note" :withHardMute="true"/> + <div v-if="note._shouldInsertAd_" :class="$style.ad"> + <MkAd :preferForms="['horizontal', 'horizontal-big']"/> + </div> + </template> + </component> </template> </MkPagination> </template> <script lang="ts" setup> -import { defineAsyncComponent, useTemplateRef } from 'vue'; +import { useTemplateRef, TransitionGroup } from 'vue'; import type { Paging } from '@/components/MkPagination.vue'; -import MkDateSeparatedList from '@/components/MkDateSeparatedList.vue'; +import DynamicNote from '@/components/DynamicNote.vue'; import MkPagination from '@/components/MkPagination.vue'; import { i18n } from '@/i18n.js'; import { infoImageUrl } from '@/instance.js'; -import { defaultStore } from '@/store.js'; - -const MkNote = defineAsyncComponent(() => - (defaultStore.state.noteDesign === 'misskey') ? import('@/components/MkNote.vue') : - (defaultStore.state.noteDesign === 'sharkey') ? import('@/components/SkNote.vue') : - null -); +import { prefer } from '@/preferences.js'; const props = defineProps<{ pagination: Paging; @@ -60,24 +56,49 @@ defineExpose({ </script> <style lang="scss" module> +.transition_x_move, +.transition_x_enterActive, +.transition_x_leaveActive { + transition: opacity 0.3s cubic-bezier(0,.5,.5,1), transform 0.3s cubic-bezier(0,.5,.5,1) !important; +} +.transition_x_enterFrom, +.transition_x_leaveTo { + opacity: 0; + transform: translateY(-50%); +} +.transition_x_leaveActive { + position: absolute; +} + .root { + container-type: inline-size; + &.noGap { - border-radius: var(--MI-radius); + background: var(--MI_THEME-panel); + + .note { + border-bottom: solid 0.5px var(--MI_THEME-divider); + } - > .notes { - background: color-mix(in srgb, var(--MI_THEME-panel) 65%, transparent); + .ad { + padding: 8px; + background-size: auto auto; + background-image: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--MI_THEME-bg) 8px, var(--MI_THEME-bg) 14px); + border-bottom: solid 0.5px var(--MI_THEME-divider); } } &:not(.noGap) { - > .notes { - background: var(--MI_THEME-bg); + background: var(--MI_THEME-bg); - .note { - background: color-mix(in srgb, var(--MI_THEME-panel) 65%, transparent); - border-radius: var(--MI-radius); - } + .note { + background: var(--MI_THEME-panel); + border-radius: var(--MI-radius); } } } + +.ad:empty { + display: none; +} </style> |