mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-13 09:08:13 +00:00
36 lines
928 B
HTML
36 lines
928 B
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<script src="js/jquery.min.js"></script>
|
|
<script src="../jspsych.js"></script>
|
|
<script src="../plugins/jspsych-reconstruction.js"></script>
|
|
<link rel="stylesheet" href="../css/jspsych.css"></link>
|
|
</head>
|
|
<body>
|
|
<div id="jspsych-target"></div>
|
|
</body>
|
|
<script>
|
|
|
|
var sample_function = function(param){
|
|
var size = 50 + Math.floor(param*250);
|
|
var html = '<div style="display: block; margin: auto; height: 300px;">'+
|
|
'<div style="display: block; margin: auto; background-color: #000000; '+
|
|
'width: '+size+'px; height: '+size+'px;"></div></div>';
|
|
return html;
|
|
}
|
|
|
|
var block_1 = {
|
|
type: 'reconstruction',
|
|
stim_function: sample_function,
|
|
starting_value: 0.25
|
|
}
|
|
|
|
jsPsych.init({
|
|
display_element: $('#jspsych-target'),
|
|
timeline: [block_1],
|
|
on_finish: function() { jsPsych.data.displayData(); }
|
|
});
|
|
|
|
</script>
|
|
</html>
|