mobileMenu added

This commit is contained in:
parsa aghaei committed 2024-09-24 17:48:41 +03:30
1 parent f047cd70e0
commit 7e92bbc054
7 files changed
+151 -6

No files matched your search

@@ -0,0 +1,43 @@
"use client";
import Image from "next/image";
import React, { useState } from "react";
import MobileMenu from "../mobile-menu/page";
export default function BurgerButton() {
const [clicked, setClicked] = useState(false);
return (
<>
{clicked ? (
<button
className="flex items-center justify-center whitespace-nowrap rounded-md bg-[#FD6F00] px-4 py-2 text-[16px] font-[600] text-[#fff] lg:hidden xl:text-[20px]"
onClick={() => setClicked(!clicked)}
>
<Image
src={"/images/icons/close-square.svg"}
width={25}
height={25}
alt="close burger-menu svg"
className="cursor-pointer burger-menu"
/>
</button>
) : (
<button
className="flex items-center justify-center whitespace-nowrap rounded-md bg-[#FD6F00] px-4 py-2 text-[16px] font-[600] text-[#fff] lg:hidden xl:text-[20px]"
onClick={() => setClicked(!clicked)}
>
<Image
src={"/images/icons/burger-menu.svg"}
width={25}
height={25}
alt="burger-menu svg"
className="burger-menu"
onClick={() => setClicked(!clicked)}
/>
</button>
)}
<MobileMenu clicked={clicked} setClicked={setClicked} />
</>
);
}
+76
View File
@@ -0,0 +1,76 @@
type propsType = {
clicked: boolean;
setClicked: React.Dispatch<React.SetStateAction<boolean>>;
};
export default function MobileMenu({ clicked, setClicked }: propsType) {
return (
<div
className={`fixed left-0 top-0 z-40 flex h-full w-[250px] flex-col items-start gap-10 bg-[#fd6f00] ${clicked ? "left-0" : "left-[-260px]"} lg:left-[-260px] mobile-menu`}
>
<div className="z-50 flex w-full flex-wrap items-center justify-start bg-white px-3 py-6">
<div className="flex w-[50px]">
<img src={"/images/logo.svg"} className="w-full" alt="logo" />
</div>
<p className="ms-2 text-[20px] font-[900] text-[#FD6F00] sm:text-[23px] xl:ms-3 xl:text-[30px]">
Parsa Aghayi
</p>
</div>
<ul className="flex w-full flex-col">
<a
href="/#home"
className="block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer hover:bg-slate-100"
onClick={(e) => {
setClicked(false);
}}
>
Home
</a>
<a
href="/#about-me"
className="block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer hover:bg-slate-100"
onClick={(e) => {
setClicked(false);
}}
>
About Me
</a>
<a
href="/#services"
className="block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer hover:bg-slate-100"
onClick={(e) => {
setClicked(false);
}}
>
Services
</a>
<a
href="/#projects"
className="block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer hover:bg-slate-100"
onClick={(e) => {
setClicked(false);
}}
>
Projects
</a>
<a
href="/#testimonials"
className="block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer hover:bg-slate-100"
onClick={(e) => {
setClicked(false);
}}
>
Testimonials
</a>
<a
href="/#contact"
className="block w-full whitespace-nowrap px-[14px] py-[10px] text-[21px] font-[400] hover:cursor-pointer hover:bg-slate-100"
onClick={(e) => {
setClicked(false);
}}
>
Contact
</a>
</ul>
</div>
);
}
+1 -1
View File
@@ -60,7 +60,7 @@ export default function Services() {
service!.title
)}
</h3>
<p className="w-full text-[14px] font-[400] text-black xl:text-[20px]">
<p className="w-full text-[14px] text-justify font-[400] text-black xl:text-[20px]">
{loading ? (
<Skeleton containerClassName={"w-full"} height={60} />
) : (
+12 -2
View File
@@ -250,7 +250,7 @@ html {
cursor: zoom-in;
}
.svg-hover{
.svg-hover {
transition: all ease-in-out 123ms;
-webkit-transition: -webkit-filter 123ms ease-in-out;
scale: 1;
@@ -259,6 +259,16 @@ html {
scale: 1.05;
filter: brightness(0) saturate(100%) invert(46%) sepia(59%) saturate(3359%)
hue-rotate(6deg) brightness(103%) contrast(104%);
transition: all ease-in-out 123ms;
transition: all ease-in-out 123ms;
-webkit-transition: -webkit-filter 123ms ease-in-out;
}
.burger-menu {
filter: brightness(0) saturate(100%) invert(100%) sepia(6%) saturate(0%)
hue-rotate(115deg) brightness(108%) contrast(108%);
}
.mobile-menu {
opacity: 0.95;
transition: all ease-in-out 0.5s;
}
+8 -3
View File
@@ -2,6 +2,8 @@ import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import Image from "next/image";
import BurgerButton from "./_components/burger-button/page";
import MobileMenu from "./_components/mobile-menu/page";
const geistSans = localFont({
src: "./../../public/fonts/Mikhak-v3.2/Variable/Mikhak[DSTY,KSHD,wght].woff2",
@@ -82,9 +84,12 @@ export default function RootLayout({
Contact
</a>
</ul>
<button className="flex items-center justify-center whitespace-nowrap rounded-md bg-[#FD6F00] px-4 py-2 text-[16px] font-[600] text-[#fff] xl:text-[20px]">
Download CV
</button>
<div className="flex gap-1">
<button className="flex items-center justify-center whitespace-nowrap rounded-md bg-[#FD6F00] px-4 py-2 text-[16px] font-[600] text-[#fff] xl:text-[20px]">
Download CV
</button>
<BurgerButton />
</div>
</div>
<div className="main my-10 flex w-full justify-center">{children}</div>