Fix navbar across all pages: add nav include, fonts, active state, spacing, stats, error pages
- Add nav.php include to 5 missing pages (cost-calculator, thank-you, 403, 404, 500) - Add ErrorDocument directives to .htaccess for custom 403/404/500 pages - Fix bogus accuracy stats (homepage, web-scraping, location pages) - Fix invisible CTA buttons on property and financial service pages - Add Google Fonts (Roboto Slab + Lato) to all pages missing it (tools, blog articles, error pages) - Add active nav link highlighting (teal underline for current page) - Improve footer contrast to WCAG AA, equal-height cards, mobile text scaling - Consistent navbar-to-content spacing across all pages - Bump cache version to v1.1.3
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
<?php
|
||||
$current_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
$current_path = rtrim($current_path, '/');
|
||||
if ($current_path === '') $current_path = '/';
|
||||
|
||||
function nav_active($href, $current) {
|
||||
// Exact match
|
||||
if ($href === $current) return ' active';
|
||||
// Section match (e.g. /tools/ matches /tools/cost-calculator)
|
||||
$href_trimmed = rtrim($href, '/');
|
||||
if ($href_trimmed !== '' && $href_trimmed !== '/' && strpos($current, $href_trimmed) === 0) return ' active';
|
||||
return '';
|
||||
}
|
||||
?>
|
||||
<!-- Navigation -->
|
||||
<nav class="navbar" id="navbar">
|
||||
<div class="nav-container">
|
||||
@@ -10,14 +24,14 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-menu" id="nav-menu">
|
||||
<a href="/" class="nav-link">Home</a>
|
||||
<a href="/#services" class="nav-link">Services</a>
|
||||
<a href="/project-types" class="nav-link">Project Types</a>
|
||||
<a href="/about" class="nav-link">About</a>
|
||||
<a href="/tools/" class="nav-link">Free Tools</a>
|
||||
<a href="/blog/" class="nav-link">Blog</a>
|
||||
<a href="/" class="nav-link<?php echo $current_path === '/' ? ' active' : ''; ?>">Home</a>
|
||||
<a href="/#services" class="nav-link<?php echo (strpos($current_path, '/services') === 0) ? ' active' : ''; ?>">Services</a>
|
||||
<a href="/project-types" class="nav-link<?php echo nav_active('/project-types', $current_path); ?>">Project Types</a>
|
||||
<a href="/about" class="nav-link<?php echo nav_active('/about', $current_path); ?>">About</a>
|
||||
<a href="/tools/" class="nav-link<?php echo nav_active('/tools', $current_path); ?>">Free Tools</a>
|
||||
<a href="/blog/" class="nav-link<?php echo nav_active('/blog', $current_path); ?>">Blog</a>
|
||||
<a href="/#contact" class="nav-link">Contact</a>
|
||||
<a href="/quote" class="nav-link cta-button">Request Consultation</a>
|
||||
<a href="/quote" class="nav-link cta-button<?php echo nav_active('/quote', $current_path); ?>">Request Consultation</a>
|
||||
</div>
|
||||
<button class="nav-toggle" id="nav-toggle" aria-expanded="false" aria-controls="nav-menu" aria-label="Toggle navigation menu">
|
||||
<span class="bar"></span>
|
||||
@@ -25,4 +39,4 @@
|
||||
<span class="bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user