2021-06-29 15:23:52 +00:00
|
|
|
const { remote } = require("electron");
|
|
|
|
const currentWindow = remote.getCurrentWindow();
|
2021-05-09 19:38:06 +00:00
|
|
|
const customTitlebar = require("custom-electron-titlebar");
|
2021-05-04 10:08:30 +00:00
|
|
|
const electronLocalshortcut = require("electron-localshortcut");
|
2021-05-09 19:38:06 +00:00
|
|
|
const ArmCord = require("./utils/ArmCord.js");
|
2021-05-21 17:27:32 +00:00
|
|
|
require("./utils/theme.js");
|
2021-11-01 10:47:32 +00:00
|
|
|
require("./utils/bridge.js")
|
2021-05-09 19:38:06 +00:00
|
|
|
window.addEventListener("DOMContentLoaded", () => {
|
2021-07-17 15:33:21 +00:00
|
|
|
if (require("./utils/ArmCord.js").Titlebar === "native") {console.log("Using native titlebar")} else {
|
2021-05-01 12:41:12 +00:00
|
|
|
new customTitlebar.Titlebar({
|
2021-05-04 15:38:20 +00:00
|
|
|
backgroundColor: customTitlebar.Color.fromHex("#202225"),
|
2021-05-09 19:38:06 +00:00
|
|
|
menu: false,
|
2021-07-17 15:33:21 +00:00
|
|
|
});}
|
2021-06-29 15:23:52 +00:00
|
|
|
|
2021-05-09 19:38:06 +00:00
|
|
|
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", () => {
|
2021-11-01 10:47:32 +00:00
|
|
|
window.location.href = "https://discord.gg/invite/F25bc4RYDt";
|
2021-05-09 19:38:06 +00:00
|
|
|
});
|
2021-05-21 17:33:11 +00:00
|
|
|
electronLocalshortcut.register(currentWindow, "F4", () => {
|
2021-06-29 15:23:52 +00:00
|
|
|
currentWindow.loadFile("./manager.html");
|
2021-05-21 17:33:11 +00:00
|
|
|
});
|
2021-05-09 19:38:06 +00:00
|
|
|
require("./utils/capturer.js");
|
2021-05-01 12:41:12 +00:00
|
|
|
|
2021-05-09 19:38:06 +00:00
|
|
|
ArmCord.addStyle(`
|
2021-05-04 15:38:20 +00:00
|
|
|
@import url("https://kckarnige.github.io/femboi_owo/discord-font.css");
|
2021-05-08 15:09:46 +00:00
|
|
|
:root {
|
|
|
|
--window-buttons: var(--header-secondary);
|
|
|
|
--cord-color: var(--header-primary);
|
|
|
|
--armcord-color: #7289da;
|
2021-05-25 10:24:42 +00:00
|
|
|
--titlebar-color: var(--background-tertiary);
|
2021-05-08 15:09:46 +00:00
|
|
|
}
|
2021-05-04 15:38:20 +00:00
|
|
|
.base-3dtUhz, .sidebar-2K8pFh {
|
|
|
|
display: -webkit-box;
|
|
|
|
display: -ms-flexbox;
|
|
|
|
display: flex;
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
-webkit-box-direction: normal;
|
|
|
|
-ms-flex-direction: column;
|
|
|
|
overflow: hidden;
|
|
|
|
border-top-left-radius: 8px;
|
|
|
|
}
|
|
|
|
div.menubar[role="menubar"] {
|
|
|
|
width: 0px;
|
|
|
|
}
|
|
|
|
.window-title:after {
|
|
|
|
content: "Cord";
|
2021-05-08 15:09:46 +00:00
|
|
|
color: var(--cord-color) !important;
|
2021-05-04 15:38:20 +00:00
|
|
|
font-weight: normal;
|
2021-05-05 03:36:28 +00:00
|
|
|
font-size: 14px;
|
2021-05-04 15:38:20 +00:00
|
|
|
font-family: Discordinated;
|
|
|
|
}
|
|
|
|
.window-title:before {
|
|
|
|
content: "ARM";
|
2021-05-08 15:09:46 +00:00
|
|
|
color: var(--armcord-color);
|
2021-05-04 15:38:20 +00:00
|
|
|
font-weight: normal;
|
2021-05-05 03:36:28 +00:00
|
|
|
font-size: 14px;
|
2021-05-04 15:38:20 +00:00
|
|
|
font-family: Helvetica, sans-serif;
|
|
|
|
}
|
|
|
|
.window-title {
|
|
|
|
font-size: 0px !important;
|
|
|
|
margin-left: initial !important;
|
2021-05-25 10:24:42 +00:00
|
|
|
transform: translate(10px, 2px);
|
2021-05-04 15:38:20 +00:00
|
|
|
}
|
2021-05-09 19:38:06 +00:00
|
|
|
.titlebar {
|
2021-05-25 10:24:42 +00:00
|
|
|
background: var(--titlebar-color) !important;
|
2021-05-08 15:09:46 +00:00
|
|
|
font-family: Verdana, Geneva, Tahoma, sans-serif;
|
|
|
|
}
|
|
|
|
.titlebar .window-controls-container .window-icon {
|
|
|
|
background: var(--window-buttons) !important;
|
2021-05-04 15:38:20 +00:00
|
|
|
}
|
2021-05-22 15:28:29 +00:00
|
|
|
.notice-3bPHh-.colorDefault-22HBa0 {
|
|
|
|
display: none;
|
|
|
|
}
|
2021-05-04 15:38:20 +00:00
|
|
|
`);
|
2021-05-04 15:44:45 +00:00
|
|
|
|
2021-05-10 07:49:24 +00:00
|
|
|
ArmCord.addStyle(
|
|
|
|
`.info-1VyQPT:last-child:before {
|
|
|
|
content: "ArmCord Version: ` +
|
|
|
|
ArmCord.Version +
|
|
|
|
`";
|
2021-05-09 19:38:06 +00:00
|
|
|
height: auto;
|
|
|
|
line-height: 16px;
|
|
|
|
text-align: center;
|
|
|
|
color: var(--text-muted);
|
|
|
|
font-size: 12px;
|
|
|
|
text-transform: none;
|
2021-05-10 07:49:24 +00:00
|
|
|
}`
|
|
|
|
);
|
2021-05-28 16:00:30 +00:00
|
|
|
|
|
|
|
document.getElementById("ac-channel").innerHTML = ArmCord.Channel;
|
2021-05-10 07:49:24 +00:00
|
|
|
});
|