88 lines
2.4 KiB
HTML
88 lines
2.4 KiB
HTML
<!doctype html>
|
|
<head>
|
|
<script src="./htmx.min.js"></script>
|
|
<style type="text/css">
|
|
body {
|
|
#grid {
|
|
.cell {
|
|
border: 1px dotted black;
|
|
padding: 33%;
|
|
}
|
|
display: grid;
|
|
border: 1px solid black;
|
|
grid-template-rows: 1fr 1fr 1fr;
|
|
grid-template-columns: 1fr 1fr 1fr;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<html>
|
|
<body>
|
|
<h1>TicTacToe</h1>
|
|
<div id="grid">
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell0"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell1"
|
|
hx-trigger="click"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell2"
|
|
hx-trigger="click"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell3"
|
|
hx-trigger="click"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell4"
|
|
hx-trigger="click"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell5"
|
|
hx-trigger="click"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell6"
|
|
hx-trigger="click"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell7"
|
|
hx-trigger="click"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
<button
|
|
class="cell"
|
|
hx-post="/ttt/cell8"
|
|
hx-trigger="click"
|
|
hx-target=".grid"
|
|
hx-swap="innerHTML"
|
|
></button>
|
|
</div>
|
|
</body>
|
|
</html>
|