forked from openexp/openexp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sandbox.html
126 lines (113 loc) · 4.73 KB
/
sandbox.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
<!doctype html>
<html>
<head>
<title>OpenEXP</title>
<script type="text/javascript" src="js/jquery.min.js" onload="window.$ = window.jQuery = module.exports;"></script>
<script src="js/jQueryRotate.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="externals/jspsych/jspsych.js"></script>
<script src="externals/jspsych/plugins/jspsych-text.js"></script>
<script src="externals/jspsych/plugins/jspsych-single-stim.js"></script>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="http://localhost:8080/socket.io/socket.io.js"></script>
<!--<script src="js/fire-0.62.min.js"></script>-->
<!-- CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="externals/jspsych/css/jspsych.css" rel="stylesheet" type="text/css"></link>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" >
<link href="css/custom.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
<img id="logo" alt="Brand" src="img/headerlogofront.png" height="25px"/>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="index.html">OpenEXP<span class="sr-only">(current)</span></a></li>
<li><a href="#">EEG</a></li>
<li><a href="sandbox.html">Sandbox</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Experiments <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="reactionTimeTask.html">Reaction Time Task</a></li>
<li><a href="#">Memory Study - Pictures</a></li>
<li><a href="#">Language Study - Words</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a></li>
<li role="separator" class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Need Help?</a></li>
<form class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" class="form-control" name="username" placeholder="Username">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" placeholder="Password">
</div>
<button type="submit" class="btn btn-default">Sign In</button>
</form>
</div>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="row spacer" style="margin-top:100px"></div>
<center>
<div class="hidden">
<div id="fire">
<img id="spinit" src="img/headerlogofront.png" width="300"/>
</div>
</div>
<div class="row spacer" style="margin-top:100px"></div>
<button id="startbutton" class="btn btn-lg btn-default">Start</button>
<button id="stopbutton" class="btn btn-lg btn-default">Stop</button>
<button id="triggerbutton" class="btn btn-lg btn-default">Touch Me</button>
<div class="row spacer" style="margin-top:100px"></div>
</center>
</body>
<script>
$(document).ready(function () {
$('div.hidden').fadeIn(1000).removeClass('hidden');
var socket = io.connect('http://localhost:8080');
$('#triggerbutton').click(function(){
console.log('button clicked')
socket.emit('message', '`');
});
$('#startbutton').click(function(){
console.log('button clicked')
socket.emit('message', 'b');
});
$('#stopbutton').click(function(){
console.log('button clicked')
socket.emit('message', 's');
});
});
var value = 0
$("#spinit").rotate({
bind:
{
click: function(){
value +=90;
$(this).rotate({ animateTo:value})
}
}
});
//
</script>
</html>