Fix conflicts

This commit is contained in:
smartfridge 2021-05-09 21:38:06 +02:00
parent 472a46f0a8
commit c91f85fd8f
2 changed files with 49 additions and 29 deletions

View file

@ -1,39 +1,32 @@
const customTitlebar = require('custom-electron-titlebar') const customTitlebar = require("custom-electron-titlebar");
const electronLocalshortcut = require("electron-localshortcut"); const electronLocalshortcut = require("electron-localshortcut");
const { remote } = require("electron"); const { remote } = require("electron");
const ArmCord = require("./utils/ArmCord.js");
window.addEventListener('DOMContentLoaded', () => { window.addEventListener("DOMContentLoaded", () => {
new customTitlebar.Titlebar({ new customTitlebar.Titlebar({
backgroundColor: customTitlebar.Color.fromHex("#202225"), backgroundColor: customTitlebar.Color.fromHex("#202225"),
menu: false,
}); });
/** const currentWindow = remote.getCurrentWindow();
* Utility function to add CSS in multiple passes. electronLocalshortcut.register(currentWindow, "F5", () => {
* @param {string} styleString location.reload();
*/ });
function addStyle(styleString) { electronLocalshortcut.register(currentWindow, "F12", () => {
const style = document.createElement('style'); currentWindow.webContents.openDevTools();
style.textContent = styleString; });
document.head.append(style); electronLocalshortcut.register(currentWindow, "F1", () => {
} require("shell").openExternal("https://support.discord.com/");
});
electronLocalshortcut.register(currentWindow, "F2", () => {
window.location.href = "https://discord.com/invite/F25bc4RYDt";
});
require("./utils/capturer.js");
ArmCord.addStyle(`
const currentWindow = remote.getCurrentWindow();
electronLocalshortcut.register(currentWindow, "F5", () => {
location.reload();
});
electronLocalshortcut.register(currentWindow, "F12", () => {
currentWindow.webContents.openDevTools();
});
electronLocalshortcut.register(currentWindow, "F1", () => {
require("shell").openExternal("https://support.discord.com/");
});
electronLocalshortcut.register(currentWindow, "F2", () => {
window.location.href = "https://discord.com/invite/F25bc4RYDt";
});
require("./utils/capturer.js")
addStyle(`
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css"); @import url("https://kckarnige.github.io/femboi_owo/discord-font.css");
:root { :root {
--window-buttons: var(--header-secondary); --window-buttons: var(--header-secondary);
--cord-color: var(--header-primary); --cord-color: var(--header-primary);
@ -76,13 +69,27 @@ div.menubar[role="menubar"] {
transform: translate(10px, 2px) !important; transform: translate(10px, 2px) !important;
} }
background: #202225 !important; .titlebar {
background: var(--background-tertiary) !important; background: var(--background-tertiary) !important;
font-family: Verdana, Geneva, Tahoma, sans-serif; font-family: Verdana, Geneva, Tahoma, sans-serif;
} }
.titlebar .window-controls-container .window-icon { .titlebar .window-controls-container .window-icon {
background: var(--window-buttons) !important; 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 = "2.4";
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);
};