Spaces:
Sleeping
Sleeping
Upload components/Header.jsx with huggingface_hub
Browse files- components/Header.jsx +105 -0
components/Header.jsx
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useState, useEffect } from 'react'
|
| 2 |
+
import { Link, Shield, BarChart3, Globe, Menu, X } from 'lucide-react'
|
| 3 |
+
|
| 4 |
+
export default function Header() {
|
| 5 |
+
const [scrolled, setScrolled] = useState(false)
|
| 6 |
+
const [mobileOpen, setMobileOpen] = useState(false)
|
| 7 |
+
|
| 8 |
+
useEffect(() => {
|
| 9 |
+
const handleScroll = () => setScrolled(window.scrollY > 20)
|
| 10 |
+
window.addEventListener('scroll', handleScroll)
|
| 11 |
+
return () => window.removeEventListener('scroll', handleScroll)
|
| 12 |
+
}, [])
|
| 13 |
+
|
| 14 |
+
const navLinks = [
|
| 15 |
+
{ label: 'Shortener', href: '#shorten' },
|
| 16 |
+
{ label: 'Features', href: '#features' },
|
| 17 |
+
{ label: 'Analytics', href: '#analytics' },
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
return (
|
| 21 |
+
<header
|
| 22 |
+
className={`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${
|
| 23 |
+
scrolled
|
| 24 |
+
? 'bg-slate-950/80 backdrop-blur-xl border-b border-slate-800/50'
|
| 25 |
+
: 'bg-transparent'
|
| 26 |
+
}`}
|
| 27 |
+
>
|
| 28 |
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
| 29 |
+
<div className="flex items-center justify-between h-16 lg:h-20">
|
| 30 |
+
<a
|
| 31 |
+
href="/"
|
| 32 |
+
className="flex items-center gap-2.5 group"
|
| 33 |
+
>
|
| 34 |
+
<div className="relative">
|
| 35 |
+
<div className="absolute inset-0 bg-emerald-400/30 blur-lg rounded-full" />
|
| 36 |
+
<div className="relative w-9 h-9 rounded-xl bg-gradient-to-br from-emerald-500 to-teal-600 flex items-center justify-center shadow-lg shadow-emerald-500/20 group-hover:shadow-emerald-500/40 transition-shadow">
|
| 37 |
+
<Link className="w-5 h-5 text-white" />
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
<span className="text-xl font-bold tracking-tight">
|
| 41 |
+
sh0rtl<span className="text-emerald-400">.ink</span>
|
| 42 |
+
</span>
|
| 43 |
+
</a>
|
| 44 |
+
|
| 45 |
+
<nav className="hidden md:flex items-center gap-8">
|
| 46 |
+
{navLinks.map((link) => (
|
| 47 |
+
<a
|
| 48 |
+
key={link.label}
|
| 49 |
+
href={link.href}
|
| 50 |
+
className="text-sm font-medium text-slate-400 hover:text-slate-100 transition-colors"
|
| 51 |
+
>
|
| 52 |
+
{link.label}
|
| 53 |
+
</a>
|
| 54 |
+
))}
|
| 55 |
+
</nav>
|
| 56 |
+
|
| 57 |
+
<div className="hidden md:flex items-center gap-4">
|
| 58 |
+
<a
|
| 59 |
+
href="https://huggingface.co/spaces/akhaliq/anycoder"
|
| 60 |
+
target="_blank"
|
| 61 |
+
rel="noopener noreferrer"
|
| 62 |
+
className="text-xs font-semibold text-emerald-400 hover:text-emerald-300 transition-colors px-3 py-1.5 rounded-lg border border-emerald-500/20 hover:border-emerald-500/40 bg-emerald-500/5 hover:bg-emerald-500/10"
|
| 63 |
+
>
|
| 64 |
+
Built with anycoder
|
| 65 |
+
</a>
|
| 66 |
+
</div>
|
| 67 |
+
|
| 68 |
+
<button
|
| 69 |
+
onClick={() => setMobileOpen(!mobileOpen)}
|
| 70 |
+
className="md:hidden p-2 text-slate-400 hover:text-slate-100 transition-colors"
|
| 71 |
+
>
|
| 72 |
+
{mobileOpen ? <X className="w-6 h-6" /> : <Menu className="w-6 h-6" />}
|
| 73 |
+
</button>
|
| 74 |
+
</div>
|
| 75 |
+
</div>
|
| 76 |
+
|
| 77 |
+
{mobileOpen && (
|
| 78 |
+
<div className="md:hidden bg-slate-900/95 backdrop-blur-xl border-t border-slate-800">
|
| 79 |
+
<div className="px-4 py-4 space-y-3">
|
| 80 |
+
{navLinks.map((link) => (
|
| 81 |
+
<a
|
| 82 |
+
key={link.label}
|
| 83 |
+
href={link.href}
|
| 84 |
+
onClick={() => setMobileOpen(false)}
|
| 85 |
+
className="block text-sm font-medium text-slate-400 hover:text-slate-100 transition-colors py-2"
|
| 86 |
+
>
|
| 87 |
+
{link.label}
|
| 88 |
+
</a>
|
| 89 |
+
))}
|
| 90 |
+
<div className="pt-3 border-t border-slate-800">
|
| 91 |
+
<a
|
| 92 |
+
href="https://huggingface.co/spaces/akhaliq/anycoder"
|
| 93 |
+
target="_blank"
|
| 94 |
+
rel="noopener noreferrer"
|
| 95 |
+
className="block text-xs font-semibold text-emerald-400"
|
| 96 |
+
>
|
| 97 |
+
Built with anycoder
|
| 98 |
+
</a>
|
| 99 |
+
</div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
)}
|
| 103 |
+
</header>
|
| 104 |
+
)
|
| 105 |
+
}
|