-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (40 loc) · 1.73 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Assets</title>
<!-- Bootstrap CDN -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
</head>
<body>
<div class="container text-center">
<h3 class="p-3">Assets</h3>
<div class="list-group list-group-flush" id="dataList"></div>
</div>
<!-- JavaScript -->
<script>
function loadJSON(callback) {
fetch('data.json')
.then(response => response.json())
.then(data => callback(data))
.catch(error => console.error('Error loading JSON:', error));
}
function generateList(jsonData) {
var dataList = document.getElementById('dataList');
dataList.innerHTML = '';
jsonData.forEach(function(item) {
var a = document.createElement('a');
a.classList.add('list-group-item', 'list-group-item-action');
a.href = item.url;
a.target = "_blank";
a.textContent = item.name;
dataList.appendChild(a);
});
}
loadJSON(generateList);
</script>
</body>
</html>