🍎🌃 Checkpoint
./for-artists/index.html:69682263/463 ./scripts/top-nav.js:69682263/693
This commit is contained in:
@ -47,11 +47,6 @@
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<nav role="navigation" id="top-nav">
|
||||
<a class="nav-item" href="/"> home </a>
|
||||
<a class="nav-item" href="/signup"> signup </a>
|
||||
<a class="nav-item" href="/zines"> zines! </a>
|
||||
<a class="nav-item" href="/status"> status </a>
|
||||
<a class="nav-item" href="/learn"> things we learned </a>
|
||||
</nav>
|
||||
|
||||
<div id="wip"> <!-- auto-populated by wip.js --> </div>
|
||||
|
||||
31
scripts/top-nav.js
Normal file
31
scripts/top-nav.js
Normal file
@ -0,0 +1,31 @@
|
||||
let navItems = [
|
||||
{
|
||||
"href": "/",
|
||||
"title": "home"
|
||||
},
|
||||
{
|
||||
"href": "/signup",
|
||||
"title": "signup"
|
||||
},
|
||||
{
|
||||
"href": "/status",
|
||||
"title": "status"
|
||||
},
|
||||
{
|
||||
"href": "/zines",
|
||||
"title": "zines!"
|
||||
},
|
||||
]
|
||||
|
||||
function populateNav() {
|
||||
let nav = document.getElementById("top-nav");
|
||||
|
||||
for (let i = 0; i < navItems.length; i++) {
|
||||
let a = document.createElement("a");
|
||||
a.classList.add("nav-item");
|
||||
a.href = navItems[i].href;
|
||||
a.innerHtml = " " + navItems[i].title + " "
|
||||
|
||||
nav.append(a);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user