feat(ui): implement authentic floating liquid glass navbar inspired by squared-media.nl with specular sheen and refraction blur
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { Menu, X, Smartphone, Layers, Sparkles } from 'lucide-react';
|
||||
import { Menu, X, Smartphone, Layers, ArrowUpRight } from 'lucide-react';
|
||||
import { SiteConfig, resolveLocalised } from '@/types';
|
||||
import { BrandLogo } from './BrandLogo';
|
||||
|
||||
@@ -26,19 +26,17 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<header
|
||||
className={`sticky top-0 z-50 transition-all duration-300 px-4 sm:px-6 lg:px-8 py-4 ${
|
||||
isScrolled
|
||||
? 'bg-[#FAF8F5]/90 backdrop-blur-2xl shadow-sm border-b border-slate-900/[0.07]'
|
||||
: 'bg-[#FAF8F5]/60 backdrop-blur-md border-b border-slate-900/[0.04]'
|
||||
}`}
|
||||
>
|
||||
<div className="max-w-7xl mx-auto flex items-center justify-between">
|
||||
{/* Bespoke CRE Innovations Vector Brand Logo */}
|
||||
<header className="fixed top-3 sm:top-5 left-0 right-0 z-50 px-3 sm:px-6 lg:px-8 pointer-events-none transition-all duration-300">
|
||||
<div
|
||||
className={`max-w-6xl mx-auto liquid-glass-nav rounded-2xl sm:rounded-[22px] px-3.5 sm:px-6 py-2.5 sm:py-3 flex items-center justify-between transition-all duration-300 pointer-events-auto ${
|
||||
isScrolled ? 'shadow-cream-lg' : 'shadow-cream-md'
|
||||
}`}
|
||||
>
|
||||
{/* Brand Logo */}
|
||||
<BrandLogo size="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-slate-900/[0.03] border border-slate-900/[0.06] backdrop-blur-md shadow-inner shadow-black/[0.01]">
|
||||
{/* Center Navigation Links - Floating Glass Track */}
|
||||
<nav className="hidden md:flex items-center gap-1 px-1.5 py-1 rounded-full bg-slate-900/[0.03] border border-white/70 shadow-inner">
|
||||
{config.nav.header.map((item) => {
|
||||
const active = pathname === item.href;
|
||||
return (
|
||||
@@ -47,42 +45,42 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
href={item.href}
|
||||
className={`relative px-4 py-2 rounded-full text-xs font-semibold tracking-wide transition-all duration-200 ${
|
||||
active
|
||||
? 'text-blue-600 bg-white shadow-sm border border-slate-900/[0.06]'
|
||||
: 'text-slate-600 hover:text-slate-900 hover:bg-slate-900/[0.04]'
|
||||
? 'text-blue-700 bg-white shadow-sm border border-slate-900/[0.06]'
|
||||
: 'text-slate-700 hover:text-slate-950 hover:bg-white/60'
|
||||
}`}
|
||||
>
|
||||
{resolveLocalised(item.label, currentLocale)}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
|
||||
{/* Direct Anchor to Studio Suite */}
|
||||
<Link
|
||||
href="/#studio-suite"
|
||||
className="flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-semibold tracking-wide text-blue-600 hover:text-blue-700 hover:bg-blue-50 transition-colors"
|
||||
className="flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-semibold tracking-wide text-blue-700 hover:text-blue-900 hover:bg-blue-50/80 transition-colors"
|
||||
>
|
||||
<Layers className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>Creative Suite</span>
|
||||
</Link>
|
||||
</nav>
|
||||
|
||||
{/* Right Status & Action Items */}
|
||||
<div className="hidden lg:flex items-center space-x-4">
|
||||
{/* Primary CTA Button */}
|
||||
{/* Right CTA Button */}
|
||||
<div className="hidden lg:flex items-center space-x-3">
|
||||
<Link
|
||||
href={config.nav.cta.href}
|
||||
className="group relative inline-flex items-center gap-2 px-5 py-2.5 rounded-full 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-md shadow-blue-500/20 hover:shadow-lg hover:shadow-blue-500/30 transition-all duration-300 hover:-translate-y-0.5 active:translate-y-0"
|
||||
className="group relative inline-flex items-center gap-2 px-5 py-2.5 rounded-full text-xs font-bold text-white bg-gradient-to-r from-blue-600 via-indigo-600 to-blue-600 hover:from-blue-700 hover:to-indigo-700 shadow-md shadow-blue-500/25 hover:shadow-lg hover:shadow-blue-500/35 transition-all duration-300 hover:scale-105 active:scale-95"
|
||||
>
|
||||
<Smartphone className="w-4 h-4 text-white group-hover:rotate-6 transition-transform" />
|
||||
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
|
||||
<ArrowUpRight className="w-3.5 h-3.5 opacity-80 group-hover:translate-x-0.5 group-hover:-translate-y-0.5 transition-transform" />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Mobile menu trigger */}
|
||||
{/* Mobile Menu Trigger */}
|
||||
<div className="flex md:hidden items-center space-x-2">
|
||||
<button
|
||||
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
|
||||
className="p-2.5 rounded-xl text-slate-700 bg-white border border-slate-200 hover:bg-slate-50 transition-colors shadow-sm"
|
||||
className="p-2 rounded-xl text-slate-800 bg-white/70 hover:bg-white border border-white/80 shadow-sm transition-colors"
|
||||
aria-label="Open menu"
|
||||
>
|
||||
{mobileMenuOpen ? <X className="w-5 h-5 text-blue-600" /> : <Menu className="w-5 h-5" />}
|
||||
@@ -90,17 +88,9 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mobile Drawer */}
|
||||
{/* Mobile Drawer (Matching Liquid Glass Card) */}
|
||||
{mobileMenuOpen && (
|
||||
<div className="md:hidden mt-3 rounded-2xl border border-slate-200 bg-[#FAF8F5]/98 backdrop-blur-2xl p-5 space-y-3 shadow-xl animate-in slide-in-from-top-4 duration-200">
|
||||
<div className="flex items-center justify-between pb-3 border-b border-slate-200">
|
||||
<div className="flex items-center gap-2 text-xs font-mono text-emerald-700">
|
||||
<span className="h-2 w-2 rounded-full bg-emerald-500 animate-pulse" />
|
||||
<span>Core v2.4 Active</span>
|
||||
</div>
|
||||
<span className="text-[10px] font-mono text-slate-500">RAM Streaming</span>
|
||||
</div>
|
||||
|
||||
<div className="max-w-6xl mx-auto md:hidden mt-2 rounded-2xl liquid-glass-dropdown p-5 space-y-3 pointer-events-auto shadow-2xl animate-in slide-in-from-top-3 duration-200">
|
||||
<div className="space-y-1">
|
||||
{config.nav.header.map((item) => {
|
||||
const active = pathname === item.href;
|
||||
@@ -111,19 +101,19 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className={`flex items-center justify-between px-4 py-3 rounded-xl text-sm font-semibold transition-colors ${
|
||||
active
|
||||
? 'text-blue-700 bg-blue-50 border border-blue-200'
|
||||
: 'text-slate-700 hover:bg-slate-100'
|
||||
? 'text-blue-700 bg-white shadow-sm border border-slate-900/[0.06]'
|
||||
: 'text-slate-800 hover:bg-white/60'
|
||||
}`}
|
||||
>
|
||||
<span>{resolveLocalised(item.label, currentLocale)}</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
|
||||
<Link
|
||||
href="/#studio-suite"
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className="flex items-center justify-between px-4 py-3 rounded-xl text-sm font-semibold text-blue-700 bg-blue-50/60 hover:bg-blue-100/60"
|
||||
className="flex items-center justify-between px-4 py-3 rounded-xl text-sm font-semibold text-blue-700 bg-blue-50/70 hover:bg-blue-100/70"
|
||||
>
|
||||
<span className="flex items-center gap-2">
|
||||
<Layers className="w-4 h-4 text-blue-600" />
|
||||
@@ -132,11 +122,11 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div className="pt-3 border-t border-slate-200">
|
||||
<div className="pt-3 border-t border-slate-900/[0.06]">
|
||||
<Link
|
||||
href={config.nav.cta.href}
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className="flex items-center justify-center gap-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/20"
|
||||
className="flex items-center justify-center gap-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"
|
||||
>
|
||||
<Smartphone className="w-4 h-4" />
|
||||
<span>{resolveLocalised(config.nav.cta.label, currentLocale)}</span>
|
||||
|
||||
Reference in New Issue
Block a user