feat(navbar): match head shows the other gym's brand, centred logo on CrossFit, mobile band

The match head is painted in the other gym's colours with a strip in this site's accent; below 992px it is a slashed band at the bottom of the open menu (menu height from the real header height). The CrossFit page gets the centred logo crossfade, the hero logo has a fixed 52px height, and the hero h1 shadow is softer with the frosted blur at .8.
This commit is contained in:
andre committed 2026-10-26 12:00:56 +00:00
1 parent 4b54a777b7
commit e7ab661f4c
5 files changed
+75 -23

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
<div class="container h-100">
<div class="d-flex h-100 text-center align-items-center">
<div class="w-100 text-white">
<h1 class="display-3"><img src="<?= base_url('site/assets/img/logos/logo_crossfit_white.svg')?>" alt="CrossFit 3070 — box de CrossFit em Mira" style="opacity: .85; max-width: 320px;" decoding="async"></h1>
<h1 class="visually-hidden">CrossFit 3070 — box de CrossFit em Mira</h1>
<p class="lead mb-0"></p>
</div>
</div>
+14 -2
View File
@@ -66,8 +66,12 @@ $center_logo = !empty($nav_center_logo);
if ((int) $g['id'] !== (int) current_gym()['id']) $other_gyms[] = $g;
}
}
if ($other_gyms): ?>
<div class="gym-switch d-flex flex-wrap gap-2 ms-lg-auto py-2 py-lg-0 pe-lg-3">
if ($other_gyms):
// The match head (style.css) is painted in the first other gym's brand.
$head_vars = gym_brand_vars($other_gyms[0]);
$head_ink = str_contains($head_vars, 'on-accent:#FFFFFF') ? ' gym-switch--light-ink' : '';
?>
<div class="gym-switch<?= $head_ink ?> d-flex flex-wrap gap-2 ms-lg-auto py-2 py-lg-0 pe-lg-3" style="<?= htmlspecialchars($head_vars) ?>">
<?php foreach ($other_gyms as $g): ?>
<?php $g_logo = gym_logo($g); ?>
<a class="gym-switch-btn<?= $g_logo !== '' ? ' gym-switch-btn--logo' : '' ?>" href="<?= htmlspecialchars(gym_url($g)) ?>" style="<?= htmlspecialchars(gym_brand_vars($g)) ?>">
@@ -102,6 +106,14 @@ $center_logo = !empty($nav_center_logo);
dock();
}
/* ── Mobile menu fills the screen below the bar (style.css --nav-h) ──── */
var hdr = document.querySelector('.header-section');
if (hdr) {
var setNavH = function() { hdr.style.setProperty('--nav-h', hdr.offsetHeight + 'px'); };
window.addEventListener('resize', setNavH, { passive: true });
setNavH();
}
/* ── Eased smooth-scroll helper ──────────────────────────────────────── */
function smoothScrollTo(targetEl, duration) {
var start = window.scrollY;