diff --git a/next.config.js b/next.config.js index e4ca3913..0721bfec 100644 --- a/next.config.js +++ b/next.config.js @@ -139,6 +139,15 @@ module.exports = withBundleAnalyzer({ name: 'preset-default', params: { overrides: { removeViewBox: false } }, }, + // preset-default's cleanupIds minifies internal ids to short + // strings (a, b, c…) per file. SVGR inlines every icon into the + // same DOM, so icons that reference their own clipPath/filter/ + // gradient via url(#id) (book, video, their shadows, delete, + // edit) end up with colliding ids — url(#a) resolves to whichever + // #a renders first, pointing at the wrong def and rendering blank. + // prefixIds namespaces each file's ids by filename so they stay + // unique across icons. + 'prefixIds', ], }, }, diff --git a/public/assets/library/audio-cover.png b/public/assets/library/audio-cover.png new file mode 100644 index 00000000..959af9b8 Binary files /dev/null and b/public/assets/library/audio-cover.png differ diff --git a/public/assets/library/book-cover.png b/public/assets/library/book-cover.png new file mode 100644 index 00000000..6c6830d4 Binary files /dev/null and b/public/assets/library/book-cover.png differ diff --git a/src/components/library/molecules/AudioCard/AudioCard.module.scss b/src/components/library/molecules/AudioCard/AudioCard.module.scss index 0be3bc2e..53a148d6 100644 --- a/src/components/library/molecules/AudioCard/AudioCard.module.scss +++ b/src/components/library/molecules/AudioCard/AudioCard.module.scss @@ -52,10 +52,29 @@ opacity: 0.55; } +// The vinyl mockup body (sleeve + disc edge baked in). Always rendered behind +// the cover so an uncovered object reads as a blank sleeve and a covered one +// keeps the disc peeking out on the right. +.placeholder { + position: absolute; + top: 0; + left: 0; + width: 230px; + height: 194px; + z-index: 0; + background: url('/assets/library/audio-cover.png') center / cover no-repeat; +} + +// The uploaded album art sits on the square sleeve only — 190×190, flush to the +// right edge so the placeholder's disc edge stays exposed on the left. .cover { position: absolute; - inset: 0; + top: 0; + right: 0; + width: 190px; + height: 190px; overflow: hidden; + z-index: 1; transition: opacity 0.15s ease; } @@ -66,12 +85,6 @@ object-fit: cover; } -.coverPlaceholder { - width: 100%; - height: 100%; - background: var(--white); -} - .tags { display: flex; flex-direction: column; @@ -94,6 +107,15 @@ height: 138px; gap: 0; + .placeholder, + .cover { + inset: 0; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + .tags { display: none; } diff --git a/src/components/library/molecules/AudioCard/AudioCard.tsx b/src/components/library/molecules/AudioCard/AudioCard.tsx index ec9b5904..00df7106 100644 --- a/src/components/library/molecules/AudioCard/AudioCard.tsx +++ b/src/components/library/molecules/AudioCard/AudioCard.tsx @@ -57,8 +57,9 @@ export function AudioCard({ /> )} + )} +