A simple TicTacToe app with Golang backend and WebSockets gluing it all together.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.5 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title>TicTacToe :: {{ .title }}</title>
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <link rel="stylesheet" type="text/css" media="screen" href="/static/main.css" />
  9. </head>
  10. <body>
  11. <div class=wrapper>
  12. <h1>TicTacToe</h1>
  13. <h2 id=player class=hide></h2>
  14. <form id=joinGameForm>
  15. <label for=name id=nameLabel>To join, enter your name:</label>
  16. <input type=text name=name id=name placeholder="Enter your name/nickname" size=64>
  17. <button type=submit id=join>Join Game</button>
  18. </form>
  19. <div id=status class=hide></div>
  20. <div id=turn class=hide></div>
  21. <div id=winner class=hide>You WIN!!!</div>
  22. </div>
  23. <div id=gameTable class=hide>
  24. <table>
  25. <tr>
  26. <td id=pos_0 class=tile>T</td>
  27. <td id=pos_1 class=tile>I</td>
  28. <td id=pos_2 class=tile>C</td>
  29. </tr>
  30. <tr>
  31. <td id=pos_3 class=tile>T</td>
  32. <td id=pos_4 class=tile>A</td>
  33. <td id=pos_5 class=tile>C</td>
  34. </tr>
  35. <tr>
  36. <td id=pos_6 class=tile>T</td>
  37. <td id=pos_7 class=tile>O</td>
  38. <td id=pos_8 class=tile>E</td>
  39. </tr>
  40. </table>
  41. </div>
  42. <script src="/static/bundle.js"></script>
  43. </body>
  44. </html>