-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
114 lines (101 loc) · 5.38 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<link rel="stylesheet" href="main.css">
<link rel="shortcut icon" type="image/png" href="favicon.png" />
<title>Vue.js</title>
</head>
<body>
<div id="app">
<nav-bar :seen-dictionary="seenDictionary" :seen-quiz="seenQuiz" :seen-score="seenScore" @click-nav="navMenu"></nav-bar>
<div id="quiz" v-if="seenQuiz" :style="seenQuiz ? 'display:block' : 'display:none'">
<h2 v-if="seenQuizTitle">Choose a group of words</h2>
<div id="group-container">
<div v-if="seenQuizGroups" class="groups" v-for="i in uniqueValues" :data-group="i" @click="quiz(i)" :style="{'background-color': uniqueGroupsCount[i] >= 4 ? colorCorr : colorWrong}">{{i}}</div>
</div>
<template v-if="seenQuizProblem">
<div id="container">
<progress :value="answers" max="10"> {{ answers }}% </progress>
<div class="problem">{{ problem }}</div>
<div id="containerAns">
<div id="box_1" :class="randomLanguage == 0 ? 'boxAns' : 'boxAnsChar'" @click="check(correctNum(nAns, 1))">{{diffNumbers(nAns, 1)}}</div>
<div id="box_2" :class="randomLanguage == 0 ? 'boxAns' : 'boxAnsChar'" @click="check(correctNum(nAns, 2))">{{diffNumbers(nAns, 2)}}</div>
<div id="box_3" :class="randomLanguage == 0 ? 'boxAns' : 'boxAnsChar'" @click="check(correctNum(nAns, 3))">{{diffNumbers(nAns, 3)}}</div>
<div id="box_4" :class="randomLanguage == 0 ? 'boxAns' : 'boxAnsChar'" @click="check(correctNum(nAns, 4))">{{diffNumbers(nAns, 4)}}</div>
</div>
</div>
</template>
</div>
<div id="score" v-if="seenScore" :style="seenScore ? 'display:block' : 'display:none'">
<table id="table">
<thead>
<tr>
<th>ID</th>
<th>Character</th>
<th>English</th>
<th>Group</th>
<th>Correct</th>
<th>Wrong</th>
<th>Percent correct</th>
</tr>
</thead>
<tbody>
<tr v-for="i in characters">
<td>{{ i.id }}</td>
<td>{{ i.character }}</td>
<td>{{ i.english }}</td>
<td>{{ i.group }}</td>
<td>{{ i.correct }}</td>
<td>{{ i.wrong }}</td>
<td>{{ totalScore(i) }}%</td>
</tr>
</tbody>
</table>
</div>
<div id="dictionary" v-if="seenDictionary" :style="seenDictionary ? 'display:block' : 'display:none'">
<update-form :character="characterUpdate" :english="englishUpdate" :group="groupUpdate" :seen-table="seenTable" @click-u="updateButton" @click-ue="updateExit" ref="upd"></update-form>
<add-form :character="characterAdd" :english="englishAdd" :group="groupAdd" :seen-add="seenAdd" @click-a="addRow" @click-ae="addExit" ref="add"></add-form>
<div id="search_field_container">
<div id="search_field">
<select v-model="searchSelect">
<option>English</option>
<option>Character</option>
<option>Group</option>
</select>
<input type="text" id="search" v-model="search" placeholder="🔍 Search...">
</div>
</div>
<table id="table">
<tbody>
<tr>
<th>ID</th>
<th>Character</th>
<th>English</th>
<th>Group</th>
<th>Update</th>
<th>Delete</th>
</tr>
<tr v-for="i in filteredCharacters">
<td>{{ i.id }}</td>
<td>{{ i.character }}</td>
<td>{{ i.english }}</td>
<td>{{ i.group }}</td>
<td>
<button type="button" :id=`update_${i.id}` class="update" @click="updateRow(i.id)" ref="update">Update {{i.id}}</button>
</td>
<td>
<button type="button" :id=`delete_${i.id}` class="delete" @click="deleteRow(i.id)">Delete {{i.id}}</button>
</td>
</tr>
</tbody>
</table>
<add-svg @click.native="addData"></add-svg>
</div>
</div>
<script language="javascript" type="text/javascript" src="chinese.js"></script>
<script language="javascript" type="text/javascript" src="components.js"></script>
<script language="javascript" type="text/javascript" src="main.js"></script>
</body></html>