diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-03-31 17:43:33 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-04-10 16:02:36 -0300 |
commit | 05c3b2ad399081cac88c8ac7fddf233c01d79e98 (patch) | |
tree | 02b05c6247fbe6122b457985abc5de7e491a4ed2 /src/content/dependencies/generateCoverArtwork.js | |
parent | 015989924eadd401ae5932d634109a2f6b801666 (diff) |
content: cover-artwork, cover-art-column
Diffstat (limited to 'src/content/dependencies/generateCoverArtwork.js')
-rw-r--r-- | src/content/dependencies/generateCoverArtwork.js | 82 |
1 files changed, 38 insertions, 44 deletions
diff --git a/src/content/dependencies/generateCoverArtwork.js b/src/content/dependencies/generateCoverArtwork.js index 06972d6b..58c29830 100644 --- a/src/content/dependencies/generateCoverArtwork.js +++ b/src/content/dependencies/generateCoverArtwork.js @@ -38,49 +38,43 @@ export default { ? {square: true} : {dimensions: slots.dimensions}); - switch (slots.mode) { - case 'primary': - return html.tags([ - slots.image.slots({ - thumb: 'medium', - reveal: true, - link: true, - - warnings: slots.warnings, - ...sizeSlots, - }), - - slots.details, - ]); - - case 'thumbnail': - return ( - slots.image.slots({ - thumb: 'small', - reveal: false, - link: false, - - warnings: slots.warnings, - ...sizeSlots, - })); - - case 'commentary': - return ( - slots.image.slots({ - thumb: 'medium', - reveal: true, - link: true, - lazy: true, - - warnings: slots.warnings, - ...sizeSlots, - - attributes: - {class: 'commentary-art'}, - })); - - default: - return html.blank(); - } + return ( + html.tag('div', {class: 'cover-artwork'}, + slots.mode === 'commentary' && + {class: 'commentary-art'}, + + (slots.mode === 'primary' + ? [ + slots.image.slots({ + thumb: 'medium', + reveal: true, + link: true, + + warnings: slots.warnings, + ...sizeSlots, + }), + + slots.details, + ] + : slots.mode === 'thumbnail' + ? slots.image.slots({ + thumb: 'small', + reveal: false, + link: false, + + warnings: slots.warnings, + ...sizeSlots, + }) + : slots.mode === 'commentary' + ? slots.image.slots({ + thumb: 'medium', + reveal: true, + link: true, + lazy: true, + + warnings: slots.warnings, + ...sizeSlots, + }) + : html.blank()))); }, }; |