feat: artist bio always shows full text, remove Mehr lesen
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
b436e39f40
commit
f91176da2a
1 file changed
+2
-10
+2
-10
@@ -161,13 +161,9 @@ export async function loadArtistDetail(artist) {
|
|||||||
const info = infoRes.status === 'fulfilled' ? infoRes.value?.artistInfo2 : null;
|
const info = infoRes.status === 'fulfilled' ? infoRes.value?.artistInfo2 : null;
|
||||||
if(info?.biography && bioEl) {
|
if(info?.biography && bioEl) {
|
||||||
const bio = info.biography.replace(/<a [^>]+>/g,'').replace(/<\/a>/g,'').replace(/<[^>]+>/g,'').trim();
|
const bio = info.biography.replace(/<a [^>]+>/g,'').replace(/<\/a>/g,'').replace(/<[^>]+>/g,'').trim();
|
||||||
const short = bio.length > 400 ? bio.slice(0,400)+'…' : bio;
|
if(bio) {
|
||||||
if(short) {
|
|
||||||
window._artistBioFull = bio;
|
|
||||||
bioEl.innerHTML = `<div class="section-title" style="margin-bottom:10px">Über</div>
|
bioEl.innerHTML = `<div class="section-title" style="margin-bottom:10px">Über</div>
|
||||||
<div class="artist-bio" id="artist-bio-text">${esc(short)}${bio.length > 400
|
<div class="artist-bio">${esc(bio)}</div>`;
|
||||||
? ` <button onclick="expandArtistBio()" style="background:none;border:none;cursor:pointer;color:var(--accent);font-size:12px;padding:0;margin-left:6px">Mehr lesen</button>`
|
|
||||||
: ''}</div>`;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,10 +410,6 @@ export async function loadAlbumDetail(album) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ─── HELPERS ───
|
// ─── HELPERS ───
|
||||||
export function expandArtistBio() {
|
|
||||||
const el = document.getElementById('artist-bio-text');
|
|
||||||
if(el && window._artistBioFull) el.textContent = window._artistBioFull;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function _extractColor(src) {
|
async function _extractColor(src) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
|||||||
Reference in new issue
Block a user