From dbad722b957e54bed014f1a33b30f82e55c4df28 Mon Sep 17 00:00:00 2001 From: mandalore Date: Thu, 28 May 2026 16:26:59 -0500 Subject: [PATCH] Extract navbar and footer into shared header.html and footer.html partials Co-Authored-By: Claude Sonnet 4.6 --- footer.html | 3 +++ header.html | 39 +++++++++++++++++++++++++++++++++++++++ index.html | 50 ++------------------------------------------------ reporting.html | 46 ++-------------------------------------------- signups.html | 46 ++-------------------------------------------- src/main.js | 20 ++++++++++++++++++++ stats.html | 46 ++-------------------------------------------- 7 files changed, 70 insertions(+), 180 deletions(-) create mode 100644 footer.html create mode 100644 header.html diff --git a/footer.html b/footer.html new file mode 100644 index 0000000..35977fb --- /dev/null +++ b/footer.html @@ -0,0 +1,3 @@ +
+

© 2026 Gateway Gamers. All rights reserved.

+
diff --git a/header.html b/header.html new file mode 100644 index 0000000..f8715eb --- /dev/null +++ b/header.html @@ -0,0 +1,39 @@ + diff --git a/index.html b/index.html index b345d15..d99190a 100644 --- a/index.html +++ b/index.html @@ -8,50 +8,7 @@ - - + @@ -94,10 +51,7 @@ - -
-

© 2026 Gateway Gamers. All rights reserved.

-
+ diff --git a/reporting.html b/reporting.html index 1f76a59..a0144b6 100644 --- a/reporting.html +++ b/reporting.html @@ -8,46 +8,7 @@ - - +
@@ -73,10 +34,7 @@
- -
-

© 2026 Gateway Gamers. All rights reserved.

-
+ diff --git a/signups.html b/signups.html index d11d23c..ca2560c 100644 --- a/signups.html +++ b/signups.html @@ -8,46 +8,7 @@ - - +
@@ -73,10 +34,7 @@
- -
-

© 2026 Gateway Gamers. All rights reserved.

-
+ diff --git a/src/main.js b/src/main.js index 8b13789..ee8be63 100644 --- a/src/main.js +++ b/src/main.js @@ -1 +1,21 @@ +function loadHTML(file, elementId) { + fetch(file) + .then(r => r.text()) + .then(html => { + document.getElementById(elementId).innerHTML = html; + if (elementId === 'header') highlightActiveNav(); + }) + .catch(err => console.error('Error loading:', file, err)); +} +function highlightActiveNav() { + const current = location.pathname.split('/').pop() || 'index.html'; + document.querySelectorAll('#header a[href]').forEach(link => { + if (link.getAttribute('href') === `/${current}`) { + link.classList.add('active'); + } + }); +} + +loadHTML('/header.html', 'header'); +loadHTML('/footer.html', 'footer'); diff --git a/stats.html b/stats.html index 1505fc6..bc70d86 100644 --- a/stats.html +++ b/stats.html @@ -8,46 +8,7 @@ - - +
@@ -72,10 +33,7 @@
- -
-

© 2026 Gateway Gamers. All rights reserved.

-
+