initial commit
This commit is contained in:
commit
ac9aa86d33
14 changed files with 1021 additions and 0 deletions
37
web/templates/index.html
Normal file
37
web/templates/index.html
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Go Fish - Welcome</title>
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body { font-family: system-ui, -apple-system, sans-serif; background: #1a1a2e; color: #e0e0e0; min-height: 100vh; }
|
||||
.container { max-width: 800px; margin: 0 auto; padding: 2rem; }
|
||||
h1 { text-align: center; margin-bottom: 2rem; color: #f0f0f0; }
|
||||
.btn { padding: 0.75rem 1.5rem; background: #e94560; color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; }
|
||||
.btn:hover { background: #ff6b7a; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Go Fish</h1>
|
||||
<p>Click below to join the waiting room and find an opponent</p>
|
||||
<button class="btn" onclick="joinWaitingRoom()">Join Waiting Room</button>
|
||||
|
||||
<script>
|
||||
function joinWaitingRoom() {
|
||||
fetch('/join', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ name: 'Player' })
|
||||
})
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
window.location.href = '/play/' + data.playerId;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue