crowsite/crow_test/webcontent/menu_bar.part

27 lines
995 B
Plaintext

<ul class="menu_bar">
<li class="left"><a id="home" href="/">Home</a></li>
<li class="left"><a id="projects" href="/projects.html">Projects</a></li>
<li class="left"><a id="research" href="/research.html">Research</a></li>
<li class="left"><a id="git" href="/git.html">Git</a></li>
<li class="left"><a id='about' href="/about.html">About</a></li>
{{#_logged_in}}
<li class="right"><a href="/logout.html">Logout</a></li>
{{/_logged_in}}
{{#_not_logged_in}}
<li class="right"><a id='login' href="/login.html">Login</a></li>
{{/_not_logged_in}}
</ul>
<script>
const path = window.location.pathname;
const ids = {
"/": "home",
"/index.html": "home",
"/projects.html": "projects",
"/research.html": "research",
"/git.html": "git",
"/about.html": "about",
"/login.html": "login"
};
var element = document.getElementById(ids[path]);
element.classList += "active";
</script>