Spaces:
Paused
Paused
Download components/header.tsx from samirhosninet/HubAPI: direct link, hf CLI and curl.
- Browser
- Download file 5.4 kB
-
https://huggingface.co/spaces/samirhosninet/HubAPI/resolve/main/components/header.tsx
- Command line
-
hf download hf://spaces/samirhosninet/HubAPI/components/header.tsx
-
curl -L -o header.tsx https://huggingface.co/spaces/samirhosninet/HubAPI/resolve/main/components/header.tsx
5.4 kB
| "use client"; | |
| import { motion } from "framer-motion"; | |
| import Link from "next/link"; | |
| import { ThemeToggle } from "@/components/ThemeToggle"; | |
| import { LanguageToggle } from "@/components/LanguageToggle"; | |
| import { useLanguage } from "@/components/LanguageContext"; | |
| export function Header() { | |
| const { t, language } = useLanguage(); | |
| return ( | |
| <motion.header | |
| initial={{ y: -100, opacity: 0, x: "-50%" }} | |
| animate={{ y: 0, opacity: 1, x: "-50%" }} | |
| transition={{ duration: 0.8, ease: "easeOut", delay: 0.2 }} | |
| className="inverted-card fixed top-6 left-1/2 z-50 flex flex-col items-center pl-6 pr-6 py-2.5 backdrop-blur-md rounded-full border border-[var(--menu-contrast-border)] w-[calc(100%-2rem)] sm:w-auto shadow-[var(--menu-shadow)] transition-all duration-300" | |
| > | |
| <nav className="flex items-center justify-between w-full gap-x-6 sm:gap-x-12" aria-label="Global Navigation"> | |
| {/* Logo/Icon Area (Semantic & accessible keyboard navigation) */} | |
| <Link | |
| href="/" | |
| className="flex items-center gap-3 cursor-pointer group rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/50 focus-visible:ring-offset-2" | |
| aria-label="HUBAPI home" | |
| > | |
| <div className="relative w-6 h-6 flex items-center justify-center transition-transform group-hover:scale-105 duration-300"> | |
| <div className="absolute inset-0 border border-border rounded-sm opacity-60"></div> | |
| <div className="absolute w-2 h-2 bg-primary rounded-full top-1 left-1 shadow-[0_0_10px_var(--primary-glow)]"></div> | |
| <div className="absolute w-1 h-1 bg-muted-foreground/40 rounded-full top-1 right-1"></div> | |
| <div className="absolute w-1 h-1 bg-muted-foreground/40 rounded-full bottom-1 left-1"></div> | |
| <div className="absolute w-2 h-0.5 bg-muted-foreground/40 bottom-1 right-1"></div> | |
| </div> | |
| <span className="font-fast-hand tracking-wider text-2xl text-foreground mt-0.5">{t("logo")}</span> | |
| </Link> | |
| {/* Status Area */} | |
| <div className="flex items-center gap-2 sm:gap-3 text-xs font-mono"> | |
| <span className="hidden sm:inline-block text-muted-foreground tracking-widest uppercase">{t("preLaunch")}</span> | |
| <div className="hidden sm:inline-flex items-center justify-center h-5 px-2.5 rounded-full border border-primary/30 bg-primary/10"> | |
| <span className="w-1.5 h-1.5 bg-primary rounded-full animate-pulse mr-2 shadow-[0_0_8px_var(--primary-glow)]"></span> | |
| <span className="text-primary text-[10px] tracking-wider uppercase font-bold">{t("preLaunchShort")}</span> | |
| </div> | |
| {/* Cyber Community Links */} | |
| <div className="flex items-center gap-1 sm:gap-1.5 px-1 border-l border-r border-black/5 dark:border-white/10"> | |
| {/* GitHub Discussions */} | |
| <a | |
| href="https://github.com/orgs/community/discussions/196796" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| className="text-muted-foreground hover:text-primary transition-all duration-300 p-1 hover:drop-shadow-[0_0_8px_var(--primary-glow)] hover:scale-105 active:scale-95" | |
| aria-label={language === "ar" ? "مناقشات جيت هاب" : "GitHub Discussions"} | |
| title={language === "ar" ? "مناقشات جيت هاب" : "GitHub Discussions"} | |
| > | |
| <svg className="w-4 h-4 fill-current" viewBox="0 0 24 24" aria-hidden="true"> | |
| <path fillRule="evenodd" clipRule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" /> | |
| </svg> | |
| </a> | |
| {/* Product Hunt Launch */} | |
| <a | |
| href="https://www.producthunt.com/products/hubapi?launch=hubapi" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| className="text-muted-foreground hover:text-primary transition-all duration-300 p-1 hover:drop-shadow-[0_0_8px_var(--primary-glow)] hover:scale-105 active:scale-95" | |
| aria-label={language === "ar" ? "برودكت هانت" : "Product Hunt Launch"} | |
| title={language === "ar" ? "برودكت هانت" : "Product Hunt Launch"} | |
| > | |
| <svg className="w-4 h-4 fill-current" viewBox="0 0 24 24" aria-hidden="true"> | |
| <path d="M13.6 8.4h-2.8v3.2h2.8c.9 0 1.6-.7 1.6-1.6s-.7-1.6-1.6-1.6zm-1.6 10c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8zm1-13H9v10h2v-4h2.6c2.1 0 3.8-1.7 3.8-3.8S15.7 5.4 13 5.4z" /> | |
| </svg> | |
| </a> | |
| </div> | |
| <LanguageToggle /> | |
| <ThemeToggle /> | |
| </div> | |
| </nav> | |
| </motion.header> | |
| ); | |
| } |