222 lines
6.6 KiB
HTML
222 lines
6.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>{{ translations['quiz_title'] }}</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;
|
|
}
|
|
.playlist-container {
|
|
background: rgba(25, 20, 20, 0.85);
|
|
padding: 40px 50px;
|
|
border-radius: 20px;
|
|
margin-top: 60px;
|
|
box-shadow: 0 8px 32px 0 rgba(0,0,0,0.37);
|
|
min-width: 350px;
|
|
}
|
|
h2 {
|
|
margin-bottom: 30px;
|
|
font-size: 2em;
|
|
letter-spacing: 1px;
|
|
text-align: center;
|
|
}
|
|
ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
li {
|
|
margin: 15px 0;
|
|
}
|
|
a.playlist-link {
|
|
display: block;
|
|
padding: 15px 25px;
|
|
background-color: #1DB954;
|
|
color: #fff;
|
|
border-radius: 30px;
|
|
text-decoration: none;
|
|
font-size: 1.1em;
|
|
font-weight: bold;
|
|
transition: background 0.2s, transform 0.2s;
|
|
text-align: center;
|
|
}
|
|
a.playlist-link:hover {
|
|
background-color: #1ed760;
|
|
transform: scale(1.04);
|
|
}
|
|
/* Invite Button and Popup Styles */
|
|
.btn {
|
|
background-color: #1DB954;
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 30px;
|
|
padding: 10px 20px;
|
|
font-size: 1em;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
transition: background 0.2s, transform 0.2s;
|
|
}
|
|
.btn:hover {
|
|
background-color: #1ed760;
|
|
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;
|
|
}
|
|
.top-bar {
|
|
width: 100%;
|
|
padding: 10px 0;
|
|
background: rgba(25, 20, 20, 0.85);
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
z-index: 100;
|
|
}
|
|
.top-bar-section {
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.top-bar-section.left {
|
|
margin-left: 30px;
|
|
}
|
|
.top-bar-section.center {
|
|
flex-grow: 1;
|
|
justify-content: center;
|
|
}
|
|
.top-bar-section.right {
|
|
margin-right: 30px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="top-bar">
|
|
<div class="top-bar-section left">
|
|
<button class="btn" onclick="openInvitePopup()">
|
|
{{ translations['referral_link'] if translations['referral_link'] else 'Referral Link' }}
|
|
</button>
|
|
</div>
|
|
<div class="top-bar-section center">
|
|
{% if user %}
|
|
<img src="{{ user.images[0].url if user.images and user.images[0] }}" style="width:32px;border-radius:50%;vertical-align:middle;margin-right:8px;">
|
|
<span>{{ user.display_name }}</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="top-bar-section right">
|
|
<a href="{{ url_for('logout') }}" class="btn btn-danger">
|
|
{{ translations['logout'] if translations['logout'] else 'Logout' }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="playlist-container" style="margin-top:80px;">
|
|
<h2>{{ translations['choose_playlist'] }}</h2>
|
|
<ul>
|
|
{% for pl in playlists %}
|
|
<li><a class="playlist-link" href="/gamemodes/{{ pl.id }}">{{ pl.name }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- Invite Popup -->
|
|
<div id="invitePopup">
|
|
<div>
|
|
<span onclick="closeInvitePopup()">×</span>
|
|
<h3>{{ translations['referral_link'] if translations['referral_link'] else 'Referral Link' }}</h3>
|
|
<label for="inviteDuration">{{ translations['referral_duration'] if translations['referral_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_referral'] if translations['generate_referral'] else 'Generate Referral Link' }}</button>
|
|
<div id="inviteLinkResult" style="margin-top:18px;">
|
|
<input id="inviteLinkInput" type="text" readonly style="width:90%;padding:8px;border-radius:8px;border:1px solid #444;display:none;background:#222;color:#fff;">
|
|
<button id="copyInviteBtn" class="btn" style="margin-top:8px;display:none;" onclick="copyInviteLink()">{{ translations['copy_referral_link'] if translations['copy_referral_link'] else 'Copy Referral Link' }}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function openInvitePopup() {
|
|
document.getElementById('invitePopup').style.display = 'flex';
|
|
document.getElementById('inviteLinkResult').style.display = '';
|
|
document.getElementById('inviteLinkInput').style.display = 'none';
|
|
document.getElementById('copyInviteBtn').style.display = 'none';
|
|
document.getElementById('inviteLinkInput').value = '';
|
|
}
|
|
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(link => {
|
|
document.getElementById('inviteLinkInput').value = link;
|
|
document.getElementById('inviteLinkInput').style.display = '';
|
|
document.getElementById('copyInviteBtn').style.display = '';
|
|
});
|
|
}
|
|
function copyInviteLink() {
|
|
const input = document.getElementById('inviteLinkInput');
|
|
input.select();
|
|
input.setSelectionRange(0, 99999);
|
|
document.execCommand('copy');
|
|
document.getElementById('copyInviteBtn').innerText = "{{ translations['copied'] if translations['copied'] else 'Copied!' }}";
|
|
setTimeout(() => {
|
|
document.getElementById('copyInviteBtn').innerText = "{{ translations['copy_referral_link'] if translations['copy_referral_link'] else 'Copy Referral Link' }}";
|
|
}, 1200);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|