-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (50 loc) · 1.84 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue Basics</title>
<link
href="https://fonts.googleapis.com/css2?family=Jost:wght@400;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles.css" />
<script src="https://unpkg.com/vue@next" defer></script>
<script src="app.js" defer></script>
</head>
<body>
<header>
<h1>Monster Slayer</h1>
</header>
<div id="game">
<section id="monster" class="container">
<h2>Monster Health</h2>
<div class="healthbar">
<div class="healthbar__value" :style="{width: monsterHealth + '%'}"></div>
</div>
</section>
<section id="player" class="container">
<h2>Your Health</h2>
<div class="healthbar">
<div class="healthbar__value" :style="{width: playerHealth + '%'}"></div>
</div>
<p v-show="endGameText !== ''">{{endGameText}}</p>
</section>
<section class="controls">
<button v-if="(!gameOn)" class="green-button" @click="startGame">START GAME</button>
<section v-else class="controls">
<button @click="playerAttack(), monsterAttack()">ATTACK</button>
<button @click="specialAttack(5), monsterAttack()" :disabled="specialAttackCD">SPECIAL ATTACK<br><span>cooldown: {{specialAttackCD}}</span></button>
<button @click="heal()" :disabled="healCD">HEAL <br><span>cooldown: {{healCD}}</span></button>
<button @click="surrenderGame">SURRENDER</button>
</section>
</section>
<section id="log" class="container">
<h2>Battle Log</h2>
<ul>
<li v-for="message in battleLog">{{message}}</li>
</ul>
</section>
</div>
</body>
</html>