// FastFund website — top navigation with working mega-menus function NavBar({ onApply }) { const { Button, Logo } = window.CapFrontDesignSystem_019e08; const { mobile, narrow } = window.useBreakpoint(); const compact = narrow; // switch to hamburger below 1024 where the full nav won't fit const [scrolled, setScrolled] = React.useState(false); const [openMenu, setOpenMenu] = React.useState(null); // 'products' | 'resources' | null const [drawer, setDrawer] = React.useState(false); const closeTimer = React.useRef(null); React.useEffect(() => { if (!compact) setDrawer(false); }, [compact]); React.useEffect(() => { document.body.style.overflow = drawer ? 'hidden' : ''; return () => { document.body.style.overflow = ''; }; }, [drawer]); React.useEffect(() => { const el = document.querySelector('[data-scroll-root]') || window; const onScroll = () => { const y = el === window ? window.scrollY : el.scrollTop; setScrolled(y > 8); }; el.addEventListener('scroll', onScroll); return () => el.removeEventListener('scroll', onScroll); }, []); React.useEffect(() => { window.lucide && window.lucide.createIcons(); }, [openMenu]); const open = (m) => { clearTimeout(closeTimer.current); setOpenMenu(m); }; const scheduleClose = () => { clearTimeout(closeTimer.current); closeTimer.current = setTimeout(() => setOpenMenu(null), 140); }; const products = [ { name: 'Term Loans', icon: 'trending-up', href: 'term-loans.html', desc: 'Up to $15M · to 25 yr' }, { name: 'Lines of Credit', icon: 'wallet', href: 'lines-of-credit.html', desc: 'Up to $1.5M · revolving' }, { name: 'Revenue-Based Financing', icon: 'percent', href: 'revenue-based-financing.html', desc: '$5K–$10M · from sales' }, { name: 'SBA Loans', icon: 'landmark', href: 'product.html', desc: 'Up to $10M · to 30 yr' }, { name: 'Equipment Financing', icon: 'forklift', href: 'equipment-financing.html', desc: 'Up to 100% of value' }, { name: 'Invoice Factoring', icon: 'file-text', href: 'invoice-factoring.html', desc: 'Up to 90% upfront' }, { name: 'HELOC', icon: 'house', href: 'heloc.html', desc: 'Up to $750K · from 5.99%' }, { name: 'Real Estate Financing', icon: 'building-2', href: 'real-estate-financing.html', desc: 'Up to $25M · to 30 yr' }, { name: 'Independent Contractor', icon: 'hard-hat', href: 'independent-contractor-financing.html', desc: 'Up to $20K · to 12 mo' }, { name: 'Ecommerce Funding', icon: 'shopping-cart', href: 'ecommerce-funding.html', desc: 'Up to $20M · platform-linked' }, ]; const resources = [ { name: 'Funding guides', icon: 'book-open', href: 'resources.html', desc: 'Plain-spoken how-tos' }, { name: 'Owner stories', icon: 'quote', href: 'story.html', desc: 'Real customer case studies' }, { name: 'About FastFund', icon: 'building', href: 'about.html', desc: 'Our mission & team' }, { name: 'Partner program', icon: 'handshake', href: 'partners.html', desc: 'Refer deals, earn more' }, ]; const linkStyle = (active) => ({ fontFamily: 'var(--font-body)', fontSize: 14.5, fontWeight: 600, color: active ? 'var(--violet-700)' : 'var(--text-body)', display: 'inline-flex', alignItems: 'center', gap: 5, cursor: 'pointer', background: 'none', border: 'none', padding: 0, height: 72, }); return (
{!compact && ( 855-555-0100 )} {!compact && } {compact && ( )}
{/* Mobile drawer */} {compact && drawer && (
setDrawer(false)} /> setDrawer(false)} />
855-555-0100
)} {/* Mega-menu panel (desktop only) */} {!compact && openMenu && (
open(openMenu)} onMouseLeave={scheduleClose} style={{ position: 'absolute', top: 72, left: 0, right: 0, background: 'var(--surface-card)', borderBottom: '1px solid var(--border-subtle)', boxShadow: 'var(--shadow-lg)', animation: 'cfMenuIn var(--duration-normal) var(--ease-out)', }} >
{openMenu === 'products' && (
Funding products View all products
{products.map((p) => )}
)} {openMenu === 'resources' && (
Learn & explore
{resources.map((r) => )}
Featured guide How to compare funding offers without getting burned Read the guide
)}
)}
); } function MobileGroup({ label, items, onNav }) { const [open, setOpen] = React.useState(false); React.useEffect(() => { window.lucide && window.lucide.createIcons(); }, [open]); return (
{open && (
{items.map((it) => ( {it.name} {it.desc} ))}
)}
); } function MegaItem({ name, icon, href, desc }) { const [hover, setHover] = React.useState(false); return ( setHover(true)} onMouseLeave={() => setHover(false)} style={{ display: 'flex', alignItems: 'center', gap: 'var(--space-3)', padding: '10px 12px', borderRadius: 'var(--radius-md)', textDecoration: 'none', background: hover ? 'var(--surface-brand-soft)' : 'transparent', transition: 'background var(--duration-fast) var(--ease-standard)' }}> {name} {desc} ); } window.NavBar = NavBar;