forked from kutyla-philipp/simple-dash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
49 lines (43 loc) · 1.52 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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Loading...</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" charset="UTF-8">
<link rel="stylesheet" type="text/css" href="common/css/fontawesome-all.min.css" />
<link rel="stylesheet" type="text/css" href="common/css/main.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
<body id="homepage">
<div id="wrapper">
<div id="itemlist">
<a title="Loading..."><i class="fa-spin fas fa-spinner fa-fw"></i></a>
</div>
</div>
<div id="particles-js"></div>
<script src="common/js/particles.min.js"></script>
<script src="common/js/app.js"></script>
<script>
var request = new XMLHttpRequest();
request.overrideMimeType("application/json");
request.open("GET", 'config.json');
request.onload = function () {
if (request.status >= 200 && request.status < 400) {
var config = JSON.parse(this.response);
console.log(config);
document.title = config.title;
var itemlistHTML = '';
for (var i = 0; i < config.items.length; i++) {
var item = config.items[i];
itemlistHTML += '<a href="'+item.link+'" title="'+item.alt+'"><i class="'+item.icon+' fa-fw"></i></a>';
}
document.getElementById("itemlist").innerHTML = itemlistHTML;
} else {
var error_text = "Error: "+request.status;
console.error(error_text);
document.title = error_text;
}
}
request.send(null);
</script>
</body>
</html>