feat(brand): bespoke CRE Innovations vector logo and neo-glass navigation
This commit is contained in:
@@ -3,8 +3,9 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { Sparkles, Moon, Sun, Menu, X, Smartphone, Layers, ChevronRight, Zap } from 'lucide-react';
|
||||
import { Menu, X, Smartphone, Layers, Sparkles, Activity } from 'lucide-react';
|
||||
import { SiteConfig, resolveLocalised } from '@/types';
|
||||
import { BrandLogo } from './BrandLogo';
|
||||
|
||||
interface NavbarProps {
|
||||
config: SiteConfig;
|
||||
@@ -14,142 +15,137 @@ interface NavbarProps {
|
||||
export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
const [isScrolled, setIsScrolled] = useState(false);
|
||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
|
||||
const [isDark, setIsDark] = useState(false);
|
||||
const pathname = usePathname();
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
setIsScrolled(window.scrollY > 15);
|
||||
setIsScrolled(window.scrollY > 20);
|
||||
};
|
||||
window.addEventListener('scroll', handleScroll, { passive: true });
|
||||
return () => window.removeEventListener('scroll', handleScroll);
|
||||
}, []);
|
||||
|
||||
const toggleTheme = () => {
|
||||
const nextDark = !isDark;
|
||||
setIsDark(nextDark);
|
||||
if (nextDark) {
|
||||
document.documentElement.classList.add('dark');
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<header
|
||||
className={`sticky top-0 z-50 transition-all duration-300 ${
|
||||
className={`sticky top-0 z-50 transition-all duration-300 px-4 sm:px-6 lg:px-8 py-3.5 ${
|
||||
isScrolled
|
||||
? 'bg-white/85 dark:bg-slate-950/85 backdrop-blur-xl shadow-lg shadow-slate-900/5 dark:shadow-black/40 border-b border-slate-200/80 dark:border-slate-800/80'
|
||||
: 'bg-white/50 dark:bg-slate-950/50 backdrop-blur-md border-b border-transparent'
|
||||
? 'bg-[#05070B]/85 backdrop-blur-2xl shadow-2xl shadow-cyan-950/20 border-b border-white/[0.08]'
|
||||
: 'bg-transparent border-b border-white/[0.04]'
|
||||
}`}
|
||||
>
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 sm:h-20 flex items-center justify-between">
|
||||
{/* CRE Innovations Brand Mark */}
|
||||
<Link href="/" className="flex items-center space-x-3 group">
|
||||
<div className="relative w-10 h-10 sm:w-11 sm:h-11 rounded-2xl bg-gradient-to-tr from-blue-600 via-indigo-600 to-cyan-400 flex items-center justify-center text-white shadow-lg shadow-blue-500/25 group-hover:shadow-blue-500/40 group-hover:scale-105 transition-all duration-300">
|
||||
<span className="font-extrabold text-base tracking-tighter">CRE</span>
|
||||
<span className="absolute -top-1 -right-1 flex h-3 w-3">
|
||||
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75"></span>
|
||||
<span className="relative inline-flex rounded-full h-3 w-3 bg-cyan-500"></span>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<div className="flex items-center space-x-1.5">
|
||||
<span className="text-lg sm:text-xl font-extrabold tracking-tight text-slate-900 dark:text-white">
|
||||
CRE <span className="bg-clip-text text-transparent bg-gradient-to-r from-blue-600 to-cyan-500 dark:from-blue-400 dark:to-cyan-400">Innovations</span>
|
||||
</span>
|
||||
</div>
|
||||
<span className="hidden sm:block text-[11px] font-medium text-slate-500 dark:text-slate-400 tracking-wide">
|
||||
AI Photo Tools & Neural Vision
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
<div className="max-w-7xl mx-auto flex items-center justify-between">
|
||||
{/* Bespoke CRE Innovations Vector Brand Logo */}
|
||||
<BrandLogo size="md" />
|
||||
|
||||
{/* Desktop Navigation Links */}
|
||||
<nav className="hidden md:flex items-center space-x-1 lg:space-x-1.5 bg-slate-100/70 dark:bg-slate-900/70 p-1.5 rounded-2xl border border-slate-200/60 dark:border-slate-800/60 backdrop-blur-md">
|
||||
{/* Center Navigation Links (Floating Glass Pill on Desktop) */}
|
||||
<nav className="hidden md:flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-white/[0.03] border border-white/[0.08] backdrop-blur-xl shadow-inner shadow-white/[0.02]">
|
||||
{config.nav.header.map((item) => {
|
||||
const active = pathname === item.href;
|
||||
return (
|
||||
<Link
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
className={`px-4 py-2 rounded-xl text-xs font-semibold tracking-wide transition-all duration-200 ${
|
||||
className={`relative px-4 py-2 rounded-full text-xs font-semibold tracking-wide transition-all duration-200 ${
|
||||
active
|
||||
? 'text-white bg-blue-600 shadow-md shadow-blue-500/25'
|
||||
: 'text-slate-700 dark:text-slate-300 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-white/80 dark:hover:bg-slate-800/80'
|
||||
? 'text-cyan-300 bg-white/[0.08] shadow-[0_0_15px_rgba(0,240,255,0.2)] border border-cyan-500/30'
|
||||
: 'text-slate-300 hover:text-white hover:bg-white/[0.04]'
|
||||
}`}
|
||||
>
|
||||
{resolveLocalised(item.label, currentLocale)}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
{/* Direct Anchor to Vertical Tool Stack */}
|
||||
<Link
|
||||
href="/#tools-stack"
|
||||
className="flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-semibold tracking-wide text-cyan-400 hover:text-cyan-300 hover:bg-cyan-500/10 transition-colors"
|
||||
>
|
||||
<Layers className="w-3.5 h-3.5 text-cyan-400" />
|
||||
<span>Tools Stack</span>
|
||||
</Link>
|
||||
</nav>
|
||||
|
||||
{/* Right Action Buttons */}
|
||||
<div className="hidden md:flex items-center space-x-3">
|
||||
{/* Theme Toggle Button */}
|
||||
<button
|
||||
onClick={toggleTheme}
|
||||
aria-label="Toggle theme"
|
||||
className="p-2.5 rounded-xl border border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-900 transition-colors"
|
||||
>
|
||||
{isDark ? <Sun className="w-4 h-4 text-amber-400" /> : <Moon className="w-4 h-4 text-slate-600" />}
|
||||
</button>
|
||||
{/* Right Status & Action Items */}
|
||||
<div className="hidden lg:flex items-center space-x-4">
|
||||
{/* Live System Operational Indicator */}
|
||||
<div className="flex items-center gap-2 px-3 py-1.5 rounded-full bg-emerald-950/40 border border-emerald-500/30 text-[11px] font-mono text-emerald-400 shadow-sm">
|
||||
<span className="relative flex h-2 w-2">
|
||||
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
|
||||
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-500"></span>
|
||||
</span>
|
||||
<span>Neural Core v2.4 Active</span>
|
||||
</div>
|
||||
|
||||
{/* Primary CTA Button */}
|
||||
<Link
|
||||
href={config.nav.cta.href}
|
||||
className="inline-flex items-center space-x-2 px-5 py-2.5 rounded-xl text-xs font-bold text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 shadow-lg shadow-blue-500/25 hover:shadow-blue-500/40 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200"
|
||||
className="group relative inline-flex items-center gap-2 px-5 py-2.5 rounded-full text-xs font-bold text-black bg-gradient-to-r from-cyan-400 via-teal-300 to-cyan-300 hover:from-cyan-300 hover:to-teal-200 shadow-[0_0_25px_rgba(0,240,255,0.35)] hover:shadow-[0_0_35px_rgba(0,240,255,0.5)] transition-all duration-300 hover:-translate-y-0.5 active:translate-y-0"
|
||||
>
|
||||
<Smartphone className="w-4 h-4" />
|
||||
<Smartphone className="w-4 h-4 text-black group-hover:rotate-6 transition-transform" />
|
||||
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Mobile menu trigger */}
|
||||
<div className="flex md:hidden items-center space-x-2">
|
||||
<button
|
||||
onClick={toggleTheme}
|
||||
className="p-2 rounded-xl text-slate-600 dark:text-slate-300 border border-slate-200 dark:border-slate-800"
|
||||
>
|
||||
{isDark ? <Sun className="w-4 h-4 text-amber-400" /> : <Moon className="w-4 h-4" />}
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
|
||||
className="p-2.5 rounded-xl text-slate-700 dark:text-slate-200 bg-slate-100 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 hover:bg-slate-200"
|
||||
className="p-2.5 rounded-xl text-slate-200 bg-white/[0.05] border border-white/[0.1] hover:bg-white/[0.1] transition-colors"
|
||||
aria-label="Open menu"
|
||||
>
|
||||
{mobileMenuOpen ? <X className="w-5 h-5" /> : <Menu className="w-5 h-5" />}
|
||||
{mobileMenuOpen ? <X className="w-5 h-5 text-cyan-400" /> : <Menu className="w-5 h-5" />}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mobile Drawer */}
|
||||
{mobileMenuOpen && (
|
||||
<div className="md:hidden border-b border-slate-200 dark:border-slate-800 bg-white/95 dark:bg-slate-950/95 backdrop-blur-2xl px-5 pt-3 pb-6 space-y-2 animate-in slide-in-from-top-4 duration-200">
|
||||
{config.nav.header.map((item) => {
|
||||
const active = pathname === item.href;
|
||||
return (
|
||||
<Link
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className={`flex items-center justify-between px-4 py-3 rounded-xl text-sm font-semibold transition-colors ${
|
||||
active
|
||||
? 'text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-950/40'
|
||||
: 'text-slate-700 dark:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-900'
|
||||
}`}
|
||||
>
|
||||
<span>{resolveLocalised(item.label, currentLocale)}</span>
|
||||
<ChevronRight className="w-4 h-4 text-slate-400" />
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
<div className="pt-3">
|
||||
<div className="md:hidden mt-3 rounded-2xl border border-white/[0.1] bg-[#07090E]/95 backdrop-blur-2xl p-5 space-y-3 shadow-2xl animate-in slide-in-from-top-4 duration-200">
|
||||
<div className="flex items-center justify-between pb-3 border-b border-white/[0.08]">
|
||||
<div className="flex items-center gap-2 text-xs font-mono text-emerald-400">
|
||||
<span className="h-2 w-2 rounded-full bg-emerald-400 animate-pulse" />
|
||||
<span>Core v2.4 Active</span>
|
||||
</div>
|
||||
<span className="text-[10px] font-mono text-slate-400">RAM Streaming</span>
|
||||
</div>
|
||||
|
||||
<div className="space-y-1">
|
||||
{config.nav.header.map((item) => {
|
||||
const active = pathname === item.href;
|
||||
return (
|
||||
<Link
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className={`flex items-center justify-between px-4 py-3 rounded-xl text-sm font-semibold transition-colors ${
|
||||
active
|
||||
? 'text-cyan-400 bg-cyan-950/40 border border-cyan-500/30'
|
||||
: 'text-slate-300 hover:bg-white/[0.05]'
|
||||
}`}
|
||||
>
|
||||
<span>{resolveLocalised(item.label, currentLocale)}</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
<Link
|
||||
href="/#tools-stack"
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className="flex items-center justify-between px-4 py-3 rounded-xl text-sm font-semibold text-cyan-400 bg-white/[0.03] hover:bg-white/[0.06]"
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
<Layers className="w-4 h-4 text-cyan-400" />
|
||||
Tools Stack
|
||||
</span>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="pt-3 border-t border-white/[0.08]">
|
||||
<Link
|
||||
href={config.nav.cta.href}
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className="flex items-center justify-center space-x-2 w-full py-3.5 rounded-xl text-sm font-bold text-white bg-gradient-to-r from-blue-600 to-indigo-600 shadow-md shadow-blue-500/25"
|
||||
className="flex items-center justify-center gap-2 w-full py-3.5 rounded-xl text-sm font-bold text-black bg-gradient-to-r from-cyan-400 to-teal-300 shadow-[0_0_20px_rgba(0,240,255,0.3)]"
|
||||
>
|
||||
<Smartphone className="w-4 h-4" />
|
||||
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
|
||||
|
||||
Reference in New Issue
Block a user