Files
quizify/templates/buzzer_settings.html
Simon 081abe54c5 modified: app.py
new file:   templates/buzzer_settings.html
	modified:   templates/playerselect.html
	modified:   templates/quiz_buzzer.html
	new file:   templates/quiz_buzzer_multiplayer.html
2025-11-15 01:30:21 +01:00

224 lines
7.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html>
<head>
<title>{{ translations['quiz_title'] }} Buzzer Einstellungen</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;
}
.settings-container {
max-width: 600px;
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;
}
.setting-group {
margin-bottom: 25px;
}
.setting-label {
display: block;
font-size: 1.1em;
margin-bottom: 8px;
color: #e0e0e0;
font-weight: 600;
}
.setting-description {
font-size: 0.9em;
color: #999;
margin-bottom: 10px;
}
.setting-input {
width: 100%;
padding: 12px;
border-radius: 8px;
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;
}
.setting-input:focus {
outline: none;
border-color: #1DB954;
box-shadow: 0 0 10px rgba(29, 185, 84, 0.3);
}
.value-display {
display: inline-block;
margin-left: 10px;
font-weight: bold;
color: #1DB954;
font-size: 1.2em;
}
.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;
}
.preview {
background: rgba(15, 20, 25, 0.6);
padding: 20px;
border-radius: 12px;
margin-top: 30px;
border: 1px solid rgba(29, 185, 84, 0.2);
}
.preview-title {
font-size: 1.2em;
color: #1DB954;
margin-bottom: 15px;
text-align: center;
}
.preview-item {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.preview-item:last-child {
border-bottom: none;
}
</style>
<script>
function updatePreview() {
const maxPoints = parseInt(document.getElementById('max_points').value);
const gracePeriod = parseInt(document.getElementById('grace_period').value);
const decayRate = parseInt(document.getElementById('decay_rate').value);
document.getElementById('maxPointsDisplay').textContent = maxPoints;
document.getElementById('gracePeriodDisplay').textContent = gracePeriod;
document.getElementById('decayRateDisplay').textContent = decayRate;
// Berechne Beispielwerte
const pointsAt10s = Math.max(0, maxPoints - Math.max(0, 10 - gracePeriod) * decayRate);
const pointsAt20s = Math.max(0, maxPoints - Math.max(0, 20 - gracePeriod) * decayRate);
const pointsAt30s = Math.max(0, maxPoints - Math.max(0, 30 - gracePeriod) * decayRate);
document.getElementById('pointsAt10s').textContent = pointsAt10s;
document.getElementById('pointsAt20s').textContent = pointsAt20s;
document.getElementById('pointsAt30s').textContent = pointsAt30s;
}
function saveSettings() {
const maxPoints = document.getElementById('max_points').value;
const gracePeriod = document.getElementById('grace_period').value;
const decayRate = document.getElementById('decay_rate').value;
localStorage.setItem('buzzer_max_points', maxPoints);
localStorage.setItem('buzzer_grace_period', gracePeriod);
localStorage.setItem('buzzer_decay_rate', decayRate);
}
window.onload = function() {
// Lade gespeicherte Werte oder verwende Defaults
document.getElementById('max_points').value = localStorage.getItem('buzzer_max_points') || '1000';
document.getElementById('grace_period').value = localStorage.getItem('buzzer_grace_period') || '5';
document.getElementById('decay_rate').value = localStorage.getItem('buzzer_decay_rate') || '50';
updatePreview();
};
</script>
</head>
<body>
<div class="settings-container">
<h2>⚙️ Buzzer Einstellungen</h2>
<div class="setting-group">
<label class="setting-label" for="max_points">
Maximale Punkte <span class="value-display" id="maxPointsDisplay">1000</span>
</label>
<div class="setting-description">Die maximalen Punkte, die man innerhalb der Schonzeit erreichen kann.</div>
<input type="range" class="setting-input" id="max_points" min="100" max="5000" step="100" value="1000" oninput="updatePreview()">
</div>
<div class="setting-group">
<label class="setting-label" for="grace_period">
Schonzeit <span class="value-display" id="gracePeriodDisplay">5</span> Sekunden
</label>
<div class="setting-description">Zeit in Sekunden, in der keine Punkte abgezogen werden.</div>
<input type="range" class="setting-input" id="grace_period" min="0" max="15" step="1" value="5" oninput="updatePreview()">
</div>
<div class="setting-group">
<label class="setting-label" for="decay_rate">
Verfallsrate <span class="value-display" id="decayRateDisplay">50</span> Punkte/Sekunde
</label>
<div class="setting-description">Punkte, die pro Sekunde nach der Schonzeit verloren gehen.</div>
<input type="range" class="setting-input" id="decay_rate" min="10" max="200" step="10" value="50" oninput="updatePreview()">
</div>
<div class="preview">
<div class="preview-title">📊 Beispiel: Punkte nach Zeit</div>
<div class="preview-item">
<span>Nach 10 Sekunden:</span>
<span class="value-display" id="pointsAt10s">750</span>
</div>
<div class="preview-item">
<span>Nach 20 Sekunden:</span>
<span class="value-display" id="pointsAt20s">250</span>
</div>
<div class="preview-item">
<span>Nach 30 Sekunden:</span>
<span class="value-display" id="pointsAt30s">0</span>
</div>
</div>
<div class="button-group">
<a href="/quiz/{{ playlist_id }}?mode={{ game_mode }}&buzzer=1{% if local_multiplayer %}&local_multiplayer=1{% endif %}" class="btn btn-primary" onclick="saveSettings()">
✅ Starten
</a>
<a href="/playerselect/{{ playlist_id }}?mode={{ game_mode }}&buzzer=1" class="btn btn-secondary">
⬅️ Zurück
</a>
</div>
</div>
</body>
</html>