moth/theme/token.html

46 lines
1.2 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<title>Redeem Token</title>
<link rel="stylesheet" href="basic.css">
<meta name="viewport" content="width=device-width">
2019-02-22 20:46:52 -07:00
<script src="puzzle.js"></script>
<script>
2019-02-22 20:46:52 -07:00
function tokenInput(e) {
let vals = e.target.value.split(":")
document.querySelector("input[name=cat]").value = vals[0]
document.querySelector("input[name=points]").value = vals[1]
document.querySelector("input[name=answer]").value = vals[2]
}
2019-02-22 20:46:52 -07:00
function tokenInit() {
document.querySelector("input[name=token]").addEventListener("input", tokenInput)
}
if (document.readyState === "loading") {
2019-02-22 20:46:52 -07:00
document.addEventListener("DOMContentLoaded", tokenInit)
} else {
2019-02-22 20:46:52 -07:00
tokenInit()
}
</script>
</head>
<body>
<h1>Redeem Token</h1>
2019-02-22 20:46:52 -07:00
<div id="messages"></div>
<form id="tokenForm">
<input type="hidden" name="cat">
<input type="hidden" name="points">
<input type="hidden" name="answer">
Team ID: <input type="text" name="id"> <br>
Token: <input type="text" name="token"> <br>
<input type="submit" value="Submit">
</form>
<nav>
<ul>
<li><a href="puzzle-list.html">Puzzles</a></li>
<li><a href="scoreboard.html">Scoreboard</a></li>
</ul>
</nav>
</body>
</html>