modified: templates/playerselect.html modified: templates/quiz_buzzer_multiplayer.html modified: templates/team_setup.html
242 lines
6.8 KiB
HTML
242 lines
6.8 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<title>{{ translations['quiz_title'] }} – Team Setup</title>
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
body {
|
||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||
background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1419 100%);
|
||
color: #e0e0e0;
|
||
min-height: 100vh;
|
||
padding: 20px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.setup-container {
|
||
max-width: 700px;
|
||
width: 100%;
|
||
background: rgba(25, 30, 45, 0.95);
|
||
border-radius: 20px;
|
||
padding: 40px;
|
||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
|
||
backdrop-filter: blur(10px);
|
||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||
}
|
||
h2 {
|
||
text-align: center;
|
||
margin-bottom: 30px;
|
||
color: #1DB954;
|
||
font-size: 2em;
|
||
}
|
||
.team-count-section {
|
||
margin-bottom: 30px;
|
||
text-align: center;
|
||
}
|
||
.team-count-label {
|
||
font-size: 1.2em;
|
||
margin-bottom: 15px;
|
||
color: #e0e0e0;
|
||
}
|
||
.team-count-buttons {
|
||
display: flex;
|
||
justify-content: center;
|
||
gap: 15px;
|
||
flex-wrap: wrap;
|
||
}
|
||
.count-btn {
|
||
padding: 15px 30px;
|
||
border-radius: 15px;
|
||
border: 2px solid rgba(29, 185, 84, 0.3);
|
||
background: rgba(15, 20, 25, 0.8);
|
||
color: #e0e0e0;
|
||
font-size: 1.2em;
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
transition: all 0.3s ease;
|
||
}
|
||
.count-btn:hover {
|
||
border-color: #1DB954;
|
||
transform: translateY(-2px);
|
||
}
|
||
.count-btn.active {
|
||
background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
|
||
border-color: #1DB954;
|
||
color: white;
|
||
box-shadow: 0 4px 15px rgba(29, 185, 84, 0.5);
|
||
}
|
||
.teams-section {
|
||
margin-bottom: 30px;
|
||
}
|
||
.team-input-group {
|
||
margin-bottom: 20px;
|
||
}
|
||
.team-label {
|
||
display: block;
|
||
font-size: 1.1em;
|
||
margin-bottom: 8px;
|
||
color: #1DB954;
|
||
font-weight: 600;
|
||
}
|
||
.team-input {
|
||
width: 100%;
|
||
padding: 15px;
|
||
border-radius: 12px;
|
||
border: 2px solid rgba(29, 185, 84, 0.3);
|
||
background: rgba(15, 20, 25, 0.8);
|
||
color: #e0e0e0;
|
||
font-size: 1.1em;
|
||
transition: all 0.3s ease;
|
||
}
|
||
.team-input:focus {
|
||
outline: none;
|
||
border-color: #1DB954;
|
||
box-shadow: 0 0 10px rgba(29, 185, 84, 0.3);
|
||
}
|
||
.team-input.disabled {
|
||
opacity: 0.4;
|
||
cursor: not-allowed;
|
||
}
|
||
.btn {
|
||
display: inline-block;
|
||
padding: 15px 30px;
|
||
margin: 10px 5px;
|
||
border-radius: 25px;
|
||
border: none;
|
||
font-size: 1.1em;
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
transition: all 0.3s ease;
|
||
text-decoration: none;
|
||
color: white;
|
||
}
|
||
.btn-primary {
|
||
background: linear-gradient(135deg, #1DB954 0%, #1ed760 100%);
|
||
box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
|
||
}
|
||
.btn-primary:hover {
|
||
transform: translateY(-2px);
|
||
box-shadow: 0 6px 20px rgba(29, 185, 84, 0.5);
|
||
}
|
||
.btn-secondary {
|
||
background: linear-gradient(135deg, #535353 0%, #666 100%);
|
||
}
|
||
.btn-secondary:hover {
|
||
transform: translateY(-2px);
|
||
background: linear-gradient(135deg, #666 0%, #777 100%);
|
||
}
|
||
.button-group {
|
||
text-align: center;
|
||
margin-top: 30px;
|
||
}
|
||
</style>
|
||
<script>
|
||
let teamCount = 2;
|
||
|
||
function setTeamCount(count) {
|
||
teamCount = count;
|
||
|
||
// Update aktive Button
|
||
document.querySelectorAll('.count-btn').forEach(btn => {
|
||
btn.classList.remove('active');
|
||
});
|
||
document.getElementById(`count${count}`).classList.add('active');
|
||
|
||
// Enable/Disable Inputs
|
||
for (let i = 1; i <= 4; i++) {
|
||
const input = document.getElementById(`team${i}`);
|
||
if (i <= count) {
|
||
input.disabled = false;
|
||
input.classList.remove('disabled');
|
||
} else {
|
||
input.disabled = true;
|
||
input.classList.add('disabled');
|
||
}
|
||
}
|
||
|
||
// Speichere in localStorage
|
||
localStorage.setItem('team_count', count);
|
||
}
|
||
|
||
function saveTeams() {
|
||
const teams = [];
|
||
for (let i = 1; i <= teamCount; i++) {
|
||
const name = document.getElementById(`team${i}`).value || `Spieler ${i}`;
|
||
teams.push(name);
|
||
}
|
||
|
||
// Speichere in localStorage
|
||
localStorage.setItem('team_names', JSON.stringify(teams));
|
||
localStorage.setItem('team_count', teamCount);
|
||
}
|
||
|
||
window.onload = function() {
|
||
// Lade gespeicherte Werte
|
||
const savedCount = parseInt(localStorage.getItem('team_count')) || 2;
|
||
const savedNames = JSON.parse(localStorage.getItem('team_names') || '[]');
|
||
|
||
// Setze Team-Anzahl
|
||
setTeamCount(savedCount);
|
||
|
||
// Setze Team-Namen
|
||
savedNames.forEach((name, index) => {
|
||
if (index < 4) {
|
||
document.getElementById(`team${index + 1}`).value = name;
|
||
}
|
||
});
|
||
};
|
||
</script>
|
||
</head>
|
||
<body>
|
||
<div class="setup-container">
|
||
<h2>👥 Team Setup</h2>
|
||
|
||
<div class="team-count-section">
|
||
<div class="team-count-label">Wie viele Teams spielen mit?</div>
|
||
<div class="team-count-buttons">
|
||
<button class="count-btn active" id="count2" onclick="setTeamCount(2)">2 Teams</button>
|
||
<button class="count-btn" id="count3" onclick="setTeamCount(3)">3 Teams</button>
|
||
<button class="count-btn" id="count4" onclick="setTeamCount(4)">4 Teams</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="teams-section">
|
||
<div class="team-input-group">
|
||
<label class="team-label" for="team1">Team 1</label>
|
||
<input type="text" class="team-input" id="team1" placeholder="Team 1 Name" value="Spieler 1">
|
||
</div>
|
||
|
||
<div class="team-input-group">
|
||
<label class="team-label" for="team2">Team 2</label>
|
||
<input type="text" class="team-input" id="team2" placeholder="Team 2 Name" value="Spieler 2">
|
||
</div>
|
||
|
||
<div class="team-input-group">
|
||
<label class="team-label" for="team3">Team 3</label>
|
||
<input type="text" class="team-input disabled" id="team3" placeholder="Team 3 Name" value="Spieler 3" disabled>
|
||
</div>
|
||
|
||
<div class="team-input-group">
|
||
<label class="team-label" for="team4">Team 4</label>
|
||
<input type="text" class="team-input disabled" id="team4" placeholder="Team 4 Name" value="Spieler 4" disabled>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="button-group">
|
||
<a href="{{ url_for('buzzer_settings', playlist_id=playlist_id, mode=game_mode, local_multiplayer=1) }}" class="btn btn-primary" onclick="saveTeams()">
|
||
✅ Weiter
|
||
</a>
|
||
<a href="{{ url_for('playerselect', playlist_id=playlist_id, mode=game_mode, buzzer=1) }}" class="btn btn-secondary">
|
||
⬅️ Zurück
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html>
|