-
Notifications
You must be signed in to change notification settings - Fork 8
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 #87 from Mr-Ben-Merch-Store/RedCat888-patch-3
Add mobile fixes
- Loading branch information
Showing
3 changed files
with
71 additions
and
17 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 |
---|---|---|
@@ -1,32 +1,73 @@ | ||
import Link from 'next/link'; | ||
import React from 'react'; | ||
"use client"; | ||
|
||
import { ShoppingCartIcon } from '@heroicons/react/24/outline'; | ||
import Link from 'next/link'; | ||
import React, { useState } from 'react'; | ||
import { ShoppingCartIcon, Bars3Icon, XMarkIcon } from '@heroicons/react/24/outline'; | ||
|
||
export default function Navbar() { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const toggleMenu = () => setIsOpen(!isOpen); | ||
|
||
return ( | ||
<nav className="bg-zinc-950 p-4"> | ||
<ul className="flex justify-between text-textLight mx-10"> | ||
<div className="flex items-center space-x-12 text-2xl"> | ||
<li> | ||
<nav className="bg-zinc-950 p-4 relative"> | ||
<div className="flex items-center justify-between mx-10"> | ||
{/* Hamburger Menu */} | ||
<button | ||
onClick={toggleMenu} | ||
className="lg:hidden absolute left-0 top-1/2 transform -translate-y-1/2 p-2 z-20" | ||
> | ||
{isOpen ? ( | ||
<XMarkIcon className="w-10 h-10 text-textLight" /> | ||
) : ( | ||
<Bars3Icon className="w-10 h-10 text-textLight" /> | ||
)} | ||
</button> | ||
|
||
{/* Desktop Links */} | ||
<div className="flex items-center space-x-12 text-2xl text-textLight"> | ||
<li className="list-none"> | ||
<Link href=".">Home</Link> | ||
</li> | ||
<li> | ||
<li className="lg:flex hidden"> | ||
<Link href="/about">About</Link> | ||
</li> | ||
<li> | ||
<li className="lg:flex hidden"> | ||
<Link href="/store">Store</Link> | ||
</li> | ||
</div> | ||
|
||
<li> | ||
{/* Mobile Cart Icon */} | ||
<div className="flex items-center lg:hidden absolute right-0 top-1/2 transform -translate-y-1/2 pr-4"> | ||
<Link href="/cart"> | ||
<ShoppingCartIcon className="w-10 h-10" /> | ||
<ShoppingCartIcon className="w-10 h-10 text-textLight" /> | ||
</Link> | ||
</li> | ||
</div> | ||
|
||
|
||
{/* Desktop Cart Icon */} | ||
<div className="hidden lg:flex items-center"> | ||
<Link href="/cart"> | ||
<ShoppingCartIcon className="w-10 h-10 text-textLight" /> | ||
</Link> | ||
</div> | ||
</div> | ||
|
||
{/* Mobile Menu */} | ||
<ul | ||
className={`absolute top-16 left-0 bg-zinc-950 ${ | ||
isOpen ? 'animate-slide-in-left' : 'hidden' | ||
} text-textLight transition-all duration-300 ease-in-out z-10 w-auto max-w-xs p-4`} | ||
> | ||
<li className="py-4 border-b border-gray-700"> | ||
<Link href="/">Home</Link> | ||
</li> | ||
<li className="py-4 border-b border-gray-700"> | ||
<Link href="/about">About</Link> | ||
</li> | ||
<li className="py-4 border-b border-gray-700"> | ||
<Link href="/store">Store</Link> | ||
</li> | ||
</ul> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,11 @@ h3 { | |
p { | ||
@apply text-textDim; | ||
} | ||
|
||
footer { | ||
@apply text-bgLight; | ||
} | ||
p a{ | ||
color:#B4FFDC; | ||
|
||
p a { | ||
color: #B4FFDC; | ||
} |
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