From a80d5b3e76962f07902df0f2472e60f27686148c Mon Sep 17 00:00:00 2001 From: domvo Date: Fri, 2 Oct 2026 20:02:37 +0200 Subject: [PATCH] Feed: support video posts and polish post tiles - Render Mastodon video and gifv attachments (lazy, no preload) - Theme-aware card styling, date links to the original post - Lighter hashtag styling and tidier spacing --- src/components/Post.vue | 77 +++++++++++++++++++++++++++++++++++------ src/i18n/ui/de.ts | 1 + src/i18n/ui/en.ts | 1 + 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/src/components/Post.vue b/src/components/Post.vue index eae4c03..7127f21 100644 --- a/src/components/Post.vue +++ b/src/components/Post.vue @@ -1,8 +1,10 @@ @@ -24,6 +42,7 @@ import { computed, onMounted, onUnmounted } from 'vue'; import PhotoSwipeLightbox from 'photoswipe/lightbox'; import 'photoswipe/style.css'; +import { getUiTranslations } from '../i18n/ui/ui-i18n-helper'; const props = defineProps({ post: { @@ -35,10 +54,16 @@ const props = defineProps({ default: 'en', }, }); +const t = getUiTranslations(props.locale); const dateOptions = { year: 'numeric', month: 'long', day: 'numeric' }; const imageAttachments = computed(() => props.post.media_attachments.filter((a) => a.type === 'image')); +// Mastodon uses "gifv" for short looping animations (converted GIFs) +const videoAttachments = computed(() => + props.post.media_attachments.filter((a) => a.type === 'video' || a.type === 'gifv'), +); + const galleryId = computed(() => `gallery-${props.post.id}`); const gridClass = computed(() => { @@ -70,36 +95,57 @@ onUnmounted(() => {