// Top nav — minimal, sticky, blurred — mobile-responsive + PWA Install & Client Gateway
const NAV_LINKS = [
{ id: "services", label: "Services", labelBn: "সার্ভিস", url: "#/services" },
{ id: "case-studies", label: "Case Studies", labelBn: "কেস স্টাডি", url: "#/case-studies" },
{ id: "pricing", label: "Pricing", labelBn: "মূল্য", url: "#/pricing" },
{ id: "blog", label: "Blog", labelBn: "ব্লগ", url: "#/blog" },
{ id: "contact", label: "Contact", labelBn: "যোগাযোগ", url: "#/contact" },
];
const NAV_TXT = {
en: {
search: "Search",
getQuote: "Get a Quote",
clientLogin: "Client Login",
getStarted: "Get Started",
installApp: "Install App",
appInstalled: "App Installed",
},
bn: {
search: "খুঁজুন",
getQuote: "কোট নিন",
clientLogin: "ক্লায়েন্ট লগইন",
getStarted: "শুরু করুন",
installApp: "অ্যাপ ইনস্টল",
appInstalled: "অ্যাপ ইনস্টলড",
},
};
// Next redirects ensure clients land seamlessly in the right SaaS portal
const REGISTER_URL = "https://auth.auraajenticai.cloud/register?next=" + encodeURIComponent("https://client.auraajenticai.cloud/services");
const CLIENT_LOGIN_URL = "https://auth.auraajenticai.cloud/login?next=" + encodeURIComponent("https://client.auraajenticai.cloud");
const Nav = ({ onCmdK, theme, onToggleTheme, accent, lang, onToggleLang, route }) => {
const [scrolled, setScrolled] = React.useState(false);
const [menuOpen, setMenuOpen] = React.useState(false);
const [installModalOpen, setInstallModalOpen] = React.useState(false);
const [deferredPrompt, setDeferredPrompt] = React.useState(null);
const [isInstalled, setIsInstalled] = React.useState(false);
const links = NAV_LINKS;
const t = NAV_TXT[lang] || NAV_TXT.en;
const bn = lang === "bn";
React.useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 12);
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
// PWA standalone detection & prompt listener
React.useEffect(() => {
const isStandalone = window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone === true;
if (isStandalone) {
setIsInstalled(true);
}
const handleBeforeInstall = (e) => {
e.preventDefault();
setDeferredPrompt(e);
};
const handleAppInstalled = () => {
setIsInstalled(true);
setDeferredPrompt(null);
};
window.addEventListener("beforeinstallprompt", handleBeforeInstall);
window.addEventListener("appinstalled", handleAppInstalled);
return () => {
window.removeEventListener("beforeinstallprompt", handleBeforeInstall);
window.removeEventListener("appinstalled", handleAppInstalled);
};
}, []);
const handleInstallClick = async () => {
if (deferredPrompt) {
try {
deferredPrompt.prompt();
const choice = await deferredPrompt.userChoice;
if (choice && choice.outcome === "accepted") {
setIsInstalled(true);
setDeferredPrompt(null);
}
} catch (err) {
console.warn("PWA install prompt error:", err);
}
} else {
setInstallModalOpen(true);
}
};
return (
<>
{/* Brand */}
{PORTFOLIO_DATA.brand.name}
v.2026
{/* Center links — hidden on mobile */}
{/* Right — desktop */}
{/* Hamburger — mobile only */}
setMenuOpen(o => !o)}
aria-label={menuOpen ? "Close menu" : "Open menu"}
style={{
display: "none",
width: 36, height: 36,
background: "transparent",
border: "1px solid var(--line)",
borderRadius: 8,
color: "var(--text-dim)",
alignItems: "center",
justifyContent: "center",
flexShrink: 0,
cursor: "pointer",
}}
>
{menuOpen ? (
) : (
)}
{/* Mobile drawer */}
{menuOpen && (
{/* Mobile PWA Install Banner */}
{!isInstalled && (
{bn ? "📲 Aura Cloud অ্যাপ" : "📲 Aura Cloud App"}
{bn ? "হোমস্ক্রিনে ১-ট্যাপে ইনস্টল করুন" : "Install to home screen for 1-tap launch"}
{
setMenuOpen(false);
handleInstallClick();
}}
style={{
padding: "6px 12px",
background: "var(--text)",
color: "var(--bg)",
border: "none",
borderRadius: 8,
fontSize: 12,
fontWeight: 600,
cursor: "pointer",
whiteSpace: "nowrap",
}}
>
{bn ? "ইনস্টল" : "Install"}
)}
{links.map(l => (
setMenuOpen(false)}
style={{
fontSize: 15,
color: "var(--text-dim)",
padding: "12px 4px",
textDecoration: "none",
display: "block",
borderBottom: "1px solid var(--line)",
}}
>{bn && l.labelBn ? l.labelBn : l.label}
))}
{ onToggleTheme(); setMenuOpen(false); }} style={{
padding: "8px 14px",
background: "transparent",
border: "1px solid var(--line)",
borderRadius: 8,
color: "var(--text-dim)",
fontSize: 13,
cursor: "pointer",
}}>
{theme === "dark" ? "Light" : "Dark"}
{ onToggleLang(); setMenuOpen(false); }} style={{
padding: "8px 14px",
background: "transparent",
border: "1px solid var(--line)",
borderRadius: 8,
color: "var(--text-dim)",
fontSize: 13,
cursor: "pointer",
fontWeight: 600,
}}>
{lang === "en" ? "বাংলা" : "English"}
setMenuOpen(false)}
style={{
padding: "8px 14px",
background: "transparent",
border: "1px solid var(--line)",
borderRadius: 8,
color: "var(--text-dim)",
fontSize: 13,
textDecoration: "none",
}}
>{t.quote}
setMenuOpen(false)}
style={{
padding: "8px 14px",
background: "transparent",
border: "1px solid var(--line)",
color: "var(--text-dim)",
fontSize: 13,
fontWeight: 500,
borderRadius: 8,
textDecoration: "none",
}}
>{t.clientLogin}
setMenuOpen(false)}
style={{
padding: "8px 14px",
background: "var(--text)",
color: "var(--bg)",
fontSize: 13,
fontWeight: 500,
borderRadius: 8,
textDecoration: "none",
}}
>{t.getStarted}
)}
{/* PWA Install Help Modal (iOS & Fallback) */}
{installModalOpen && (
setInstallModalOpen(false)}
style={{
position: "fixed",
inset: 0,
zIndex: 100,
background: "rgba(0, 0, 0, 0.72)",
backdropFilter: "blur(10px)",
WebkitBackdropFilter: "blur(10px)",
display: "grid",
placeItems: "center",
padding: 16,
}}
>
e.stopPropagation()}
style={{
position: "relative",
width: "100%",
maxWidth: 440,
background: "var(--bg-card, #0c1222)",
border: "1px solid rgba(0, 212, 255, 0.35)",
borderRadius: 16,
padding: "24px 22px",
boxShadow: "0 24px 60px rgba(0, 0, 0, 0.6)",
}}
>
📲
{bn ? "Aura Cloud অ্যাপ ইনস্টল গাইড" : "Install Aura Cloud App"}
setInstallModalOpen(false)}
style={{ background: "transparent", border: "none", color: "var(--text-dim)", cursor: "pointer", fontSize: 18 }}
>
✕
{bn
? "Aura Cloud অ্যাপ আপনার মোবাইল বা কম্পিউটারে ইনস্টল করে সরাসরি ১-ট্যাপে ওপেন করুন:"
: "Install the Aura Cloud App directly to your device for 1-tap instant launch and offline access:"}
🍏 iOS / iPhone (Safari):
{bn
? "সাফারি ব্রাউজারের নিচে শেয়ার বাটনে (Share ⎋) ট্যাপ করুন, এরপর নিচে স্ক্রল করে 'Add to Home Screen ⊞' সিলেক্ট করুন।"
: "Tap the Share icon (⎋) at bottom of Safari, scroll down and tap 'Add to Home Screen ⊞'."}
🤖 Android (Chrome):
{bn
? "ব্রাউজারের উপরের ডান কোণায় ৩-ডট মেনুতে (⋮) ট্যাপ করে 'Install app' বা 'Add to Home screen' নির্বাচন করুন।"
: "Tap the 3 dots menu (⋮) in Chrome and select 'Install app' or 'Add to Home screen'."}
💻 Windows / Mac (Chrome & Edge):
{bn
? "ব্রাউজারের অ্যাড্রেস বারের ডানপাশে ইনস্টল আইকন (⊕) ক্লিক করে ইনস্টল করুন।"
: "Click the Install icon (⊕) in the browser address bar to install to desktop."}
setInstallModalOpen(false)}
style={{
width: "100%",
marginTop: 18,
padding: "10px",
background: "var(--text)",
color: "var(--bg)",
border: "none",
borderRadius: 8,
fontWeight: 600,
fontSize: 13,
cursor: "pointer",
}}
>
{bn ? "ঠিক আছে, বুঝেছি" : "Got it"}
)}
>
);
};
window.Nav = Nav;