diff options
Diffstat (limited to 'src/content/dependencies/generateAlbumStylesheet.js')
-rw-r--r-- | src/content/dependencies/generateAlbumStylesheet.js | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/content/dependencies/generateAlbumStylesheet.js b/src/content/dependencies/generateAlbumStylesheet.js deleted file mode 100644 index c9547836..00000000 --- a/src/content/dependencies/generateAlbumStylesheet.js +++ /dev/null @@ -1,61 +0,0 @@ -import {empty} from '../../util/sugar.js'; - -export default { - extraDependencies: [ - 'to', - ], - - data(album) { - const data = {}; - - data.hasWallpaper = !empty(album.wallpaperArtistContribs); - data.hasBanner = !empty(album.bannerArtistContribs); - - if (data.hasWallpaper) { - data.hasWallpaperStyle = !!album.wallpaperStyle; - data.wallpaperPath = ['media.albumWallpaper', album.directory, album.wallpaperFileExtension]; - data.wallpaperStyle = album.wallpaperStyle; - } - - if (data.hasBanner) { - data.hasBannerStyle = !!album.bannerStyle; - data.bannerStyle = album.bannerStyle; - } - - return data; - }, - - generate(data, {to}) { - const wallpaperPart = - (data.hasWallpaper - ? [ - `body::before {`, - ` background-image: url("${to(...data.wallpaperPath)}");`, - ...(data.hasWallpaperStyle - ? data.wallpaperStyle - .split('\n') - .map(line => ` ${line}`) - : []), - `}`, - ] - : []); - - const bannerPart = - (data.hasBannerStyle - ? [ - `#banner img {`, - ...data.bannerStyle - .split('\n') - .map(line => ` ${line}`), - `}`, - ] - : []); - - return [ - ...wallpaperPart, - ...bannerPart, - ] - .filter(Boolean) - .join('\n'); - }, -}; |