2024-02-14 21:52:29 +01:00
|
|
|
<!-- HTML -->
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
2024-02-25 20:41:38 +01:00
|
|
|
<title>Ozai:Join</title>
|
|
|
|
<link rel="icon" type="image/png" href="/azul-flake.png">
|
2024-02-15 12:58:18 +01:00
|
|
|
<style>
|
2024-02-25 20:41:38 +01:00
|
|
|
body {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
height: 100vh;
|
|
|
|
padding: 10px;
|
|
|
|
background: url({{ url_for('static', filename='azul.webp') }}) no-repeat center center fixed;
|
|
|
|
-webkit-background-size: cover;
|
|
|
|
-moz-background-size: cover;
|
|
|
|
-o-background-size: cover;
|
|
|
|
background-size: cover;
|
|
|
|
}
|
2024-02-15 12:58:18 +01:00
|
|
|
</style>
|
2024-02-14 21:52:29 +01:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- a field to add a game id -->
|
|
|
|
<form id="joinGameForm" method="POST" action="/join" onsubmit="submitForm(event)">
|
|
|
|
<input type="text" name="game_id" placeholder="Game ID" required value="{{ game_id }}">
|
|
|
|
<input type="submit" value="Join Game">
|
|
|
|
</form>
|
|
|
|
<button onclick="window.history.back();">Back</button>
|
|
|
|
<!-- script to get from localstorage and prefill join game -->
|
|
|
|
<script>
|
|
|
|
function submitForm(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
var game_id = document.querySelector('input[name="game_id"]').value;
|
|
|
|
sessionStorage.setItem('game_id', game_id);
|
|
|
|
document.getElementById('joinGameForm').submit();
|
|
|
|
}
|
|
|
|
|
|
|
|
var game_id = sessionStorage.getItem('game_id');
|
|
|
|
if (game_id) {
|
|
|
|
document.querySelector('input[name="game_id"]').value = game_id;
|
|
|
|
}
|
|
|
|
</script>
|
2024-02-15 12:58:18 +01:00
|
|
|
|
2024-02-14 21:52:29 +01:00
|
|
|
{% if game_id %}
|
|
|
|
<script>
|
|
|
|
var game_id = '{{ game_id }}';
|
|
|
|
sessionStorage.setItem('game_id', game_id);
|
|
|
|
//redirect to join game
|
|
|
|
window.location.href = '/join_game/' + game_id;
|
|
|
|
</script>
|
|
|
|
<noscript>
|
|
|
|
<p>manual redirect</p>
|
|
|
|
<a href="/join_game/+{{ game_id }}">Go to player selection</a>
|
|
|
|
</noscript>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
<noscript>
|
|
|
|
<p>JavaScript is not enabled. Some convenience migth not work.</p>
|
|
|
|
</noscript>
|
|
|
|
</body>
|
|
|
|
</html>
|