-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonsterSlayer.html
60 lines (60 loc) · 2.39 KB
/
monsterSlayer.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
<!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</title>
<link rel="stylesheet" href="css/foundation.min.css">
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<div id="app">
<section class="row">
<div class="small-6 columns">
<h1 class="text-center">YOU</h1>
<div class="healthbar">
<div class="healthbar text-center" style="background-color: green; margin: 0; color: white;"
:style="{width : myHealBar + '%'}">
{{ myHealBar }}
</div>
</div>
</div>
<div class="small-6 columns">
<h1 class="text-center">MONSTER</h1>
<div class="healthbar">
<div class="healthbar text-center" style="background-color: green; margin: 0; color: white;"
:style="{width : monsterHealBar + '%'}">
{{ monsterHealBar }}
</div>
</div>
</div>
</section>
<section class="row controls" v-if="!gameIsStarting">
<div class="small-12 columns">
<button id="start-game" @click="gameStart()">START NEW GAME</button>
</div>
</section>
<section class="row controls" v-else="gameIsStarting">
<div class="small-12 columns">
<button id="attack" @click="attack">ATTACK</button>
<button id="special-attack" @click="specialAttack">SPECIAL ATTACK</button>
<button id="heal" @click="heal">HEAL</button>
<button id="give-up" @click="giveUp">GIVE UP</button>
</div>
</section>
<section class="row log" v-if="logs.length >0">
<div class="small-12 columns">
<ul>
<li v-for="logs in logs"
:class="{'player-turn': logs.isPlayer, 'monster-turn' : !logs.isPlayer}">
{{ logs.text }}
</li>
</ul>
</div>
</section>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.8/dist/vue.js"></script>
<script src="monsterSlayer.js"></script>
</html>