OC nav: match Manus — always-white frosted glass, small no-wrap desktop links + smaller CTA, hamburger->circle mobile menu with CTA inside the dropdown
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+34
-18
@@ -13,16 +13,29 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<header class="nav on-light" id="nav">
|
<header class="nav" id="nav">
|
||||||
<div class="wrap nav-row">
|
<a class="nav-logo" href="#top" aria-label="Open Communications — home">
|
||||||
<a class="wordmark" href="#top" aria-label="Open Communications — home"><span class="logo-mark" role="img" aria-label="Open Communications"></span></a>
|
<img class="nav-logo-img" src="assets/brand/oc-logo.svg" alt="Open Communications">
|
||||||
<nav class="nav-links" aria-label="Main">
|
</a>
|
||||||
|
<nav class="nav-links-desktop" aria-label="Main">
|
||||||
<a href="#problem">The problem</a>
|
<a href="#problem">The problem</a>
|
||||||
<a href="#work">How we work</a>
|
<a href="#work">How we work</a>
|
||||||
<a href="#who">Who we are</a>
|
<a href="#who">Who we are</a>
|
||||||
<a class="tel nav-phone" data-p1="778" data-p2="985" data-p3="6736" href="#contact" aria-label="Call Open Communications">778‑985‑OPEN</a>
|
|
||||||
<a class="nav-cta" href="#contact">Book a conversation</a>
|
<a class="nav-cta" href="#contact">Book a conversation</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
<button class="nav-toggle" id="navToggle" aria-label="Open menu" aria-expanded="false">
|
||||||
|
<svg class="nav-toggle-icon" viewBox="0 0 32 32" aria-hidden="true">
|
||||||
|
<line class="bar bar-top" x1="6" y1="10" x2="26" y2="10"/>
|
||||||
|
<line class="bar bar-mid" x1="6" y1="16" x2="26" y2="16"/>
|
||||||
|
<line class="bar bar-bot" x1="6" y1="22" x2="26" y2="22"/>
|
||||||
|
<circle class="o-ring" cx="16" cy="16" r="9"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<div class="nav-mobile-menu" id="navMobileMenu">
|
||||||
|
<a href="#problem">The problem</a>
|
||||||
|
<a href="#work">How we work</a>
|
||||||
|
<a href="#who">Who we are</a>
|
||||||
|
<a class="nav-cta" href="#contact">Book a conversation</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -192,21 +205,24 @@
|
|||||||
for (var l of document.querySelectorAll('a.tel')) {
|
for (var l of document.querySelectorAll('a.tel')) {
|
||||||
l.setAttribute('href', 'tel:+1' + l.dataset.p1 + l.dataset.p2 + l.dataset.p3);
|
l.setAttribute('href', 'tel:+1' + l.dataset.p1 + l.dataset.p2 + l.dataset.p3);
|
||||||
}
|
}
|
||||||
var nav = document.getElementById('nav');
|
var toggle = document.getElementById('navToggle');
|
||||||
var sections = Array.from(document.querySelectorAll('[data-bg]'));
|
var menu = document.getElementById('navMobileMenu');
|
||||||
function setNav() {
|
function closeMenu() {
|
||||||
var line = nav.offsetHeight * 0.5, current = sections[0];
|
menu.classList.remove('open');
|
||||||
for (var s of sections) {
|
toggle.classList.remove('open');
|
||||||
var r = s.getBoundingClientRect();
|
toggle.setAttribute('aria-label', 'Open menu');
|
||||||
if (r.top <= line && r.bottom > line) { current = s; break; }
|
toggle.setAttribute('aria-expanded', 'false');
|
||||||
}
|
}
|
||||||
var dark = current.dataset.bg === 'dark';
|
if (toggle && menu) {
|
||||||
nav.classList.toggle('on-dark', dark);
|
toggle.addEventListener('click', function () {
|
||||||
nav.classList.toggle('on-light', !dark);
|
var open = !menu.classList.contains('open');
|
||||||
|
menu.classList.toggle('open', open);
|
||||||
|
toggle.classList.toggle('open', open);
|
||||||
|
toggle.setAttribute('aria-label', open ? 'Close menu' : 'Open menu');
|
||||||
|
toggle.setAttribute('aria-expanded', open ? 'true' : 'false');
|
||||||
|
});
|
||||||
|
for (var a of menu.querySelectorAll('a')) { a.addEventListener('click', closeMenu); }
|
||||||
}
|
}
|
||||||
setNav();
|
|
||||||
window.addEventListener('scroll', function () { window.requestAnimationFrame(setNav); }, { passive: true });
|
|
||||||
window.addEventListener('resize', setNav);
|
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -54,36 +54,53 @@ strong { font-weight: 500; color: var(--ink); }
|
|||||||
}
|
}
|
||||||
.eyebrow::before { content: ""; width: 28px; height: 1.5px; background: var(--amber); margin-right: 18px; flex: none; }
|
.eyebrow::before { content: ""; width: 28px; height: 1.5px; background: var(--amber); margin-right: 18px; flex: none; }
|
||||||
|
|
||||||
/* Brand logo — CSS mask so it flips with currentColor */
|
/* Nav — always-white frosted glass (matched from Manus), small links that never wrap, hamburger->circle on mobile */
|
||||||
.logo-mark {
|
|
||||||
display: block; width: 168px; height: 36px; background-color: currentColor;
|
|
||||||
-webkit-mask: url(assets/brand/oc-logo.svg) no-repeat left center / contain;
|
|
||||||
mask: url(assets/brand/oc-logo.svg) no-repeat left center / contain;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Adaptive frosted nav */
|
|
||||||
.nav {
|
.nav {
|
||||||
position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h);
|
position: fixed; top: 0; left: 0; right: 0; z-index: 100;
|
||||||
display: flex; align-items: center;
|
padding: 0.85rem 3rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
|
||||||
backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
|
background: #f7f4ef80; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
|
||||||
border-bottom: 1px solid transparent;
|
border-bottom: 1px solid rgba(15, 23, 41, 0.08);
|
||||||
transition: background-color .35s ease, border-color .35s ease, color .35s ease;
|
|
||||||
}
|
}
|
||||||
.nav-row { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 16px; }
|
.nav-logo { flex-shrink: 0; display: flex; }
|
||||||
.nav.on-light { background: rgba(247, 244, 239, 0.78); border-bottom-color: var(--line); color: var(--ink); }
|
.nav-logo-img { height: 34px; width: auto; display: block; }
|
||||||
.nav.on-dark { background: rgba(15, 23, 41, 0.55); border-bottom-color: var(--line-dark); color: var(--cream); }
|
.nav-links-desktop { display: flex; align-items: center; gap: clamp(1rem, 2vw, 2.5rem); }
|
||||||
.wordmark { display: flex; align-items: center; color: inherit; text-decoration: none; }
|
.nav-links-desktop a { font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase; color: #374151; text-decoration: none; white-space: nowrap; transition: color 0.3s; }
|
||||||
.nav-links { display: flex; align-items: center; gap: 28px; font-family: 'DM Sans', sans-serif; font-size: 0.72rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.13em; }
|
.nav-links-desktop a:hover { color: #0f1729; }
|
||||||
.nav-links a { color: inherit; text-decoration: none; opacity: 0.72; transition: opacity .2s; }
|
|
||||||
.nav-links a:hover { opacity: 1; }
|
|
||||||
.nav-phone { opacity: 1 !important; white-space: nowrap; }
|
|
||||||
.nav-cta {
|
.nav-cta {
|
||||||
background: var(--amber); color: #fff !important; opacity: 1 !important;
|
font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
|
||||||
padding: 9px 21px; border-radius: 2px; border: 1px solid var(--amber); letter-spacing: 0.13em;
|
padding: 0.55rem 1.3rem; background: #e89b1c; color: #fff !important; border-radius: 2px; text-decoration: none;
|
||||||
|
white-space: nowrap; border: none; transition: background 0.3s;
|
||||||
}
|
}
|
||||||
.nav-cta:hover { background: var(--amber-deep); border-color: var(--amber-deep); }
|
.nav-cta:hover { background: #c4820f; }
|
||||||
a.tel { text-decoration: none; }
|
a.tel { text-decoration: none; }
|
||||||
|
|
||||||
|
.nav-toggle { display: none; cursor: pointer; padding: 4px; background: none; border: none; align-items: center; justify-content: center; }
|
||||||
|
.nav-toggle-icon { width: 32px; height: 32px; overflow: visible; }
|
||||||
|
.nav-toggle-icon .bar { stroke: #0f1729; stroke-width: 1.8; stroke-linecap: round; transition: opacity 0.25s ease, transform 0.35s cubic-bezier(.4,0,.2,1); }
|
||||||
|
.nav-toggle-icon .o-ring { fill: none; stroke: #0f1729; stroke-width: 1.8; stroke-dasharray: 57; stroke-dashoffset: 57; opacity: 0; transform-origin: 16px 16px; transition: stroke-dashoffset 0.4s cubic-bezier(.4,0,.2,1) 0.1s, opacity 0.2s ease 0.1s; }
|
||||||
|
.nav-toggle.open .bar-top { opacity: 0; transform: translateY(-4px); }
|
||||||
|
.nav-toggle.open .bar-mid { opacity: 0; transform: scaleX(0); }
|
||||||
|
.nav-toggle.open .bar-bot { opacity: 0; transform: translateY(4px); }
|
||||||
|
.nav-toggle.open .o-ring { stroke-dashoffset: 0; opacity: 1; }
|
||||||
|
|
||||||
|
.nav-mobile-menu {
|
||||||
|
display: none; position: fixed; top: 56px; left: 0; right: 0; z-index: 90;
|
||||||
|
flex-direction: column; gap: 1.25rem; padding: 1.75rem 1.5rem 2rem;
|
||||||
|
background: #f7f4ef80; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
|
||||||
|
border-bottom: 1px solid rgba(15, 23, 41, 0.08); align-items: flex-end; text-align: right;
|
||||||
|
}
|
||||||
|
.nav-mobile-menu.open { display: flex; animation: navFadeIn 0.22s ease forwards; }
|
||||||
|
.nav-mobile-menu a { font-family: 'DM Sans', system-ui, sans-serif; font-size: 0.82rem; letter-spacing: 0.13em; text-transform: uppercase; color: #374151; text-decoration: none; }
|
||||||
|
.nav-mobile-menu a:hover { color: #0f1729; }
|
||||||
|
.nav-mobile-menu .nav-cta { color: #fff !important; }
|
||||||
|
@keyframes navFadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.nav { padding: 0.7rem 1.5rem; }
|
||||||
|
.nav-links-desktop { display: none; }
|
||||||
|
.nav-toggle { display: flex; }
|
||||||
|
}
|
||||||
|
|
||||||
/* Bands */
|
/* Bands */
|
||||||
.band { padding: 112px 0; position: relative; overflow: hidden; }
|
.band { padding: 112px 0; position: relative; overflow: hidden; }
|
||||||
.band.light { background: var(--paper); color: var(--ink); }
|
.band.light { background: var(--paper); color: var(--ink); }
|
||||||
|
|||||||
Reference in New Issue
Block a user