i have no idea what i am doing

This commit is contained in:
smartfridge 2021-05-14 21:47:01 +02:00
parent 41306d6cde
commit 8d3b5f523a
4 changed files with 121 additions and 74 deletions

View file

@ -23,7 +23,7 @@ window.addEventListener("DOMContentLoaded", () => {
window.location.href = "https://discord.com/invite/F25bc4RYDt"; window.location.href = "https://discord.com/invite/F25bc4RYDt";
}); });
electronLocalshortcut.register(currentWindow, "F3", () => { electronLocalshortcut.register(currentWindow, "F3", () => {
window.location.href = "./theme.html"; window.location.href = __dirname + "/theme.html";
}); });
require("./utils/capturer.js"); require("./utils/capturer.js");

View file

@ -1,75 +1,71 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="UTF-8" />
<title>ArmCord Theme Manager</title>
<style>
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css");
<head> :root {
<meta charset="UTF-8" /> background-color: #2c2f33;
<title>ArmCord Theme Manager</title> --header-secondary: #b9bbbe;
<style> --header-primary: #fff;
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css"); --background-tertiary: #202225;
}
:root { body {
background-color: #2c2f33; color: white;
--header-secondary: #b9bbbe; }
--header-primary: #fff;
--background-tertiary: #202225;
}
body { p {
color: white; color: white;
} }
p { h1 {
color: white; font-size: 0px;
} text-align: center;
transform: translateY(-105%);
}
h1 { h1:before {
font-size: 0px; content: "ARM";
text-align: center; color: #7289da;
transform: translateY(-105%); font-weight: normal;
} font-family: Helvetica, sans-serif;
font-size: 32px;
}
h1:before { h1:after {
content: "ARM"; content: "Cord";
color: #7289da; color: #ffffff;
font-weight: normal; font-weight: normal;
font-family: Helvetica, sans-serif; font-family: Discordinated;
font-size: 32px; font-size: 32px;
} }
h1:after { span {
content: "Cord"; text-align: center;
color: #ffffff; }
font-weight: normal;
font-family: Discordinated;
font-size: 32px;
}
span { .logo {
text-align: center; color: #ffffff;
} font-weight: normal;
font-family: Discordinated;
font-size: 32px;
}
.logo { .container {
display: block; position: fixed;
margin-left: auto; top: 50%;
margin-right: auto; left: 50%;
max-height: 204px; color: #fff;
max-width: 204px; transform: translate(-50%, -50%);
transform: translateY(5%); }
} </style>
</head>
.container { <body>
position: fixed; <p class="logo">Theme Manager</p>
top: 50%; <div id="tm-list"></div>
left: 50%; </body>
color: #fff; </html>
transform: translate(-50%, -50%);
}
</style>
</head>
<body>
</body>
</html>

View file

@ -1,14 +1,57 @@
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", () => { const splitRegex = /[^\S\r\n]*?\r?(?:\r\n|\n)[^\S\r\n]*?\*[^\S\r\n]?/;
fs.readdirSync(themeFolder).forEach((file) => { const escapedAtRegex = /^\\@/;
console.log(file); function parseMeta(fileContent) {
try { //https://github.com/rauenzi/BetterDiscordApp/blob/01941c1178c13e1229e39e1f1434678a39a020b8/renderer/src/modules/addonmanager.js
const style = fs.readFileSync(`${__dirname}/themes/${file}`, "utf8"); const block = fileContent.split("/**", 2)[1].split("*/", 1)[0];
armcord.addStyle(style) const out = {};
} catch (err) { let field = "";
console.error(err); let accum = "";
for (const line of block.split(splitRegex)) {
if (line.length === 0) continue;
if (line.charAt(0) === "@" && line.charAt(1) !== " ") {
out[field] = accum;
const l = line.indexOf(" ");
field = line.substr(1, l - 1);
accum = line.substr(l + 1);
} else {
accum += " " + line.replace("\\n", "\n").replace(escapedAtRegex, "@");
}
} }
out[field] = accum.trim();
delete out[""];
out.format = "jsdoc";
return out;
}
function loadPluginMenu() {
window.addEventListener("DOMContentLoaded", () => {
fs.readdirSync(themeFolder).forEach((file) => {
console.log(file);
try {
const style = fs.readFileSync(`${__dirname}/themes/${file}`, "utf8");
document.getElementById("tm-list").appendChild(
`
<p>${parseMeta(style)}</p>
`
);
} catch (err) {
console.error(err);
}
});
});
}
window.addEventListener("DOMContentLoaded", () => {
loadPluginMenu()
fs.readdirSync(themeFolder).forEach((file) => {
console.log(file);
try {
const style = fs.readFileSync(`${__dirname}/themes/${file}`, "utf8");
armcord.addStyle(style);
} catch (err) {
console.error(err);
}
});
}); });
})

View file

@ -1 +1,9 @@
/**
* @name Revert Rebrand
* @author GooseNest
* @description Reverts Discord's 2021 rebrand (font, colors, reactions, mentions, loading screen, home icon, reply ping color, and more)
* @invite neMncS2
* @version 3.0
*/
@import url('https://Goose-Nest.github.io/GT-RevertRebrand/src/main.css'); @import url('https://Goose-Nest.github.io/GT-RevertRebrand/src/main.css');