-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
72 lines (72 loc) · 2.42 KB
/
index.html
File metadata and controls
72 lines (72 loc) · 2.42 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Wizard Duel</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>Wizard Duel</h1>
</header>
<div id="game">
<section id="voldemort" class="container">
<h2>Voldemort Health</h2>
<div class="healthbar">
<div
class="healthbar__value__voldemort"
:style="voldemortBarStyles"
></div>
</div>
</section>
<section id="player" class="container">
<h2>Your Health</h2>
<div class="healthbar">
<div class="healthbar__value" :style="playerBarStyles"></div>
</div>
</section>
<section class="container" v-if="winner">
<h2>Game Over!!</h2>
<h3 v-if="winner==='voldemort'">You Lost !!</h3>
<h3 v-else-if="winner==='player'">You Won !!</h3>
<h3 v-else="winner==='draw'">Its a draw !!</h3>
<button @click="startGame">Start New Game</button>
</section>
<section id="controls" v-else>
<button @click="attackvoldemort">Stupify</button>
<button :disabled="useSpecialAttack" @click="specialAttackvoldemort">
Expelliarmus
</button>
<button @click="healPlayer">Protego (HEAL)</button>
<button @click="surrender">SURRENDER</button>
</section>
<section id="log" class="container">
<h2>Battle Log</h2>
<ul>
<li v-for="logMessage in logMessages">
<span
:class="{'log--player':logMessage.actionBy==='player','log--voldemort':logMessage.actionBy==='voldemort'}"
>
{{logMessage.actionBy==='player'?'Player':'voldemort'}}
</span>
<span v-if="logMessage.actionType==='heal'">
heals himself for
<span class="log--heal">{{logMessage.actionValue}}</span></span
>
<span v-else>
attacks and deals
<span class="log--damage">{{logMessage.actionValue}}</span></span
>
</li>
</ul>
</section>
</div>
</body>
</html>