-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# OctoPrint-UICustomizerThemes | ||
This is a placeholder for UI CustomizerThemes | ||
-# OctoPrint-UICustomizerThemes | ||
-This is a placeholder for UI CustomizerThemes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<!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">Source</a>'); | ||
}else{ | ||
data[s] = ''; | ||
} | ||
} | ||
newTemplate = newTemplate.replace("["+s+"]",data[s]); | ||
} | ||
document.getElementById('mainGallery').innerHTML += newTemplate; | ||
console.log(k, data[k]); | ||
}); | ||
} | ||
(function() { | ||
fetch('https://lazemss.github.io/OctoPrint-UICustomizerThemes/themes.json') | ||
.then(response => response.json()) | ||
.then(data => buildThemes(data)); | ||
})(); | ||
</script> | ||
</body> | ||
</html> |