diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-11-27 22:49:16 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-11-27 22:49:16 -0400 |
commit | 5206ac7188c9eefd6f1d18050e2831b0f10be8ef (patch) | |
tree | 75c0f8ad55cd7771182ba64aa146104e5a5049ef /src/page/album.js | |
parent | fb5859f083687b477b8e65e0e4de56baf4b35a98 (diff) |
redesign & refinements for sticky layouting
Diffstat (limited to 'src/page/album.js')
-rw-r--r-- | src/page/album.js | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/page/album.js b/src/page/album.js index e7658cd..741fcab 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -131,9 +131,14 @@ export function write(album, {wikiData}) { return { title: language.$('albumPage.title', {album: album.name}), stylesheet: getAlbumStylesheet(album), - theme: getThemeString(album.color, [ - `--album-directory: ${album.directory}`, - ]), + + themeColor: album.color, + theme: + getThemeString(album.color, { + additionalVariables: [ + `--album-directory: ${album.directory}`, + ], + }), banner: !empty(album.bannerArtistContribs) && { dimensions: album.bannerDimensions, @@ -463,15 +468,26 @@ export function generateAlbumSidebar(album, currentTrack, { ]); if (empty(groupParts)) { - return {content: trackListPart}; + return { + stickyMode: 'column', + content: trackListPart, + }; } else if (isTrackPage) { - const combinedGroupPart = - groupParts + const combinedGroupPart = { + classes: ['no-sticky-header'], + content: groupParts .map(groupPart => groupPart.filter(Boolean).join('\n')) - .join('\n<hr>\n'); - return {multiple: [trackListPart, combinedGroupPart]}; + .join('\n<hr>\n'), + }; + return { + stickyMode: 'column', + multiple: [trackListPart, combinedGroupPart], + }; } else { - return {multiple: [...groupParts, trackListPart]}; + return { + stickyMode: 'last', + multiple: [...groupParts, trackListPart], + }; } } |