-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheyes.html
More file actions
313 lines (272 loc) · 9.71 KB
/
Copy patheyes.html
File metadata and controls
313 lines (272 loc) · 9.71 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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
<!DOCTYPE html>
<html>
<head>
<title>Eye tracker</title>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<div class="calibre" id="calibro">1</div>
<div class="elcontainer">
<div class="container">
<header><h2>Accesos Oculares</h2><h3 class="aviso">A traves de los movimientos oculares podemos detectar el procesamiento interno cerebral en terminos de sistemas representacionales de cada persona. Divididos en Visuales, Auditivos y Kinestesicos <a href="http://programacionneurolinguisticahoy.com/claves-de-acceso-ocular/">+ info.</a></h3></header>
<div class="row">
<div class="square VC met">Visual Creado</div>
<div class="square"></div>
<div class="square VR met">Visual Recordado</div>
</div>
<div class="row">
<div class="square AC met">Auditivo Creado</div>
<div class="vidSquare">
<div id="contVideo"></div>
</div>
<div class="square AR met">Auditivo Recordado</div>
</div>
<div class="row">
<div class="square KI met">Kinestesia Sensaciones</div>
<div class="square"></div>
<div class="square DI met">Dialogo Interno</div>
</div>
<footer>
<ul>
<li>
<a id="calibrelo" href="#">| CALIBRAR |</a>
</li>
<li>VR = <span id="vr"></span></li>
<li>AR = <span id="ar"></span></li>
<li>DI = <span id="di"></span></li>
<li>VC = <span id="vc"></span></li>
<li>AC = <span id="ac"></span></li>
<li>KI = <span id="ki"></span></li>
</ul>
</footer>
</div>
</div>
<style type="text/css">
body {
color: #333333;
background-color: whitesmoke
}
.aviso{ padding: 1em; }
#contVideo{
position: relative;
border: 1px solid black;
text-align: center;
margin: 0 auto;
width: 200px;
}
#contVideo:after {
content: " ";
display: table;
clear: both;
}
.container{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100vh;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -o-flexbox;
display: -webkit-flex;
display: flex;
background-color: #afafaf;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
-o-flex-direction: column;
flex-direction: column;
}
.container h2{text-align: center; margin-bottom: 4px}
.container h3{text-align: justify; margin-top: 4px}
.row{
background-color: #e5e5e5;
-webkit-flex: 5;
-moz-flex: 5;
-ms-flex: 5;
-o-flex: 5;
flex: 5;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
-moz-flex-direction: row;
-ms-flex-direction: row;
-o-flex-direction: row;
flex-direction: row;
}
.square{
background-color: #cacaca;
font-size: 2em;
-webkit-flex: 4;
-moz-flex: 4;
-ms-flex: 4;
-o-flex: 4;
flex: 4;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
text-align: center;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
justify-content: center;
-webkit-flex-flow: column wrap;
-moz-flex-flow: column wrap;
-ms-flex-flow: column wrap;
-o-flex-flow: column wrap;
flex-flow: column wrap;
}
.vidSquare{
background: black;
}
.calibre{
border-radius: 50%; padding: 10px 15px; border: 3px solid black;
background: red; color: black; text-align: center;
position: absolute; left: 5px; top: 5px; z-index: 10; cursor: crosshair;
}
/* .calibre:before {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
content: "\274c";
font-size: 20px;
color: #FFF;
line-height: 12px;
text-align: center;
}*/
ul li{display: inline-block;}
footer{text-align: center;}
</style>
<script src="build/webgazer.js"></script>
<script>
// window.onload = function() {
$(function() {
var altoCanal = window.innerHeight / 4;
var mitad = window.innerWidth / 2;
var visual = altoCanal;
var auditivo = altoCanal * 2;
var kinestesico = altoCanal * 3;
var AR=1, DI=1, VR=1, AC=1, KI=1, VC=1;
alert("Despues de reconocer tu rostro, calibra la pantalla haciendo click en los punto de las esquinas. Repite el proceso para mayor precision");
$("#calibrelo").on("click", function(){$("#calibro").show()})
var blink = function(pos){
$(".met").css('background','none');
$("."+pos).css('background','cyan');
}
var ubicar = function(xpos, ypos){
console.log(xpos+" < X :: Y > "+ypos);
if ( xpos > mitad ){
console.log("> Derecha");
if(ypos <= auditivo ){blink("AR"); AR+=1};
if(ypos <= kinestesico){blink("DI"); DI+=1};
if(ypos <= (visual+130)){blink("VR");VR+=1};
}else if(xpos < mitad){
console.log("< Izquierda");
if(ypos <= auditivo ){blink("AC");AC+=1};
if(ypos <= kinestesico) {blink("KI");KI+=1};
if(ypos <= (visual+130)){blink("VC");VC+=1};
}
$("#ar").text(AR);
$("#vr").text(VR);
$("#di").text(DI);
$("#ac").text(AC);
$("#vc").text(VC);
$("#ki").text(KI);
}
//webgazer.setRegression('ridge') /* currently must set regression and tracker */
//.setTracker('clmtrackr')
webgazer.setGazeListener(function(data, clock) {
data == null ? console.log(data):ubicar(data.x, data.y);
/* data is an object containing an x and y key which are the x and
y prediction coordinates (no bounds limiting) */
//console.log(clock); /* elapsed time in milliseconds since webgazer.begin() was called */
})
.begin()
.showPredictionPoints(true); /* shows a square every 100 milliseconds where current prediction is */
var width = 200;
var height = 150;
var topDist = '0px';
var leftDist = 0;
var setup = function() {
var contVideo = document.getElementById('contVideo');
var video = document.getElementById('webgazerVideoFeed');
var overlay = document.createElement('canvas');
video.style.display = 'block';
video.style.position = 'absolute';
video.style.top = topDist;
video.style.left = leftDist;
video.width = width;
video.height = height;
webgazer.params.imgWidth = width;
webgazer.params.imgHeight = height;
overlay.id = 'overlay';
overlay.style.position = 'absolute';
overlay.width = width;
overlay.style.display = 'block';
overlay.height = height;
overlay.style.top = topDist;
overlay.style.left = leftDist;
contVideo.appendChild(video);
contVideo.appendChild(overlay);
var cl = webgazer.getTracker().clm;
function drawLoop() {
requestAnimFrame(drawLoop);
overlay.getContext('2d').clearRect(0,0,width,height);
if (cl.getCurrentPosition()) {
cl.draw(overlay);
}
}
drawLoop();
};
$("#calibro").on("click", function(){
switch($("#calibro").text()) {
case "1":
$(this).css("left", "inherit");
$(this).css("right", "10px");
$(this).text("2");
break;
case "2":
$(this).css("top", "inherit");
$(this).css("bottom", "10px");
$(this).text("3");
break;
case "3":
$(this).css("right", "inherit");
$(this).css("left", "10px");
$(this).text("4");
break;
case "4":
$(this).css("top", "10px");
$(this).css("bottom", "inherit");
$(this).text("1");
$(this).hide()
break;
default:
$(this).hide()
}
})
function checkIfReady() {
if (webgazer.isReady()) {
setup();
} else {
setTimeout(checkIfReady, 100);
}
}
setTimeout(checkIfReady,100);
});
window.onbeforeunload = function() {
//webgazer.end(); //Uncomment if you want to save the data even if you reload the page.
window.localStorage.clear(); //Comment out if you want to save data across different sessions
}
</script>
</body>
</html>