-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
64 lines (61 loc) · 2.71 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
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Typing Game</title>
<link rel="apple-touch-icon" sizes="180x180" href="assets/img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/img/favicon/favicon-16x16.png">
<link rel="manifest" href="assets/img/favicon/site.webmanifest">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="assets/css/style.css">
</head>
<body>
<div id="app">
<div class="game-board">
<div class="words-board" ref="words_board">
<template v-for="word in currentWords">
<div class="word" :style="word.style">
<template v-for="(character,index) in word.characters">
<span :class="word.classList[index]">{{ character }} </span>
</template>
</div>
</template>
</div>
<template v-if="isGameStarted">
<input type="text" class="word-input" v-model="inputValue"
@input="checkWordEquality();checkCharacter();">
<div class="game-status">
<div class="game-status-item">
<label>Time</label>
<span>{{ getTime}}</span>
</div>
<div class="game-status-item">
<label>Score</label>
<span>{{score}}</span>
</div>
</div>
</template>
<template v-else>
<div class="game-options">
<div class="game-option">
<label>Game Mode </label>
<select @change="setGameMode" v-model="selectedGameMode">
<option v-for="(gameMode,index) in config.modes" :value="index"
:selected="index==selectedGameMode">
{{gameMode}}</option>
</select>
</div>
<div class="game-option">
<button class="btn" @click="play">Play<span class="btn-arrow">➔</span></button>
</div>
</div>
</template>
</div>
<Modal :class="modalDisplayStatus ? 'open':''" :isgameover="gameOver" :modes="config.modes" @restart-game="restartGame" />
</div>
</body>
</html>
<script src="https://unpkg.com/vue@3.0.4/dist/vue.global.js"></script>
<script src="assets/js/game.js" type="module"></script>