From 33f069d8997c494a97f9f6b2dd5651f5bc957d79 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 19 Nov 2024 14:05:14 -0400 Subject: content: generate{Album,Flash,Track}CoverArtwork: mode slot Passthrough. This maintains the interface previously used for all cover artworks and therefore obliterates surrounding hacks. --- src/content/dependencies/generateCoverArtwork.js | 33 ++++++++++++++---------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/content/dependencies/generateCoverArtwork.js') diff --git a/src/content/dependencies/generateCoverArtwork.js b/src/content/dependencies/generateCoverArtwork.js index 50089f69..27133b9d 100644 --- a/src/content/dependencies/generateCoverArtwork.js +++ b/src/content/dependencies/generateCoverArtwork.js @@ -34,25 +34,31 @@ export default { ? {square: true} : {dimensions: slots.dimensions}); - return html.tags([ - (slots.mode === 'primary' - ? slots.image.slots({ + switch (slots.mode) { + case 'primary': + return html.tags([ + slots.image.slots({ thumb: 'medium', reveal: true, link: true, ...sizeSlots, - }) + }), - : slots.mode === 'thumbnail' - ? slots.image.slots({ + slots.details, + ]); + + case 'thumbnail': + return ( + slots.image.slots({ thumb: 'small', reveal: false, link: false, ...sizeSlots, - }) + })); - : slots.mode === 'commentary' - ? slots.image.slots({ + case 'commentary': + return ( + slots.image.slots({ thumb: 'medium', reveal: true, link: true, @@ -61,11 +67,10 @@ export default { attributes: {class: 'commentary-art'}, - }) - - : html.blank()), + })); - html.tags([slots.details], {[html.onlyIfSiblings]: true}), - ]); + default: + return html.blank(); + } }, }; -- cgit 1.3.0-6-gf8a5