Made a new ArmCord module :D

This commit is contained in:
KayoticCarnige 2021-05-09 12:57:48 -04:00
parent 72ab64ee21
commit 4beef1a9c4
2 changed files with 26 additions and 12 deletions

View file

@ -1,6 +1,7 @@
const customTitlebar = require('custom-electron-titlebar')
const electronLocalshortcut = require("electron-localshortcut");
const { remote } = require("electron");
const ArmCord = require("./utils/ArmCord.js")
window.addEventListener('DOMContentLoaded', () => {
new customTitlebar.Titlebar({
@ -8,17 +9,6 @@ window.addEventListener('DOMContentLoaded', () => {
menu: false,
});
/**
* Utility function to add CSS in multiple passes.
* @param {string} styleString
*/
function addStyle(styleString) {
const style = document.createElement('style');
style.textContent = styleString;
document.head.append(style);
}
const currentWindow = remote.getCurrentWindow();
electronLocalshortcut.register(currentWindow, "F5", () => {
location.reload();
@ -33,7 +23,8 @@ electronLocalshortcut.register(currentWindow, "F2", () => {
window.location.href = "https://discord.com/invite/F25bc4RYDt"
});
require("./utils/capturer.js")
addStyle(`
ArmCord.addStyle(`
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css");
:root {
@ -87,4 +78,14 @@ div.menubar[role="menubar"] {
background: var(--window-buttons) !important;
}
`);
ArmCord.addStyle(`.info-1VyQPT:last-child:before {
content: "ArmCord Version: ` + ArmCord.Version + `";
height: auto;
line-height: 16px;
text-align: center;
color: var(--text-muted);
font-size: 12px;
text-transform: none;
}`);
})

13
utils/ArmCord.js Normal file
View file

@ -0,0 +1,13 @@
exports.Version = "DevBuild";
exports.addStyle = function(styleString) {
const style = document.createElement('style');
style.textContent = styleString;
document.head.append(style);
};
exports.addScript = function(scriptString) {
var script = document.createElement('script');
script.textContent = scriptString;
document.body.append(script);
};