// var-nav.jsx — LOCKED navigation per spec. // Utility bar · Primary nav · CTA always visible // Sticky, transparent over hero; deep navy (#152545) + shadow on scroll. const LOCK_NAV_LINKS = [ { name: 'Solutions', href: '#solutions' }, { name: 'Industries', href: '#industries' }, { name: 'Projects', href: '/projects/' }, { name: 'Resources', href: '#resources' }, { name: 'About', href: '#about' }]; const LOCK_UTILITY_LEFT = { label: 'Community & Partners', href: '/community-and-partners/', icon: 'users' }; const LOCK_UTILITY_RIGHT = { label: 'Solar Calculator', href: '/solar-calculator/', icon: 'calculator' }; const LOCK_DROPDOWNS = { Solutions: [ 'Energy Audits', 'Commercial Solar', 'Battery Storage', 'EV Charging', 'LED Lighting', 'Solar Maintenance'], Industries: [ 'Manufacturing', 'Warehousing & Logistics', 'Food & Beverage', 'Agriculture', 'REITs & Property', 'Government & Institutional'], Resources: [ 'Insights', 'Rebates & Incentives' // 'Payment plans' ], About: [ 'Our Story', 'Partners', 'Careers', 'Contact'] }; const LOCK_DROPDOWN_HREFS = { Solutions: { 'Energy Audits': '/solutions/energy-audits/', 'Commercial Solar': '/solutions/commercial-solar/', 'Battery Storage': '/solutions/battery-storage/', 'EV Charging': '/solutions/ev-charging/', 'LED Lighting': '/solutions/led-lighting/', 'Solar Maintenance': '/solutions/solar-maintenance/' }, Industries: { 'Manufacturing': '/industries/manufacturing/', 'Warehousing & Logistics': '/industries/warehousing/', 'Food & Beverage': '/industries/food-and-beverage/', 'Agriculture': '/industries/agriculture/', 'REITs & Property': '/industries/real-estate/', 'Government & Institutional': '/industries/government/', }, Resources: { 'Insights': '/resources/insights/', 'Rebates & Incentives': '/resources/rebates-and-incentives/', 'Payment plans': '/resources/payment-plans/' }, About: { 'Our Story': '/about/our-story/', 'Partners': '/about/partners/', 'Careers': '/about/careers/', 'Contact': '/about/contact/' } }; // ============================================================ // LockedNavBar — to use on all variation hero mockups. // onHero controls whether it's over-hero (transparent/white) or scrolled (#152545). // activeLink: optional string matching a primary link — shows active underline. // openDropdown: optional string — forces a dropdown open for preview. // ============================================================ const LockedNavBar = ({ onHero = true, activeLink = null, activeDropdownItem = null, openDropdown = null }) => { const [hover, setHover] = React.useState(null); const [mobileOpen, setMobileOpen] = React.useState(false); const [mobileExpanded, setMobileExpanded] = React.useState(null); const [isMobile, setIsMobile] = React.useState( () => typeof window !== 'undefined' && window.matchMedia('(max-width: 1024px)').matches ); const shown = hover || openDropdown; // Lock body scroll when mobile menu open React.useEffect(() => { if (mobileOpen) { const prev = document.body.style.overflow; document.body.style.overflow = 'hidden'; return () => {document.body.style.overflow = prev;}; } }, [mobileOpen]); // Track the mobile/tablet breakpoint so the bar and the menu panel share one // compact scale (logo + padding) — keeps the open/close transition seamless. React.useEffect(() => { const mq = window.matchMedia('(max-width: 1024px)'); const update = () => { setIsMobile(mq.matches); if (!mq.matches) setMobileOpen(false); }; update(); mq.addEventListener('change', update); return () => mq.removeEventListener('change', update); }, []); const barBg = onHero ? 'transparent' : 'var(--gi-wise-blue)'; const barShadow = onHero ? 'none' : '0 1px 0 rgba(255,255,255,0.05), 0 2px 12px rgba(15,33,51,0.10)'; const primaryLinkColor = onHero ? 'rgba(255,255,255,0.88)' : 'rgba(255,255,255,0.88)'; const utilityLinkColor = onHero ? 'rgba(255,255,255,0.62)' : 'rgba(255,255,255,0.62)'; const utilityBarBorder = onHero ? 'rgba(255,255,255,0.14)' : 'rgba(255,255,255,0.10)'; return (
{/* Utility bar */}
{[LOCK_UTILITY_LEFT, LOCK_UTILITY_RIGHT].map((u) => {u.label} )}
{/* Primary bar */}
Green Integrations
{/* Mobile menu overlay — always mounted so it can fade in/out smoothly. Its header mirrors the bar's mobile scale (logo + padding) so opening is a seamless cross-fade rather than a jump. */}
Green Integrations
); }; Object.assign(window, { LockedNavBar, LOCK_NAV_LINKS, LOCK_DROPDOWNS, LOCK_UTILITY_LEFT, LOCK_UTILITY_RIGHT });