Spaces:
Sleeping
Sleeping
Upload components/Navbar.js with huggingface_hub
Browse files- components/Navbar.js +91 -0
components/Navbar.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use client';
|
| 2 |
+
|
| 3 |
+
import { motion } from 'framer-motion';
|
| 4 |
+
import { Menu, X } from 'lucide-react';
|
| 5 |
+
import { useState } from 'react';
|
| 6 |
+
|
| 7 |
+
export default function Navbar() {
|
| 8 |
+
const [isOpen, setIsOpen] = useState(false);
|
| 9 |
+
|
| 10 |
+
const navLinks = [
|
| 11 |
+
{ name: 'Research', href: '#research' },
|
| 12 |
+
{ name: 'Projects', href: '#projects' },
|
| 13 |
+
{ name: 'About', href: '#about' },
|
| 14 |
+
{ name: 'Contact', href: '#contact' },
|
| 15 |
+
];
|
| 16 |
+
|
| 17 |
+
return (
|
| 18 |
+
<motion.nav
|
| 19 |
+
initial={{ y: -100 }}
|
| 20 |
+
animate={{ y: 0 }}
|
| 21 |
+
transition={{ duration: 0.8, ease: [0.16, 1, 0.3, 1] }}
|
| 22 |
+
className="fixed top-0 left-0 w-full z-50 px-6 py-6 flex justify-between items-center mix-blend-difference"
|
| 23 |
+
>
|
| 24 |
+
<a href="/" className="font-serif text-2xl font-bold tracking-tighter hover:opacity-70 transition-opacity">
|
| 25 |
+
A.I.
|
| 26 |
+
</a>
|
| 27 |
+
|
| 28 |
+
{/* Desktop Nav */}
|
| 29 |
+
<div className="hidden md:flex items-center gap-8 font-mono text-sm uppercase tracking-widest">
|
| 30 |
+
{navLinks.map((link) => (
|
| 31 |
+
<a
|
| 32 |
+
key={link.name}
|
| 33 |
+
href={link.href}
|
| 34 |
+
className="relative group overflow-hidden"
|
| 35 |
+
>
|
| 36 |
+
<span className="block transition-transform duration-300 group-hover:-translate-y-full">
|
| 37 |
+
{link.name}
|
| 38 |
+
</span>
|
| 39 |
+
<span className="absolute top-0 left-0 block translate-y-full transition-transform duration-300 group-hover:translate-y-0 text-gray-400">
|
| 40 |
+
{link.name}
|
| 41 |
+
</span>
|
| 42 |
+
</a>
|
| 43 |
+
))}
|
| 44 |
+
<a
|
| 45 |
+
href="https://huggingface.co/spaces/akhaliq/anycoder"
|
| 46 |
+
target="_blank"
|
| 47 |
+
rel="noopener noreferrer"
|
| 48 |
+
className="text-xs border-b border-white/30 pb-0.5 hover:border-white transition-colors"
|
| 49 |
+
>
|
| 50 |
+
Built with anycoder
|
| 51 |
+
</a>
|
| 52 |
+
</div>
|
| 53 |
+
|
| 54 |
+
{/* Mobile Toggle */}
|
| 55 |
+
<button
|
| 56 |
+
className="md:hidden"
|
| 57 |
+
onClick={() => setIsOpen(!isOpen)}
|
| 58 |
+
>
|
| 59 |
+
{isOpen ? <X /> : <Menu />}
|
| 60 |
+
</button>
|
| 61 |
+
|
| 62 |
+
{/* Mobile Menu */}
|
| 63 |
+
{isOpen && (
|
| 64 |
+
<motion.div
|
| 65 |
+
initial={{ opacity: 0, y: -20 }}
|
| 66 |
+
animate={{ opacity: 1, y: 0 }}
|
| 67 |
+
className="absolute top-full left-0 w-full bg-void/90 backdrop-blur-xl border-b border-white/10 p-6 flex flex-col gap-4 md:hidden"
|
| 68 |
+
>
|
| 69 |
+
{navLinks.map((link) => (
|
| 70 |
+
<a
|
| 71 |
+
key={link.name}
|
| 72 |
+
href={link.href}
|
| 73 |
+
className="font-mono text-lg uppercase tracking-widest hover:text-gray-400"
|
| 74 |
+
onClick={() => setIsOpen(false)}
|
| 75 |
+
>
|
| 76 |
+
{link.name}
|
| 77 |
+
</a>
|
| 78 |
+
))}
|
| 79 |
+
<a
|
| 80 |
+
href="https://huggingface.co/spaces/akhaliq/anycoder"
|
| 81 |
+
target="_blank"
|
| 82 |
+
rel="noopener noreferrer"
|
| 83 |
+
className="text-xs border-b border-white/30 pb-0.5 w-fit"
|
| 84 |
+
>
|
| 85 |
+
Built with anycoder
|
| 86 |
+
</a>
|
| 87 |
+
</motion.div>
|
| 88 |
+
)}
|
| 89 |
+
</motion.nav>
|
| 90 |
+
);
|
| 91 |
+
}
|