-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
102 lines (99 loc) · 2.92 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Notli Notes - By Jacky</title>
<link rel="stylesheet" href="./css/style.generated.css" type="text/css" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
</head>
<body class="bg-gradient-to-r from-fuchsia-100 via-gray-50 to-teal-100">
<main>
<div id="container">
<div id="header">
<div id="banner">
<div id="header-svg">
<img src="assets/logo.svg" />
</div>
<h1>Notli</h1>
</div>
<h2>Open-source notes for revision and studying</h2>
</div>
<section id="cards">
<!--Items dynamically generated with JavaScript-->
</section>
</div>
<footer class="text-gray-600 body-font m-auto py-12">
<div class="container">
<a href="#" class="primary">Notli notes</a>
<a href="https://github.com/Songtech-0912" rel="noopener noreferrer" target="_blank" class="secondary">By @Songtech-0912</a>
</div>
</footer>
</main>
</body>
<script>
function generateElement(markupString){
// First, create a temporary DOM element
var tempParentElement = document.createElement("div");
tempParentElement.innerHTML = markupString;
var generatedHTMLElement = tempParentElement.firstElementChild;
return generatedHTMLElement
}
let pages = [
"A Clean Well-Lighted Place Notes",
"A Noiseless Patient Spider Notes",
"AP Lang and Comp Notes",
"AP US Gov Notes",
"AP US History Notes",
"Charge and electromagnetism",
"Complex Polynomials",
"Economic Change and Development",
"Energy",
"Exponential and Logarithmic Functions",
"German Notes",
"Gravity",
"Honors Algebra Notes",
"Honors Chemistry Notes",
"Honors Physics Notes",
"Momentum",
"Oscillations, vibrations, and waves",
"Political Ideology",
"Political Institutions",
"Political Participation",
"Political Parties and Elections",
"Political Systems and Governments",
"Polynomial Division",
"Precalculus Notes",
"Quadratic Inequalities",
"Rational Polynomials",
"Robert Frost Poems Collections Notes",
"Song of Myself Notes",
"The Great Gatsby Notes",
"Trigonometry",
"War is Kind and War Prayer Notes",
"We Grow Accustomed To The Dark Notes",
"AP Physics C Notes",
"AP Econ Notes"
];
let html = [];
let pagename = "";
pages.forEach(page => {
let link = `./pages/${page}.html`;
if (page.includes("notes") || page.includes("Notes")) {
pagename = `Open the ${page}`;
} else {
pagename = `Open the ${page} notes`;
}
let markup = `
<a href="${link}" class="w-full">
<button>
<h1>${pagename} ➝</h1>
</button>
</a>`;
let element = generateElement(markup);
html.push(element)
});
html.forEach(card => {
document.getElementById("cards").appendChild(card);
})
</script>
</html>