Spaces:
Running
Running
Download frontend/src/components/Header.jsx from SeventhSenseAI/face-recognition: direct link, hf CLI and curl.
- Browser
- Download file 3.62 kB
-
https://huggingface.co/spaces/SeventhSenseAI/face-recognition/resolve/main/frontend/src/components/Header.jsx
- Command line
-
hf download hf://spaces/SeventhSenseAI/face-recognition/frontend/src/components/Header.jsx
-
curl -L -o Header.jsx https://huggingface.co/spaces/SeventhSenseAI/face-recognition/resolve/main/frontend/src/components/Header.jsx
3.62 kB
| import { motion } from 'framer-motion' | |
| import { Menu, X } from 'lucide-react' | |
| import { useState } from 'react' | |
| function Header() { | |
| const [mobileMenuOpen, setMobileMenuOpen] = useState(false) | |
| return ( | |
| <header className="relative z-50"> | |
| <nav className="container mx-auto px-4 py-6"> | |
| <div className="flex items-center justify-between"> | |
| {/* Logo */} | |
| <motion.a | |
| href="/" | |
| initial={{ opacity: 0, x: -20 }} | |
| animate={{ opacity: 1, x: 0 }} | |
| className="flex items-center gap-3 group" | |
| > | |
| <img | |
| src="/logo.png" | |
| alt="Seventh Sense AI" | |
| className="h-10 object-contain group-hover:scale-105 transition-transform mix-blend-lighten" | |
| /> | |
| </motion.a> | |
| {/* Desktop Navigation */} | |
| <motion.div | |
| initial={{ opacity: 0, x: 20 }} | |
| animate={{ opacity: 1, x: 0 }} | |
| className="hidden md:flex items-center gap-8" | |
| > | |
| <NavLink href="#compare">Compare</NavLink> | |
| <NavLink href="#api">API</NavLink> | |
| <NavLink href="#features">Features</NavLink> | |
| <motion.a | |
| href="#api" | |
| whileHover={{ scale: 1.05 }} | |
| whileTap={{ scale: 0.95 }} | |
| className="px-5 py-2.5 rounded-xl bg-gradient-to-r from-primary-500 to-secondary-400 text-white font-medium shadow-lg shadow-primary-500/25 hover:shadow-primary-500/40 transition-shadow" | |
| > | |
| Get Started | |
| </motion.a> | |
| </motion.div> | |
| {/* Mobile Menu Button */} | |
| <button | |
| onClick={() => setMobileMenuOpen(!mobileMenuOpen)} | |
| className="md:hidden p-2 text-gray-400 hover:text-white transition-colors" | |
| > | |
| {mobileMenuOpen ? <X className="w-6 h-6" /> : <Menu className="w-6 h-6" />} | |
| </button> | |
| </div> | |
| {/* Mobile Menu */} | |
| {mobileMenuOpen && ( | |
| <motion.div | |
| initial={{ opacity: 0, y: -20 }} | |
| animate={{ opacity: 1, y: 0 }} | |
| className="md:hidden mt-4 p-6 glass-card" | |
| > | |
| <div className="flex flex-col gap-4"> | |
| <NavLink href="#compare" mobile>Compare</NavLink> | |
| <NavLink href="#api" mobile>API</NavLink> | |
| <NavLink href="#features" mobile>Features</NavLink> | |
| <a | |
| href="#api" | |
| className="mt-2 px-5 py-3 rounded-xl bg-gradient-to-r from-primary-500 to-secondary-400 text-white font-medium text-center" | |
| > | |
| Get Started | |
| </a> | |
| </div> | |
| </motion.div> | |
| )} | |
| </nav> | |
| </header> | |
| ) | |
| } | |
| function NavLink({ href, children, external, mobile }) { | |
| const baseClass = mobile | |
| ? 'text-gray-300 hover:text-white transition-colors py-2' | |
| : 'text-gray-400 hover:text-white transition-colors relative group' | |
| if (external) { | |
| return ( | |
| <a href={href} target="_blank" rel="noopener noreferrer" className={baseClass}> | |
| {children} | |
| {!mobile && ( | |
| <span className="absolute -bottom-1 left-0 w-0 h-0.5 bg-gradient-to-r from-primary-500 to-secondary-400 group-hover:w-full transition-all duration-300" /> | |
| )} | |
| </a> | |
| ) | |
| } | |
| return ( | |
| <a href={href} className={baseClass}> | |
| {children} | |
| {!mobile && ( | |
| <span className="absolute -bottom-1 left-0 w-0 h-0.5 bg-gradient-to-r from-primary-500 to-secondary-400 group-hover:w-full transition-all duration-300" /> | |
| )} | |
| </a> | |
| ) | |
| } | |
| export default Header |