mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Add shortcut to theme manager and make base for it
This commit is contained in:
parent
7dab560a99
commit
38edef38ee
3 changed files with 78 additions and 55 deletions
|
@ -22,6 +22,9 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
electronLocalshortcut.register(currentWindow, "F2", () => {
|
||||
window.location.href = "https://discord.com/invite/F25bc4RYDt";
|
||||
});
|
||||
electronLocalshortcut.register(currentWindow, "F3", () => {
|
||||
window.location.href = "./theme.html";
|
||||
});
|
||||
require("./utils/capturer.js");
|
||||
|
||||
ArmCord.addStyle(`
|
||||
|
|
55
renderer.js
55
renderer.js
|
@ -1,55 +0,0 @@
|
|||
// This file is required by the index.html file and will
|
||||
// be executed in the renderer process for that window.
|
||||
// All of the Node.js APIs are available in this process.
|
||||
const remote = require('electron').remote;
|
||||
|
||||
const win = remote.getCurrentWindow(); /* Note this is different to the
|
||||
html global `window` variable */
|
||||
|
||||
// When document has loaded, initialise
|
||||
document.onreadystatechange = (event) => {
|
||||
if (document.readyState == "complete") {
|
||||
handleWindowControls();
|
||||
|
||||
document.getElementById('electron-ver').innerHTML = `${process.versions.electron}`
|
||||
}
|
||||
};
|
||||
|
||||
window.onbeforeunload = (event) => {
|
||||
/* If window is reloaded, remove win event listeners
|
||||
(DOM element listeners get auto garbage collected but not
|
||||
Electron win listeners as the win is not dereferenced unless closed) */
|
||||
win.removeAllListeners();
|
||||
}
|
||||
|
||||
function handleWindowControls() {
|
||||
// Make minimise/maximise/restore/close buttons work when they are clicked
|
||||
document.getElementById('min-button').addEventListener("click", event => {
|
||||
win.minimize();
|
||||
});
|
||||
|
||||
document.getElementById('max-button').addEventListener("click", event => {
|
||||
win.maximize();
|
||||
});
|
||||
|
||||
document.getElementById('restore-button').addEventListener("click", event => {
|
||||
win.unmaximize();
|
||||
});
|
||||
|
||||
document.getElementById('close-button').addEventListener("click", event => {
|
||||
win.close();
|
||||
});
|
||||
|
||||
// Toggle maximise/restore buttons when maximisation/unmaximisation occurs
|
||||
toggleMaxRestoreButtons();
|
||||
win.on('maximize', toggleMaxRestoreButtons);
|
||||
win.on('unmaximize', toggleMaxRestoreButtons);
|
||||
|
||||
function toggleMaxRestoreButtons() {
|
||||
if (win.isMaximized()) {
|
||||
document.body.classList.add('maximized');
|
||||
} else {
|
||||
document.body.classList.remove('maximized');
|
||||
}
|
||||
}
|
||||
}
|
75
theme.html
75
theme.html
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html>
|
||||
<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");
|
||||
|
||||
:root {
|
||||
background-color: #2c2f33;
|
||||
--header-secondary: #b9bbbe;
|
||||
--header-primary: #fff;
|
||||
--background-tertiary: #202225;
|
||||
}
|
||||
|
||||
body {
|
||||
color: white;
|
||||
}
|
||||
|
||||
p {
|
||||
color: white;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 0px;
|
||||
text-align: center;
|
||||
transform: translateY(-105%);
|
||||
}
|
||||
|
||||
h1:before {
|
||||
content: "ARM";
|
||||
color: #7289da;
|
||||
font-weight: normal;
|
||||
font-family: Helvetica, sans-serif;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
h1:after {
|
||||
content: "Cord";
|
||||
color: #ffffff;
|
||||
font-weight: normal;
|
||||
font-family: Discordinated;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
span {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
max-height: 204px;
|
||||
max-width: 204px;
|
||||
transform: translateY(5%);
|
||||
}
|
||||
|
||||
.container {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
color: #fff;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in a new issue