modified: locales/de-DE.json
modified: locales/en-EN.json modified: templates/playlists.html
This commit is contained in:
@@ -40,5 +40,9 @@
|
|||||||
"logout": "Abmelden",
|
"logout": "Abmelden",
|
||||||
"custom": "Anpassbar",
|
"custom": "Anpassbar",
|
||||||
"quiz_mode": "Quiz-Modus",
|
"quiz_mode": "Quiz-Modus",
|
||||||
"quiz_mode_desc": "Errate Künstler, Titel oder Jahr. Klassisches Musik-Quiz."
|
"quiz_mode_desc": "Errate Künstler, Titel oder Jahr. Klassisches Musik-Quiz.",
|
||||||
|
"invite_guest": "Gast einladen",
|
||||||
|
"invite_duration": "Link gültig für (Minuten):",
|
||||||
|
"generate_link": "Link generieren",
|
||||||
|
"invite_link": "Einladungslink:"
|
||||||
}
|
}
|
||||||
@@ -40,5 +40,9 @@
|
|||||||
"logout": "Logout",
|
"logout": "Logout",
|
||||||
"custom": "custom",
|
"custom": "custom",
|
||||||
"quiz_mode": "Quiz Mode",
|
"quiz_mode": "Quiz Mode",
|
||||||
"quiz_mode_desc": "Guess artist, title or year. Classic music quiz."
|
"quiz_mode_desc": "Guess artist, title or year. Classic music quiz.",
|
||||||
|
"invite_guest": "Invite Guest",
|
||||||
|
"invite_duration": "Link valid for (minutes):",
|
||||||
|
"generate_link": "Generate Link",
|
||||||
|
"invite_link": "Invite Link:"
|
||||||
}
|
}
|
||||||
@@ -51,21 +51,66 @@
|
|||||||
background-color: #1ed760;
|
background-color: #1ed760;
|
||||||
transform: scale(1.04);
|
transform: scale(1.04);
|
||||||
}
|
}
|
||||||
|
/* Invite Button and Popup Styles */
|
||||||
.btn {
|
.btn {
|
||||||
display: inline-block;
|
background-color: #1DB954;
|
||||||
padding: 10px 20px;
|
|
||||||
background-color: #007bff;
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 5px;
|
border: none;
|
||||||
text-decoration: none;
|
border-radius: 30px;
|
||||||
|
padding: 10px 20px;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
cursor: pointer;
|
||||||
transition: background 0.2s, transform 0.2s;
|
transition: background 0.2s, transform 0.2s;
|
||||||
margin-top: 20px;
|
|
||||||
}
|
}
|
||||||
.btn:hover {
|
.btn:hover {
|
||||||
background-color: #0056b3;
|
background-color: #1ed760;
|
||||||
transform: scale(1.05);
|
transform: scale(1.04);
|
||||||
|
}
|
||||||
|
#invitePopup {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
#invitePopup > div {
|
||||||
|
background: #191414;
|
||||||
|
color: #fff;
|
||||||
|
padding: 30px 40px;
|
||||||
|
border-radius: 18px;
|
||||||
|
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
|
||||||
|
min-width: 320px;
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#invitePopup span {
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 18px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
#invitePopup label {
|
||||||
|
display: block;
|
||||||
|
margin: 15px 0 5px;
|
||||||
|
}
|
||||||
|
#invitePopup input {
|
||||||
|
width: 60px;
|
||||||
|
margin: 10px auto;
|
||||||
|
padding: 5px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#invitePopup #inviteLinkResult {
|
||||||
|
margin-top: 18px;
|
||||||
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
@@ -73,6 +118,9 @@
|
|||||||
<a href="{{ url_for('logout') }}" class="logout-btn" style="position:absolute;top:20px;right:30px;">
|
<a href="{{ url_for('logout') }}" class="logout-btn" style="position:absolute;top:20px;right:30px;">
|
||||||
{{ translations['logout'] if translations['logout'] else 'Logout' }}
|
{{ translations['logout'] if translations['logout'] else 'Logout' }}
|
||||||
</a>
|
</a>
|
||||||
|
<button class="btn" onclick="openInvitePopup()" style="position:absolute;top:20px;left:30px;">
|
||||||
|
{{ translations['invite_guest'] if translations['invite_guest'] else 'Invite Guest' }}
|
||||||
|
</button>
|
||||||
<div class="playlist-container">
|
<div class="playlist-container">
|
||||||
<h2>{{ translations['choose_playlist'] }}</h2>
|
<h2>{{ translations['choose_playlist'] }}</h2>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -80,7 +128,47 @@
|
|||||||
<li><a class="playlist-link" href="/gamemodes/{{ pl.id }}">{{ pl.name }}</a></li>
|
<li><a class="playlist-link" href="/gamemodes/{{ pl.id }}">{{ pl.name }}</a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
<a href="{{ url_for('invite') }}?duration=60" class="btn">Gast einladen (1h-Link)</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Invite Popup -->
|
||||||
|
<div id="invitePopup">
|
||||||
|
<div>
|
||||||
|
<span onclick="closeInvitePopup()">×</span>
|
||||||
|
<h3>{{ translations['invite_guest'] if translations['invite_guest'] else 'Invite Guest' }}</h3>
|
||||||
|
<label for="inviteDuration">{{ translations['invite_duration'] if translations['invite_duration'] else 'Link valid for (minutes):' }}</label>
|
||||||
|
<input type="number" id="inviteDuration" min="1" max="1440" value="60">
|
||||||
|
<br>
|
||||||
|
<button class="btn" onclick="generateInviteLink()">{{ translations['generate_link'] if translations['generate_link'] else 'Generate Link' }}</button>
|
||||||
|
<div id="inviteLinkResult"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function openInvitePopup() {
|
||||||
|
document.getElementById('invitePopup').style.display = 'flex';
|
||||||
|
document.getElementById('inviteLinkResult').innerHTML = '';
|
||||||
|
}
|
||||||
|
function closeInvitePopup() {
|
||||||
|
document.getElementById('invitePopup').style.display = 'none';
|
||||||
|
}
|
||||||
|
function generateInviteLink() {
|
||||||
|
const duration = document.getElementById('inviteDuration').value || 60;
|
||||||
|
fetch(`/invite?duration=${duration}`)
|
||||||
|
.then(response => response.text())
|
||||||
|
.then(html => {
|
||||||
|
// Extrahiere den Link aus dem HTML (da /invite ein Template rendert)
|
||||||
|
const match = html.match(/href="([^"]+)"/);
|
||||||
|
if (match) {
|
||||||
|
document.getElementById('inviteLinkResult').innerHTML =
|
||||||
|
`<div style="margin-top:10px;">
|
||||||
|
<strong>{{ translations['invite_link'] if translations['invite_link'] else 'Invite Link:' }}</strong><br>
|
||||||
|
<a href="${match[1]}" target="_blank" style="color:#1DB954;">${match[1]}</a>
|
||||||
|
</div>`;
|
||||||
|
} else {
|
||||||
|
document.getElementById('inviteLinkResult').innerHTML = "Error generating link.";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user