-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from Raiden0456/navbar-remake
feat(NavBar mobile): New Navbar for mobile
- Loading branch information
Showing
11 changed files
with
406 additions
and
14 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,159 @@ | ||
import React, { useState } from 'react' | ||
import MyLogo from './Mylogo' | ||
import { Menu } from 'lucide-react' | ||
import ThemeSwitch from './ThemeSwitch/ThemeSwitch' | ||
|
||
const MobileNavbar: React.FC = () => { | ||
const [isMenuOpen, setMenuOpen] = useState(false) | ||
|
||
const menuTransformClass = isMenuOpen ? 'translate-x-0' : 'translate-x-full' | ||
|
||
return ( | ||
<div className="lg:hidden"> | ||
{/* Mobile Header */} | ||
<header className="flex items-center justify-between bg-paper px-4 py-2"> | ||
<a className="flex items-center gap-2" href="/"> | ||
<MyLogo className="h-8 w-8 text-coral" /> | ||
<span className="text-lg font-bold">zen browser</span> | ||
</a> | ||
<div className="flex flex-row gap-2"> | ||
<ThemeSwitch /> | ||
<button | ||
id="burger-btn" | ||
className="p-2 text-dark" | ||
aria-label="Open menu" | ||
onClick={() => setMenuOpen(true)} | ||
> | ||
<Menu className="h-6 w-6" /> | ||
</button> | ||
</div> | ||
</header> | ||
|
||
{/* Mobile Slide Menu (slides in from the right) */} | ||
<div | ||
id="mobile-menu" | ||
className={`fixed inset-y-0 right-0 z-40 w-64 transform bg-paper shadow-lg transition-transform duration-300 ${menuTransformClass}`} | ||
> | ||
<div className="flex items-center justify-between border-b border-dark px-4 py-2"> | ||
<div className="text-lg font-bold">Menu</div> | ||
<button | ||
id="close-btn" | ||
className="p-2 text-dark" | ||
aria-label="Close menu" | ||
onClick={() => setMenuOpen(false)} | ||
> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
className="h-6 w-6" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke="currentColor" | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth={2} | ||
d="M6 18L18 6M6 6l12 12" | ||
/> | ||
</svg> | ||
</button> | ||
</div> | ||
<nav className="px-4 py-2"> | ||
<ul className="space-y-4"> | ||
{/* Getting Started Links */} | ||
<li> | ||
<div className="mb-2 font-bold">Getting Started</div> | ||
<ul className="ml-4 space-y-2"> | ||
<li> | ||
<a href="/mods" className="block text-dark hover:text-coral"> | ||
Zen Mods | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="/release-notes" | ||
className="block text-dark hover:text-coral" | ||
> | ||
Release Notes | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://discord.gg/zen-browser" | ||
className="block text-dark hover:text-coral" | ||
> | ||
Discord | ||
</a> | ||
</li> | ||
</ul> | ||
</li> | ||
{/* Useful Links */} | ||
<li> | ||
<div className="mb-2 font-bold">Useful Links</div> | ||
<ul className="ml-4 space-y-2"> | ||
<li> | ||
<a | ||
href="/donate" | ||
className="block text-dark hover:text-coral" | ||
> | ||
Donate ❤️ | ||
</a> | ||
</li> | ||
<li> | ||
<a href="/about" className="block text-dark hover:text-coral"> | ||
About Us 🌟 | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://docs.zen-browser.app" | ||
className="block text-dark hover:text-coral" | ||
> | ||
Documentation | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="https://github.com/zen-browser" | ||
target="_blank" | ||
className="block text-dark hover:text-coral" | ||
> | ||
GitHub | ||
</a> | ||
</li> | ||
</ul> | ||
</li> | ||
{/* Extra Links */} | ||
<li> | ||
<a | ||
href="/mods" | ||
className="block font-bold text-dark hover:text-coral" | ||
> | ||
Mods | ||
</a> | ||
</li> | ||
<li> | ||
<a | ||
href="/download" | ||
className="block font-bold text-dark hover:text-coral" | ||
> | ||
Download | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
|
||
{/* Overlay for Mobile Menu */} | ||
{isMenuOpen && ( | ||
<div | ||
id="overlay" | ||
className="fixed inset-0 z-30 bg-black opacity-50" | ||
onClick={() => setMenuOpen(false)} | ||
/> | ||
)} | ||
</div> | ||
) | ||
} | ||
|
||
export default MobileNavbar |
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,37 @@ | ||
import React from 'react' | ||
|
||
interface MyLogoProps { | ||
className?: string | ||
} | ||
|
||
const MyLogo: React.FC<MyLogoProps> = ({ className }) => ( | ||
<svg | ||
className={className} | ||
width="32" | ||
height="32" | ||
viewBox="0 0 64 64" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M32 44.3077C38.7974 44.3077 44.3077 38.7974 44.3077 32C44.3077 25.2027 38.7974 19.6923 32 19.6923C25.2027 19.6923 19.6923 25.2027 19.6923 32C19.6923 38.7974 25.2027 44.3077 32 44.3077ZM41.8462 32C41.8462 37.4379 37.4379 41.8462 32 41.8462C26.5621 41.8462 22.1538 37.4379 22.1538 32C22.1538 26.5621 26.5621 22.1538 32 22.1538C37.4379 22.1538 41.8462 26.5621 41.8462 32Z" | ||
fill="currentColor" | ||
/> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M53.3333 32C53.3333 43.7821 43.7821 53.3333 32 53.3333C20.2179 53.3333 10.6667 43.7821 10.6667 32C10.6667 20.2179 20.2179 10.6667 32 10.6667C43.7821 10.6667 53.3333 20.2179 53.3333 32ZM32 49.2308C41.5163 49.2308 49.2308 41.5163 49.2308 32C49.2308 22.4837 41.5163 14.7692 32 14.7692C22.4837 14.7692 14.7692 22.4837 14.7692 32C14.7692 41.5163 22.4837 49.2308 32 49.2308Z" | ||
fill="currentColor" | ||
/> | ||
<path | ||
fillRule="evenodd" | ||
clipRule="evenodd" | ||
d="M64 32C64 49.6731 49.6731 64 32 64C14.3269 64 0 49.6731 0 32C0 14.3269 14.3269 0 32 0C49.6731 0 64 14.3269 64 32ZM32 58.2564C46.501 58.2564 58.2564 46.501 58.2564 32C58.2564 17.499 46.501 5.74359 32 5.74359C17.499 5.74359 5.74359 17.499 5.74359 32C5.74359 46.501 17.499 58.2564 32 58.2564Z" | ||
fill="currentColor" | ||
/> | ||
</svg> | ||
) | ||
|
||
export default MyLogo |
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
Oops, something went wrong.