global: move home page and add logic for every page
This commit is contained in:
parent
bec16ce0e4
commit
9e47d0ce83
3 changed files with 14 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,12 @@
|
|||
</label>
|
||||
</navbar-toggle>
|
||||
<navbar-content>
|
||||
<a href="/">Home</a>
|
||||
<a href="/home">Home</a>
|
||||
<input type="radio" name="nav" id="nav-home" checked>
|
||||
<a href="/about">About me</a>
|
||||
<input type="radio" name="nav" id="nav-about">
|
||||
<a href="/blog">Blog</a>
|
||||
<input type="radio" name="nav" id="nav-blog">
|
||||
<a href="/projects">Projects</a>
|
||||
<input type="radio" name="nav" id="nav-projects">
|
||||
<a href="/music">Music</a>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue