-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscriptTutorial.js
85 lines (80 loc) · 2.18 KB
/
scriptTutorial.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
var hided=false;
var blocks;
var b0=false;
var b1=false;
var b2=false;
var b3=false;
function hideIt(){
setTimeout(function(){
for (var i = 0; i < 4; i++) {
var el = document.getElementById("block" + i);
el.className = el.className + " no-color";
}
for(var i=0;i<4;++i){
var klucis = document.getElementById("block"+i);
klucis.addEventListener('touchstart',function(){
},false);
}
},2000);
setTimeout(function(){
$("#currentPlace").fadeIn(500);
$(".alerts").html("Now there is small square in the bottom that tells current color. With this color you have to press on all squares in this color.<button onclick='hidesecond();'>Continue</button>");
$(".alerts").fadeIn(500);
$(".black").fadeIn(500);
},2800);
hided=true;
}
function hidesecond(){
$(".alerts").fadeOut(500);
$(".black").fadeOut(500);
}
function hidethird(){
$(".alerts").html("Tutorial is over. Get more info in help section.<button onclick='home();'>Continue</button>");
}
function home(){
location.replace("menu.html");
}
function set(id){
if(id=="block0"){
if(!b0){
if(hided){
$("#"+id).removeClass("no-color");
b0=true;
}
}
}
if(id=="block1"){
if(!b1){
if(hided){
$("#"+id).removeClass("no-color");
b1=true;
}
}
}
if(id=="block2"){
if(!b2){
if(hided){
$("#"+id).removeClass("no-color");
b2=true;
}
}
}
if(id=="block3"){
if(!b3){
if(hided){
$("#"+id).removeClass("no-color");
b3=true;
}
}
}
check();
}
function check(){
if(b0 && b1 && b2 && b3){
setTimeout(function(){
$(".alerts").html("When answer is correct - you get points, otherwise - you lose points. To change color, tap on small square .<button onclick='hidethird();'>Continue</button>");
$(".alerts").fadeIn(500);
$(".black").fadeIn(500);
},1000);
}
}