-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
47 lines (47 loc) · 2.45 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
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>
<body>
<script>
(async () => {
const main = 'https://github.com/kaarthaarlem/iconen/blob/main/';
const response = await fetch('https://api.github.com/repos/kaarthaarlem/iconen/contents/');
const data = await response.json();
let htmlString = `<div class="container">
<nav class="navbar navbar-expand-lg">
<div class="container-fluid">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="https://github.com/kaarthaarlem/iconen">Repository</a></li>
</ol>
<a class="navbar-brand" href="#">HAARLEM KAARTSYMBOLEN</a>
<div class="navbar-nav">
<a class="nav-link" href="https://github.com/kaarthaarlem/iconen/blob/main/README.md">README</a>
</div>
</div>
</nav>
</div>`;
htmlString += '<div class="d-flex flex-column flex-md-row p-4 gap-4 py-md-5 align-items-center justify-content-center">';
htmlString += '<ol class="list-group">';
for (let file of data) {
if (file.type === 'dir') {
htmlString += `<li class="list-group-item list-group-item-action d-flex gap-3 py-3" aria-current="true">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-folder" viewBox="0 0 16 16">
<path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a2 2 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139q.323-.119.684-.12h5.396z"/>
</svg>
<div class="d-flex gap-2 w-100 justify-content-between">
<div>
<h6><a href="${file.name}">${file.name}</a></h6>
<p>${document.URL}${file.name}</p>
</div>
</div>
</li>`;
}
}
htmlString += '</ol></div>';
document.getElementsByTagName('body')[0].innerHTML = htmlString;
})()
</script>
</body>
</html>