-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
36 lines (34 loc) · 918 Bytes
/
index.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
<!doctype html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Roguelike Phases</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>Roguelike Tutorial: Adding Scrolling</h1>
<div id="container">
<p><a href="project/index.html">Project</a></p>
</div>
</body>
<script>
let el = document.querySelector('#container');
let d = document.createDocumentFragment();
const addItem = (num, myDir, label) => {
console.log('add item...');
let p = document.createElement('p');
let a = document.createElement('a');
let dir = myDir || `phase-${num}-solution`;
a.href = `${dir}/index.html`;
a.innerHTML = label || `Phase ${num} Solution`;
p.appendChild(a);
d.appendChild(p);
};
let numPhases = 3;
for (var i = 1; i <= numPhases; ++i) {
addItem(i);
}
addItem(0, 'challenge-solution', 'Challenge Solution');
el.appendChild(d);
</script>
</html>