diff --git a/client/public/img/Grafika pod interface-ramka 2.png b/client/public/img/Grafika pod interface-ramka 2.png deleted file mode 100644 index ff36f1c..0000000 Binary files a/client/public/img/Grafika pod interface-ramka 2.png and /dev/null differ diff --git a/client/public/img/Grafika pod interface-ramka.png b/client/public/img/Grafika pod interface-ramka.png deleted file mode 100644 index 2c6d92a..0000000 Binary files a/client/public/img/Grafika pod interface-ramka.png and /dev/null differ diff --git a/client/public/img/Lupa.png b/client/public/img/Lupa.png deleted file mode 100644 index d7d3788..0000000 Binary files a/client/public/img/Lupa.png and /dev/null differ diff --git a/client/public/img/arrow-down.svg b/client/public/img/arrow-down.svg deleted file mode 100644 index 71127c2..0000000 --- a/client/public/img/arrow-down.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/client/public/img/arrow_after.png b/client/public/img/arrow_after.png deleted file mode 100644 index a410f6c..0000000 Binary files a/client/public/img/arrow_after.png and /dev/null differ diff --git a/client/public/img/arrow_before.png b/client/public/img/arrow_before.png deleted file mode 100644 index fdb5fc1..0000000 Binary files a/client/public/img/arrow_before.png and /dev/null differ diff --git a/client/public/img/fire-truck.png b/client/public/img/fire-truck.png deleted file mode 100644 index bf98f75..0000000 Binary files a/client/public/img/fire-truck.png and /dev/null differ diff --git a/client/public/img/fire-truck/arrow-turn.png b/client/public/img/fire-truck/arrow-turn.png deleted file mode 100644 index 4f312bd..0000000 Binary files a/client/public/img/fire-truck/arrow-turn.png and /dev/null differ diff --git a/client/public/img/fire-truck/img1.JPG b/client/public/img/fire-truck/img1.JPG deleted file mode 100644 index 7fe11b1..0000000 Binary files a/client/public/img/fire-truck/img1.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/img2.JPG b/client/public/img/fire-truck/img2.JPG deleted file mode 100644 index df38944..0000000 Binary files a/client/public/img/fire-truck/img2.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/img3.JPG b/client/public/img/fire-truck/img3.JPG deleted file mode 100644 index b661114..0000000 Binary files a/client/public/img/fire-truck/img3.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/img4.JPG b/client/public/img/fire-truck/img4.JPG deleted file mode 100644 index 2f3605e..0000000 Binary files a/client/public/img/fire-truck/img4.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/img5.JPG b/client/public/img/fire-truck/img5.JPG deleted file mode 100644 index 6b553df..0000000 Binary files a/client/public/img/fire-truck/img5.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/img6.JPG b/client/public/img/fire-truck/img6.JPG deleted file mode 100644 index a073cc0..0000000 Binary files a/client/public/img/fire-truck/img6.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/img7.JPG b/client/public/img/fire-truck/img7.JPG deleted file mode 100644 index 0018c1d..0000000 Binary files a/client/public/img/fire-truck/img7.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/img8.JPG b/client/public/img/fire-truck/img8.JPG deleted file mode 100644 index fe40353..0000000 Binary files a/client/public/img/fire-truck/img8.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/imgTrack2.jpg b/client/public/img/fire-truck/imgTrack2.jpg deleted file mode 100644 index 98f0c85..0000000 Binary files a/client/public/img/fire-truck/imgTrack2.jpg and /dev/null differ diff --git a/client/public/img/fire-truck/imgTrack3.jpg b/client/public/img/fire-truck/imgTrack3.jpg deleted file mode 100644 index d0de4c0..0000000 Binary files a/client/public/img/fire-truck/imgTrack3.jpg and /dev/null differ diff --git a/client/public/img/fire-truck/imgTrack4.jpg b/client/public/img/fire-truck/imgTrack4.jpg deleted file mode 100644 index eb880fc..0000000 Binary files a/client/public/img/fire-truck/imgTrack4.jpg and /dev/null differ diff --git a/client/public/img/fire-truck/track1.JPG b/client/public/img/fire-truck/track1.JPG deleted file mode 100644 index a073cc0..0000000 Binary files a/client/public/img/fire-truck/track1.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/track2.JPG b/client/public/img/fire-truck/track2.JPG deleted file mode 100644 index 2f3605e..0000000 Binary files a/client/public/img/fire-truck/track2.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/track3.JPG b/client/public/img/fire-truck/track3.JPG deleted file mode 100644 index 6b553df..0000000 Binary files a/client/public/img/fire-truck/track3.JPG and /dev/null differ diff --git a/client/public/img/fire-truck/wozBACK.webp b/client/public/img/fire-truck/wozBACK.webp deleted file mode 100644 index 0048f88..0000000 Binary files a/client/public/img/fire-truck/wozBACK.webp and /dev/null differ diff --git a/client/public/img/fire-truck/wozLEFT.webp b/client/public/img/fire-truck/wozLEFT.webp deleted file mode 100644 index 15c6375..0000000 Binary files a/client/public/img/fire-truck/wozLEFT.webp and /dev/null differ diff --git a/client/public/img/fire-truck/wozRIGHT.webp b/client/public/img/fire-truck/wozRIGHT.webp deleted file mode 100644 index 7b7b474..0000000 Binary files a/client/public/img/fire-truck/wozRIGHT.webp and /dev/null differ diff --git a/client/public/img/fire-truck/wozTOP.webp b/client/public/img/fire-truck/wozTOP.webp deleted file mode 100644 index e00a84e..0000000 Binary files a/client/public/img/fire-truck/wozTOP.webp and /dev/null differ diff --git a/client/public/img/fire-truck/zwolnieni.jpg b/client/public/img/fire-truck/zwolnieni.jpg deleted file mode 100644 index 47ff5fb..0000000 Binary files a/client/public/img/fire-truck/zwolnieni.jpg and /dev/null differ diff --git a/client/public/img/logo.png b/client/public/img/logo.png deleted file mode 100644 index 63dd58f..0000000 Binary files a/client/public/img/logo.png and /dev/null differ diff --git a/client/public/img/trophy.jpg b/client/public/img/trophy.jpg deleted file mode 100644 index 7cb2c2c..0000000 Binary files a/client/public/img/trophy.jpg and /dev/null differ diff --git a/client/public/img/trophy.webp b/client/public/img/trophy.webp deleted file mode 100644 index 66034e8..0000000 Binary files a/client/public/img/trophy.webp and /dev/null differ diff --git a/client/public/img/trucks/test.png b/client/public/img/trucks/test.png deleted file mode 100644 index d95c0e3..0000000 Binary files a/client/public/img/trucks/test.png and /dev/null differ diff --git a/client/public/img/trucks/woz_jakis_tam11.png b/client/public/img/trucks/woz_jakis_tam11.png deleted file mode 100644 index d95c0e3..0000000 Binary files a/client/public/img/trucks/woz_jakis_tam11.png and /dev/null differ diff --git a/client/public/img/trucks/woz_jakis_tam11/lewa.png b/client/public/img/trucks/woz_jakis_tam11/lewa.png deleted file mode 100644 index d95c0e3..0000000 Binary files a/client/public/img/trucks/woz_jakis_tam11/lewa.png and /dev/null differ diff --git a/client/public/img/trucks/woz_jakis_tam11/prawa.png b/client/public/img/trucks/woz_jakis_tam11/prawa.png deleted file mode 100644 index d95c0e3..0000000 Binary files a/client/public/img/trucks/woz_jakis_tam11/prawa.png and /dev/null differ diff --git a/client/src/components/BottomFPage.jsx b/client/src/components/BottomFPage.jsx index adf106a..b60306f 100644 --- a/client/src/components/BottomFPage.jsx +++ b/client/src/components/BottomFPage.jsx @@ -3,14 +3,9 @@ import React, {useContext} from 'react'; import { AppContext } from './AppContext'; import {Link} from 'react-router-dom'; -import {useState, useEffect} from 'react'; -import FooterQuiz from './FooterQuiz'; - - const BottomFPage = () => { - const {unitOsp} = useContext(AppContext); @@ -22,18 +17,10 @@ const BottomFPage = () => { : ""; - return ( <> {buttonShow} - - - - - - - ) } diff --git a/client/src/components/QuizGame.jsx b/client/src/components/QuizGame.jsx index 78951da..89e1f52 100644 --- a/client/src/components/QuizGame.jsx +++ b/client/src/components/QuizGame.jsx @@ -1,5 +1,5 @@ import {useNavigate} from 'react-router-dom'; -import React, {useState, useContext} from 'react'; +import React, {useState} from 'react'; import {QuizGetQuestion } from './GetQuestion'; import { QuizGetImage } from './GetImageAndQuestion'; import AppProvider, { AppContext } from './AppContext'; @@ -14,7 +14,7 @@ export let endScore = 0; const NavigationQuiz = ({score,buttonState}) => { - console.log(endScore) + link = /[^/]*$/.exec(`${window.location.href}`)[0]; @@ -53,7 +53,7 @@ const QuizGame = () => { const ButtonNextQuestionClick = (e) => { setScore(score + 1); - console.log(Number(e.target.name), EndCacheId) + if(score === 9) navigate("/result"); else if (Number(e.target.name) === EndCacheId) diff --git a/client/src/components/Result.jsx b/client/src/components/Result.jsx index 60df0a2..5616ac0 100644 --- a/client/src/components/Result.jsx +++ b/client/src/components/Result.jsx @@ -8,10 +8,11 @@ import Conffetti from './Conffetti'; import { CircularProgressbar , buildStyles } from 'react-circular-progressbar' ; import 'react-circular-progressbar/dist/styles.css'; -export let points = endScore; + const Result = () => { - console.log(TruckId, SecondSeconds, endScore) + + fetch('/quiz-results', { method: 'POST', headers: { diff --git a/client/src/components/Timer.jsx b/client/src/components/Timer.jsx index 4a00104..4a38fb1 100644 --- a/client/src/components/Timer.jsx +++ b/client/src/components/Timer.jsx @@ -1,38 +1,27 @@ -import React, {useState, useEffect, useContext} from 'react'; - - export let SecondSeconds = 1; export let SecondMinutes = 0; +import React, { useState, useEffect } from 'react'; const Timer = () => { - const [seconds, setSeconds] = useState(0); - const [minutes, setMinutes] = useState(0); + const [time, setTime] = useState(0); + let seconds = Math.floor(time % 60); + let minutes = Math.floor(time / 60); - useEffect(() => { - let timer = setInterval(() => { - SecondSeconds = seconds; - SecondMinutes = minutes - setSeconds(seconds + 1); + useEffect(() => { + const intervalId = setInterval(() => { + SecondSeconds = seconds; + SecondMinutes = minutes + setTime(time + 1); + }, 1000); + return () => clearInterval(intervalId); + }, [time]); - if(seconds === 59) { - setMinutes(minutes + 1); - setSeconds(0); - } - - }, 1000); - - - return () => clearInterval(timer); - }); - - - - - - return ( + return ( +

{minutes < 10 ? "0"+minutes: minutes} : {seconds < 10 ? "0"+seconds: seconds}

- ) -} +
+ ); +}; export default Timer; \ No newline at end of file diff --git a/client/src/components/Truck.jsx b/client/src/components/Truck.jsx index 69d6e0e..835527c 100644 --- a/client/src/components/Truck.jsx +++ b/client/src/components/Truck.jsx @@ -1,12 +1,9 @@ -import React, {useRef,useEffect,useContext} from 'react'; +import React, {useRef,useEffect} from 'react'; import { useState } from 'react'; import { useParams } from 'react-router-dom'; import {Link} from 'react-router-dom'; -import { AppContext } from './AppContext'; import { idUnits } from './SelectBox'; - - export let TruckId = ""; @@ -36,22 +33,28 @@ const Truck = () => { - const BoxComponent = () => { + + + + + let [truck, setTruck] = useState(''); useEffect(()=> { + + fetch(`/fire-trucks?osp-unit=${idUnits}`) .then(response => response.json()) .then(data => { setTruck(data.map(({ID,name,imagePath,avgPercent},index) => { TruckId = ID; - - let firstAvgPercent = avgPercent * 10; - let SecondAvgPercent = avgPercent * 100; + let percent = avgPercent.toString().slice(0,3); + let firstAvgPercent = percent * 10; + let SecondAvgPercent = percent * 100; return ( <> - +
handleImageClick(e)} > diff --git a/client/src/style/congratulation.mp3 b/client/src/style/congratulation.mp3 deleted file mode 100644 index 2fef238..0000000 Binary files a/client/src/style/congratulation.mp3 and /dev/null differ