modified: templates/quiz.html

This commit is contained in:
2025-11-14 23:44:17 +01:00
parent b8e6fab663
commit 8abd857864

View File

@@ -411,13 +411,19 @@
const resultContainer = document.getElementById('resultContainer'); const resultContainer = document.getElementById('resultContainer');
resultContainer.style.display = 'block'; resultContainer.style.display = 'block';
// Bereinige die Antwort für die Anzeige im title-Modus
let displayAnswer = data.correct_answer;
if (currentGameMode === 'title') {
displayAnswer = cleanTitle(displayAnswer);
}
if (data.correct) { if (data.correct) {
resultContainer.className = 'result-container correct'; resultContainer.className = 'result-container correct';
resultContainer.innerHTML = `<h3>${i18n.correct}</h3>`; resultContainer.innerHTML = `<h3>${i18n.correct}</h3>`;
} else { } else {
resultContainer.className = 'result-container incorrect'; resultContainer.className = 'result-container incorrect';
resultContainer.innerHTML = `<h3>${i18n.wrong}</h3> resultContainer.innerHTML = `<h3>${i18n.wrong}</h3>
<p>${i18n.right_answer} <strong>${data.correct_answer}</strong></p>`; <p>${i18n.right_answer} <strong>${displayAnswer}</strong></p>`;
} }
// Song-Infos ergänzen // Song-Infos ergänzen
@@ -425,7 +431,7 @@
<div style="margin-top:20px; padding:20px; background:rgba(15,20,35,0.8); border-radius:15px; border:1px solid rgba(29,185,84,0.3);"> <div style="margin-top:20px; padding:20px; background:rgba(15,20,35,0.8); border-radius:15px; border:1px solid rgba(29,185,84,0.3);">
<img src="{{ track.album.images[0].url }}" alt="Cover" style="width:120px; height:120px; border-radius:12px; margin-bottom:15px; box-shadow:0 4px 15px rgba(0,0,0,0.5);"><br> <img src="{{ track.album.images[0].url }}" alt="Cover" style="width:120px; height:120px; border-radius:12px; margin-bottom:15px; box-shadow:0 4px 15px rgba(0,0,0,0.5);"><br>
<div style="text-align:left; display:inline-block; margin-top:10px;"> <div style="text-align:left; display:inline-block; margin-top:10px;">
<p style="margin:8px 0;"><strong style="color:#1DB954;">${i18n.song || 'Song'}:</strong> <span style="color:#e0e0e0;">{{ track.name }}</span></p> <p style="margin:8px 0;"><strong style="color:#1DB954;">${i18n.song || 'Song'}:</strong> <span style="color:#e0e0e0;">${currentGameMode === 'title' ? displayAnswer : '{{ track.name }}'}</span></p>
<p style="margin:8px 0;"><strong style="color:#1DB954;">${i18n.artist || 'Artist'}:</strong> <span style="color:#e0e0e0;">{{ track.artists[0].name }}</span></p> <p style="margin:8px 0;"><strong style="color:#1DB954;">${i18n.artist || 'Artist'}:</strong> <span style="color:#e0e0e0;">{{ track.artists[0].name }}</span></p>
<p style="margin:8px 0;"><strong style="color:#1DB954;">${i18n.album || 'Album'}:</strong> <span style="color:#e0e0e0;">{{ track.album.name }}</span></p> <p style="margin:8px 0;"><strong style="color:#1DB954;">${i18n.album || 'Album'}:</strong> <span style="color:#e0e0e0;">{{ track.album.name }}</span></p>
<p style="margin:8px 0;"><strong style="color:#1DB954;">${i18n.year || 'Year'}:</strong> <span style="color:#e0e0e0;">{{ track.album.release_date[:4] }}</span></p> <p style="margin:8px 0;"><strong style="color:#1DB954;">${i18n.year || 'Year'}:</strong> <span style="color:#e0e0e0;">{{ track.album.release_date[:4] }}</span></p>