-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[update] responsive navbar [update] footer to the bottom
- Loading branch information
1 parent
66b2f1b
commit 55dcaa0
Showing
10 changed files
with
83 additions
and
10 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
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 |
---|---|---|
@@ -1,14 +1,25 @@ | ||
import { HamburgerIcon } from "components/icons/hamburger" | ||
import { HamburgerModal } from "components/ui/modals/hamburger" | ||
import Link from "next/link" | ||
import { Navbar } from "./navbar" | ||
import { TranslateIcon } from "components/icons/translatepy" | ||
import { useState } from "react" | ||
|
||
export const Header = () => { | ||
const [showMenu, setShowMenu] = useState(false); | ||
|
||
return <nav className="flex flex-row w-screen h-max mt-5 mb-16"> | ||
<div className="left-10 absolute my-auto cursor-pointer"> | ||
<Link href="/"> | ||
<TranslateIcon /> | ||
</Link> | ||
</div> | ||
<Navbar /> | ||
<HamburgerIcon onClick={() => { | ||
setShowMenu(true); | ||
}} className="sm:hidden block absolute right-10 cursor-pointer opacity-50 hover:opacity-100 transition" /> | ||
{ | ||
showMenu && <HamburgerModal onClose={() => { setShowMenu(false) }} /> | ||
} | ||
<Navbar className="sm:flex hidden" /> | ||
</nav> | ||
} |
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 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 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,5 @@ | ||
import { IconX } from "@tabler/icons" | ||
|
||
export const CloseIcon = (props) => { | ||
return <IconX {...props} /> | ||
} |
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,5 @@ | ||
import { IconMenu2 } from "@tabler/icons"; | ||
|
||
export const HamburgerIcon = (props: any) => ( | ||
<IconMenu2 {...props} /> | ||
); |
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,31 @@ | ||
import { CloseIcon } from "components/icons/close"; | ||
import Link from "next/link"; | ||
import { useLanguage } from "contexts/language"; | ||
|
||
export const HamburgerMenuElement = ({ href, name, ...props }: any) => { | ||
return <div className="w-full h-16 p-5 text-xl items-center flex cursor-pointer hover:bg-slate-100 transition" {...props}> | ||
<Link href={href}> | ||
{name} | ||
</Link> | ||
</div> | ||
} | ||
|
||
export const HamburgerModal = ({ onClose, ...props }) => { | ||
const { strings } = useLanguage(); | ||
return <div className="h-screen animate-enter-menu w-4/5 z-10 right-0 absolute bg-white shadow-xl flex flex-col space-y-5 items-center sm:hidden"> | ||
<CloseIcon className="absolute top-0 right-0 mx-10 cursor-pointer opacity-60 hover:opacity-100 transition" onClick={() => { onClose(); }} /> | ||
{/* <span className="text-xl justify-center">Menu</span> */} | ||
<div className="h-5"></div> | ||
<div className="w-full"> | ||
<hr /> | ||
<HamburgerMenuElement onClick={onClose} href="/translate" name={strings.pages.translate} /> | ||
<hr /> | ||
<HamburgerMenuElement onClick={onClose} href="/documentation" name={strings.pages.documentation} /> | ||
<hr /> | ||
<HamburgerMenuElement onClick={onClose} href="/stats" name={strings.pages.stats} /> | ||
<hr /> | ||
</div> | ||
<div></div> | ||
<span>🧃 Anime no Sekai, 2022</span> | ||
</div> | ||
} |
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 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 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