diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..a31ede1 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/sh +. "$(dirname $0)/_/husky.sh" + +npm run format +git add -A diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..bac5ad4 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +# Some prettier-specific files so it doesn't die. +**/*.png +**/*.ico +LICENSE +.gitignore + +node_modules +out/ +dist +ts-out/ +ts-out \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c7a71d6..fed925e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,13 @@ { "name": "ArmCord", - "version": "3.0.4", + "version": "3.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ArmCord", - "version": "3.0.4", + "version": "3.1.0", + "hasInstallScript": true, "license": "OSL-3.0", "dependencies": { "electron-context-menu": "^3.1.2", @@ -21,6 +22,8 @@ "copyfiles": "^2.4.1", "electron": "^17.1.0", "electron-builder": "^22.14.13", + "husky": "^7.0.4", + "prettier": "^2.5.1", "typescript": "^4.5.4" } }, @@ -2020,6 +2023,21 @@ "node": ">= 6" } }, + "node_modules/husky": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "dev": true, + "bin": { + "husky": "lib/bin.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-corefoundation": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/iconv-corefoundation/-/iconv-corefoundation-1.1.7.tgz", @@ -2724,6 +2742,18 @@ "node": ">=4" } }, + "node_modules/prettier": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -5191,6 +5221,12 @@ "debug": "4" } }, + "husky": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/husky/-/husky-7.0.4.tgz", + "integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==", + "dev": true + }, "iconv-corefoundation": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/iconv-corefoundation/-/iconv-corefoundation-1.1.7.tgz", @@ -5728,6 +5764,12 @@ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", "dev": true }, + "prettier": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", + "dev": true + }, "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", diff --git a/package.json b/package.json index 3a4808d..3b616e9 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "build": "tsc && copyfiles -u 1 src/**/*.html src/**/**/*.css ts-out/ && copyfiles package.json ts-out/ && copyfiles assets/** ts-out/", "watch": "tsc -w", "start": "npm run build && electron ./ts-out/main.js", - "package": "npm run build && electron-builder" + "package": "npm run build && electron-builder", + "format": "prettier --write **/*", + "postinstall": "husky install" }, "repository": { "type": "git", @@ -25,6 +27,8 @@ "copyfiles": "^2.4.1", "electron": "^17.1.0", "electron-builder": "^22.14.13", + "husky": "^7.0.4", + "prettier": "^2.5.1", "typescript": "^4.5.4" }, "dependencies": { diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..d8902c1 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,14 @@ +module.exports = { + printWidth: 120, + tabWidth: 4, + useTabs: false, + semi: true, + singleQuote: false, + quoteProps: "as-needed", + jsxSingleQuote: false, + trailingComma: "none", + bracketSpacing: false, + jsxBracketSameLine: false, + arrowParens: "always", + endOfLine: "auto" +}; diff --git a/src/content/css/discord.css b/src/content/css/discord.css index 4e29030..1b49a8b 100644 --- a/src/content/css/discord.css +++ b/src/content/css/discord.css @@ -1,12 +1,12 @@ .info-3pQQBb:last-child:before { - content: "ArmCord Version: 3.1.0"!important; - height: auto; - line-height: 16px; - text-align: center; - color: var(--text-muted); - font-size: 12px; - text-transform: none; + content: "ArmCord Version: 3.1.0" !important; + height: auto; + line-height: 16px; + text-align: center; + color: var(--text-muted); + font-size: 12px; + text-transform: none; } .notice-2HEN-u { display: none; -} \ No newline at end of file +} diff --git a/src/content/css/setup.css b/src/content/css/setup.css index b138257..d848205 100644 --- a/src/content/css/setup.css +++ b/src/content/css/setup.css @@ -2,68 +2,68 @@ @import url("https://kckarnige.github.io/femboi_owo/discord-font.css"); :root { - background-color: #2c2f33 !important; - --header-secondary: #b9bbbe !important; - --header-primary: #fff !important; - --background-tertiary: #202225 !important; + background-color: #2c2f33 !important; + --header-secondary: #b9bbbe !important; + --header-primary: #fff !important; + --background-tertiary: #202225 !important; } body { - background-color: #2c2f33; - color: white; + background-color: #2c2f33; + color: white; } p { - color: white; - text-align: center; - font-weight: 100; - font-family: Whitney, Helvetica Neue, Helvetica, Arial, sans-serif; - text-rendering: optimizeLegibility; + color: white; + text-align: center; + font-weight: 100; + font-family: Whitney, Helvetica Neue, Helvetica, Arial, sans-serif; + text-rendering: optimizeLegibility; } .logo { - font-size: 0px; - text-align: center; - transform: translateY(-105%); + font-size: 0px; + text-align: center; + transform: translateY(-105%); } .logo:before { - content: "ARM"; - color: #7289da; - font-weight: normal; - font-family: Helvetica, sans-serif; - font-size: 32px; + content: "ARM"; + color: #7289da; + font-weight: normal; + font-family: Helvetica, sans-serif; + font-size: 32px; } .logo:after { - content: "Cord"; - color: #ffffff; - font-weight: normal; - font-family: Discordinated; - font-size: 32px; + content: "Cord"; + color: #ffffff; + font-weight: normal; + font-family: Discordinated; + font-size: 32px; } span { - text-align: center; + text-align: center; } .logo { - display: block; - margin-left: auto; - margin-right: auto; - max-height: 204px; - max-width: 204px; - transform: translateY(5%); + 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%); + position: fixed; + top: 50%; + left: 50%; + color: #fff; + transform: translate(-50%, -50%); } button#express { - margin-right: 84px; + margin-right: 84px; } button { background-color: #7289da; @@ -72,13 +72,13 @@ button { padding: 4px; border-radius: 5px; margin-top: 5px; - + text-align: center; border-style: none; outline: none; } .setup-ask { - font-size: 20px; + font-size: 20px; } button:hover { background-color: #687dc6; @@ -87,25 +87,25 @@ button:hover { cursor: pointer; } select { - -webkit-appearance: button; - -moz-appearance: button; - -webkit-padding-end: 20px; - -moz-padding-end: 20px; - -webkit-padding-start: 2px; - -moz-padding-start: 2px; - background-color: #2c2f33; - background-position: center right; - background-repeat: no-repeat; - border: 1px solid #aaa; - border-radius: 2px; - box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); - color: #fff; - font-size: inherit; - margin: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + -webkit-appearance: button; + -moz-appearance: button; + -webkit-padding-end: 20px; + -moz-padding-end: 20px; + -webkit-padding-start: 2px; + -moz-padding-start: 2px; + background-color: #2c2f33; + background-position: center right; + background-repeat: no-repeat; + border: 1px solid #aaa; + border-radius: 2px; + box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1); + color: #fff; + font-size: inherit; + margin: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .center { - text-align: center; -} \ No newline at end of file + text-align: center; +} diff --git a/src/content/css/splash.css b/src/content/css/splash.css index 710813e..88af543 100644 --- a/src/content/css/splash.css +++ b/src/content/css/splash.css @@ -20,95 +20,95 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ :root { - --background-primary: #282b30; - --background-secondary: rgba(255, 255, 255, 0.1); - --brand-experiment: #5865f2; - --header-primary: #fff; - --text-muted: #72767d; + --background-primary: #282b30; + --background-secondary: rgba(255, 255, 255, 0.1); + --brand-experiment: #5865f2; + --header-primary: #fff; + --text-muted: #72767d; } @font-face { - font-family: Whitney; - font-weight: 400; - font-style: normal; - src: url(https://armcord.smartfridge.space/whitney_400.woff) format("woff"); + font-family: Whitney; + font-weight: 400; + font-style: normal; + src: url(https://armcord.smartfridge.space/whitney_400.woff) format("woff"); } html, body { - -webkit-app-region: drag; - overflow: hidden; + -webkit-app-region: drag; + overflow: hidden; - margin: 0; - padding: 0; - width: 100%; - height: 100%; + margin: 0; + padding: 0; + width: 100%; + height: 100%; - background: var(--background-primary); + background: var(--background-primary); - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; } * { - font-family: "Whitney", sans-serif; + font-family: "Whitney", sans-serif; - box-sizing: border-box; - -webkit-user-select: none; - cursor: default; + box-sizing: border-box; + -webkit-user-select: none; + cursor: default; } video { - width: 200px; - height: 150px; - object-fit: cover; + width: 200px; + height: 150px; + object-fit: cover; } #text-splashscreen { - font-size: 7vw; - text-align: center; + font-size: 7vw; + text-align: center; - color: var(--header-primary); - font-weight: 400; - font-style: italic; - font-size: 16px; + color: var(--header-primary); + font-weight: 400; + font-style: italic; + font-size: 16px; - text-transform: uppercase; + text-transform: uppercase; - width: 100%; + width: 100%; } #bar-container, #bar-fill { - width: 180px; - height: 8px; + width: 180px; + height: 8px; - border-radius: 4px; + border-radius: 4px; - visibility: hidden; + visibility: hidden; } #bar-container { - background-color: var(--background-secondary); + background-color: var(--background-secondary); - position: relative; - margin-top: 12px; + position: relative; + margin-top: 12px; } #bar-fill { - background-color: var(--brand-experiment); - width: 0; + background-color: var(--brand-experiment); + width: 0; } #debug { - position: absolute; - bottom: 6px; - right: 6px; + position: absolute; + bottom: 6px; + right: 6px; - text-align: right; - font-size: 10px; - color: var(--text-muted); - white-space: pre; + text-align: right; + font-size: 10px; + color: var(--text-muted); + white-space: pre; } diff --git a/src/content/css/tabs.css b/src/content/css/tabs.css index 5813278..fe88f80 100644 --- a/src/content/css/tabs.css +++ b/src/content/css/tabs.css @@ -1,53 +1,53 @@ @import url("https://kckarnige.github.io/femboi_owo/discord-font.css"); :root { - --window-buttons: var(--header-secondary); - --cord-color: var(--header-primary); - --armcord-color: #7289da; - --titlebar-color: var(--background-tertiary); + --window-buttons: var(--header-secondary); + --cord-color: var(--header-primary); + --armcord-color: #7289da; + --titlebar-color: var(--background-tertiary); } .tabs { - display: block; - top: 0; - left: 0; - right: 0; - flex-shrink: 0; - overflow: hidden; - zoom: 1; - box-sizing: border-box; - width: 100%; - clear: both; - height: 30px; - line-height: 30px; - background-color: #202225; - -webkit-app-region: drag; - width: 100%; - user-select: none; - -webkit-user-select: none; - position: fixed; - z-index: 99999; + display: block; + top: 0; + left: 0; + right: 0; + flex-shrink: 0; + overflow: hidden; + zoom: 1; + box-sizing: border-box; + width: 100%; + clear: both; + height: 30px; + line-height: 30px; + background-color: #202225; + -webkit-app-region: drag; + width: 100%; + user-select: none; + -webkit-user-select: none; + position: fixed; + z-index: 99999; } .tabs #tabs-controls-container { - float: left; - width: 150px; - height: 100%; - line-height: 30px; - background-color: #202225; - -webkit-app-region: no-drag; + float: left; + width: 150px; + height: 100%; + line-height: 30px; + background-color: #202225; + -webkit-app-region: no-drag; } .tabs-buttons { - color: white; - background-color: inherit; - float: left; - border: none; - outline: none; - cursor: pointer; - transition: 0.3s; - font-size: 20px; + color: white; + background-color: inherit; + float: left; + border: none; + outline: none; + cursor: pointer; + transition: 0.3s; + font-size: 20px; } .tabs-buttons:hover { - background-color: #4e515a; + background-color: #4e515a; } .withFrame-haYltI { - height: 30px !important; + height: 30px !important; } diff --git a/src/content/css/titlebar.css b/src/content/css/titlebar.css index 6060d56..d29f54f 100644 --- a/src/content/css/titlebar.css +++ b/src/content/css/titlebar.css @@ -1,108 +1,108 @@ @import url("https://armcord.smartfridge.space/logofont.css"); :root { - --window-buttons: var(--header-secondary); - --cord-color: var(--header-primary); - --armcord-color: #7289da; - --titlebar-color: var(--background-tertiary); + --window-buttons: var(--header-secondary); + --cord-color: var(--header-primary); + --armcord-color: #7289da; + --titlebar-color: var(--background-tertiary); } .titlebar { - display: block; - top: 0; - left: 0; - right: 0; - flex-shrink: 0; - overflow: hidden; - zoom: 1; - box-sizing: border-box; - width: 100%; - clear: both; - height: 30px; - line-height: 30px; - background-color: #202225; - -webkit-app-region: drag; - width: 100%; - user-select: none; - -webkit-user-select: none; - position: fixed; - z-index: 99999; + display: block; + top: 0; + left: 0; + right: 0; + flex-shrink: 0; + overflow: hidden; + zoom: 1; + box-sizing: border-box; + width: 100%; + clear: both; + height: 30px; + line-height: 30px; + background-color: #202225; + -webkit-app-region: drag; + width: 100%; + user-select: none; + -webkit-user-select: none; + position: fixed; + z-index: 99999; } .titlebar #window-title { - width: 30%; - height: 100%; - line-height: 30px; - float: left; - padding: 0 0 0 1em; + width: 30%; + height: 100%; + line-height: 30px; + float: left; + padding: 0 0 0 1em; } .titlebar #window-controls-container { - float: right; - width: 150px; - height: 100%; - line-height: 30px; - background-color: #202225; - -webkit-app-region: no-drag; + float: right; + width: 150px; + height: 100%; + line-height: 30px; + background-color: #202225; + -webkit-app-region: no-drag; } .titlebar #window-controls-container #minimize, .titlebar #window-controls-container #maximize, .titlebar #window-controls-container #quit { - float: left; - height: 100%; - width: 33%; - text-align: center; - color: #f7f7f7; - cursor: default; + float: left; + height: 100%; + width: 33%; + text-align: center; + color: #f7f7f7; + cursor: default; } .titlebar #window-controls-container #minimize:hover { - background-color: #99aab5; + background-color: #99aab5; } .titlebar #window-controls-container #maximize:hover { - background-color: #99aab5; + background-color: #99aab5; } .titlebar #window-controls-container #quit:hover { - background-color: #f04747; + background-color: #f04747; } .titlebar #window-controls-container #quit { - background-color: #f7f7f7; - -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z' fill='%23000'/%3E%3C/svg%3E") - no-repeat 50% 50%; - mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z' fill='%23000'/%3E%3C/svg%3E") - no-repeat 50% 50%; + background-color: #f7f7f7; + -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z' fill='%23000'/%3E%3C/svg%3E") + no-repeat 50% 50%; + mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z' fill='%23000'/%3E%3C/svg%3E") + no-repeat 50% 50%; } .titlebar #window-controls-container #minimize { - background-color: #f7f7f7; - -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4.399V5.5H0V4.399h11z' fill='%23000'/%3E%3C/svg%3E") - no-repeat 50% 50%; - mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4.399V5.5H0V4.399h11z' fill='%23000'/%3E%3C/svg%3E") - no-repeat 50% 50%; + background-color: #f7f7f7; + -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4.399V5.5H0V4.399h11z' fill='%23000'/%3E%3C/svg%3E") + no-repeat 50% 50%; + mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4.399V5.5H0V4.399h11z' fill='%23000'/%3E%3C/svg%3E") + no-repeat 50% 50%; } .titlebar #window-controls-container #maximize { - background-color: #f7f7f7; - -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 0v11H0V0h11zM9.899 1.101H1.1V9.9h8.8V1.1z' fill='%23000'/%3E%3C/svg%3E") - no-repeat 50% 50%; - mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 0v11H0V0h11zM9.899 1.101H1.1V9.9h8.8V1.1z' fill='%23000'/%3E%3C/svg%3E") - no-repeat 50% 50%; + background-color: #f7f7f7; + -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 0v11H0V0h11zM9.899 1.101H1.1V9.9h8.8V1.1z' fill='%23000'/%3E%3C/svg%3E") + no-repeat 50% 50%; + mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 0v11H0V0h11zM9.899 1.101H1.1V9.9h8.8V1.1z' fill='%23000'/%3E%3C/svg%3E") + no-repeat 50% 50%; } .window-title:after { - content: "Cord"; - color: var(--cord-color) !important; - font-weight: normal; - font-size: 14px; - font-family: Discordinated; + content: "Cord"; + color: var(--cord-color) !important; + font-weight: normal; + font-size: 14px; + font-family: Discordinated; } .window-title:before { - content: "ARM"; - color: var(--armcord-color); - font-weight: normal; - font-size: 14px; - font-family: Helvetica, sans-serif; + content: "ARM"; + color: var(--armcord-color); + font-weight: normal; + font-size: 14px; + font-family: Helvetica, sans-serif; } .window-title { - font-size: 0px !important; - margin-left: initial !important; - transform: translate(10px, 0px); + font-size: 0px !important; + margin-left: initial !important; + transform: translate(10px, 0px); } .withFrame-haYltI { - height: 30px !important; + height: 30px !important; } diff --git a/src/content/setup.html b/src/content/setup.html index ecc47f4..cdca768 100644 --- a/src/content/setup.html +++ b/src/content/setup.html @@ -1,64 +1,60 @@ -
- - -Select what kind of setup you want to perform:
- - -