create-psytask 1.2.0-0 → 1.2.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/main.ts +10 -9
- package/template/package.json +2 -1
package/package.json
CHANGED
package/template/main.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { adapter } from '@psytask/components';
|
|
2
|
+
import { type NodeLike, createApp } from 'psytask';
|
|
3
3
|
import van from 'vanjs-core';
|
|
4
4
|
|
|
5
5
|
const { a, div } = van.tags;
|
|
@@ -7,27 +7,28 @@ const { a, div } = van.tags;
|
|
|
7
7
|
using app = await createApp();
|
|
8
8
|
using dc = app.collector('demo.csv');
|
|
9
9
|
|
|
10
|
-
using simpleText = app.scene(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
10
|
+
using simpleText = app.scene(
|
|
11
|
+
(props: { content: NodeLike }) =>
|
|
12
|
+
div({ class: 'psytask-center' }, () => props.content),
|
|
13
|
+
{ defaultProps: { content: '' }, adapter },
|
|
14
|
+
);
|
|
14
15
|
|
|
15
16
|
await simpleText.show({
|
|
16
17
|
content: div(
|
|
17
18
|
'Welcome to PsyTask template!\nsee more ',
|
|
18
19
|
a(
|
|
19
|
-
{ href: 'https://bluebonesx.github.io/psytask', target: '_blank' },
|
|
20
|
+
{ href: 'https://bluebonesx.github.io/psytask/play/', target: '_blank' },
|
|
20
21
|
'Information & Examples',
|
|
21
22
|
),
|
|
22
23
|
'\n\nClick to continue.',
|
|
23
24
|
),
|
|
24
25
|
});
|
|
25
26
|
for (let i = 0; i < 3; i++) {
|
|
26
|
-
const {
|
|
27
|
+
const { frame_times } = await simpleText.show({
|
|
27
28
|
content: `This is trial ${i + 1}. Click to continue.`,
|
|
28
29
|
});
|
|
29
30
|
|
|
30
|
-
dc.add({ index: i + 1, start_time });
|
|
31
|
+
dc.add({ index: i + 1, start_time: frame_times[0]! });
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
// show data on page and download
|