Skip to content

Commit 31828dc

Browse files
adding tracking cross
1 parent d6e1955 commit 31828dc

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

webcamstudy/src/components/FaceTask.jsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { useEffect, useState } from 'react';
22

3-
// Settings for each face task variant
43
const FACE_TASKS = [
54
{ gridSize: 2, trials: 25 },
65
{ gridSize: 3, trials: 25 },
@@ -55,10 +54,10 @@ const FaceTask = () => {
5554

5655
const timer = setTimeout(() => {
5756
setShowCross(false);
58-
}, 10000); // Hide cross after 10s
57+
}, 10000); // 10 seconds
5958

6059
return () => clearTimeout(timer);
61-
}, []); // Run once on mount
60+
}, []);
6261

6362
const handleClick = (index) => {
6463
if (completed) return;
@@ -100,9 +99,11 @@ const FaceTask = () => {
10099
}}
101100
>
102101
{showCross && (
103-
<div style={styles.crossContainer}>
104-
<div style={styles.cross}>+</div>
105-
</div>
102+
console.log("Rendering fixation cross...") || (
103+
<div style={styles.crossContainer}>
104+
<div style={styles.cross}>+</div>
105+
</div>
106+
)
106107
)}
107108

108109
{!showCross && (
@@ -153,7 +154,7 @@ const FaceTask = () => {
153154
);
154155
};
155156

156-
// Styles for the tracking dot (cross)
157+
// Styles
157158
const styles = {
158159
crossContainer: {
159160
position: 'absolute',
@@ -164,13 +165,14 @@ const styles = {
164165
display: 'flex',
165166
justifyContent: 'center',
166167
alignItems: 'center',
167-
zIndex: 10,
168+
zIndex: 9999,
168169
backgroundColor: '#fff',
170+
border: '3px dashed red', // Debug visual
169171
},
170172
cross: {
171173
fontSize: '100px',
172174
fontWeight: 'bold',
173-
color: '#000',
175+
color: 'black',
174176
},
175177
};
176178

0 commit comments

Comments
 (0)