diff --git a/index.html b/index.html
index bd6850c..a5a20c8 100644
--- a/index.html
+++ b/index.html
@@ -46,57 +46,7 @@
diff --git a/js/dom.js b/js/dom.js
index 0183d02..11f958a 100644
--- a/js/dom.js
+++ b/js/dom.js
@@ -13,4 +13,20 @@ function load_img(img) {
function get_background() {
let bg = get("background");
return bg.children[1-bg.classList.contains("dark")];
+}
+function safe_text(text) {
+ text = text.replaceAll("<", "<");
+ text = text.replaceAll(">", ">");
+ text = text.replaceAll("&", "&");
+ return text;
+}
+function mk_entry(app) {
+ return `
+
+
+
+
${safe_text(app["name"])}
+
${safe_text(app["desc"])}
+
+ `;
}
\ No newline at end of file
diff --git a/js/main.js b/js/main.js
index 5b81269..7bee166 100644
--- a/js/main.js
+++ b/js/main.js
@@ -1,14 +1,60 @@
-var CONFIG = {
+var UI = {
"dark_mode": false
}
+var SERVICES = [
+ {
+ "name": "CalDav",
+ "desc": "Simple CalDav server for calendar sync between various devices.",
+ "href": "caldav",
+ "icon": "img/preview/caldav.png"
+ },
+ {
+ "name": "Files",
+ "desc": "Fancy file manager for the web.",
+ "href": "files",
+ "icon": "img/preview/files.png"
+ },
+ {
+ "name": "Gallery",
+ "desc": "Photo & video gallery syncable with multiple Android devices.",
+ "href": "gallery",
+ "icon": "img/preview/gallery.png"
+ },
+ {
+ "name": "Git",
+ "desc": "Self-hosted, painless, secure place for your repositories.",
+ "href": "git",
+ "icon": "img/preview/git.png"
+ },
+ {
+ "name": "E-Mail",
+ "desc": "Feature-rich, decentralized and secure E-Mail server.",
+ "href": "mail",
+ "icon": "img/preview/mail.png"
+ },
+ {
+ "name": "Music",
+ "desc": "Beautiful, moody music streaming app.",
+ "href": "music",
+ "icon": "img/preview/music.png"
+ },
+ {
+ "name": "Notes",
+ "desc": "Sweet & lightweight app for taking notes.",
+ "href": "notes",
+ "icon": "img/preview/notes.png"
+ }
+]
function config(key, value) {
+ let def = UI[key];
+ let val = localStorage.getItem(key);
+ if (def == value && !val) return;
if (value !== undefined) {
localStorage.setItem(key, value);
- return value;
+ return;
}
- let val = localStorage.getItem(key);
- if (val === null) val = CONFIG.dark_mode;
+ if (!val) val = UI[key].toString();
return val;
}
@@ -17,6 +63,7 @@ function onload() {
btn.onclick = back;
});
switch_theme(config("dark_mode") == "true");
+ load_apps();
setTimeout(() => {
back();
document.body.classList.remove("init");
@@ -54,4 +101,13 @@ function switch_theme(value) {
bg_box.remove("dark");
get_background().src = "img/background.jpg";
}
+}
+
+function load_apps() {
+ let final = "";
+ for (let i = 0; i < SERVICES.length; i++) {
+ let app = mk_entry(SERVICES[i]);
+ final += app;
+ }
+ get("applist").innerHTML = final;
}
\ No newline at end of file