-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
102 lines (101 loc) · 5.43 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bot-Tac-Toe | AI Supercharged Tic Tac Toe Game</title>
<!--[if IE]><link rel="shortcut icon" href="assets/icons/favicon.ico"><![endif]-->
<link rel="apple-touch-icon" href="assets/icons/favicon_180.png" loading="lazy">
<link rel="icon" href="assets/icons/favicon_196.png" loading="lazy">
<meta name="theme-color" content="#385aa7"/>
<link rel="stylesheet" href="assets/minireset.min.css">
<link rel="stylesheet" href="style.css">
<style id="table_adjustments"></style>
<script type="text/javascript" src="assets/brython/brython.js" defer></script>
<script type="text/javascript" src="assets/brython/brython_modules.js" defer></script>
<link rel="manifest" href="manifest.webmanifest" loading="lazy">
</head>
<body onload="brython()">
<main>
<div class="container">
<header>
<h1>
<span style="color: #1ea382;">Bot-</span><span style="color: #22263f;">Tac-</span><span style="color: #7399c6;">Toe!</span>
</h1>
</header>
<section>
<div class="board-area">
<div class="game-status" id="game_status">
Game loading...
</div>
<div class="game-start-stop">
<button type="button" class="btn-sq" id="btn_start" name="start" style="display: none;">Start</button>
<button type="button" class="btn-sq" id="btn_reset" name="reset" style="display: none;">Reset</button>
</div>
<table class="board" id="board">
<tr>
<td><span class="cell"></span></td>
<td><span class="cell"></span></td>
<td><span class="cell"></span></td>
</tr>
<tr>
<td><span class="cell"></span></td>
<td><span class="cell"></span></td>
<td><span class="cell"></span></td>
</tr>
<tr>
<td><span class="cell"></span></td>
<td><span class="cell"></span></td>
<td><span class="cell"></span></td>
</tr>
</table>
</div>
<aside>
<h5>Board side length:</h5>
<ul>
<li><button type="button" class="btn-rad btn-len" name="len_3" style="background-color: #22263f;">3</button></li>
<li><button type="button" class="btn-rad btn-len" name="len_4">4</button></li>
<li><button type="button" class="btn-rad btn-len" name="len_5">5</button></li>
</ul>
<!-- <h5>Winning step length:</h5>
<ul>
<li><button type="button" class="btn-rad btn-win" name="win_3" style="background-color: #22263f;">3</button></li>
<li><button type="button" class="btn-rad btn-win btn-dis" name="win_4" disabled="true">4</button></li>
<li><button type="button" class="btn-rad btn-win btn-dis" name="win_5" disabled="true">5</button></li>
</ul> -->
<h5>Player 1 game piece:</h5>
<ul>
<li><button type="button" class="btn-piece" name="piece_x" style="color: #22263f;">x</button></li>
<li><button type="button" class="btn-piece" name="piece_o">o</button></li>
</ul>
<h5>Who starts first:</h5>
<ul class="ul-start-first">
<li><button type="button" class="btn-sq btn-st" name="st_rand">Random Draw</button></li>
<span>
<li><button type="button" class="btn-sq btn-st" name="st_p1" style="background-color: #22263f;">Player 1</button></li><li><button type="button" class="btn-sq btn-st" name="st_p2">Player 2</button></li>
</span>
</ul>
<h5>Player 2 role:</h5>
<select name="player_2_role" id="player_2_role">
<option value="another_human">Another Human</option>
<option value="ai_random">AI — Random</option>
<option value="ai_easy" selected="selected">AI — Easy</option>
<option value="ai_hard">AI — Hard</option>
</select>
</aside>
</section>
</div>
</main>
<footer>
<h3>Built by <a href="https://sammdu.com" target="_blank" class="link_footer" rel="noreferrer noopener">Samm Du</a></h3>
<h4>With <a href="https://brython.info/index.html" target="_blank" class="link_footer" rel="noreferrer noopener">Brython — Python in the browser!</a></h4>
</footer>
<script type="text/python" src="python/interaction.py" defer></script>
<script type="text/javascript" defer>
// register the service worker for PWA
if('serviceWorker' in navigator) {
navigator.serviceWorker.register('./service_worker.js');
};
</script>
</body>
</html>