modified: app.py
modified: locales/de-DE.json modified: locales/en-EN.json modified: templates/gamemodes.html new file: templates/playerselect.html
This commit is contained in:
10
app.py
10
app.py
@@ -342,5 +342,15 @@ def get_user_from_cookie():
|
||||
return None
|
||||
return None
|
||||
|
||||
@app.route("/playerselect/<playlist_id>")
|
||||
def playerselect(playlist_id):
|
||||
game_mode = request.args.get('mode', 'artist')
|
||||
return render_template(
|
||||
"playerselect.html",
|
||||
playlist_id=playlist_id,
|
||||
game_mode=game_mode,
|
||||
translations=get_translations()
|
||||
)
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", port=5000, debug=True)
|
||||
|
||||
@@ -51,5 +51,9 @@
|
||||
"referral_duration": "Link gültig für (Minuten):",
|
||||
"generate_referral": "Einladungslink generieren",
|
||||
"referral_link_label": "Dein Einladungslink:",
|
||||
"copy_referral_link": "Link kopieren"
|
||||
"copy_referral_link": "Link kopieren",
|
||||
"singleplayer": "Singleplayer",
|
||||
"singleplayer_desc": "Spiele alleine und teste dein Wissen.",
|
||||
"local_multiplayer": "Lokaler Multiplayer",
|
||||
"online_multiplayer": "Online Multiplayer"
|
||||
}
|
||||
@@ -51,5 +51,9 @@
|
||||
"generate_referral": "Generate Referral Link",
|
||||
"referral_link_label": "Your referral link:",
|
||||
"copy_referral_link": "Copy Referral Link",
|
||||
"copied": "Copied!"
|
||||
"copied": "Copied!",
|
||||
"singleplayer": "Singleplayer",
|
||||
"singleplayer_desc": "Play alone and test your knowledge.",
|
||||
"local_multiplayer": "Local Multiplayer",
|
||||
"online_multiplayer": "Online Multiplayer"
|
||||
}
|
||||
@@ -60,7 +60,8 @@
|
||||
<body>
|
||||
<div class="gamemode-container">
|
||||
<h2>{{ translations['quiz_title'] }} – Game Modes</h2>
|
||||
<form method="get" action="{{ url_for('quiz', playlist_id=playlist_id) }}">
|
||||
<form method="get" action="{{ url_for('playerselect', playlist_id=playlist_id) }}">
|
||||
<input type="hidden" name="mode" value="artist">
|
||||
<button class="gamemode-btn" type="submit">{{ translations['quiz_mode'] if translations['quiz_mode'] else 'Quiz Mode' }}</button>
|
||||
<div class="gamemode-desc">{{ translations['quiz_mode_desc'] if translations['quiz_mode_desc'] else 'Classic music quiz.' }}</div>
|
||||
</form>
|
||||
|
||||
77
templates/playerselect.html
Normal file
77
templates/playerselect.html
Normal file
@@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ translations['quiz_title'] }} – Player Selection</title>
|
||||
<style>
|
||||
body {
|
||||
background: linear-gradient(135deg, #191414 0%, #1DB954 100%);
|
||||
color: #fff;
|
||||
font-family: Arial, sans-serif;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.playerselect-container {
|
||||
background: rgba(25, 20, 20, 0.92);
|
||||
padding: 40px 50px;
|
||||
border-radius: 22px;
|
||||
box-shadow: 0 8px 32px 0 rgba(0,0,0,0.37);
|
||||
min-width: 350px;
|
||||
text-align: center;
|
||||
}
|
||||
.player-btn {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 18px 0;
|
||||
margin: 18px 0;
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
border-radius: 30px;
|
||||
border: none;
|
||||
background: #1DB954;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s, transform 0.2s;
|
||||
text-align: center;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
.player-btn:hover {
|
||||
background: #1ed760;
|
||||
transform: scale(1.04);
|
||||
}
|
||||
.player-btn.disabled, .player-btn[disabled] {
|
||||
background: #535353;
|
||||
color: #bbb;
|
||||
cursor: not-allowed;
|
||||
opacity: 0.7;
|
||||
pointer-events: none;
|
||||
border: 1px solid #888;
|
||||
}
|
||||
.player-desc {
|
||||
font-size: 0.95em;
|
||||
color: #bdbdbd;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="playerselect-container">
|
||||
<h2>{{ translations['quiz_title'] }} – Player Selection</h2>
|
||||
<form method="get" action="{{ url_for('quiz', playlist_id=playlist_id) }}">
|
||||
<input type="hidden" name="mode" value="{{ game_mode }}">
|
||||
<button class="player-btn" type="submit">{{ translations['singleplayer'] if translations['singleplayer'] else 'Singleplayer' }}</button>
|
||||
<div class="player-desc">{{ translations['singleplayer_desc'] if translations['singleplayer_desc'] else 'Play alone and test your knowledge.' }}</div>
|
||||
</form>
|
||||
<button class="player-btn disabled" disabled>{{ translations['local_multiplayer'] if translations['local_multiplayer'] else 'Local Multiplayer' }}</button>
|
||||
<div class="player-desc">Coming soon!</div>
|
||||
<button class="player-btn disabled" disabled>{{ translations['online_multiplayer'] if translations['online_multiplayer'] else 'Online Multiplayer' }}</button>
|
||||
<div class="player-desc">Coming soon!</div>
|
||||
<div style="margin-top:30px;">
|
||||
<a href="{{ url_for('gamemodes', playlist_id=playlist_id) }}" style="color:#1DB954;">← {{ translations['quiz_mode'] }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user