Sootzani/app/components/Landing.tsx

190 lines
7.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use client";
import React from "react";
import Navbar from "../../components/Navbar";
import Counter from "../../components/Counter";
import SubmitRequest from "../../components/SubmitRequest";
import { boxItems, newsItems } from "@/constants";
import Image from "next/image";
import { cn } from "@/lib/utils";
import Link from "next/link";
import bgimg from "../../public/img/bg.png";
import Footer from "@/components/Footer";
// Import Swiper React components
import { Swiper, SwiperSlide } from "swiper/react";
// Import Swiper styles
import "swiper/css";
import "swiper/css/pagination";
// import required modules
import { Autoplay, Pagination, Navigation} from "swiper/modules";
import { sliderItems } from "@/constants";
export default function Landing() {
return (
<div>
<div className="w-screen bg-top lg:bg-center bg-no-repeat h-[13rem] sm:h-[20rem] md:h-[24rem] xl:h-[33rem]">
<Swiper
slidesPerView={1}
spaceBetween={0}
autoplay={{
delay: 2500,
disableOnInteraction: false,
}}
loop={false}
pagination={{
clickable: true,
}}
modules={[Autoplay]}
className="mySwiper w-full h-full"
>
{sliderItems.map((item) => {
return (
<SwiperSlide key={item.id}>
<Image
alt="bg"
src={bgimg}
// width={20}
// height={20}
quality={100}
className=" w-full h-full bg-cover"
/>
</SwiperSlide>
);
})}
</Swiper>
</div>
<div className="3xl:w-[60%] w-[75%] mx-auto max-md:mt-5">
<div className="flex justify-between gap-6 w-full mx-auto -mt-24 max-md:mt-0 max-sm:flex-wrap max-sm:justify-around ">
{boxItems.map((item, index) => {
return (
<Link
className="group bg-white shadow-md rounded-lg p-10 h-64 w-64 flex items-end justify-center z-10 relative
hover:bg-blue transition-all duration-700 ease-in-out text-center
hover:flex-col-reverse hover:justify-evenly hover:items-center hover:cursor-pointer
max-lg:w-52 max-lg:h-52 max-md:w-40 max-md:h-40
max-lg:p-8 max-md:p-5 max-sm:p-2 hover:max-lg:p-2
max-md:shadow-[0px_0px_8px_0px_#00000040]
"
key={index}
href={item.link}
>
<p className="text-xs text-center font-medium text-gray hidden group-hover:flex ">
{item.description}
</p>
<p className=" z-10 text-base text-black group-hover:text-white max-md:text-sm">
{item.name}
</p>
<Image
alt="icon"
src={item.icon}
width={20}
height={20}
quality={100}
key={index}
className={cn(
" w-[80%] h-[80%] absolute left-2 top-6 group-hover:hidden max-md:h-[60%] max-md:w-[60%] max-md:left-auto",
item.id == 1 && "left-8"
)}
/>
<Image
alt="icon"
src={item.icon2}
width={20}
height={20}
quality={100}
key={index}
className=" w-[45%] h-[45%] hidden group-hover:flex"
/>
</Link>
);
})}
</div>
{/* News */}
<div className=" border mt-6 mx-auto py-3 px-4 rounded-lg">
آخرین اخبار
</div>
<div
className=" w-full mt-6 flex flex-row gap-8 mb-14
max-lg:flex-col max-lg:gap-4
"
>
{/* Right News */}
<div
className=" w-1/2 max-lg:w-full border rounded-lg flex flex-row shadow-md hover:shadow-none transition-all
max-lg:h-[14em] max-md:h-[12em] max-sm:h-[22em] max-sm:flex-col max-sm:gap-[3px]"
>
<div className="w-1/2 h-full rounded-r-lg bg-rose-400 max-sm:h-1/2 max-md:w-1/3 max-sm:w-full">
<Image
alt="picture"
src="/img/pic1.png"
height={500}
width={500}
style={{ objectFit: "fill", objectPosition: "center" }}
className="w-full h-full rounded-r-lg"
/>
</div>
<div className=" w-1/2 h-full flex flex-col p-8 justify-between max-lg:p-4 max-md:justify-evenly max-md:w-2/3 max-sm:h-1/2 max-sm:w-full">
<p className="text-[10px] font-bold text-right text-white bg-blue p-1 rounded ">
اخبار
</p>
<p className="text-xs font-medium text-right text-black">
24 آذر ماه 1402
</p>
<p className="text-base font-medium text-right text-black line-clamp-1">
شروع به کار سامانه سوت زنی
</p>
<p className="text-sm font-normal text-justify text-[#3C3C43D9] line-clamp-5 max-md:line-clamp-2">
این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور
مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده
است ...
</p>
<Link
href="#"
className="text-[10px] font-normal text-blue text-left"
>
بیشتر بخوانید{" "}
</Link>
</div>
</div>
{/* Left News */}
<div className=" w-1/2 max-lg:w-full flex flex-col gap-[2px] max-lg:gap-4">
{newsItems.map((item, index) => {
return (
<div
className=" w-full h-1/3 flex flex-col border rounded-lg justify-between px-8 py-[10px] hover:shadow-[0px_0px_8px_0px_#00000040] transition-all
max-lg:px-4 max-lg:gap-3"
key={index}
>
<div className="flex flex-row justify-between items-center max-sm:flex-col-reverse">
<p className="text-base font-medium text-right text-black max-sm:self-start">
{item.title}
</p>
<p className="text-xs font-medium text-right text-black max-sm:self-end">
{item.date}
</p>
</div>
<p className="text-sm font-normal text-justify text-[#3C3C43D9] max-md:line-clamp-2">
{item.content}
</p>
</div>
);
})}
</div>
</div>
</div>
{/* Counter */}
<Counter />
{/*SubmitRequest */}
<SubmitRequest />
{/* Footer */}
<Footer />
</div>
);
}