2021-01-20 22:29:23 +01:00
|
|
|
<!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">
|
2021-01-20 22:50:24 +01:00
|
|
|
<div class="healthbar__value" :style="monsterBarStyles"></div>
|
2021-01-20 22:29:23 +01:00
|
|
|
</div>
|
|
|
|
</section>
|
2021-01-22 19:50:36 +01:00
|
|
|
<section v-if="winner" class="container">
|
|
|
|
<h2>Game Over!</h2>
|
|
|
|
<h3 v-if="monsterWon">You lost!</h3>
|
|
|
|
<h3 v-if="playerWon">You won!</h3>
|
|
|
|
<h3 v-if="draw">It's a draw'!</h3>
|
2021-01-22 20:01:25 +01:00
|
|
|
<button @click="restartGame">Start a new game</button>
|
2021-01-22 19:50:36 +01:00
|
|
|
</section>
|
2021-01-20 22:29:23 +01:00
|
|
|
<section id="player" class="container">
|
|
|
|
<h2>Your Health</h2>
|
|
|
|
<div class="healthbar">
|
2021-01-20 22:50:24 +01:00
|
|
|
<div class="healthbar__value" :style="playerBarStyles"></div>
|
2021-01-20 22:29:23 +01:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<section id="controls">
|
2021-01-20 22:50:24 +01:00
|
|
|
<button @click="attackMonster">ATTACK</button>
|
2021-01-21 12:28:31 +01:00
|
|
|
<button :disabled="specialAttackAllowed" @click="specialAttackMonster">SPECIAL ATTACK</button>
|
2021-01-22 19:50:16 +01:00
|
|
|
<button @click="healPlayer">HEAL</button>
|
2021-01-22 20:05:29 +01:00
|
|
|
<button @click="surrender">SURRENDER</button>
|
2021-01-20 22:29:23 +01:00
|
|
|
</section>
|
|
|
|
<section id="log" class="container">
|
|
|
|
<h2>Battle Log</h2>
|
|
|
|
<ul></ul>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|