Merge pull request #1427 from xxDUxx/master

ContourClock: Customizer with preview
pull/1451/head
Gordon Williams 2022-02-14 09:41:39 +00:00 committed by GitHub
commit 9101777f8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 52 additions and 47 deletions

View File

@ -3,3 +3,4 @@
0.21: Fixed settings menu, four more fonts
0.22: Changed timing code, original "Nunito" Font is back!
0.23: Customizer! Unused fonts no longer take up precious memory.
0.24: Added previews to the customizer.

View File

@ -1,70 +1,74 @@
<html>
<head>
<link rel="stylesheet" href="../../css/spectre.min.css">
<style>
input[type=checkbox] {
opacity:0;
}
input[type=checkbox] + label {
opacity:0.2;
}
input[type=checkbox]:checked + label {
opacity:1;
}
</style>
</head>
<body>
<h3>&nbsp;&nbsp;&nbsp;Select Fonts to upload:</h3>
<form>
<input type="checkbox" id="BarlowCond">
<label for="BarlowCond">Barlow Condensed</label><br>
<label for="BarlowCond"><img src="fonts/BarlowCond-p1.png"> <img src="fonts/BarlowCond-p2.png"></label><br>
<input type="checkbox" id="BebasNeue">
<label for="BebasNeue">Bebas Neue</label><br>
<label for="BebasNeue"><img src="fonts/BebasNeue-p1.png"> <img src="fonts/BebasNeue-p2.png"></label><br>
<input type="checkbox" id="Dekko">
<label for="Dekko">Dekko</label><br>
<label for="Dekko"><img src="fonts/Dekko-p1.png"> <img src="fonts/Dekko-p2.png"></label><br>
<input type="checkbox" id="DinAlternate">
<label for="DinAlternate">Din Alternate</label><br>
<input type="checkbox" id="Dosis">
<label for="Dosis">Dosis</label><br>
<label for="DinAlternate"><img src="fonts/DinAlternate-p1.png"> <img src="fonts/DinAlternate-p2.png"></label><br>
<input type="checkbox" id="Impact">
<label for="Impact">Impact</label><br>
<label for="Impact"><img src="fonts/Impact-p1.png"> <img src="fonts/Impact-p2.png"></label><br>
<input type="checkbox" id="Nunito">
<label for="Nunito">Nunito</label><br>
<label for="Nunito"><img src="fonts/Nunito-p1.png"> <img src="fonts/Nunito-p2.png"></label><br>
<input type="checkbox" id="OpenSansEC">
<label for="OpenSansEC">Open Sans Extra Condensed</label><br>
<label for="OpenSansEC"><img src="fonts/OpenSansEC-p1.png"> <img src="fonts/OpenSansEC-p2.png"></label><br>
<input type="checkbox" id="Phosphate">
<label for="Phosphate">Phosphate</label><br>
<label for="Phosphate"><img src="fonts/Phosphate-p1.png"> <img src="fonts/Phosphate-p2.png"></label><br>
<input type="checkbox" id="Quicksand">
<label for="Quicksand">Quicksand</label><br>
<input type="checkbox" id="SairaCond">
<label for="SairaCond">Saira Condensed</label><br>
<label for="Quicksand"><img src="fonts/Quicksand-p1.png"> <img src="fonts/Quicksand-p2.png"></label><br>
<input type="checkbox" id="SairaEC">
<label for="SairaEC">Saira Extra Condensed</label><br>
<label for="SairaEC"><img src="fonts/SairaEC-p1.png"> <img src="fonts/SairaEC-p2.png"></label><br>
<input type="checkbox" id="Teko">
<label for="Teko">Teko</label><br>
<label for="Teko"><img src="fonts/Teko-p1.png"> <img src="fonts/Teko-p2.png"></label><br>
<input type="checkbox" id="Yumaro">
<label for="Yumaro">Yumaro</label><br>
<label for="Yumaro"><img src="fonts/Yumaro-p1.png"> <img src="fonts/Yumaro-p2.png"></label><br>
<input type="checkbox" id="YuseiMagic">
<label for="YuseiMagic">Yusei Magic</label><br>
<p>Click <button id="upload" class="btn btn-primary">Upload</button></p>
<label for="YuseiMagic"><img src="fonts/YuseiMagic-p1.png"> <img src="fonts/YuseiMagic-p2.png"></label><br>
<p><button id="upload" class="btn btn-primary">Upload selected Fonts</button></p>
<script src="../../core/lib/customize.js"></script>
<script>
FontList = ["BarlowCond", "BebasNeue", "Dekko", "DinAlternate", "Dosis",
"Impact", "Nunito", "OpenSansEC", "Phosphate", "Quicksand", "SairaCond", "SairaEC",
"Yumaro", "YuseiMagic"]
// When the 'upload' button is clicked...
document.getElementById("upload").addEventListener("click", function() {
var n=0;
var fonts = [];
for (fontName of FontList) {
if (document.getElementById(fontName).checked==true) {
var f = new Object();
f.name="contourclock-"+n+".json";
f.url="font-"+fontName+".json";
//fonts.push({name:"contourclock-"+n+".json", url:"font-"+fontName+".json"});
fonts.push(f);
//console.log("contourclock-"+n+".json <- font-"+fontName+".json");
n++;
FontList = ["BarlowCond", "BebasNeue", "Dekko", "DinAlternate",
"Impact", "Nunito", "OpenSansEC", "Phosphate", "Quicksand", "SairaEC",
"Yumaro", "YuseiMagic"]
// When the 'upload' button is clicked...
document.getElementById("upload").addEventListener("click", function() {
var n=0;
var fonts = [];
for (fontName of FontList) {
if (document.getElementById(fontName).checked==true) {
var f = new Object();
fonts.push({
name:"contourclock-"+n+".json",
url:"font-"+fontName+".json"
});
n++;
}
}
}
//console.log(fonts[0]);
sendCustomizedApp(storage=fonts);
/*sendCustomizedApp({
storage:[
{name:"myapp.app.js", url:"app.js", content:app},
]
});*/
});
</script>
if (n>0)
sendCustomizedApp({storage:fonts});
else
alert("Please select at least one Font!");
});
</script>
</form>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 726 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 695 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 633 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 774 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

View File

@ -0,0 +1 @@

View File

@ -1,13 +1,12 @@
{ "id": "contourclock",
"name": "Contour Clock",
"shortName" : "Contour Clock",
"version":"0.23",
"version":"0.24",
"icon": "app.png",
"description": "A Minimalist clockface with large Digits. Now with more fonts!",
"screenshots" : [{"url":"cc-screenshot-1.png"},{"url":"cc-screenshot-2.png"}],
"tags": "clock",
"custom": "custom.html",
"allow_emulator":true,
"supports" : ["BANGLEJS2"],
"type": "clock",
"storage": [