mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-12 00:28:11 +00:00
35 lines
894 B
HTML
35 lines
894 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, 0.5, 0.75]
|
|
}
|
|
|
|
jsPsych.init({
|
|
display_element: $('#jspsych-target'),
|
|
experiment_structure: [block_1]
|
|
});
|
|
|
|
</script>
|
|
</html>
|