responsive home page and layout
This commit is contained in:
@@ -42,28 +42,30 @@ const columns: CategoryGroup[][] = [
|
||||
|
||||
const AllProductsMenu: FC = () => {
|
||||
return (
|
||||
<div className="absolute top-full right-[120px] z-50 mt-2 w-[1099px] rounded-[32px] bg-[#F9FAFB]/90 px-8 pt-8 pb-10">
|
||||
<div className="flex w-full items-start justify-between">
|
||||
{columns.map((groups) => (
|
||||
<div key={groups[0].title} className="flex w-[228px] shrink-0 flex-col gap-6">
|
||||
{groups.map((group) => (
|
||||
<div key={group.title} className="flex flex-col gap-2">
|
||||
<div className="flex h-10 items-center px-4 text-base font-bold text-black">{group.title}</div>
|
||||
{group.items.map((item) => (
|
||||
<button
|
||||
key={item}
|
||||
type="button"
|
||||
className="flex h-6 w-full items-center px-4 text-right text-base font-medium text-[#011E3A] transition-colors hover:text-primary"
|
||||
>
|
||||
{item}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
<div className="absolute top-full z-50 mt-2 inset-x-4 sm:inset-x-8 lg:inset-x-auto lg:right-[120px] w-auto lg:w-[min(1099px,calc(100vw-240px))] max-h-[70vh] overflow-y-auto rounded-2xl sm:rounded-[32px] bg-[#F9FAFB]/95 backdrop-blur-sm px-4 sm:px-8 pt-6 sm:pt-8 pb-6 sm:pb-10 shadow-lg border border-[#E9EEF2]/80">
|
||||
<div className="flex w-full flex-col lg:flex-row items-start justify-between gap-8">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 lg:gap-0 lg:contents w-full lg:w-auto">
|
||||
{columns.map((groups) => (
|
||||
<div key={groups[0].title} className="flex w-full lg:w-[228px] shrink-0 flex-col gap-6">
|
||||
{groups.map((group) => (
|
||||
<div key={group.title} className="flex flex-col gap-2">
|
||||
<div className="flex h-10 items-center px-2 sm:px-4 text-sm sm:text-base font-bold text-black">{group.title}</div>
|
||||
{group.items.map((item) => (
|
||||
<button
|
||||
key={item}
|
||||
type="button"
|
||||
className="flex h-6 w-full items-center px-2 sm:px-4 text-right text-sm sm:text-base font-medium text-[#011E3A] transition-colors hover:text-primary"
|
||||
>
|
||||
{item}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="relative h-[157px] w-[163px] shrink-0 overflow-hidden rounded-2xl">
|
||||
<div className="relative mx-auto lg:mx-0 h-[140px] w-[145px] sm:h-[157px] sm:w-[163px] shrink-0 overflow-hidden rounded-2xl">
|
||||
<Image src={businessCardMenu} alt="کارت ویزیت" fill className="object-cover" sizes="163px" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,7 +17,7 @@ const ContactItem: FC<ContactItemProps> = ({ icon, children }) => {
|
||||
|
||||
const FooterContact: FC = () => {
|
||||
return (
|
||||
<div className="flex max-w-[280px] flex-col gap-5">
|
||||
<div className="flex max-w-none sm:max-w-[280px] flex-col gap-5">
|
||||
<ContactItem icon={<Location size={18} color="currentColor" variant="Linear" />}>
|
||||
جاده خاوران، شریف آباد، شهرک صنعتی شنزار، بعد از میدان چهارم، خیابان بوستان پنجم، خیابان گلبهار، پلاک ۱۲۲
|
||||
</ContactItem>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { type FC } from "react";
|
||||
|
||||
const FooterNewsletter: FC = () => {
|
||||
return (
|
||||
<div className="flex max-w-[360px] flex-col gap-4">
|
||||
<div className="flex w-full max-w-[360px] flex-col gap-4 lg:ms-auto">
|
||||
<p className="text-sm leading-6 font-bold text-[#0A1B2C]">برای دریافت آخرین پیشنهادها، اخبار و مطالب الهامبخش، در خبرنامه ما عضو شوید.</p>
|
||||
<form className="relative" action="#">
|
||||
<input
|
||||
|
||||
@@ -62,9 +62,9 @@ const socialLinks: SocialLink[] = [
|
||||
|
||||
const FooterSocial: FC = () => {
|
||||
return (
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="flex flex-col gap-4 items-center lg:items-start text-center lg:text-right">
|
||||
<h3 className="text-sm font-bold text-[#0A1B2C]">ما را در شبکههای اجتماعی دنبال کنید</h3>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="flex items-center gap-3 flex-wrap justify-center lg:justify-start">
|
||||
{socialLinks.map((item) => (
|
||||
<a key={item.label} href={item.href} aria-label={item.label} className={`flex size-9 items-center justify-center rounded-full ${item.bg}`}>
|
||||
{item.icon}
|
||||
|
||||
@@ -6,9 +6,9 @@ const FooterTrustBadges: FC = () => {
|
||||
return (
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<h3 className="text-sm font-bold text-[#0A1B2C]">نماد های اعتماد</h3>
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="flex items-center gap-3 sm:gap-4 flex-wrap justify-center">
|
||||
{badges.map((badge) => (
|
||||
<div key={badge} className="flex size-16 items-center justify-center rounded-full border border-[#E9EEF2] bg-white text-center text-[10px] font-bold text-[#6C7680]">
|
||||
<div key={badge} className="flex size-14 sm:size-16 items-center justify-center rounded-full border border-[#E9EEF2] bg-white text-center text-[10px] font-bold text-[#6C7680]">
|
||||
{badge}
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -36,21 +36,21 @@ const HeaderMenu: FC = () => {
|
||||
}, [isAllProductsOpen]);
|
||||
|
||||
return (
|
||||
<div ref={containerRef} className="relative h-[72px] w-full flex-1 px-[120px]">
|
||||
<div className="flex h-full items-center justify-center gap-8">
|
||||
<div ref={containerRef} className="relative h-14 sm:h-[72px] w-full flex-1 px-4 sm:px-8 lg:px-[120px]">
|
||||
<div className="flex h-full items-center gap-4 sm:gap-6 lg:gap-8 overflow-x-auto scrollbar-none [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden lg:justify-center">
|
||||
<button
|
||||
type="button"
|
||||
className={cn("flex items-center gap-2 font-bold transition-colors", isAllProductsOpen && "text-primary")}
|
||||
className={cn("flex items-center gap-2 font-bold transition-colors shrink-0 text-sm sm:text-base", isAllProductsOpen && "text-primary")}
|
||||
onClick={() => setIsAllProductsOpen((open) => !open)}
|
||||
aria-expanded={isAllProductsOpen}
|
||||
aria-haspopup="true"
|
||||
>
|
||||
<HamburgerMenu size={24} color="currentColor" />
|
||||
<HamburgerMenu size={22} color="currentColor" />
|
||||
<span>همه محصولات</span>
|
||||
</button>
|
||||
|
||||
{menuItems.map((item) => (
|
||||
<div key={item} className="font-bold">
|
||||
<div key={item} className="font-bold shrink-0 whitespace-nowrap text-sm sm:text-base">
|
||||
{item}
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user