summaryrefslogtreecommitdiff
path: root/script.js
blob: 7b526578476c2971c7eb9db0f72e8869c0f7f7a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Fetch navbar
fetch('/nav.html')
  .then(r => r.text())
  .then(html => {
    document.getElementById('nav').innerHTML = html;

    // Mark the current page link as active
    const current = window.location.pathname;
    document.querySelectorAll('nav a').forEach(a => {
      if (a.getAttribute('href') === current) {
        a.classList.add('active');
      }
    })
  })

// Fetch footer
document.getElementById('footer').innerHTML = '© 2026 Luhamus';