-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
236 lines (218 loc) · 11.7 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Metadata for page -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TTC Barchi - Tic-Tac-Toe with a Touch of Blue Archive</title>
<meta
name="description"
content="TTC Barchi is a web-based tic-tac-toe game with Blue Archive characters, dialogues, and a bot that can play against you."
/>
<meta name="keywords" content="tic-tac-toe, TTC, Blue Archive, web game, bot, game" />
<meta name="author" content="Rezzvy" />
<!-- External Stylesheets -->
<link rel="stylesheet" href="./lib/bootstrap-5.3.3-dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="./css/main.css" />
</head>
<body class="not-started">
<!-- Hina's Fireball Animation -->
<div class="hina-bullet bullet">
<img src="./assets/fireball.gif" alt="Hina's Fireball" />
</div>
<!-- Neru's Fireball Animation -->
<div class="neru-bullet bullet">
<img src="./assets/fireball.gif" alt="Neru's Fireball" />
</div>
<!-- Dialog Boxes for Characters -->
<div class="rounded-2 dialog dialog-top shadow p-2 text-bg-dark bg-opacity-75 d-none" id="hina-dialog">N/A</div>
<div class="rounded-2 dialog dialog-bottom shadow p-2 text-bg-dark text-end bg-opacity-75 d-none" id="neru-dialog">N/A</div>
<!-- Game Container -->
<div class="game-container d-flex flex-column flex-lg-row">
<!-- Hina's Video Panel -->
<aside class="panel">
<video src="./assets/Hina_dangle.webm" id="hina-video" loop muted playsinline></video>
</aside>
<!-- Main Game Panel -->
<main class="panel bg-white d-flex flex-column flex-fill gap-3 overflow-auto">
<!-- Player Profile (Hina) -->
<section class="profile hina d-flex align-items-center pe-3 flex-wrap e">
<div class="d-flex flex-fill align-items-center">
<img src="./assets/avatars/Hina.webp" alt="Hina avatar" />
<div class="text-dark">
<h2 class="fw-bold h3 m-0">Hina</h2>
<div class="badge ms-2 text-bg-dark hina-actor-name">You</div>
</div>
</div>
<div class="text-end text-dark">
<h3 class="fw-medium fs-6 m-0">Symbol</h3>
<div class="fs-1 lh-1 fw-bold">X</div>
</div>
</section>
<!-- Game Status and Progress Bars -->
<div class="px-3 d-flex flex-column flex-fill gap-3">
<div class="alert alert-primary text-center m-0 p-1 p-md-2"><span class="fw-bold">Status:</span> <span id="status-text">N/A</span></div>
<div class="row row-cols-2 g-0">
<!-- Hina's Progress Bar -->
<div class="col">
<div class="progress rounded-0" role="progressbar">
<div id="hina-winning-progress" class="progress-bar progress-bar-striped bg-dark" style="width: 0%"></div>
</div>
</div>
<!-- Neru's Progress Bar -->
<div class="col">
<div class="progress rounded-0" role="progressbar">
<div id="neru-winning-progress" class="progress-bar progress-bar-striped ms-auto bg-danger" style="width: 0%"></div>
</div>
</div>
</div>
<!-- Tic-Tac-Toe Game Board -->
<div class="board-container row g-1 flex-fill row-cols-3">
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="0"></button></div>
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="1"></button></div>
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="2"></button></div>
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="3"></button></div>
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="4"></button></div>
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="5"></button></div>
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="6"></button></div>
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="7"></button></div>
<div class="col"><button class="d-block bg-transparent border fs-4 fw-bold h-100 rounded-0 w-100 ttc-board" data-index="8"></button></div>
</div>
<!-- Menu Button -->
<button class="btn btn-outline-primary fw-bold w-100" id="open-main-menu-btn">Menu</button>
</div>
<!-- Opponent Profile (Neru) -->
<section class="profile neru d-flex align-items-center flex-row-reverse ps-3 flex-wrap e">
<div class="d-flex flex-fill align-items-center flex-row-reverse">
<img src="./assets/avatars/Neru.webp" alt="Neru avatar" />
<div class="text-end text-danger">
<h2 class="fw-bold h3 m-0">Neru</h2>
<div class="badge me-2 text-bg-danger neru-actor-name">Bot</div>
</div>
</div>
<div class="text-start text-danger">
<h3 class="fw-medium fs-6 m-0">Symbol</h3>
<div class="fs-1 lh-1 fw-bold">O</div>
</div>
</section>
</main>
<!-- Neru's Video Panel -->
<aside class="panel">
<video src="./assets/Neru_dangle.webm" id="neru-video" loop muted playsinline></video>
</aside>
</div>
<!-- Main Menu Modal -->
<div class="modal fade" id="main-menu-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title fw-bold fs-4 text-primary">Main Menu</h2>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<header class="text-center">
<img src="./assets/logo.png" alt="Game logo" />
</header>
<div class="_modal-body mb-1">
<!-- Difficulty Level Selection -->
<h2 class="h5">Difficulty Level</h2>
<select class="form-select mb-2" id="diff-selection">
<option value="easy">Easy (No thinking)</option>
<option value="normal">Normal (Thinks after first move / Strategy-based Algorithm)</option>
<option value="hard">Hard (Thinks from the first move / Strategy-based Algorithm)</option>
<option value="god" selected>God (Minimax Algorithm)</option>
</select>
<!-- Player Symbol Selection -->
<h2 class="h5">Play as</h2>
<div class="row g-0 row-cols-2 symbol-selection">
<div class="col">
<button class="btn btn-primary w-100 h-100 rounded-0 fs-1 fw-bold" data-symbol="X">X</button>
</div>
<div class="col">
<button class="btn btn-outline-primary w-100 h-100 rounded-0 fs-1 fw-bold" data-symbol="O">O</button>
</div>
</div>
<!-- Start Game Button -->
<div class="alert alert-primary m-0 mt-2 mb-3">
The <span class="fw-bold">X</span> will go first, and the <span class="fw-bold">O</span> will go last.
</div>
<button class="btn btn-primary fw-bold w-100" id="start-game-btn">Start Game</button>
</div>
<footer class="text-center">
<p>Made with lots of love by <a href="https://github.com/rezzvy" class="fw-bold">Muhammad Reza Fahlevi</a></p>
</footer>
</div>
</div>
</div>
</div>
<!-- Result Modal -->
<div class="modal fade" id="result-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title fw-bold fs-4 text-primary">Result</h2>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body text-center">
<!-- Display Winner Profile -->
<div class="result-modal-profile d-none" id="solo-win-result-profile">
<div class="result-modal-avatar">
<img
id="result-winner-avatar"
src="./assets/avatars/Hina.webp"
alt="Hina result"
class="profile border border-primary p-2 border-2"
/>
</div>
<div class="my-2">
<h2 class="fw-bold h4 m-0" id="result-winner-name">Hina (X)</h2>
<div class="badge text-bg-primary" id="result-winner-actor">You</div>
</div>
</div>
<!-- Draw Result Profiles -->
<div class="d-flex flex-column flex-md-row justify-content-center gap-2 gap-md-4 d-none" id="draw-result-profiles">
<div class="result-modal-profile">
<div class="result-modal-avatar">
<img src="./assets/avatars/Hina.webp" alt="Hina result" class="profile border border-primary p-2 border-2" />
</div>
<div class="my-2">
<h2 class="fw-bold h4 m-0">Hina (X)</h2>
<div class="badge text-bg-primary hina-actor-name">You</div>
</div>
</div>
<div class="result-modal-profile">
<div class="result-modal-avatar">
<img src="./assets/avatars/Neru.webp" alt="Neru result" class="profile border border-primary p-2 border-2" />
</div>
<div class="my-2">
<h2 class="fw-bold h4 m-0">Neru (O)</h2>
<div class="badge text-bg-primary neru-actor-name">Bot</div>
</div>
</div>
</div>
<p class="fs-5 m-0 mb-3" id="result-status">The game ended in a draw!</p>
<button class="btn btn-primary fw-bold w-100 mb-1" id="play-again-button">Play Again</button>
<button class="btn btn-outline-primary fw-bold w-100" id="back-to-main-menu-button">Main Menu</button>
</div>
</div>
</div>
</div>
<!-- Dialog Audio Files (Hina and Neru) -->
<div class="d-none">
<audio src="./assets/dialog/hina/1.mp3" class="hina-dialog dialog" data-index="0"></audio>
<audio src="./assets/dialog/hina/2.mp3" class="hina-dialog dialog" data-index="1"></audio>
<audio src="./assets/dialog/hina/3.mp3" class="hina-dialog dialog" data-index="2"></audio>
<audio src="./assets/dialog/hina/4.mp3" class="hina-dialog dialog" data-index="3"></audio>
<audio src="./assets/dialog/hina/5.mp3" class="hina-dialog dialog" data-index="4"></audio>
<audio src="./assets/dialog/neru/1.mp3" class="neru-dialog dialog" data-index="0"></audio>
<audio src="./assets/dialog/neru/2.mp3" class="neru-dialog dialog" data-index="1"></audio>
<audio src="./assets/dialog/neru/3.mp3" class="neru-dialog dialog" data-index="2"></audio>
<audio src="./assets/dialog/neru/4.mp3" class="neru-dialog dialog" data-index="3"></audio>
<audio src="./assets/dialog/neru/5.mp3" class="neru-dialog dialog" data-index="4"></audio>
<audio src="./assets/shoot.mp3" id="shoot-audio"></audio>
</div>
<!-- External Scripts -->
<script src="./lib/bootstrap-5.3.3-dist/js/bootstrap.min.js"></script>
<script src="./src/main.js" type="module"></script>
</body>
</html>