fix: artist hero desktop uses blurred backdrop + natural-proportion portrait

Single object-position can never work well for portrait photos in a ~6:1 wide
banner — we'd only see ~11% of the image height no matter the value.

Desktop now uses two layers:
  1. artist-hero-bg: same image, blurred + darkened, fills full banner width
  2. artist-hero-img: sharp portrait anchored to the right at natural proportions
     (height: 100%, width: auto — no cropping, full face visible)

Mobile unchanged (cover + center center was already working great).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-06-07 21:11:24 +02:00
1 parent ce0697e00a
commit 79a4aa352f
2 files changed
+10 -2

No files matched your search

+6 -1
View File
@@ -71,6 +71,7 @@ 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 overlay = hero.querySelector('.artist-hero-overlay');
if(overlay) overlay.style.background = '';
[bioEl, simEl, tsEl, albEl].forEach(el => { if(el) el.innerHTML = ''; });
@@ -110,11 +111,15 @@ export async function loadArtistDetail(artist) {
const img = imgRes.status === 'fulfilled' ? imgRes.value : null;
if(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, hero.firstChild);
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%)';
}