From ae6235429af9a6817db91e6ff7f013a0d86bf57e Mon Sep 17 00:00:00 2001 From: Lightling <contact@lightling.xyz> Date: Fri, 12 Apr 2024 01:22:22 -0400 Subject: [PATCH] reflect thumbnailPosition --- src/views/gallery/gallery-tile.vue | 1 + src/views/gallery/gallery-utilities.ts | 3 +++ src/views/gallery/gallery.d.ts | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/src/views/gallery/gallery-tile.vue b/src/views/gallery/gallery-tile.vue index b548e52..f378d20 100644 --- a/src/views/gallery/gallery-tile.vue +++ b/src/views/gallery/gallery-tile.vue @@ -27,6 +27,7 @@ const title = computed(() => getTitleFromEntryOrId(props.entry, props.id)) img( :src='entry.thumbnailUrl || entry.url' :alt='entry.description || id' + :data-thumbnail-position='entry.thumbnailPosition || "center center"' ) .caption-wrapper p {{ title }} diff --git a/src/views/gallery/gallery-utilities.ts b/src/views/gallery/gallery-utilities.ts index f546ac0..6386903 100644 --- a/src/views/gallery/gallery-utilities.ts +++ b/src/views/gallery/gallery-utilities.ts @@ -35,6 +35,9 @@ export const _amendVariantWithDefaults = (parent: GalleryEntryInheritedPropertie if (!variant.tags && !!parent.tags) { variant.tags = parent.tags } + if (!variant.thumbnailPosition && !!parent.thumbnailPosition) { + variant.thumbnailPosition = parent.thumbnailPosition + } return variant } diff --git a/src/views/gallery/gallery.d.ts b/src/views/gallery/gallery.d.ts index 9b84516..87bdbc7 100644 --- a/src/views/gallery/gallery.d.ts +++ b/src/views/gallery/gallery.d.ts @@ -22,6 +22,12 @@ export type GalleryEntryInheritedProperties = { * @see {@link GalleryList.tags} */ tags: string[] + /** + * the position of the thumbnail; + * reflects this as a dataset attribute that can be targeted by CSS selectors + * for the purpose of positioning the thumbnail + */ + thumbnailPosition?: string /** * the title of the entry */