Add barebones theme loading!

This commit is contained in:
smartfridge 2021-05-14 20:27:59 +02:00
parent 9608851fa2
commit 41306d6cde

View file

@ -1,7 +1,14 @@
const themeFolder = __dirname + "/themes/"; const themeFolder = __dirname + "/themes/";
const fs = require("fs"); const fs = require("fs");
const armcord = require("./armcord.js") const armcord = require("./armcord.js")
window.addEventListener("DOMContentLoaded", () => {
fs.readdirSync(themeFolder).forEach((file) => { fs.readdirSync(themeFolder).forEach((file) => {
armcord.addStyle(fs.readFileSync(file)) console.log(file);
console.log(file) try {
const style = fs.readFileSync(`${__dirname}/themes/${file}`, "utf8");
armcord.addStyle(style)
} catch (err) {
console.error(err);
}
}); });
})