global: move home page and add logic for every page

This commit is contained in:
Agahnim 2026-03-24 14:32:08 +01:00
parent d9a5e97259
commit 8c2363d330
3 changed files with 14 additions and 3 deletions

View file

@ -48,12 +48,21 @@
document.querySelectorAll('navbar input[type="radio"]').forEach(radio => {
radio.checked = false;
});
if (path === '/') {
if (path === '/home') {
const homeRadio = document.getElementById('nav-home');
if (homeRadio) homeRadio.checked = true;
} else if (path === '/music') {
const musicRadio = document.getElementById('nav-music');
if (musicRadio) musicRadio.checked = true;
} else if (path === "/blog") {
const blogRadio = document.getElementById('nav-blog');
if (blogRadio) blogRadio.checked = true;
} else if (path === "/about") {
const aboutRadio = document.getElementById('nav-about');
if (aboutRadio) aboutRadio.checked = true;
} else if (path === "/projects") {
const projectsRadio = document.getElementById('nav-projects');
if (projectsRadio) projectsRadio.checked = true;
}
}