-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavbar.html
50 lines (44 loc) · 2.17 KB
/
navbar.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="https://www.montgomerycountymd.gov/mc311/" target="_blank" title="mc311.com">
<img src="./assets/MC311_Icon.png" id="311Icon" alt="" height="50" class="d-inline-block align-text-center">
</a>
<h5 class="text-light me-4 mb-0">
MC311 Note Tool
</h5>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup"
aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a id="nav--home" class="nav-link" aria-current="page" href="./index.html">Home</a>
<a id="nav--about-app" class="nav-link" href="./about-the-app.html">About the App</a>
<a id="nav--btc" class="nav-link" href="./behind-the-code.html">Behind the Code</a>
<a id="nav--author" class="nav-link" href="./author.html">About the Author</a>
</div>
</div>
</div>
</nav>
<script>
let page = window.location.pathname.split("/").pop();
console.log(page);
switch (page) {
case "index.html":
document.getElementById("nav--home").classList.add("active");
$("head").append( "<title>MC 311 Tool</title>");
break;
case "about-the-app.html":
document.getElementById("nav--about-app").classList.add("active");
$("head").append( "<title>MC 311 Tool-About the App</title>");
break;
case "behind-the-code.html":
document.getElementById("nav--btc").classList.add("active");
$("head").append( "<title>MC 311 Tool-Behind the Code</title>");
break;
case "author.html":
document.getElementById("nav--author").classList.add("active");
$("head").append( "<title>MC 311 Tool-About the Author</title>");
break;
}
</script>