-
Notifications
You must be signed in to change notification settings - Fork 0
/
figures.html
179 lines (138 loc) · 4.5 KB
/
figures.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>MemoryDB! v0.4</title>
<!--
<script src="js/jquery.min.js"></script>
<script src="js/underscore-min.js"></script>
-->
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/underscore-min.js"></script>
<script src="js/routes.js"></script>
<style type="text/css">
#bottom-content {
position: fixed;
bottom: 0;
left: 0;
height: 50px;
width: 100%;
border-top: 0.5px solid;
border-bottom: 0.5px solid;
vertical-align: middle;
}
.btn:focus {
outline: none;
}
</style>
</head>
<body>
<div id="controls-div">
<a name="top">
<a href="#" onclick="location.reload();">MemoryDb</a>
<span id="menu-modules"></span>
<select class="btn" id="game"></select>
<input class="btn" type="button" value="start" onclick="jugarRapid(1);" onmousedown="preventFocus()" id="start-btn">
<input type="button" value="Manage configurations" onclick="config();" id="cfg-btn">
<span id="noTime-span">noTime</span><input type="checkbox" id="noTime" onclick="noTime=!noTime; nttt();">
<a href="#" onclick="bHelp=!bHelp; bHelp?$('#screen').html('<br>Flash Figures and Colors!<br><br>Key space: Start flash!<br>Key right: next card or set noTime and start<br>Key d: restore defaults.<br><br>NoTime (nt): The figures do not flash automatically<br><br>contact: robertchalean@gmail.com'):$('#screen').html('');">[?]</a>
</div>
<br>
<div id="screen" style="margin-top: 10px;"></div>
<br>
<div id="preload" style="opacity: 0.5"></div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<div id="bottom-content">
<div style="width:100%; float:left;" id="go-btn" onclick="jugarRapid(1);"><center style="margin-top: 10px; font-size: 25px;"><b id="go-txt">GO!</b></center></div>
<div style="width: 0px; float:left;" id="next-btn" onclick="next();"><center style="margin-top: 10px; font-size: 25px;"><b>Next</b></center></div>
</div>
<script type="text/javascript">
function n(x){ return parseFloat($("#"+x).val()); }
function preventFocus() {
setTimeout(function() { $("#game").focus() }, 1);
}
bHelp=0;
$("#screen").html("Loading...");
zPreload=0;
$("#screen").html("Loading...");
$("#controls-div").hide();
function preload(arrayOfImages) {
/*
$(arrayOfImages).each(function(){
$('<img/>')[0].src = this;
$('<img/>').ready(function(){
//console.log(imgLoadedCount);
imgLoadedCount++;
if(imgLoadedCount>78){ $("#screen").html(""); }
});
// Alternatively you could use:
// (new Image()).src = this;
});
*/
for(i=0;i<arrayImages.length;i++){
//console.log(`<img src="${arrayImages[i]}" id="imgPreload-${zPreload}">`);
$("#preload").append(`<img src="${arrayImages[i]}" id="imgPreload-${zPreload}" width="32" height="32">`);
$(`#imgPreload-${zPreload}`).on("load",function(){
imgLoadedCount++;
if(imgLoadedCount>79){
$("#screen").html("");
$("#preload").hide();
$("#controls-div").show();
}
});
zPreload++;
}
}
arrayImages=[];
imgLoadedCount=0;
z=0;
for(i=0;i<100;i++){
if(i>9 && i<30)
continue;
_p=i;
if(i<10)
_p="0"+i
arrayImages[z]=rootDir+"figuras/"+_p+".png";
z++;
}
preload();
//$("<img>").on('load', function() { imgLoadedCount++; console.log(imgLoadedCount); if(imgLoadedCount>50){ $("#screen").html(""); } });
winWidth = $(window).width();
bMovil =0;
if(winWidth<500){
//alert("The App was designed to use in Desktop Pc. It can have speed issues.\n La App fue pensada para usar en Pc de Escritorio. En celulares puede tener problemas de velocidad");
$(":button").css("zoom","1.25");
$("#game").css("zoom","1.25");
$("#screen").css("zoom","1.3");
$("#screen").css("margin-top","-20px");
$("#myTitle").hide();
$(".fb-share-button").hide();
$("#screen").css("zoom","1.3");
$("#cfg-btn").val("cfg");
$("#noTime-span").html("nt");
bMovil = 1;
}else{
$("#screen").css("zoom","1.3");
$("#bottom-content").hide();
}
</script>
<script src="js/flash/flashFiguresAndColors/flashFiguresAndColorsConfig.js"></script>
<script src="js/flash/flashFiguresAndColors/flashFiguresAndColorsGame.js"></script>
<script src="js/controller.js"></script>
<script type="text/javascript">
if (window.location.href.substr(-2) !== '?r') {
location.reload();
window.location.href = window.location.href + '?r';
//alert(window.location);
}
</script>
</body>
</html>