Skip to content

Commit

Permalink
Subject folders
Browse files Browse the repository at this point in the history
  • Loading branch information
nayakrujul committed Nov 3, 2023
1 parent 9c33550 commit 8a81d91
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 39 deletions.
64 changes: 33 additions & 31 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,43 @@
</head>
<body>
<h1>VTP6</h1>
<ul id="linklist"></ul>
<script>
const LIST_OF_LINKS = [
"Latin GCSE Page 1",
"Latin GCSE Page 2",
"Latin GCSE Page 3",
"Latin GCSE Page 4",
"Latin GCSE Page 5",
"Latin GCSE Page 6",
"",
"Latin GCSE Eng To Lat Page 1",
"Latin GCSE Eng To Lat Page 2",
"",
"Latin To GCSE Chapter 1",
"Latin To GCSE Chapter 2",
"Latin To GCSE Chapter 3",
"Latin To GCSE Chapter 4",
"Latin To GCSE Chapter 5",
"Latin To GCSE Chapter 6",
"",
"Spanish GCSE Unit 1",
"Spanish GCSE Unit 2",
"Spanish GCSE Unit 3",
"Spanish GCSE Unit 4",
"Spanish GCSE Unit 5",
"Spanish GCSE Unit 6",
"Spanish GCSE Unit 7",
"Spanish GCSE Unit 8",
"Spanish GCSE Unit 9",
"Spanish GCSE Unit 10",
"Spanish GCSE Unit 11",
"Spanish GCSE Unit 12",
["Latin GCSE", [
"Page 1",
"Page 2",
"Page 3",
"Page 4",
"Page 5",
"Page 6",
"Eng To Lat Page 1",
"Eng To Lat Page 2",
]],
["Latin To GCSE", [
"Chapter 1",
"Chapter 2",
"Chapter 3",
"Chapter 4",
"Chapter 5",
"Chapter 6",
]],
["Spanish GCSE", [
"Unit 1",
"Unit 2",
"Unit 3",
"Unit 4",
"Unit 5",
"Unit 6",
"Unit 7",
"Unit 8",
"Unit 9",
"Unit 10",
"Unit 11",
"Unit 12",
]]
]; // Link creation is automated
</script>
<script src="load.js"></script>
<sub>© Rujul Nayak 2023 - <a href="mailto:[email protected]">Feedback</a></sub>
<sub id="sub">© Rujul Nayak 2023 - <a href="mailto:[email protected]">Feedback</a></sub>
</body>
</html>
24 changes: 16 additions & 8 deletions load.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
// Load the links onto the main page

const ll = document.getElementById("linklist");
const sub = document.getElementById("sub");

LIST_OF_LINKS.forEach(s => {
if (s === "") {
ll.appendChild(document.createElement("br"));
} else {
LIST_OF_LINKS.forEach(p => {
let [a, b] = p;
let det = document.createElement("details");
let sum = document.createElement("summary");
sum.innerHTML = a;
det.appendChild(sum);
let ul = document.createElement("ul");
b.forEach(s => {
let newli = document.createElement("li");
newli.innerHTML = `<a href="./sets/` + s.replaceAll(" ", "") + `">` + s + `</a>`;
ll.appendChild(newli);
}
newli.innerHTML = `<a href="./sets/` + (a + s).replaceAll(" ", "") + `">` + s + `</a>`;
ul.appendChild(newli);
});
det.appendChild(ul);
document.body.insertBefore(det, sub);
document.body.insertBefore(document.createElement("br"), sub);
document.body.insertBefore(document.createElement("br"), sub);
});

0 comments on commit 8a81d91

Please sign in to comment.