-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (42 loc) · 1.25 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
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/[email protected]"></script>
<script src="plugin-html-slider-response_display_slider_value.js"></script>
<script src="https://unpkg.com/@jspsych/[email protected]"></script>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/jspsych.css">
<style>
.jspsych-btn {margin-bottom: 10px;}
</style>
</head>
<body></body>
<script>
var jsPsych = initJsPsych();
var start = {
type: jsPsychHtmlButtonResponse,
stimulus: '',
choices: ['Run demo']
};
var trial = {
type: jsPsychHtmlSliderResponseDisplayValue,
stimulus: `The duration you select will be displayed here in seconds.`,
require_movement: true,
slider_width: 500,
min: 1,
max: 60,
step:0.1,
labels: ['1s', '15s', '30s', '45s', '60s'],
};
var trial_loop = {
timeline: [trial],
loop_function: function() {
return true;
}
};
if (typeof jsPsych !== "undefined") {
jsPsych.run([start, trial_loop]);
} else {
document.body.innerHTML = '<div style="text-align:center; margin-top:50%; transform:translate(0,-50%);">You must be online to view the plugin demo.</div>';
}
</script>
</html>