modified: templates/quiz.html
This commit is contained in:
@@ -277,17 +277,17 @@
|
|||||||
.then(data => {
|
.then(data => {
|
||||||
const resultContainer = document.getElementById('resultContainer');
|
const resultContainer = document.getElementById('resultContainer');
|
||||||
resultContainer.style.display = 'block';
|
resultContainer.style.display = 'block';
|
||||||
|
|
||||||
if (data.correct) {
|
if (data.correct) {
|
||||||
resultContainer.className = 'result-container correct';
|
resultContainer.className = 'result-container correct';
|
||||||
resultContainer.innerHTML = `<h3>Richtig! 🎉</h3>`;
|
resultContainer.innerHTML = `<h3>${i18n.correct}</h3>`;
|
||||||
} else {
|
} else {
|
||||||
resultContainer.className = 'result-container incorrect';
|
resultContainer.className = 'result-container incorrect';
|
||||||
resultContainer.innerHTML = `<h3>Falsch 😢</h3>
|
resultContainer.innerHTML = `<h3>${i18n.wrong}</h3>
|
||||||
<p>Die richtige Antwort ist: <strong>${data.correct_answer}</strong></p>`;
|
<p>${i18n.right_answer} <strong>${data.correct_answer}</strong></p>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Song-Infos ergänzen (du müsstest sie ggf. aus dem Backend mitgeben)
|
// Song-Infos ergänzen
|
||||||
resultContainer.innerHTML += `
|
resultContainer.innerHTML += `
|
||||||
<div style="margin-top:10px;">
|
<div style="margin-top:10px;">
|
||||||
<img src="{{ track.album.images[0].url }}" alt="Cover" style="width:80px;border-radius:8px;"><br>
|
<img src="{{ track.album.images[0].url }}" alt="Cover" style="width:80px;border-radius:8px;"><br>
|
||||||
@@ -298,7 +298,7 @@
|
|||||||
<a href="{{ track.external_urls.spotify }}" target="_blank" style="color:#1DB954;">${i18n.open_on_spotify}</a>
|
<a href="{{ track.external_urls.spotify }}" target="_blank" style="color:#1DB954;">${i18n.open_on_spotify}</a>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Zeige den "Nächste Frage" Button
|
// Zeige den "Nächste Frage" Button
|
||||||
document.getElementById('nextQuestionBtn').style.display = 'inline-block';
|
document.getElementById('nextQuestionBtn').style.display = 'inline-block';
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user