feat: artist hero redesign — album art banner + circular pfp on left
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
79a4aa352f
commit
64aec78a43
3 files changed
+33
-22
No files matched your search
+21
-12
@@ -71,7 +71,11 @@ export async function loadArtistDetail(artist) {
|
||||
const albEl = document.getElementById('artist-albums-section');
|
||||
hero.style.background = 'linear-gradient(135deg, var(--surface2), var(--surface))';
|
||||
hero.querySelector('.artist-hero-img')?.remove();
|
||||
hero.querySelector('.artist-hero-bg')?.remove();
|
||||
const heroBgEl = document.getElementById('artist-hero-bg');
|
||||
if(heroBgEl) heroBgEl.style.backgroundImage = '';
|
||||
document.getElementById('artist-hero-pfp-wrap')?.querySelector('.artist-hero-pfp')?.remove();
|
||||
const pfpInitial = document.getElementById('artist-hero-pfp-initial');
|
||||
if(pfpInitial) pfpInitial.textContent = artist.name?.[0]?.toUpperCase() || '?';
|
||||
const overlay = hero.querySelector('.artist-hero-overlay');
|
||||
if(overlay) overlay.style.background = '';
|
||||
[bioEl, simEl, tsEl, albEl].forEach(el => { if(el) el.innerHTML = ''; });
|
||||
@@ -109,18 +113,23 @@ export async function loadArtistDetail(artist) {
|
||||
|
||||
// ── Hero ──
|
||||
const img = imgRes.status === 'fulfilled' ? imgRes.value : null;
|
||||
if(img) {
|
||||
const _firstAlbums = albumRes.status === 'fulfilled' ? (albumRes.value?.artist?.album || []) : [];
|
||||
const _bgCover = _firstAlbums[0] ? coverUrl(_firstAlbums[0].coverArt, 512) : null;
|
||||
if(_bgCover || img) {
|
||||
hero.style.background = '';
|
||||
const bgEl = document.createElement('div');
|
||||
bgEl.className = 'artist-hero-bg';
|
||||
bgEl.style.backgroundImage = `url('${img}')`;
|
||||
hero.insertBefore(bgEl, overlay);
|
||||
const heroImg = document.createElement('img');
|
||||
heroImg.className = 'artist-hero-img';
|
||||
heroImg.alt = '';
|
||||
heroImg.src = img;
|
||||
hero.insertBefore(heroImg, overlay);
|
||||
if(overlay) overlay.style.background = 'linear-gradient(to right,rgba(7,7,15,.95) 0%,rgba(7,7,15,.35) 55%,rgba(7,7,15,.75) 100%)';
|
||||
const bgEl = document.getElementById('artist-hero-bg');
|
||||
if(bgEl) bgEl.style.backgroundImage = `url('${_bgCover || img}')`;
|
||||
if(overlay) overlay.style.background = 'linear-gradient(to top,rgba(7,7,15,.92) 0%,rgba(7,7,15,.35) 100%)';
|
||||
}
|
||||
if(img) {
|
||||
const pfpWrap = document.getElementById('artist-hero-pfp-wrap');
|
||||
if(pfpWrap) {
|
||||
const pfpImg = document.createElement('img');
|
||||
pfpImg.className = 'artist-hero-pfp';
|
||||
pfpImg.alt = '';
|
||||
pfpImg.src = img;
|
||||
pfpWrap.prepend(pfpImg);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Bio ──
|
||||
|
||||
Reference in new issue
Block a user