Skip to content

Commit

Permalink
evaluation handled
Browse files Browse the repository at this point in the history
  • Loading branch information
buggyGrandma committed Dec 26, 2023
1 parent cc72e1c commit 8dfd3c9
Show file tree
Hide file tree
Showing 15 changed files with 190 additions and 20 deletions.
Binary file added app/assets/fonts/FontsFree-Net-ir_sans.ttf
Binary file not shown.
3 changes: 3 additions & 0 deletions app/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ interface Props {
| "error"
| "disabled";
direction?: "left" | "right" | "up" | "down";
onClick?: () => void;
}

const Button = ({
Expand All @@ -29,11 +30,13 @@ const Button = ({
direction = "down",
arrowposition = "left",
arrow = false,
onClick,
}: Props) => {
const renderedColor = ColorList.get(color);
const [arrowColor, setArrowcolor] = useState(renderedColor?.arrowColor);
return (
<button
onClick={onClick && onClick}
onMouseEnter={() => setArrowcolor(renderedColor?.onHoverArrowColor)}
onMouseLeave={() => setArrowcolor(renderedColor?.arrowColor)}
disabled={color === "disabled"}
Expand Down
4 changes: 2 additions & 2 deletions app/evaluation/Note.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import CheckIcon from "./CheckIcon";
import CheckIcon from "./assets/CheckIcon";

const Note = () => {
return (
<div className="rounded-lg gap-4 max-w-[648px] flex items-center p-[24px] bg-white">
<div>
<CheckIcon />
</div>
<p className="text-wrap">
<p className="text-wrap text-[14px] font-normal">
با توجه به اینکه تعیین سطح هوشمند است،در هر زمان از آزمون که سیستم تشخیص
دهد سطح شما تعیین می شود
</p>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions app/evaluation/evaluation-exam/EvaluationQuestion/Options.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from "react";

const Options = ({ selected }: { selected: boolean }) => {
const renderedContainerClass = selected
? "text-[#202020] bg-[#FFD073]"
: "text-[#818181] bg-white";
const renderedBarClass = selected ? "bg-[#FFE0A5]" : "bg-[#DADADA]";
const renderedOptionClass = selected ? "bg-[#FFE0A5]" : "bg-[#EEEEEE]";
return (
<div
className={`${renderedContainerClass} text-[18px] font-medium relative px-[11px] w-full flex flex-row-reverse justify-start items-center rounded-[12px] max-w-[648px] h-[64px] my-[12px]`}
>
<div
className={`${renderedBarClass} absolute left-0 rounded-r-[50px] w-[5px] h-[44px]`}
></div>
<div
className={`${renderedOptionClass} mr-[12px] w-[44px] h-[44px] rounded-[8px] flex items-center justify-center`}
>
A
</div>
Options
</div>
);
};

export default Options;
66 changes: 66 additions & 0 deletions app/evaluation/evaluation-exam/EvaluationQuestion/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
"use client";
import { useState } from "react";
import Options from "./Options";

const EvaluationQuestion = () => {
const [selected, setSelected] = useState("");
return (
<div className="w-full flex flex-col justify-center items-center mb-[128px]">
<div className="relative mb-[90px] w-full max-w-[648px] h-[220px] bg-white rounded-[12px] flex justify-center items-center">
<div className="bg-[#F1F1F1] absolute top-3 left-3 w-[40px] h-[40px] rounded-[8px] flex items-center justify-center text-[18px] text-[#555555] font-medium">
60
</div>
<div className="bg-[#F5F5F5] text-[18px] font-normal text-[#818181] px-[16px] py-[8px] rounded-full absolute top-3 right-3">
I don`t know
</div>
<div className="text-[24px] font-medium">She was sick</div>
</div>
<input
onChange={() => setSelected("A")}
className="hidden"
type="radio"
name="options"
value="A"
id="A"
/>
<label className="w-full max-w-[648px]" htmlFor="A">
<Options selected={selected === "A"} />
</label>
<input
onChange={() => setSelected("B")}
className="hidden"
type="radio"
name="options"
value="B"
id="B"
/>
<label className="w-full max-w-[648px]" htmlFor="B">
<Options selected={selected === "B"} />
</label>
<input
onChange={() => setSelected("C")}
className="hidden"
type="radio"
name="options"
value="C"
id="C"
/>
<label className="w-full max-w-[648px]" htmlFor="C">
<Options selected={selected === "C"} />
</label>
<input
onChange={() => setSelected("D")}
className="hidden"
type="radio"
name="options"
value="D"
id="D"
/>
<label className="w-full max-w-[648px]" htmlFor="D">
<Options selected={selected === "D"} />
</label>
</div>
);
};

export default EvaluationQuestion;
15 changes: 15 additions & 0 deletions app/evaluation/evaluation-exam/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import EvaluationQuestion from "./EvaluationQuestion";

const EvaluationExam = () => {
return (
<div className="flex flex-col justify-center items-center w-full ">
<div className="text-[#757575] text-[14px] font-normal mb-[16px]">
با توجه به سوال گزینه صحیح را انتخاب کنید.
</div>
<EvaluationQuestion />
</div>
);
};

export default EvaluationExam;
15 changes: 9 additions & 6 deletions app/evaluation/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from "react";
import CloseIcon from "./Close";

import CloseIcon from "./assets/Close";
import localFont from "next/font/local";
const IRANSans = localFont({
src: "../assets/fonts/FontsFree-Net-ir_sans.ttf",
});
const EvaluationLayout = ({ children }: { children: React.ReactNode }) => {
return (
<>
<main dir="rtl" className="md:pt-[56px] bg-gray-500 h-[100vh]">
<main className={IRANSans.className}>
<div dir="rtl" className="md:pt-[56px] bg-gray-500 h-[100vh]">
<div className="border-b h-[64px] md:h-[91px] md:px-[172px] flex items-center gap-[8px] md:gap-[12px] w-full bg-white md:rounded-t-[24px]">
<div className="p-[8px] rounded-full md:bg-[#F2F2F2]">
<CloseIcon />
Expand All @@ -14,8 +17,8 @@ const EvaluationLayout = ({ children }: { children: React.ReactNode }) => {
<div className="p-4 gap-4 flex flex-col justify-center items-center bg-[#F8F8FB] h-fit">
{children}
</div>
</main>
</>
</div>
</main>
);
};

Expand Down
35 changes: 35 additions & 0 deletions app/evaluation/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from "react";

const loading = () => {
return (
<div
className="w-full h-[100vh] flex flex-col items-center justify-center"
role="status"
>
<svg
aria-hidden="true"
className="mb-[24px] w-[64px] h-[64px] text-[#E6E6E6] animate-spin fill-[#0CAC67]"
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill="currentColor"
/>
<path
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
fill="currentFill"
/>
</svg>
<div className="mb-[8px] text-[#121212] text-[18px] font-normal">
ما در حال تعیین سطح شما هستیم
</div>
<div className="text-[#818181] text-[14px] font-medium">
لطفا کمی منتظر بمانید...
</div>
</div>
);
};

export default loading;
23 changes: 16 additions & 7 deletions app/evaluation/page.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
"use client";
import { useRouter } from "next/navigation";
import Button from "../components/Button";
import Note from "./Note";
import PictuerMD from "./PictuerMD";
import PictureSM from "./PictureSM";
import PictuerMD from "./assets/PictuerMD";
import PictureSM from "./assets/PictureSM";

const Evaluation = () => {
const router = useRouter();
return (
<>
<PictuerMD />
<PictureSM />
<div className="flex">
<p className="text-green-600">سطح زبانتو </p>
<p>مشخص کن!</p>
<div className="flex text-[20px] font-bold">
<p className="text-[#08C784]">سطح زبانتو </p> <p>مشخص کن! </p>
</div>
<Note />
<Note />
<Note />
<Note />
<div className="w-[325px] h-[64px]">
<Button color="secondary">شروع آزمون</Button>
<div className="w-full max-w-[648px] flex justify-center md:justify-start">
<div className="w-full md:w-[325px] h-[64px]">
<Button
color="secondary"
onClick={() => router.push("/evaluation/evaluation-exam")}
>
شروع آزمون
</Button>
</div>
</div>
</>
);
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
"lint": "next lint"
},
"dependencies": {
"delay": "^6.0.0",
"next": "14.0.4",
"react": "^18",
"react-dom": "^18",
"next": "14.0.4"
"react-dom": "^18"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"eslint": "^8",
"eslint-config-next": "14.0.4",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"eslint": "^8",
"eslint-config-next": "14.0.4"
"typescript": "^5"
}
}

0 comments on commit 8dfd3c9

Please sign in to comment.