runic-client/index.html

35 lines
997 B
HTML
Raw Normal View History

2023-03-07 08:51:04 -08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Play Runic</title>
<link rel="stylesheet" href="css/title.css">
</head>
<body>
<div class="center">
<h1 class="name">
RUNIC
</h1>
2023-03-15 10:39:12 -07:00
<input id="runic_username" class="username" placeholder="Username" maxlength="16"><br>
<input type="button" class="play" onclick="play()" value="PLAY">
2023-03-07 08:51:04 -08:00
</div>
<script>
2023-03-15 10:39:12 -07:00
var usernameinput = document.getElementById("runic_username");
2023-03-07 08:51:04 -08:00
function play() {
2023-03-15 10:39:12 -07:00
var username = usernameinput.value;
if (username != "") {
window.location = "game.html" + "?name=" + username;
}
else {
window.location = "game.html";
}
2023-03-07 08:51:04 -08:00
}
usernameinput.addEventListener("keypress", function(event) {
if (event.key === "Enter") {
event.preventDefault();
play();
}
});
2023-03-07 08:51:04 -08:00
</script>
</body>
</html>