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;">
|
||||
@@ -270,16 +276,9 @@ window.onload = function() {
|
||||
}
|
||||
document.getElementById('startPosition').value = getOption('startPosition', 'start');
|
||||
|
||||
// Prüfe, ob Namen im LocalStorage sind
|
||||
const names = JSON.parse(localStorage.getItem('quizify_multiplayer_names') || "[]");
|
||||
if (names.length < 2) {
|
||||
// Popup anzeigen
|
||||
if (document.getElementById('multiplayerPopup')) {
|
||||
document.getElementById('multiplayerPopup').style.display = 'flex';
|
||||
}
|
||||
} else {
|
||||
updateMultiplayerUI();
|
||||
quizifyReady();
|
||||
// Popup immer anzeigen, weil LocalStorage oben geleert wurde
|
||||
if (document.getElementById('multiplayerPopup')) {
|
||||
document.getElementById('multiplayerPopup').style.display = 'flex';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user