Skip to content

Commit d3339dd

Browse files
making button dissapear
1 parent 2e70c44 commit d3339dd

6 files changed

Lines changed: 86 additions & 11 deletions

File tree

webcamstudy/asset-manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"files": {
33
"main.css": "https://seresl.unl.edu/webcamstudy/static/css/main.ea5d9395.css",
4-
"main.js": "https://seresl.unl.edu/webcamstudy/static/js/main.c9dfb723.js",
4+
"main.js": "https://seresl.unl.edu/webcamstudy/static/js/main.0cf5287e.js",
55
"static/js/453.e44939a0.chunk.js": "https://seresl.unl.edu/webcamstudy/static/js/453.e44939a0.chunk.js",
66
"static/media/clip2.mp4": "https://seresl.unl.edu/webcamstudy/static/media/clip2.1e6e426f2cdb61fe74ec.mp4",
77
"static/media/clip3.mp4": "https://seresl.unl.edu/webcamstudy/static/media/clip3.3341365941d9bce4b98b.mp4",
@@ -70,11 +70,11 @@
7070
"static/media/image-16.jpg": "https://seresl.unl.edu/webcamstudy/static/media/image-16.8583b0dd5e9bb251fc9c.jpg",
7171
"index.html": "https://seresl.unl.edu/webcamstudy/index.html",
7272
"main.ea5d9395.css.map": "https://seresl.unl.edu/webcamstudy/static/css/main.ea5d9395.css.map",
73-
"main.c9dfb723.js.map": "https://seresl.unl.edu/webcamstudy/static/js/main.c9dfb723.js.map",
73+
"main.0cf5287e.js.map": "https://seresl.unl.edu/webcamstudy/static/js/main.0cf5287e.js.map",
7474
"453.e44939a0.chunk.js.map": "https://seresl.unl.edu/webcamstudy/static/js/453.e44939a0.chunk.js.map"
7575
},
7676
"entrypoints": [
7777
"static/css/main.ea5d9395.css",
78-
"static/js/main.c9dfb723.js"
78+
"static/js/main.0cf5287e.js"
7979
]
8080
}

webcamstudy/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="https://seresl.unl.edu/webcamstudy/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="https://seresl.unl.edu/webcamstudy/logo192.png"/><link rel="manifest" href="https://seresl.unl.edu/webcamstudy/manifest.json"/><title>React App</title><script type="module">import EmbeddedPageSdk from"https://app.realeye.io/sdk/js/testRunnerEmbeddableSdk-1.7.1.js";window.addEventListener("DOMContentLoaded",()=>{new EmbeddedPageSdk(!1,null,!1)})</script><script defer="defer" src="https://seresl.unl.edu/webcamstudy/static/js/main.c9dfb723.js"></script><link href="https://seresl.unl.edu/webcamstudy/static/css/main.ea5d9395.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="https://seresl.unl.edu/webcamstudy/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="https://seresl.unl.edu/webcamstudy/logo192.png"/><link rel="manifest" href="https://seresl.unl.edu/webcamstudy/manifest.json"/><title>React App</title><script type="module">import EmbeddedPageSdk from"https://app.realeye.io/sdk/js/testRunnerEmbeddableSdk-1.7.1.js";window.addEventListener("DOMContentLoaded",()=>{new EmbeddedPageSdk(!1,null,!1)})</script><script defer="defer" src="https://seresl.unl.edu/webcamstudy/static/js/main.0cf5287e.js"></script><link href="https://seresl.unl.edu/webcamstudy/static/css/main.ea5d9395.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

webcamstudy/src/App.jsx

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,40 @@ import FaceTask from './components/FaceTask';
1010
function App() {
1111
const [currentTask, setCurrentTask] = useState(0);
1212
const [taskFiles, setTaskFiles] = useState([]);
13-
13+
const [clickCount, setClickCount] = useState(0);
14+
const [buttonVisible, setButtonVisible] = useState(true);
15+
1416
useEffect(() => {
1517
generateTaskSequence();
1618
}, []);
1719

1820
const generateTaskSequence = () => {
19-
// Randomly shuffle tasks (same logic as original)
2021
const tasks = [
2122
'ConsentForm',
2223
'TextTask',
2324
'VideoTask',
2425
'FaceTask',
2526
];
26-
2727
setTaskFiles(tasks);
2828
};
2929

3030
const incrementTask = () => {
31-
setCurrentTask(prev => prev + 1);
31+
setClickCount((prev) => prev + 1);
32+
setCurrentTask((prev) => prev + 1);
33+
setButtonVisible(false);
34+
35+
let delay = 0;
36+
if (clickCount === 0) {
37+
delay = 15000; // 15 seconds
38+
} else if (clickCount === 1) {
39+
delay = 20000; // 20 seconds
40+
} else {
41+
delay = 150000; // 2 min 30 seconds
42+
}
43+
44+
setTimeout(() => {
45+
setButtonVisible(true);
46+
}, delay);
3247
};
3348

3449
const renderCurrentTask = () => {
@@ -37,7 +52,7 @@ function App() {
3752
}
3853

3954
const taskName = taskFiles[currentTask];
40-
55+
4156
switch (taskName) {
4257
case 'ConsentForm':
4358
return <ConsentForm />;
@@ -60,7 +75,7 @@ function App() {
6075
{renderCurrentTask()}
6176
</div>
6277
<div className="button-container">
63-
{!isTaskComplete && (
78+
{!isTaskComplete && buttonVisible && (
6479
<button
6580
id="nextTaskButton"
6681
className="button"
@@ -74,4 +89,4 @@ function App() {
7489
);
7590
}
7691

77-
export default App;
92+
export default App;

webcamstudy/static/js/main.0cf5287e.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/* @license
2+
Papa Parse
3+
v5.5.3
4+
https://github.com/mholt/PapaParse
5+
License: MIT
6+
*/
7+
8+
/**
9+
* @license React
10+
* react-dom-client.production.js
11+
*
12+
* Copyright (c) Meta Platforms, Inc. and affiliates.
13+
*
14+
* This source code is licensed under the MIT license found in the
15+
* LICENSE file in the root directory of this source tree.
16+
*/
17+
18+
/**
19+
* @license React
20+
* react-dom.production.js
21+
*
22+
* Copyright (c) Meta Platforms, Inc. and affiliates.
23+
*
24+
* This source code is licensed under the MIT license found in the
25+
* LICENSE file in the root directory of this source tree.
26+
*/
27+
28+
/**
29+
* @license React
30+
* react-jsx-runtime.production.js
31+
*
32+
* Copyright (c) Meta Platforms, Inc. and affiliates.
33+
*
34+
* This source code is licensed under the MIT license found in the
35+
* LICENSE file in the root directory of this source tree.
36+
*/
37+
38+
/**
39+
* @license React
40+
* react.production.js
41+
*
42+
* Copyright (c) Meta Platforms, Inc. and affiliates.
43+
*
44+
* This source code is licensed under the MIT license found in the
45+
* LICENSE file in the root directory of this source tree.
46+
*/
47+
48+
/**
49+
* @license React
50+
* scheduler.production.js
51+
*
52+
* Copyright (c) Meta Platforms, Inc. and affiliates.
53+
*
54+
* This source code is licensed under the MIT license found in the
55+
* LICENSE file in the root directory of this source tree.
56+
*/

webcamstudy/static/js/main.0cf5287e.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)