statki/views/pvp/create.handlebars

83 lines
2.6 KiB
Handlebars
Raw Normal View History

<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Statki</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&family=Poppins:ital,wght@0,600;1,600&family=Roboto+Mono:ital@0;1&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/assets/css/board.css">
<style>
.modes {
display: flex;
gap: 2rem;
}
.modes div {
height: 17rem;
width: 15rem;
background: black;
border: solid 1px white;
border-radius: 15px;
user-select: none;
padding: 1rem 3rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
input, button {
background: black;
color: white;
border-radius: 15px;
border: 1px solid white;
font-size: 1.5rem;
text-align: center;
padding: 0.5rem 2rem;
outline: none;
}
button {
cursor: pointer;
font-size: 1rem;
transition: all 0.3s;
}
button:hover {
background: white;
color: black;
}
</style>
</head>
<body>
<div class="container">
<div>
<h1>Statki</h1>
<h2>PvP / Stwórz</h2>
<div class="modes">
<div>
<h2>Kod pokoju:</h2>
<input type="text" maxlength="6" readonly value="123456">
<h3>Oczekiwanie na gracza...</h3>
<button>Opuść pokój</button>
</div>
</div>
<span class="designerTag">Designed by Maciejka</span>
<script>
const form = document.getElementById('form');
const input = document.getElementById('input');
form.addEventListener('submit', (e) => {
e.preventDefault();
if (input.value && input.value.length===6) {
socket.emit('join game', input.value);
input.value = '';
}
});
</script>
</div>
</div>
</body>
</html>