-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
245 lines (245 loc) · 8.95 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
237
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Monster Slayer Game</title>
<meta property="og:title" content="Monster Slayer Game" />
<meta
property="og:image"
content="https://raw.githubusercontent.com/Manojlovic1998/monster-game/main/public/monster-game.jpg"
/>
<meta
property="og:url"
content="https://manojlovic1998.github.io/monster-game/"
/>
<meta
property="og:image:alt"
content="Landing page preview of the game desktop interface"
/>
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="607" />
<meta
property="og:description"
content="Simple monster slaying game built using Vue."
/>
<link rel="icon" href="public/favicon.ico" type="image/x-icon" />
<!-- BootStrap -->
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<!-- BootStrap Scripts -->
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
crossorigin="anonymous"
></script>
<!-- Custom CSS -->
<link rel="stylesheet" href="assets/css/style.css" />
<!-- Vue CDN -->
<script src="https://unpkg.com/vue@3"></script>
</head>
<body>
<header>
<nav class="navbar">
<div
class="container-fuild w-100 d-flex flex-row justify-content-center"
>
<a href="index.html" class="navbar-brand">
<img
src="assets/img/nav-logo.svg"
alt="Orch like creature icon"
class="img-fluid"
/>
</a>
</div>
</nav>
</header>
<main id="main">
<div>
<div class="container position-relative">
<!-- Game Window Wrapper -->
<div
class="game-window-wrapper mt-5 d-flex flex-column flex-md-row align-items-center justify-content-md-center mx-auto"
>
<!-- Enemy View -->
<div class="enemy-field mt-2 mt-lg-0">
<!-- ThreeJS Mount Canvas:Enemy -->
<div class="char-animation">
<img
src="assets/img/ironhordedestroyersm.jpg"
alt=""
class="img-fluid"
/>
<!-- <canvas id="enemy"></canvas> -->
</div>
<!-- Enemy Health Bar -->
<div class="health-bar-wrapper">
<p class="health-label fw-bolder text-white text-center mb-0">
<img
src="assets/img/health-icon.svg"
alt="Health icon"
class="me-2"
/>
Enemy Health
</p>
<div class="healthbar">
<div class="healthbar-value" :style="monsterBarStyle"></div>
</div>
</div>
</div>
<!-- Client View -->
<div class="client-field mt-2 mt-lg-0">
<!-- ThreeJS Mount Canvas:Client -->
<div class="char-animation">
<img src="assets/img/player.jpg" alt="" class="img-fluid" />
<!-- <canvas id="client"></canvas> -->
</div>
<!-- Client Health Bar -->
<div class="health-bar-wrapper">
<p class="health-label fw-bolder text-white text-center mb-0">
<img
src="assets/img/health-icon.svg"
alt="Health icon"
class="me-2"
/>
Your Health
</p>
<div class="healthbar">
<div class="healthbar-value" :style="playerBarStyle"></div>
</div>
</div>
</div>
</div>
<!-- Button Section -->
<div
class="button-wrapper mx-auto mt-3 d-none d-md-flex justify-content-evenly flex-wrap"
v-if="!winner"
>
<button
class="btn btn-primary fw-bolder px-5 py-2 d-flex align-items-center"
@click="attackMonster"
>
<img
src="assets/img/attack-icon.svg"
alt="Sword icon"
class="me-2"
/>
Attack
</button>
<button
:disabled="specialButtonStatus"
@click="specialAttack"
class="btn btn-primary fw-bolder px-4 py-2 d-flex align-items-center"
>
<img
src="assets/img/special-attack-icon.svg"
alt="Special sword icon"
class="me-2"
/>
Special Attack
</button>
<button
@click="healPlayer"
class="btn btn-primary fw-bolder px-5 py-2 d-flex align-items-center"
>
<img
src="assets/img/heal-action-icon.svg"
alt="Heal icon"
class="me-2"
/>
Heal
</button>
<button
class="btn btn-primary fw-bolder px-5 py-2 d-flex align-items-center"
@click="surrender"
>
<img
src="assets/img/surrender-icon.svg"
alt="Surrender icon"
class="me-2"
/>
Surrender
</button>
</div>
<!-- Mobile Button Section -->
<div
class="mobile-button-wrapper d-flex justify-content-evenly d-md-none fixed-bottom mb-3 w-100"
v-if="!winner"
>
<button class="btn btn-primary btn-lg" @click="attackMonster">
<img src="assets/img/attack-icon.svg" alt="Sword icon" />
</button>
<button
class="btn btn-primary btn-lg"
:disabled="specialButtonStatus"
@click="specialAttack"
>
<img src="assets/img/special-attack-icon.svg" alt="Sword icon" />
</button>
<button class="btn btn-primary btn-lg" @click="healPlayer">
<img src="assets/img/heal-action-icon.svg" alt="Heal icon" />
</button>
<button class="btn btn-primary btn-lg" @click="surrender">
<img src="assets/img/surrender-icon.svg" alt="Flag icon" />
</button>
</div>
<!-- Battle Log Section -->
<div class="battle-log-wrapper">
<div class="battle-log">
<p class="fw-bolder fs-4 text-center text-pink mt-2">
Battle Log
</p>
<ul class="list-unstyled">
<li v-for="logMessage in logMessages" class="text-center">
<p>
<span
:class="['fw-bolder' ,logMessage.actionBy === 'Player' ? 'text-pink' : 'text-red']"
>
{{logMessage.actionBy}}</span
>,
<span v-if="logMessage.actionType === 'attacks'"
>attacks and deals</span
>
<span v-else-if="logMessage.actionType === 'specialAttack'"
>special attacks and deals
</span>
<span v-else="logMessage.actionType === 'heals'"
>heals for</span
>
<span
v-if="logMessage.actionType === 'attacks' || 'specialAttack'"
class="text-darkblue fw-bolder"
>
{{' ' + logMessage.actionValue}} damage</span
>
<span v-else class="text-darkblue fw-bolder">
{{' ' + logMessage.actionValue}} HP</span
>
</p>
</li>
</ul>
</div>
</div>
<!-- Winner message -->
<div
class="position-fixed winner-message d-flex flex-column justify-content-center align-items-center"
v-if="winner"
>
<p class="fs-4 fw-bold">Game Over!</p>
<p v-if="winner === 'draw'" class="fw-bolder">It's a draw</p>
<p v-else-if="winner === 'player'" class="fw-bolder">You won!</p>
<p v-else="winner === 'monster'" class="fw-bolder">You lost!</p>
<button @click="closeMessage" class="btn btn-primary">Close</button>
</div>
</div>
</div>
</main>
<!-- Main JavaScript -->
<script src="assets/script/main.js"></script>
</body>
</html>