-
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.
- Loading branch information
Showing
8 changed files
with
421 additions
and
153 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,3 @@ | ||
export const metadata = { | ||
title: 'Next.js', | ||
description: 'Generated by Next.js', | ||
} | ||
import RootLayout from "@/layouts/RootLayout"; | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} | ||
export default RootLayout; |
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,119 @@ | ||
'use client'; | ||
|
||
import React, { useState } from 'react'; | ||
import { motion, AnimatePresence } from 'framer-motion'; | ||
|
||
const menuItems = [ | ||
{ label: 'Home', href: '#home' }, | ||
{ label: 'About', href: '/about' }, | ||
{ label: 'Services', href: '#services' }, | ||
{ label: 'Contact', href: '#contact' }, | ||
]; | ||
|
||
const Navbar: React.FC = () => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const toggleMenu = () => setIsOpen((prev) => !prev); | ||
|
||
return ( | ||
<nav className="bg-gray-800"> | ||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> | ||
<div className="flex items-center justify-between h-16"> | ||
{/* Logo */} | ||
<div className="flex items-center"> | ||
<div className="flex-shrink-0"> | ||
<img | ||
className="h-8 w-8" | ||
src="https://tailwindui.com/img/logos/workflow-mark-indigo-500.svg" | ||
alt="Workflow" | ||
/> | ||
</div> | ||
{/* Desktop Menu */} | ||
<div className="hidden md:flex ml-10 space-x-4"> | ||
{menuItems.map((item) => ( | ||
<a | ||
key={item.href} | ||
href={item.href} | ||
className="text-gray-300 hover:bg-gray-700 hover:text-white px-3 py-2 rounded-md text-sm font-medium" | ||
> | ||
{item.label} | ||
</a> | ||
))} | ||
</div> | ||
</div> | ||
|
||
{/* Mobile Menu Toggle */} | ||
<div className="flex md:hidden"> | ||
<button | ||
onClick={toggleMenu} | ||
className="text-gray-400 hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white" | ||
aria-expanded={isOpen} | ||
> | ||
<span className="sr-only">Open main menu</span> | ||
{isOpen ? ( | ||
<svg | ||
className="h-6 w-6" | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke="currentColor" | ||
aria-hidden="true" | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
d="M6 18L18 6M6 6l12 12" | ||
/> | ||
</svg> | ||
) : ( | ||
<svg | ||
className="h-6 w-6" | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke="currentColor" | ||
aria-hidden="true" | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
d="M4 6h16M4 12h16M4 18h16" | ||
/> | ||
</svg> | ||
)} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{/* Mobile Menu */} | ||
<AnimatePresence> | ||
{isOpen && ( | ||
<motion.div | ||
initial={{ opacity: 0, height: 0 }} | ||
animate={{ opacity: 1, height: 'auto' }} | ||
exit={{ opacity: 0, height: 0 }} | ||
className="md:hidden bg-gray-700" | ||
> | ||
<div className="px-2 pt-2 pb-3 space-y-1 sm:px-3"> | ||
{menuItems.map((item) => ( | ||
<a | ||
key={item.href} | ||
href={item.href} | ||
className="block text-gray-300 hover:bg-gray-600 hover:text-white px-3 py-2 rounded-md text-base font-medium" | ||
onClick={() => setIsOpen(false)} // Close menu on selection | ||
> | ||
{item.label} | ||
</a> | ||
))} | ||
</div> | ||
</motion.div> | ||
)} | ||
</AnimatePresence> | ||
</nav> | ||
); | ||
}; | ||
|
||
export default Navbar; |
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