modified: templates/quiz_multiplayer.html
This commit is contained in:
@@ -64,7 +64,8 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="quiz-container">
|
||||
<div id="multiplayerBar">
|
||||
<!-- Multiplayer-Bar immer sichtbar -->
|
||||
<div id="multiplayerBar" style="margin-bottom:15px;text-align:center;">
|
||||
<span id="multiplayerPlayers"></span>
|
||||
</div>
|
||||
<div style="text-align:center; margin-bottom: 20px;">
|
||||
@@ -250,14 +251,15 @@
|
||||
const names = JSON.parse(localStorage.getItem('quizify_multiplayer_names') || "[]");
|
||||
const scores = JSON.parse(localStorage.getItem('quizify_multiplayer_scores') || "[]");
|
||||
const current = parseInt(localStorage.getItem('quizify_multiplayer_current') || "0");
|
||||
let html = '';
|
||||
if(names.length > 1) {
|
||||
document.getElementById('multiplayerBar').style.display = '';
|
||||
let html = '';
|
||||
names.forEach((n,i) => {
|
||||
html += `<span style="margin:0 10px;${i===current?'font-weight:bold;text-decoration:underline;':''}">${n}: ${scores[i]}</span>`;
|
||||
html += `<span style="margin:0 10px;${i===current?'font-weight:bold;text-decoration:underline;':''}">${n}: ${scores[i] || 0}</span>`;
|
||||
});
|
||||
html += `<br><span style="font-size:0.95em;color:#bdbdbd;">Am Zug: <b>${names[current]}</b></span>`;
|
||||
document.getElementById('multiplayerPlayers').innerHTML = html;
|
||||
}
|
||||
document.getElementById('multiplayerPlayers').innerHTML = html;
|
||||
if(names.length > 1) {
|
||||
document.getElementById('answerInput').placeholder = "Antwort für " + names[current];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user