|
|
|
@ -3,8 +3,8 @@ import img2 from "../../assets/img/usgs-hoS3dzgpHzw-unsplash.jpg"; |
|
|
|
|
import stickynote from "../../assets/img/stickynote.svg"; |
|
|
|
|
import clockIcon from "../../assets/img/vuesax-linear-clock.svg"; |
|
|
|
|
import Title from "./Title"; |
|
|
|
|
import './index.css' |
|
|
|
|
const FutureExams = () => { |
|
|
|
|
import "./index.css"; |
|
|
|
|
const FutureExams = ({ seeMoreHandler, seeMoreStatus, deActiveSeeMore }) => { |
|
|
|
|
let data = [ |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
@ -54,64 +54,92 @@ const FutureExams = () => { |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
//hoverHandler--------------
|
|
|
|
|
const hoverHandler=(index)=>{ |
|
|
|
|
const hoverHandler = (index) => { |
|
|
|
|
let frontBox = document.querySelectorAll(".frontBox"); |
|
|
|
|
let description = document.querySelectorAll(".frontBox-description"); |
|
|
|
|
frontBox[index].style.transform="translateY(0px)"; |
|
|
|
|
frontBox[index].style.transform = "translateY(0px)"; |
|
|
|
|
frontBox[index].style.background = "rgba(223,20,82,0.7)"; |
|
|
|
|
description[index].style.display="block"; |
|
|
|
|
description[index].style.display = "block"; |
|
|
|
|
// rgba(223,20,82,0.7)
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const hoverHandle2 = (index) => { |
|
|
|
|
let frontBox = document.querySelectorAll(".frontBox"); |
|
|
|
|
let description = document.querySelectorAll(".frontBox-description"); |
|
|
|
|
if(window.innerWidth>=1490){ |
|
|
|
|
frontBox[index].style.transform = "translateY(60%)"; |
|
|
|
|
}else if (window.innerWidth >= 1410) { |
|
|
|
|
frontBox[index].style.transform = "translateY(57%)"; |
|
|
|
|
}else if (window.innerWidth >= 1315) { |
|
|
|
|
frontBox[index].style.transform = "translateY(70%)"; |
|
|
|
|
}else if (window.innerWidth >= 1230) { |
|
|
|
|
frontBox[index].style.transform = "translateY(67%)"; |
|
|
|
|
}else{ |
|
|
|
|
frontBox[index].style.transform = "translateY(63%)"; |
|
|
|
|
if (seeMoreStatus !== 1) { |
|
|
|
|
if (window.innerWidth >= 1490) { |
|
|
|
|
frontBox[index].style.transform = "translateY(60%)"; |
|
|
|
|
} else if (window.innerWidth >= 1410) { |
|
|
|
|
frontBox[index].style.transform = "translateY(57%)"; |
|
|
|
|
} else if (window.innerWidth >= 1315) { |
|
|
|
|
frontBox[index].style.transform = "translateY(70%)"; |
|
|
|
|
} else if (window.innerWidth >= 1230) { |
|
|
|
|
frontBox[index].style.transform = "translateY(67%)"; |
|
|
|
|
} else { |
|
|
|
|
frontBox[index].style.transform = "translateY(63%)"; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
frontBox[index].style.transform = "translateY(72%)"; |
|
|
|
|
} |
|
|
|
|
frontBox[index].style.background = |
|
|
|
|
"linear-gradient(0deg, rgba(223,20,82,1) 65%, rgba(255,255,255,0) 100%)"; |
|
|
|
|
description[index].style.display = "none"; |
|
|
|
|
// rgba(223,20,82,0.7)
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className="FutureExams w-[55%] h-full border-l border-[#E0E0E0] px-1 pt-1"> |
|
|
|
|
<div |
|
|
|
|
className="FutureExams w-[55%] h-full border-l border-[#E0E0E0] px-1 pt-1" |
|
|
|
|
style={seeMoreStatus !== 0 ? { width: "100%", border: "none" } : null} |
|
|
|
|
> |
|
|
|
|
<div className="w-full h-full overflow-y-auto px-4 pt-4"> |
|
|
|
|
{/* ----title-------- */} |
|
|
|
|
<Title titleText="آزمونهای پیشرو" /> |
|
|
|
|
<Title |
|
|
|
|
titleText="آزمونهای پیشرو" |
|
|
|
|
seeMoreHandler={() => seeMoreHandler(1)} |
|
|
|
|
seeMoreStatus={seeMoreStatus} |
|
|
|
|
deActiveSeeMore={deActiveSeeMore} |
|
|
|
|
/> |
|
|
|
|
{/* ----body-------- */} |
|
|
|
|
<div className="w-full mt-4 flex flex-row-reverse items-start gap-x-[5%] res1:gap-x-[3.5%] gap-y-4 flex-wrap pb-2"> |
|
|
|
|
<div |
|
|
|
|
className="w-full mt-4 flex flex-row-reverse items-start gap-x-[5%] res1:gap-x-[3.5%] gap-y-4 flex-wrap pb-2" |
|
|
|
|
style={seeMoreStatus === 1 ? { columnGap: "3.5%" } : null} |
|
|
|
|
> |
|
|
|
|
{data?.map((item, index) => ( |
|
|
|
|
<div |
|
|
|
|
key={index} |
|
|
|
|
className="w-[47.5%] res1:w-[31%] aspect-square rounded overflow-hidden relative cursor-pointer" |
|
|
|
|
onMouseEnter={() => hoverHandler(index)} |
|
|
|
|
onMouseLeave={() => hoverHandle2(index)} |
|
|
|
|
style={seeMoreStatus === 1 ? { width: "31%" } : null} |
|
|
|
|
> |
|
|
|
|
{/* -----back-img------ */} |
|
|
|
|
<img src={item.img} className="w-full" alt="back-img" /> |
|
|
|
|
{/* -----front-data------ */} |
|
|
|
|
<div |
|
|
|
|
className="frontBox w-full h-full absolute top-0 left-0 p-3 translate-y-[60%] transition-all duration-300" |
|
|
|
|
style={{ |
|
|
|
|
background: |
|
|
|
|
"linear-gradient(0deg, rgba(223,20,82,1) 65%, rgba(255,255,255,0) 100%)", |
|
|
|
|
}} |
|
|
|
|
style={ |
|
|
|
|
seeMoreStatus === 1 |
|
|
|
|
? { |
|
|
|
|
background: |
|
|
|
|
"linear-gradient(0deg, rgba(223,20,82,1) 65%, rgba(255,255,255,0) 100%)", |
|
|
|
|
transform: "translateY(72%)", |
|
|
|
|
} |
|
|
|
|
: { |
|
|
|
|
background: |
|
|
|
|
"linear-gradient(0deg, rgba(223,20,82,1) 65%, rgba(255,255,255,0) 100%)", |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
<div className="w-full flex items-center flex-row-reverse pb-1 border-b border-white"> |
|
|
|
|
<img src={stickynote} alt="stickynote" className="h-5 ml-1" /> |
|
|
|
|
<div |
|
|
|
|
className="text-xs text-white text-right overflow-hidden text-ellipsis whitespace-nowrap" |
|
|
|
|
style={{ direction: "rtl" }} |
|
|
|
|
style={ |
|
|
|
|
seeMoreStatus === 1 |
|
|
|
|
? { direction: "rtl", fontSize: "16px" } |
|
|
|
|
: { direction: "rtl" } |
|
|
|
|
} |
|
|
|
|
> |
|
|
|
|
{item.title} |
|
|
|
|
</div> |
|
|
|
@ -120,11 +148,17 @@ const FutureExams = () => { |
|
|
|
|
<div className="w-full flex flex-row-reverse items-center justify-between py-1"> |
|
|
|
|
<div className="flex flex-row-reverse items-center"> |
|
|
|
|
<img src={clockIcon} alt="clockIcon" className="ml-1 h-4" /> |
|
|
|
|
<div className="text-xs res1:text-[10px] res0_5:text-xs text-white text-right"> |
|
|
|
|
<div |
|
|
|
|
className="text-xs res1:text-[10px] res0_5:text-xs text-white text-right" |
|
|
|
|
style={seeMoreStatus === 1 ? { fontSize: "14px" } : null} |
|
|
|
|
> |
|
|
|
|
{item.date} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div className="text-xs res1:text-[10px] res0_5:text-xs text-white text-right"> |
|
|
|
|
<div |
|
|
|
|
className="text-xs res1:text-[10px] res0_5:text-xs text-white text-right" |
|
|
|
|
style={seeMoreStatus === 1 ? { fontSize: "14px" } : null} |
|
|
|
|
> |
|
|
|
|
ساعت {item.time} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -144,4 +178,4 @@ const FutureExams = () => { |
|
|
|
|
); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
export default FutureExams; |
|
|
|
|
export default FutureExams; |
|
|
|
|