-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/mtocommunity/landing-page
- Loading branch information
Showing
5 changed files
with
127 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { useState } from "react"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import { faBars } from "@fortawesome/free-solid-svg-icons"; | ||
import { MTOTransparentBackground } from "../../../../assets"; | ||
|
||
import "./style.css"; | ||
|
||
type Props = { | ||
children: React.ReactNode; | ||
fixed: boolean; | ||
full?: boolean; | ||
}; | ||
|
||
function CustomNavBar({ children, fixed, full }: Props) { | ||
const [toggle, setToggle] = useState(true); | ||
|
||
const handleToggle = () => { | ||
setToggle(!toggle); | ||
}; | ||
|
||
return ( | ||
<> | ||
<header | ||
className={`flex justify-between items-center w-full h-14${ | ||
fixed ? " fixed" : null | ||
} top-0 px-4 transition-colors z-50 ${ | ||
!toggle ? "bg-mto_gray" : "bg-transparent" | ||
} lg:bg-transparent lg:w-[95%] lg:mx-auto lg:top-6`} | ||
> | ||
<a className="h-full flex items-centers" href="/"> | ||
<MTOTransparentBackground className="h-full lg:h-[150%] aspect-square" /> | ||
{full && ( | ||
<span className="font-main_sans flex items-center font-semibold"> | ||
Many To One | ||
</span> | ||
)} | ||
</a> | ||
<div className="text-white lg:hidden" onClick={handleToggle}> | ||
<FontAwesomeIcon icon={faBars} /> | ||
</div> | ||
<nav className="hidden lg:flex nav-desktop">{children}</nav> | ||
</header> | ||
<div | ||
className={`nav-mobile fixed w-full top-14 bg-mto_gray text-mto_blue_light z-20 flex-col items-center justify-between py-4 text-xl lg:hidden ${ | ||
toggle ? "hidden" : "flex" | ||
}`} | ||
> | ||
{children} | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default CustomNavBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.nav-mobile { | ||
animation: dropDown 0.2s ease-in-out; | ||
height: 33dvh; | ||
} | ||
|
||
.nav-desktop { | ||
@apply h-3/4 text-gray-300; | ||
} | ||
|
||
.nav-desktop a { | ||
@apply px-5 h-full flex items-center transition-colors; | ||
} | ||
|
||
.nav-desktop a:hover { | ||
@apply relative text-white drop-shadow-md shadow-white; | ||
} | ||
|
||
.nav-desktop a:hover::before { | ||
content: ""; | ||
@apply h-[.2rem] w-[calc(100%-2.5rem)] bg-white absolute bottom-1 left-[1.25rem]; | ||
animation: sliceIn 0.2s ease-in-out; | ||
} | ||
|
||
@keyframes sliceIn { | ||
0% { | ||
width: 0; | ||
} | ||
100% { | ||
width: calc(100%-2.5rem); | ||
} | ||
} | ||
|
||
@keyframes dropDown { | ||
0% { | ||
height: 0; | ||
} | ||
100% { | ||
height: 33dvh; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters