-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (52 loc) · 2.19 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
<!DOCTYPE html>
<html>
<head>
<title>Monster Slayer</title>
<script src="https://npmcdn.com/vue/dist/vue.js"></script>
<link rel="stylesheet" href="foundation.min.css">
<link rel="stylesheet" href="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" v-bind:style="{width: playerHealth + '%'}" style="background-color: green; margin: 0; color: white;">
{{ playerHealth }}
</div>
</div>
</div>
<div class="small-6 columns">
<h1 class="text-center">MONSTER</h1>
<div class="healthbar">
<div class="healthbar text-center" v-bind:style="{width: monsterHealth + '%'}" style="background-color: green; margin: 0; color: white;">
{{ monsterHealth }}
</div>
</div>
</div>
</section>
<section class="row controls">
<div class="small-12 columns" v-if="!gameOn">
<button id="start-game" v-on:click="gameOn = true, playerHealth = 100, monsterHealth = 100, battleLog = []">START NEW GAME</button>
</div>
</section>
<section v-if="gameOn" class="row controls">
<div class="small-12 columns">
<button id="attack" v-on:click="atk">ATTACK</button>
<button id="special-attack" v-on:click="spatk">SPECIAL ATTACK</button>
<button id="heal" v-on:click="heal">HEAL</button>
<button id="give-up" v-on:click="gameOn = false">GIVE UP</button>
</div>
</section>
<section class="row log">
<div class="small-12 columns">
<ul>
<li v-for="(action, i) in battleLog" v-bind:class="(i % 2 != 0) ? 'player-turn' : 'monster-turn'">{{ action }}</li>
</ul>
</div>
</section>
</div>
</body>
</html>
<script src="script.js"></script>