diff --git a/src/react-app/blink-detection-with-sliders.jsx b/src/react-app/blink-detection-with-sliders.jsx index 70604c1d..43142ddd 100644 --- a/src/react-app/blink-detection-with-sliders.jsx +++ b/src/react-app/blink-detection-with-sliders.jsx @@ -22,6 +22,7 @@ export const BlinkDetectionWithSliders = ({ onBlink, children, sx = {}, + paperSx = {}, }) => { const distanceHistory = useRef( Array(KEEP_NUMBER_OF_VALUES).fill({ time: Infinity, value: 0 }) @@ -121,10 +122,11 @@ export const BlinkDetectionWithSliders = ({ {!loadingBlinkThreshold && ( diff --git a/src/react-app/blink-training.jsx b/src/react-app/blink-training.jsx index a6d71f54..6f51fcae 100644 --- a/src/react-app/blink-training.jsx +++ b/src/react-app/blink-training.jsx @@ -97,8 +97,15 @@ export const BlinkTraining = ({ prevTask, forceReload }) => { sx={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "1rem" }} faceInFrame={setAllowNext} onBlink={onBlink} + paperSx={{ minHeight: "296px" }} > - + diff --git a/src/react-app/camera-with-highlights.jsx b/src/react-app/camera-with-highlights.jsx index 1cba4bae..b04a9656 100644 --- a/src/react-app/camera-with-highlights.jsx +++ b/src/react-app/camera-with-highlights.jsx @@ -12,6 +12,8 @@ import { useFaceMesh } from "./hooks/use-face-mesh"; import { SelectedWebcam } from "./selected-webcam.jsx"; import { useStoreValue } from "./hooks/use-store"; import { REVERSE_CAMERA } from "./lib/store-consts"; +import { CircularProgress } from "@mui/material"; +import { Box } from "@mui/system"; const LOADING_TIME = 2000; @@ -82,20 +84,36 @@ export const CameraWithHighlights = ({ onFrame = () => {} }) => { useFaceMesh({ loading: loading || reverseLoading, webcamRef }, onResults); + const showIndicator = loading || reverseLoading; + return ( - <> + + + {showIndicator && } + - + > + ); }; diff --git a/src/react-app/face-framer.jsx b/src/react-app/face-framer.jsx index 99facc68..e30bdb06 100644 --- a/src/react-app/face-framer.jsx +++ b/src/react-app/face-framer.jsx @@ -40,6 +40,7 @@ export const FaceFramer = ({ nextTask, prevTask }) => { width: "100%", margin: "0 auto", maxWidth: "540px", + minHeight: "296px", }} > {!allowNext ? ( diff --git a/src/react-app/main-screen.jsx b/src/react-app/main-screen.jsx index 478281ba..0f07cbe0 100644 --- a/src/react-app/main-screen.jsx +++ b/src/react-app/main-screen.jsx @@ -30,7 +30,7 @@ export const MainScreen = () => { ); const reloadTrigger = useReload([reloadPlaySound]); const [play] = useSound("./public/notif.mp3"); - const [isFaceInFrame, setIsFaceInFrame] = useState(false); + const [isFaceInFrame, setIsFaceInFrame] = useState(true); const sendBlinkToBackend = useBlinkAction(); const openSettings = useOpenSettings(); @@ -51,6 +51,7 @@ export const MainScreen = () => { onBlink={onBlink} faceInFrame={setIsFaceInFrame} sx={{ display: "grid", gridTemplateColumns: "1fr 1fr" }} + paperSx={{ minHeight: "296px" }} > <> {!isFaceInFrame && ( @@ -59,7 +60,7 @@ export const MainScreen = () => { the screen and well lit. )} - + { >