forked from LazeMSS/OctoPrint-UICustomizerThemes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
107 lines (102 loc) · 4.39 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
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<title>UI Customizer themes</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous" />
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
</head>
<body>
<header>
<div class="navbar navbar-dark bg-dark shadow-sm">
<div class="container">
<a href="#" class="navbar-brand d-flex align-items-center">
<strong>UI Customizer themes…</strong>
</a>
</div>
</div>
</header>
<main>
<section class="py-5 text-center container">
<div class="row py-lg-5">
<div class="col-lg-6 col-md-8 mx-auto">
<h1 class="fw-light">UI Customizer themes</h1>
<p class="lead text-muted">Below is the currently features themes in UI Customizer. UI Customizer is a plugin for the wonderfull Octoprint software for 3D printing.</p>
<p>
<a href="https://github.com/LazeMSS/OctoPrint-UICustomizer" class="btn btn-primary my-2">UI Customizer</a>
<a href="https://octoprint.org/" class="btn btn-secondary my-2">Octoprint</a>
</p>
</div>
</div>
</section>
<div class="album py-5 bg-light">
<div class="container">
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 g-3" id="mainGallery">
</div>
</div>
</div>
</main>
<footer class="text-muted py-5">
<div class="container">
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
<script>
var template = '<div class="col">\
<div class="card shadow-sm">\
<img class="card-img-top" src="thumbs/[key].png">\
<div class="card-body">\
<h5 class="card-title">[name]</h5>\
<p class="card-text">[desc]</p>\
<div class="d-flex justify-content-between align-items-center">\
<div class="btn-group">\
<a href="" class="btn btn-sm btn-primary">Preview</a>\
[org]\
</div>\
</div>\
</div>\
</div>\
</div>';
function buildThemes(dataIn){
var keys = Object.keys(dataIn);
keys.sort();
keys.forEach(function(k,foo){
var data = dataIn[k];
var newTemplate = template.replace("[key]",k);
for (var s in data){
if (s == "org"){
// Hack to handle org
if (data[s] != false){
newTemplate = newTemplate.replace('[org]','<a href="[org]" target="_blank"class="btn btn-sm btn-secondary">Author</a>');
}else{
data[s] = '';
}
}
newTemplate = newTemplate.replace("["+s+"]",data[s]);
}
document.getElementById('mainGallery').innerHTML += newTemplate;
});
}
(function() {
fetch('https://lazemss.github.io/OctoPrint-UICustomizerThemes/themes.json')
.then(response => response.json())
.then(data => buildThemes(data));
})();
</script>
</body>
</html>