@@ -29,6 +29,7 @@ | |||||
"node": "^17.7.2", | "node": "^17.7.2", | ||||
"node-sass": "^7.0.1", | "node-sass": "^7.0.1", | ||||
"react": "^17.0.1", | "react": "^17.0.1", | ||||
"react-countdown-circle-timer": "^3.0.9", | |||||
"react-dom": "^17.0.1", | "react-dom": "^17.0.1", | ||||
"react-router": "^5.2.0", | "react-router": "^5.2.0", | ||||
"react-router-dom": "^5.2.0", | "react-router-dom": "^5.2.0", | ||||
@@ -13120,6 +13121,14 @@ | |||||
"node": ">=14" | "node": ">=14" | ||||
} | } | ||||
}, | }, | ||||
"node_modules/react-countdown-circle-timer": { | |||||
"version": "3.0.9", | |||||
"resolved": "https://registry.npmjs.org/react-countdown-circle-timer/-/react-countdown-circle-timer-3.0.9.tgz", | |||||
"integrity": "sha512-2rE2NklqgtArbvM9RVR3NctiKQ8+lY8PEjUZ2S1pKowD8CmaXUGqIaCbFBcygYH2aZQs9qPIQA49Z+9Jc2TOiQ==", | |||||
"peerDependencies": { | |||||
"react": ">=16.8.0" | |||||
} | |||||
}, | |||||
"node_modules/react-dev-utils": { | "node_modules/react-dev-utils": { | ||||
"version": "12.0.1", | "version": "12.0.1", | ||||
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz", | "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz", | ||||
@@ -26117,6 +26126,12 @@ | |||||
"whatwg-fetch": "^3.6.2" | "whatwg-fetch": "^3.6.2" | ||||
} | } | ||||
}, | }, | ||||
"react-countdown-circle-timer": { | |||||
"version": "3.0.9", | |||||
"resolved": "https://registry.npmjs.org/react-countdown-circle-timer/-/react-countdown-circle-timer-3.0.9.tgz", | |||||
"integrity": "sha512-2rE2NklqgtArbvM9RVR3NctiKQ8+lY8PEjUZ2S1pKowD8CmaXUGqIaCbFBcygYH2aZQs9qPIQA49Z+9Jc2TOiQ==", | |||||
"requires": {} | |||||
}, | |||||
"react-dev-utils": { | "react-dev-utils": { | ||||
"version": "12.0.1", | "version": "12.0.1", | ||||
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz", | "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz", | ||||
@@ -24,6 +24,7 @@ | |||||
"node": "^17.7.2", | "node": "^17.7.2", | ||||
"node-sass": "^7.0.1", | "node-sass": "^7.0.1", | ||||
"react": "^17.0.1", | "react": "^17.0.1", | ||||
"react-countdown-circle-timer": "^3.0.9", | |||||
"react-dom": "^17.0.1", | "react-dom": "^17.0.1", | ||||
"react-router": "^5.2.0", | "react-router": "^5.2.0", | ||||
"react-router-dom": "^5.2.0", | "react-router-dom": "^5.2.0", | ||||
@@ -17,6 +17,7 @@ $dim-grey: #696969; | |||||
ion-icon { | ion-icon { | ||||
width: 1.5rem; | width: 1.5rem; | ||||
height: 1.5rem; | height: 1.5rem; | ||||
align-self: center; | |||||
} | } | ||||
ion-input { | ion-input { | ||||
@@ -25,15 +25,8 @@ section { | |||||
} | } | ||||
.quizTimer { | .quizTimer { | ||||
.border { | |||||
width: 6rem; | |||||
height: 6rem; | |||||
border-radius: 50%; | |||||
border: 0.2rem solid #6BD534; | |||||
.time { | |||||
margin-top: 1.8rem; | |||||
font-size: 1.4rem; | |||||
} | |||||
.time { | |||||
font-size: 1.4rem; | |||||
} | } | ||||
} | } | ||||
} | } |
@@ -1,5 +1,6 @@ | |||||
import { createRef, useEffect, useRef, useState } from "react"; | |||||
import { useEffect, useState } from "react"; | |||||
import styles from "./Question.module.scss"; | import styles from "./Question.module.scss"; | ||||
import { CountdownCircleTimer } from 'react-countdown-circle-timer'; | |||||
interface OwnProp { | interface OwnProp { | ||||
@@ -33,6 +34,14 @@ const Question: React.FC<OwnProp> = (props) => { | |||||
return () => clearTimeout(timeout);; | return () => clearTimeout(timeout);; | ||||
}, [seconds]); | }, [seconds]); | ||||
const renderTime = () => { | |||||
return ( | |||||
<div className={styles.time}> | |||||
{`${displayMinutes < 10 ? "0" : ""}${displayMinutes}:${displaySeconds < 10 ? "0" : ""}${displaySeconds}`} | |||||
</div> | |||||
); | |||||
} | |||||
return ( | return ( | ||||
<section> | <section> | ||||
<div className={styles.questionHolder}> | <div className={styles.questionHolder}> | ||||
@@ -44,11 +53,16 @@ const Question: React.FC<OwnProp> = (props) => { | |||||
</div> | </div> | ||||
<div className={styles.quizTimer}> | <div className={styles.quizTimer}> | ||||
<div className={styles.border}> | |||||
<div className={styles.time}> | |||||
{`${displayMinutes < 10 ? "0" : ""}${displayMinutes}:${displaySeconds < 10 ? "0" : ""}${displaySeconds}`} | |||||
</div> | |||||
</div> | |||||
<CountdownCircleTimer | |||||
isPlaying | |||||
duration={COUNTDOWN_AMOUNT_TOTAL} | |||||
colors={'#6BD534'} | |||||
size={60} | |||||
strokeWidth={5} | |||||
> | |||||
{renderTime} | |||||
</CountdownCircleTimer> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</section> | </section> | ||||
@@ -1,6 +1,8 @@ | |||||
.assignment { | .assignment { | ||||
.description { | .description { | ||||
height: 75vh; | |||||
.icon { | .icon { | ||||
margin-top: 4rem; | margin-top: 4rem; | ||||
display: flex; | display: flex; | ||||
@@ -38,7 +40,6 @@ | |||||
ion-button { | ion-button { | ||||
width: 95%; | width: 95%; | ||||
margin: 0 auto; | margin: 0 auto; | ||||
margin-top: 35vh; | |||||
margin-bottom: 0; | margin-bottom: 0; | ||||
--background: var(--primary-button-color); | --background: var(--primary-button-color); | ||||
} | } | ||||
@@ -1,10 +1,11 @@ | |||||
.assignmentCompleted { | .assignmentCompleted { | ||||
.description { | .description { | ||||
height: 70vh; | |||||
.icon { | .icon { | ||||
margin-top: 4rem; | |||||
display: flex; | display: flex; | ||||
justify-content: center; | justify-content: center; | ||||
padding-top: 4rem; | |||||
ion-icon { | ion-icon { | ||||
width: 10rem; | width: 10rem; | ||||
height: 10rem; | height: 10rem; | ||||
@@ -36,6 +37,7 @@ | |||||
display: flex; | display: flex; | ||||
justify-content: space-around; | justify-content: space-around; | ||||
align-items: center; | align-items: center; | ||||
height: 18vh; | |||||
a{ | a{ | ||||
text-decoration: none; | text-decoration: none; | ||||
@@ -49,7 +51,6 @@ | |||||
.dashboard { | .dashboard { | ||||
ion-button { | ion-button { | ||||
margin-top: 35vh; | |||||
margin-bottom: 0; | margin-bottom: 0; | ||||
--background: transparent; | --background: transparent; | ||||
--border-width: 0.1rem; | --border-width: 0.1rem; | ||||
@@ -61,7 +62,6 @@ | |||||
.nextStep { | .nextStep { | ||||
ion-button { | ion-button { | ||||
margin-top: 35vh; | |||||
margin-bottom: 0; | margin-bottom: 0; | ||||
--background: var(--primary-button-color); | --background: var(--primary-button-color); | ||||
} | } | ||||
@@ -1,5 +1,6 @@ | |||||
.submitAssignment { | .submitAssignment { | ||||
.description { | .description { | ||||
height: 50vh; | |||||
.icon { | .icon { | ||||
margin-top: 4rem; | margin-top: 4rem; | ||||
display: flex; | display: flex; | ||||
@@ -31,7 +32,9 @@ | |||||
} | } | ||||
} | } | ||||
.inputHolder { | .inputHolder { | ||||
margin-top: 5rem; | |||||
// margin-top: 5rem; | |||||
width: 85%; | |||||
margin: 0 auto; | |||||
} | } | ||||
.submitAssigment { | .submitAssigment { | ||||
text-decoration: none; | text-decoration: none; | ||||