-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminiGameKanjiN3Unit2.2.html
More file actions
273 lines (252 loc) · 8.83 KB
/
miniGameKanjiN3Unit2.2.html
File metadata and controls
273 lines (252 loc) · 8.83 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<!DOCTYPE html>
<html>
<head>
<title>Try hard N3'Kanji</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/css_form.css">
</head>
<body>
<!--toolbar-->
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active" ><a href="homePage.html"><span class="glyphicon glyphicon-home"></span> Home</a></li>
</ul>
<!--Search-->
<form class="navbar-form navbar-left">
<div class="form-group">
<input id = "myInput"type="text" class="form-control" placeholder=" ... ">
</div>
</form>
<!--^^-->
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-king"></span> Goi N3
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="miniGameGoiNihongoUnit1.html"><span class="glyphicon glyphicon-wrench"></span> Unit 1</a></li>
<li><a href="miniGameGoiNihongoUnit2.html"><span class="glyphicon glyphicon-minus-sign"></span> Unit 2</a></li>
<li><a href="miniGameGoiNihongoUnit3.html"><span class="glyphicon glyphicon-plus-sign"></span> Unit 3</a></li>
<li><a href="#"><span class="glyphicon glyphicon-minus-sign"></span> xxx</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="glyphicons glyphicons-coffee-cup"></span> Kanji N3
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="miniGameKanjiN3Unit1.1.html"><span class="glyphicons glyphicons-coffee-cup"></span> Unit 1.1</a></li>
<li><a href="miniGameKanjiN3Unit1.2.html"><span class="glyphicons glyphicons-coffee-cup"></span> Unit 1.2</a></li>
<li><a href="miniGameKanjiN3Unit1.3.html"><span class="glyphicons glyphicons-coffee-cup"></span> Unit 1.3</a></li>
<li><a href="miniGameKanjiN3Unit1.4.html"><span class="glyphicons glyphicons-coffee-cup"></span> Unit 1.4</a></li>
<li><a href="miniGameKanjiN3Unit2.1.html"><span class="glyphicons glyphicons-coffee-cup"></span> Unit 2.1</a></li>
<li><a href="miniGameKanjiN3Unit1.6.html"><span class="glyphicons glyphicons-coffee-cup"></span> Unit 1.6</a></li>
<li><a href="#"><span class="glyphicon glyphicon-minus-sign"></span> Delete User</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="glyphicon glyphicon-king"></span> Grammer N3
<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="miniGameGoiNihongounit1.html"><span class="glyphicon glyphicon-wrench"></span> Update product</a></li>
<li><a href="miniGameGoiNihongounit2.html"><span class="glyphicon glyphicon-minus-sign"></span> Delete product</a></li>
<li><a href="miniGameGoiNihongounit3.html"><span class="glyphicon glyphicon-plus-sign"></span> Add product</a></li>
<li><a href="#"><span class="glyphicon glyphicon-minus-sign"></span> Delete User</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<center>
<div class= "col-sm-4">
<image width = "60%" src = "D:\MinigameNihongo\javaScript\image\haicot.gif"><br>
<button onclick = "enableLoop()"> ahihi -_- quẩy nào :))</button>
<br>
<audio id="myAudio" controls>
<source src="D:\MinigameNihongo\javaScript\music\faded.mp3" type="audio/mpeg">
</audio>
</div>
<!--Hirakana-->
<div class="col-sm-4">
<br>
<h1>Unit 2.2 !</h1>
<p>Hirakana? </p>
<h1 id="demo2"></h1>
<form id="form2">
<input id = "input2" name="nameInput2" type="text">
</form>
<br>
<!-- <img id="result" src="D:\MinigameNihongo\javaScript\image\off.png" style="width:100px"><br> -->
<button onclick = "Myfunction2()">Check!</button> <button onclick = "function2()">next!</button>
<br>
<br>
<p id = "result2"></p>
<h3 id = "answer2"></h3>
<p id = "mean2"></p>
</div>
<!--Han tu-->
<div class="col-sm-4">
<br>
<h1>Unit 2.2 !</h1>
<p>Hán tự của từ ? </p>
<h1 id="demo"></h1>
<form id="form1">
<input id = "input" name="nameInput" type="text">
</form>
<br>
<!-- <img id="result" src="D:\MinigameNihongo\javaScript\image\off.png" style="width:100px"><br> -->
<button onclick = "Myfunction()">Check!</button> <button onclick = "function1()">next!</button>
<br>
<br>
<p id = "result"></p>
<h3 id = "answer"></h3>
<p id = "mean"></p>
</div>
</center>
<script>
var myaudio = document.getElementById("myAudio");
var i = -1;
var j = -1;
var arr = [
"煙",
"禁煙",
"本当",
"当たる",
"当たり前",
"全部",
"全席",
"安全",
"お客様",
"様子",
"理解",
"解説",
"解答",
"協力",
"願う"
];
var hantu = {
煙:"yên",
禁煙:"cấm yên",
本当:"bản đương",
当たる:"đương",
当たり前:"đương tiền",
全部:"toàn bộ",
全席:"toàn tịch",
安全:"an toàn",
お客様:"khách dạng",
様子:"dạng tử",
理解:"lí giải",
解説:"giải thuyết",
解答:"giải đáp",
協力:"hiệp lực",
願う:"nguyện",
};
var cachdoc = {
煙:"けむり",
禁煙:"きんえん",
本当:"ほんとう",
当たる:"あたる",
当たり前:"あたりまえ",
全部:"ぜんぶ",
全席:"ぜんせき",
安全:"あんぜん",
お客様:"おきゃくさま",
様子:"ようす",
理解:"りかい",
解説:"かいせつ",
協力:"きょうりょく",
願う:"ねがう",
};
var nghia = {
煙:"けむり Khói",
禁煙:"きんえん Cấm hút thuốc",
本当:"ほんとう Sự thật",
当たる:"あたる Trúng, trúng số ...",
当たり前:"あたりまえ Đương nhiên, hiển nhiên",
全部:"ぜんぶ Toàn bộ",
全席:"ぜんせき Tất cả chỗ ngồi",
欠席:"けっせき Vắng mặt",
安全:"あんぜん An toàn",
お客様:"おきゃくさま Qúy khách",
様子:"ようす Trạng thái, tình trạng",
理解:"りかい Lý giải, hiểu",
解説:"かいせつ Giải thích",
協力:"きょうりょく Cộng tác",
願う:"ねがう ước(điều gì đó)",
};
//hirakana
function function2(){
j = j+1;
//i = Math.floor(Math.random() * arr.length);
document.getElementById("demo2").innerHTML = arr[j];
document.getElementById("result2").innerHTML ="";
document.getElementById("answer2").innerHTML ="";
document.getElementById("mean2").innerHTML ="";
$("#input2").val("");
location.repeat();
}
function Myfunction2(){
var x,y;
x = document.getElementById("form2");
y = x.elements["nameInput2"].value;
document.getElementById("result2").innerHTML = y;
if(cachdoc[arr[j]] == y){
document.getElementById("result2").innerHTML = "true";
document.getElementById("mean2").innerHTML = nghia[arr[j]];
document.getElementById("answer2").innerHTML = "";
}else {
document.getElementById("result2").innerHTML = "fail";
document.getElementById("answer2").innerHTML = hantu[arr[j]];
document.getElementById("mean2").innerHTML = nghia[arr[j]];
}
}
//kanji hantu
function function1(){
i = i+1;
//i = Math.floor(Math.random() * arr.length);
document.getElementById("demo").innerHTML = arr[i];
document.getElementById("result").innerHTML ="";
document.getElementById("answer").innerHTML ="";
document.getElementById("mean").innerHTML ="";
$("#input").val("");
location.repeat();
}
function Myfunction(){
var x,y;
x = document.getElementById("form1");
y = x.elements["nameInput"].value;
document.getElementById("result").innerHTML = y;
if(hantu[arr[i]] == y){
document.getElementById("result").innerHTML = "true";
document.getElementById("mean").innerHTML = nghia[arr[i]];
document.getElementById("answer").innerHTML = "";
}else {
document.getElementById("result").innerHTML = "fail";
document.getElementById("answer").innerHTML = hantu[arr[i]];
document.getElementById("mean").innerHTML = nghia[arr[i]];
}
}
//...
function enableLoop(){ // loop mp3
myaudio.loop = true;
myaudio.load();
}
</script>
</body>
</html>