-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
103 lines (94 loc) · 2.5 KB
/
script.js
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
var result=0;
var select_sound = new Audio('sounds/pop.mp3');
var found_sound = new Audio('sounds/found.mp3')
document.getElementById("instruction").style.display = "none";
function found1(argument) {
window.result += 1;
checkmate()
document.getElementById('btn1').innerHTML = "Ok!";
select_sound.play();
select_sound.currentTime = 0;
}
function found2(argument) {
window.result += 2;
checkmate()
document.getElementById('btn2').innerHTML = "Ok!";
select_sound.play();
select_sound.currentTime = 0;
}
function found3(argument) {
window.result += 3;
checkmate()
document.getElementById('btn3').innerHTML = "Ok!";
select_sound.play();
select_sound.currentTime = 0;
}
function found4(argument) {
window.result += 4;
checkmate()
document.getElementById('btn4').innerHTML = "Ok!";
select_sound.play();
select_sound.currentTime = 0;
}
function found5(argument) {
window.result += 5;
checkmate()
document.getElementById('btn5').innerHTML = "Ok!";
select_sound.play();
select_sound.currentTime = 0;
}
function found6(argument) {
window.result += 6;
checkmate()
document.getElementById('btn6').innerHTML = "Ok!";
select_sound.play();
select_sound.currentTime = 0;
}
function inst(argument) {
document.getElementById("instruction").style.display = "";
document.getElementById("btn-htp").style.display = "none";
}
//result
/*6.london
11.mumbai
12.chennai
14.paris
10.wuhan
15.america
9.delhi
13.thailand*/
function checkmate(argument) {
if (result==6) {
found_sound.play();
found_sound.currentTime = 0;
document.getElementById('display').innerHTML = "🔮: LONDON";
}else if (result==11) {
found_sound.play();
found_sound.currentTime = 0;
document.getElementById('display').innerHTML = "🔮: MUMBAI";
}else if (result==12) {
found_sound.play();
found_sound.currentTime = 0;
document.getElementById('display').innerHTML = "🔮: CHENNAI";
}else if (result==14) {
found_sound.play();
found_sound.currentTime = 0;
document.getElementById('display').innerHTML = "🔮: PARIS";
}else if (result==10) {
found_sound.play();
found_sound.currentTime = 0;
document.getElementById('display').innerHTML = "🔮: WUHAN";
}else if (result==15) {
found_sound.play();
found_sound.currentTime = 0;
document.getElementById('display').innerHTML = "🔮: AMERICA";
}else if (result==9) {
found_sound.play();
found_sound.currentTime = 0;
document.getElementById('display').innerHTML = "🔮: DELHI";
}else if (result==13) {
found_sound.play();
found_sound.currentTime = 0;
document.getElementById('display').innerHTML = "🔮: THAILAND";
}
}