modified: templates/quiz_multiplayer.html
This commit is contained in:
@@ -56,6 +56,12 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extra_body %}
|
||||
<script>
|
||||
// Multiplayer-Daten IMMER beim Laden löschen, damit Popup immer erscheint
|
||||
localStorage.removeItem('quizify_multiplayer_names');
|
||||
localStorage.removeItem('quizify_multiplayer_scores');
|
||||
localStorage.removeItem('quizify_multiplayer_current');
|
||||
</script>
|
||||
{% if local_multiplayer %}
|
||||
<div id="multiplayerPopup" style="position:fixed;top:0;left:0;width:100vw;height:100vh;background:rgba(0,0,0,0.7);display:flex;align-items:center;justify-content:center;z-index:2000;">
|
||||
<div style="background:#191414;padding:30px 40px;border-radius:18px;box-shadow:0 8px 32px 0 rgba(0,0,0,0.37);min-width:320px;text-align:center;">
|
||||
@@ -71,13 +77,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function fillPlayerFields() {
|
||||
// Namen aus LocalStorage vorbefüllen
|
||||
const names = JSON.parse(localStorage.getItem('quizify_multiplayer_names') || "[]");
|
||||
for(let i=1;i<=4;i++) {
|
||||
document.getElementById('player'+i).value = names[i-1] || "";
|
||||
}
|
||||
}
|
||||
function startMultiplayer(e) {
|
||||
e.preventDefault();
|
||||
const names = [];
|
||||
@@ -96,13 +95,6 @@ function startMultiplayer(e) {
|
||||
updateMultiplayerUI();
|
||||
quizifyReady(); // Musik und Quiz jetzt starten!
|
||||
}
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
fillPlayerFields();
|
||||
// Popup IMMER anzeigen, falls vorhanden
|
||||
if (document.getElementById('multiplayerPopup')) {
|
||||
document.getElementById('multiplayerPopup').style.display = 'flex';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
<script>
|
||||
@@ -276,6 +268,11 @@ window.onload = function() {
|
||||
}
|
||||
document.getElementById('startPosition').value = getOption('startPosition', 'start');
|
||||
updateMultiplayerUI();
|
||||
|
||||
// Popup immer anzeigen, weil LocalStorage oben geleert wurde
|
||||
if (document.getElementById('multiplayerPopup')) {
|
||||
document.getElementById('multiplayerPopup').style.display = 'flex';
|
||||
}
|
||||
};
|
||||
|
||||
// Musikstart und Quiz erst nach Namensbestätigung!
|
||||
|
||||
Reference in New Issue
Block a user