modified: templates/playerselect.html
modified: templates/quiz_multiplayer.html
This commit is contained in:
@@ -62,13 +62,13 @@
|
|||||||
<h2>{{ translations['quiz_title'] }} – Player Selection</h2>
|
<h2>{{ translations['quiz_title'] }} – Player Selection</h2>
|
||||||
<form method="get" action="{{ url_for('quiz', playlist_id=playlist_id) }}">
|
<form method="get" action="{{ url_for('quiz', playlist_id=playlist_id) }}">
|
||||||
<input type="hidden" name="mode" value="{{ game_mode }}">
|
<input type="hidden" name="mode" value="{{ game_mode }}">
|
||||||
<button class="player-btn" type="submit">{{ translations['singleplayer'] if translations['singleplayer'] else 'Singleplayer' }}</button>
|
<button class="player-btn" type="submit">{{ translations['singleplayer'] }}</button>
|
||||||
<div class="player-desc">{{ translations['singleplayer_desc'] if translations['singleplayer_desc'] else 'Play alone and test your knowledge.' }}</div>
|
<div class="player-desc">{{ translations['singleplayer_desc'] if translations['singleplayer_desc'] else 'Play alone and test your knowledge.' }}</div>
|
||||||
</form>
|
</form>
|
||||||
<form method="get" action="{{ url_for('quiz', playlist_id=playlist_id) }}">
|
<form method="get" action="{{ url_for('quiz', playlist_id=playlist_id) }}">
|
||||||
<input type="hidden" name="mode" value="{{ game_mode }}">
|
<input type="hidden" name="mode" value="{{ game_mode }}">
|
||||||
<input type="hidden" name="local_multiplayer" value="1">
|
<input type="hidden" name="local_multiplayer" value="1">
|
||||||
<button class="player-btn" type="submit">{{ translations['local_multiplayer'] if translations['local_multiplayer'] else 'Local Multiplayer' }}</button>
|
<button class="player-btn" type="submit">{{ translations['local_multiplayer'] }}</button>
|
||||||
<div class="player-desc">Spiele mit bis zu 4 Personen an einem Gerät.</div>
|
<div class="player-desc">Spiele mit bis zu 4 Personen an einem Gerät.</div>
|
||||||
</form>
|
</form>
|
||||||
<button class="player-btn disabled" disabled>{{ translations['online_multiplayer'] if translations['online_multiplayer'] else 'Online Multiplayer' }}</button>
|
<button class="player-btn disabled" disabled>{{ translations['online_multiplayer'] if translations['online_multiplayer'] else 'Online Multiplayer' }}</button>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ function startMultiplayer(e) {
|
|||||||
localStorage.setItem('quizify_multiplayer_current', 0);
|
localStorage.setItem('quizify_multiplayer_current', 0);
|
||||||
document.getElementById('multiplayerPopup').style.display = 'none';
|
document.getElementById('multiplayerPopup').style.display = 'none';
|
||||||
updateMultiplayerUI();
|
updateMultiplayerUI();
|
||||||
quizifyReady();
|
quizifyReady(); // Musik und Quiz jetzt starten!
|
||||||
}
|
}
|
||||||
window.addEventListener('DOMContentLoaded', function() {
|
window.addEventListener('DOMContentLoaded', function() {
|
||||||
fillPlayerFields();
|
fillPlayerFields();
|
||||||
@@ -257,6 +257,8 @@ function switchGameMode(mode) {
|
|||||||
function setOption(key, value) { localStorage.setItem(key, value); }
|
function setOption(key, value) { localStorage.setItem(key, value); }
|
||||||
function getOption(key, defaultValue) { return localStorage.getItem(key) || defaultValue; }
|
function getOption(key, defaultValue) { return localStorage.getItem(key) || defaultValue; }
|
||||||
|
|
||||||
|
// KEIN quizifyReady oder Musikstart im window.onload!
|
||||||
|
// Nur UI initialisieren:
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
const playDuration = getOption('playDuration', '0');
|
const playDuration = getOption('playDuration', '0');
|
||||||
const sel = document.getElementById('playDuration');
|
const sel = document.getElementById('playDuration');
|
||||||
@@ -276,8 +278,8 @@ window.onload = function() {
|
|||||||
updateMultiplayerUI();
|
updateMultiplayerUI();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Musikstart und Quiz erst nach Namensbestätigung!
|
||||||
function quizifyReady() {
|
function quizifyReady() {
|
||||||
// Musik abspielen
|
|
||||||
if (window.spotifyPlayer && window.spotifyPlayer._options && window.spotifyPlayer._options.getOAuthToken) {
|
if (window.spotifyPlayer && window.spotifyPlayer._options && window.spotifyPlayer._options.getOAuthToken) {
|
||||||
const device_id = document.getElementById('device_id').value;
|
const device_id = document.getElementById('device_id').value;
|
||||||
const playDuration = getPlayDuration();
|
const playDuration = getPlayDuration();
|
||||||
|
|||||||
Reference in New Issue
Block a user