From e9152585176e8ed0a511c03d492720373d547e00 Mon Sep 17 00:00:00 2001 From: Lightling Date: Sat, 13 Apr 2024 02:16:51 -0400 Subject: [PATCH] styles on thumbnails/images - thumbnail and image background - apply thumbnail position as object-position directly --- src/views/gallery/gallery-tile.vue | 10 +++++++++- src/views/gallery/gallery-utilities.ts | 6 ++++++ src/views/gallery/gallery-view.vue | 10 +++++++++- src/views/gallery/gallery.d.ts | 11 +++++++++-- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/views/gallery/gallery-tile.vue b/src/views/gallery/gallery-tile.vue index 7065eda..fffb8c9 100644 --- a/src/views/gallery/gallery-tile.vue +++ b/src/views/gallery/gallery-tile.vue @@ -15,6 +15,14 @@ defineEmits<{ }>() const title = computed(() => getTitleFromEntryOrId(props.entry, props.id)) +const styles = computed(() => { + const stylesReturn: Record = {} + if (!!props.entry.thumbnailBackground) { + stylesReturn.background = props.entry.thumbnailBackground + } + stylesReturn['object-position'] = props.entry.thumbnailPosition || 'center center' + return stylesReturn +})