-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
240 lines (216 loc) · 10.9 KB
/
index.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Fitt's Experiment Simulation</title>
<meta name="description" content="An interactive getting started guide for Brackets.">
<link rel="stylesheet" href="Css/style.css">
<link rel="shortcut icon" href="Images/54414-200.png">
<link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
</head>
<body>
<!---------------------------- Loading Screen ------------------------>
<section class="loading">
<div class = "info">
Fitts’s Law is about how long it takes to move your hand to an object.<br>
This simple website is simulating this experiment with plotting the final results.<br>
<span>Have Fun !</span>
</div>
<button class = "start">Start</button>
<div class = "shape">
<svg version="1.1" width="500" height="500" viewBox="0 0 320 320" fill="none" stroke="#FFF" stroke-linecap="round"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<path id="r1">
<animate id="p1" attributeName="d" values="m160,160l0,0 0,0;m130,110l30,-17 30,17;m130,60l30,-17 30,17;m160,20l0,0 0,0" dur="6s" repeatCount="indefinite"/>
<animate attributeName="stroke-width" values="0;4;4;4;0" dur="6s" repeatCount="indefinite" begin="p1.begin"/>
</path>
<path id="r2">
<animate attributeName="d" values="m160,160l0,0 0,0;m130,110l30,-17 30,17;m130,60l30,-17 30,17;m160,20l0,0 0,0" dur="6s" repeatCount="indefinite" begin="p1.begin+1s"/>
<animate attributeName="stroke-width" values="0;4;4;4;0" dur="6s" repeatCount="indefinite" begin="p1.begin+1s"/>
</path>
<path id="r3">
<animate attributeName="d" values="m160,160l0,0 0,0;m130,110l30,-17 30,17;m130,60l30,-17 30,17;m160,20l0,0 0,0" dur="6s" repeatCount="indefinite" begin="p1.begin+2s"/>
<animate attributeName="stroke-width" values="0;4;4;4;0" dur="6s" repeatCount="indefinite" begin="p1.begin+2s"/>
</path>
<path id="r4">
<animate id="p1" attributeName="d" values="m160,160l0,0 0,0;m130,110l30,-17 30,17;m130,60l30,-17 30,17;m160,20l0,0 0,0" dur="6s" repeatCount="indefinite" begin="p1.begin+3s"/>
<animate attributeName="stroke-width" values="0;4;4;4;0" dur="6s" repeatCount="indefinite" begin="p1.begin+3s"/>
</path>
<path id="r5">
<animate attributeName="d" values="m160,160l0,0 0,0;m130,110l30,-17 30,17;m130,60l30,-17 30,17;m160,20l0,0 0,0" dur="6s" repeatCount="indefinite" begin="p1.begin+4s"/>
<animate attributeName="stroke-width" values="0;4;4;4;0" dur="6s" repeatCount="indefinite" begin="p1.begin+4s"/>
</path>
<path id="r6">
<animate attributeName="d" values="m160,160l0,0 0,0;m130,110l30,-17 30,17;m130,60l30,-17 30,17;m160,20l0,0 0,0" dur="6s" repeatCount="indefinite" begin="p1.begin+5s"/>
<animate attributeName="stroke-width" values="0;4;4;4;0" dur="6s" repeatCount="indefinite" begin="p1.begin+5s"/>
</path>
</defs>
<use xlink:href="#r1"/>
<use xlink:href="#r1" transform="rotate(60 160 160)"/>
<use xlink:href="#r1" transform="rotate(120 160 160)"/>
<use xlink:href="#r1" transform="rotate(180 160 160)"/>
<use xlink:href="#r1" transform="rotate(240 160 160)"/>
<use xlink:href="#r1" transform="rotate(300 160 160)"/>
<use xlink:href="#r2" transform="rotate(30 160 160)"/>
<use xlink:href="#r2" transform="rotate(90 160 160)"/>
<use xlink:href="#r2" transform="rotate(150 160 160)"/>
<use xlink:href="#r2" transform="rotate(210 160 160)"/>
<use xlink:href="#r2" transform="rotate(270 160 160)"/>
<use xlink:href="#r2" transform="rotate(330 160 160)"/>
<use xlink:href="#r3"/>
<use xlink:href="#r3" transform="rotate(60 160 160)"/>
<use xlink:href="#r3" transform="rotate(120 160 160)"/>
<use xlink:href="#r3" transform="rotate(180 160 160)"/>
<use xlink:href="#r3" transform="rotate(240 160 160)"/>
<use xlink:href="#r3" transform="rotate(300 160 160)"/>
<use xlink:href="#r4" transform="rotate(30 160 160)"/>
<use xlink:href="#r4" transform="rotate(90 160 160)"/>
<use xlink:href="#r4" transform="rotate(150 160 160)"/>
<use xlink:href="#r4" transform="rotate(210 160 160)"/>
<use xlink:href="#r4" transform="rotate(270 160 160)"/>
<use xlink:href="#r4" transform="rotate(330 160 160)"/>
<use xlink:href="#r5"/>
<use xlink:href="#r5" transform="rotate(60 160 160)"/>
<use xlink:href="#r5" transform="rotate(120 160 160)"/>
<use xlink:href="#r5" transform="rotate(180 160 160)"/>
<use xlink:href="#r5" transform="rotate(240 160 160)"/>
<use xlink:href="#r5" transform="rotate(300 160 160)"/>
<use xlink:href="#r6" transform="rotate(30 160 160)"/>
<use xlink:href="#r6" transform="rotate(90 160 160)"/>
<use xlink:href="#r6" transform="rotate(150 160 160)"/>
<use xlink:href="#r6" transform="rotate(210 160 160)"/>
<use xlink:href="#r6" transform="rotate(270 160 160)"/>
<use xlink:href="#r6" transform="rotate(330 160 160)"/>
</svg>
</div>
</section>
<!---------------------------- Experiment ------------------------>
<div id = "left" class = "stick left">
<span class="circle"></span>
</div>
<span id = "home" class = "home"></span>
<div id = "right" class = "stick right">
<span class="circle"></span>
</div>
<div class = "timer">
00 : 00 : 00 : 000
</div>
<div id = "resetTimer" class = "reset">
Results
</div>
<div id = 'Plot'>
<!-- Plotly chart will be drawn inside this DIV -->
</div>
<!-- Script Here -->
<script>
// ---------------------------------------- plot ------------------------
//
//
// var process = {
// x: [],
// y: [],
// mode: 'lines + markers',
// type: 'scatter',
// name: "Your process"
// };
// var idle = {
// x: [1, 2, 3, 4],
// y: [10, 15, 13, 17],
// mode: 'lines',
// type: 'scatter',
// name: "Regression Line"
// };
//
// var layout = {
// title: 'Your process'
// };
//
//
// let [milliseconds,seconds,minutes,hours] = [0,0,0,0];
// let timerRef = document.querySelector('.timer');
// let int = null;
// let [pmil, psec] = [0, 0];
//
// document.getElementById('home').addEventListener('click', ()=>{
// if(int !== null){
// clearInterval(int);
// }
// int = setInterval(displayTimer, 10);
//
// let W = document.getElementById("left").width;
// let d = window.innerWidth - document.getElementById("left").offsetLeft;
// console.log(d + " " + W);
//
// if(milliseconds-pmil + (seconds-psec) * 1000)
// process.y.push(milliseconds-pmil + (seconds-psec) * 1000);
// pmil = milliseconds;psec = seconds;
// });
//
// document.getElementById('resetTimer').addEventListener('click', ()=>{
// [milliseconds,seconds,minutes,hours] = [0,0,0,0];
// timerRef.innerHTML = '00 : 00 : 00 : 000 ';
// $(".stcik.left").removeClass("is-active");
// $(".home").removeClass("is-active");
// $(".stcik.right").removeClass("is-active");
//
// var data = [process, idle];
// $("#Plot").css({width: window.innerWidth, height: window.innerHeight});
// Plotly.newPlot('Plot', data, layout);
// });
//
// function displayTimer(){
// milliseconds+=10;
// if(milliseconds == 1000){
// milliseconds = 0;
// seconds++;
// if(seconds == 60){
// seconds = 0;
// minutes++;
// if(minutes == 60){
// minutes = 0;
// hours++;
// }
// }
// }
// let h = hours < 10 ? "0" + hours : hours;
// let m = minutes < 10 ? "0" + minutes : minutes;
// let s = seconds < 10 ? "0" + seconds : seconds;
// let ms = milliseconds < 10 ? "00" + milliseconds : milliseconds < 100 ? "0" + milliseconds : milliseconds;
//
// timerRef.innerHTML = ` ${h} : ${m} : ${s} : ${ms}`;
// }
// ---------------------------------------- plot ------------------------
// var trace1 = {
// x: [1, 2, 3, 4],
// y: [10, 15, 13, 17],
// mode: 'markers',
// type: 'scatter'
// };
//
// var trace2 = {
// x: [2, 3, 4, 5],
// y: [16, 5, 11, 9],
// mode: 'lines',
// type: 'scatter'
// };
//
// var trace3 = {
// x: [1, 2, 3, 4],
// y: [12, 9, 15, 12],
// mode: 'lines+markers',
// type: 'scatter'
// };
//
// var data = [trace1, trace2, trace3];
//
// Plotly.newPlot('myDiv', data);
</script>
<script src="Js/jquery-2.2.3.min.js"></script>
<script src="Js/jquery-1.11.3.js"></script>
<script src="Js/jquery-3.2.1.min.js"></script>
<script src="Js/plotly.js"></script>
<script src="Js/javascript.js"></script>
</body>
</html>