Polish: nav hamburger, pillar alignment, wordmark, hero tightening
- Nav: responsive hamburger at ≤1060px, full mobile menu with close behaviors - Nav: all section anchors are absolute (/#...) for correct cross-page routing - Pillars: flex column cards with margin-top:auto on taglines — all three align - About footer: image wordmark matches main page (was plain text "Neuron") - Hero: "Six patents" → "Patented"; sub-copy trimmed to one clean sentence - Environmental/efficiency/inference: remove all "memory graph" mentions, cite 40% token reduction - Environmental: savings calculator (slider, live annual savings calculation)
This commit is contained in:
+68
-8
@@ -1,15 +1,14 @@
|
||||
// components/nav.el - Top navigation bar.
|
||||
// components/nav.el — Top navigation bar.
|
||||
//
|
||||
// Returns an HTML string. Server-rendered, no JavaScript required for
|
||||
// the nav structure itself. Scroll-based opacity is CSS-only via
|
||||
// :has() and scroll-driven animations where supported; we default to
|
||||
// a clean transparent state that looks great on first load.
|
||||
// Responsive: desktop shows full link bar, ≤1060px collapses to hamburger.
|
||||
// Hamburger toggles .nav-mobile panel. Closes on link click or outside click.
|
||||
|
||||
fn nav() -> String {
|
||||
return "
|
||||
<nav id=\"nav\">
|
||||
<div class=\"nav-inner\">
|
||||
<a href=\"/\" class=\"nav-logo\" aria-label=\"Neuron home\"><img src=\"/assets/brand/neuron-wordmark-on-light.png\" srcset=\"/assets/brand/neuron-wordmark-on-light@2x.png 2x\" alt=\"Neuron\" height=\"28\"></a>
|
||||
|
||||
<div class=\"nav-links\">
|
||||
<a href=\"/#how-it-works\" class=\"nav-link\">How it works</a>
|
||||
<a href=\"/#mission\" class=\"nav-link\">Mission</a>
|
||||
@@ -17,11 +16,72 @@ fn nav() -> String {
|
||||
<a href=\"/#environmental\" class=\"nav-link\">Environment</a>
|
||||
<a href=\"/#pricing\" class=\"nav-link\">Pricing</a>
|
||||
<a href=\"/#enterprise\" class=\"nav-link\">Enterprise</a>
|
||||
<a href=\"/about\" class=\"nav-link\">About</a>
|
||||
<a href=\"#share\" class=\"nav-link cta\">Share Neuron →</a>
|
||||
<a href=\"#pricing\" class=\"nav-cta\">Get Access</a>
|
||||
<a href=\"/about\" class=\"nav-link\">About</a>
|
||||
<a href=\"/#share\" class=\"nav-link cta\">Share Neuron →</a>
|
||||
<a href=\"/#pricing\" class=\"nav-cta\">Get Access</a>
|
||||
</div>
|
||||
|
||||
<button class=\"nav-hamburger\" id=\"nav-hamburger\" aria-label=\"Open navigation\" aria-expanded=\"false\" aria-controls=\"nav-mobile\">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
|
||||
<div class=\"nav-mobile\" id=\"nav-mobile\" role=\"navigation\" aria-label=\"Mobile navigation\">
|
||||
<a href=\"/#how-it-works\" class=\"nav-mobile-link\">How it works</a>
|
||||
<a href=\"/#mission\" class=\"nav-mobile-link\">Mission</a>
|
||||
<a href=\"/#safety\" class=\"nav-mobile-link\">Safety</a>
|
||||
<a href=\"/#environmental\" class=\"nav-mobile-link\">Environment</a>
|
||||
<a href=\"/#pricing\" class=\"nav-mobile-link\">Pricing</a>
|
||||
<a href=\"/#enterprise\" class=\"nav-mobile-link\">Enterprise</a>
|
||||
<a href=\"/about\" class=\"nav-mobile-link\">About</a>
|
||||
<a href=\"/#share\" class=\"nav-mobile-link cta\">Share Neuron →</a>
|
||||
<a href=\"/#pricing\" class=\"nav-mobile-cta\">Get Access</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var btn = document.getElementById('nav-hamburger');
|
||||
var menu = document.getElementById('nav-mobile');
|
||||
var nav = document.getElementById('nav');
|
||||
if (!btn || !menu) return;
|
||||
|
||||
function close() {
|
||||
menu.classList.remove('open');
|
||||
btn.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
function open() {
|
||||
menu.classList.add('open');
|
||||
btn.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
function toggle() {
|
||||
if (menu.classList.contains('open')) { close(); } else { open(); }
|
||||
}
|
||||
|
||||
btn.addEventListener('click', function(e) { e.stopPropagation(); toggle(); });
|
||||
|
||||
// Close on any link inside mobile menu
|
||||
menu.querySelectorAll('a').forEach(function(a) {
|
||||
a.addEventListener('click', close);
|
||||
});
|
||||
|
||||
// Close when clicking outside
|
||||
document.addEventListener('click', function(e) {
|
||||
if (!nav.contains(e.target)) { close(); }
|
||||
});
|
||||
|
||||
// Close on Escape
|
||||
document.addEventListener('keydown', function(e) {
|
||||
if (e.key === 'Escape') { close(); }
|
||||
});
|
||||
|
||||
// Close if viewport grows past breakpoint
|
||||
window.addEventListener('resize', function() {
|
||||
if (window.innerWidth > 1060) { close(); }
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user