Compare commits

...

19 commits

Author SHA1 Message Date
dependabot[bot]
170c6a1771
Update prettier requirement from ^2.7.0 to ^2.7.1
Updates the requirements on [prettier](https://github.com/prettier/prettier) to permit the latest version.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.7.0...2.7.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-05 16:36:40 +00:00
smartfrigde
5d19f1844b cleaning up 2022-07-05 18:34:53 +02:00
altinat
57fbc45315
Translated using Weblate (Thai)
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/th/
2022-07-05 05:17:22 +02:00
KayoticCarnige
b9a0a73399
Translated using Weblate (English (United States))
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/en_US/
2022-07-05 05:17:21 +02:00
KayoticCarnige
efbccabd4c Style overhaul and fully implemented titlebars
Dev note: Titlebars are still a WIP for Linux, using the native theme is recommended for now on Linux
2022-07-04 10:39:22 -04:00
smartfridge
f7b860fc06
Fix broken logo in readme 2022-06-28 17:59:28 +02:00
Mahdi Koushan Mehr
fe86b2508a
Translated using Weblate (Persian)
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/fa/
2022-06-23 08:21:16 +02:00
PoorPockets McNewHold
12994b1050
Translated using Weblate (French)
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/fr/
2022-06-23 08:21:16 +02:00
smartfridge
c19bb21282
Add Pi-Apps to readme 2022-06-21 23:50:12 +02:00
Anonymous
cdc52346d8
Translated using Weblate (Persian)
Currently translated at 100.0% (0 of 0 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/fa/
2022-06-21 12:25:17 +02:00
Mahdi Koushan Mehr
ef8a15c328
Added translation using Weblate (Persian) 2022-06-21 12:25:14 +02:00
4d13e686da
Translated using Weblate (Thai)
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/th/
2022-06-18 04:21:23 +02:00
smartfrigde
9efce82462 Add fallback to English 2022-06-17 09:37:18 +02:00
smartfrigde
a216475618 Add theme loader 2022-06-16 23:09:41 +02:00
smartfrigde
b7a0d1face formatting 2022-06-16 17:31:57 +02:00
smartfrigde
0b165e64bc Remove left over from tabs in armcord api 2022-06-16 17:31:57 +02:00
Hosted Weblate
8c62d9dd86
Update translation files
Updated by "Cleanup translation files" hook in Weblate.

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/
2022-06-16 17:25:18 +02:00
smartfrigde
86f885c41f Add window state manager 2022-06-16 17:25:09 +02:00
dfa1665b19
Translated using Weblate (Thai)
Currently translated at 100.0% (28 of 28 strings)

Translation: ArmCord/ArmCord
Translate-URL: https://hosted.weblate.org/projects/armcord/armcord/th/
2022-06-16 17:19:39 +02:00
38 changed files with 664 additions and 208 deletions

View file

@ -1,6 +1,6 @@
<div align="center"> <div align="center">
<img src="https://armcord.vercel.app/armcord_full_logo.png" width="520"> <img src="https://armcord.vercel.app/logo.png" width="520">
<br>ArmCord is a custom client designed to enhance your Discord experience while keeping everything lightweight. <br>ArmCord is a custom client designed to enhance your Discord experience while keeping everything lightweight.
</div> </div>
@ -45,6 +45,9 @@ ArmCord is also available on the Snap store [here](https://snapcraft.io/armcord)
<a href="https://snapcraft.io/armcord"> <a href="https://snapcraft.io/armcord">
<img alt="Get it from the Snap Store" src="https://snapcraft.io/static/images/badges/en/snap-store-black.svg" /> <img alt="Get it from the Snap Store" src="https://snapcraft.io/static/images/badges/en/snap-store-black.svg" />
</a> </a>
### Pi-Apps
ArmCord is also available in [Pi-Apps](https://github.com/Botspot/pi-apps).
[![badge](https://github.com/Botspot/pi-apps/blob/master/icons/badge.png?raw=true)](https://github.com/Botspot/pi-apps)
### Manual: ### Manual:
Alternatively you can run ArmCord from source (npm, nodejs required): Alternatively you can run ArmCord from source (npm, nodejs required):
1. Clone ArmCord repo: `git clone https://github.com/ArmCord/ArmCord.git` 1. Clone ArmCord repo: `git clone https://github.com/ArmCord/ArmCord.git`

BIN
assets/ac_black_plug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -1,30 +1,30 @@
{ {
"loading_screen_start": "Starting ArmCord…", "loading_screen_start": "Starting ArmCord…",
"loading_screen_offline": "You appear to be offline. Please connect to the Internet and try again.", "loading_screen_offline": "You appear to be offline. Please connect to the Internet and try again.",
"loading_screen_update": "A new version of ArmCord is available. Please update to the latest version.", "loading_screen_update": "A new version of ArmCord is available. Please update to the latest version.",
"setup_question1": "Select what kind of setup you want to perform:", "setup_question1": "Select what kind of setup you want to perform:",
"setup_question1_answer1": "Express setup", "setup_question1_answer1": "Express Setup",
"setup_question1_answer2": "Full setup", "setup_question1_answer2": "Full Setup",
"setup_offline": "You appear to be offline. Please connect to the Internet and restart the ArmCord setup.", "setup_offline": "You appear to be offline. Please connect to the internet and restart ArmCord.",
"setup_question2": "Choose your Discord channel/instance:", "setup_question2": "Choose your Discord channel/instance:",
"setup_question3": "Should ArmCord handle client mods installation?", "setup_question3": "Should ArmCord handle client mods installation?",
"yes": "Yes", "yes": "Yes",
"no": "No", "no": "No",
"next": "Next", "next": "Next",
"setup_question4": "Select a client mod you want to install:", "setup_question4": "Select a client mod you want to install:",
"setup_question4_clientmodnotice": "Why not all of them? Having many client mods at the same time can cause issues. If you really want to do it though, check our Discord.", "setup_question4_clientmodnotice": "Why not all of them? Having many client mods at the same time can cause issues. If you really want to do it though, check our Discord.",
"settings-theme": "ArmCord theme:", "settings-theme": "ArmCord theme:",
"settings-theme-default": "Default", "settings-theme-default": "Default",
"settings-theme-native": "Native", "settings-theme-native": "Native",
"settings-tray": "Minimize to tray", "settings-tray": "Minimize to tray",
"settings-patches": "Automatic Patches", "settings-patches": "Automatic Patches",
"settings-channel": "Discord channel:", "settings-channel": "Discord channel:",
"settings-invitewebsocket": "Invite Websocket", "settings-invitewebsocket": "Invite Websocket",
"settings-mod": "Client mod:", "settings-mod": "Client mod:",
"settings-prfmMode": "Performance mode:", "settings-prfmMode": "Performance mode:",
"settings-prfmMode-performance": "Performance", "settings-prfmMode-performance": "Performance",
"settings-prfmMode-battery": "Battery", "settings-prfmMode-battery": "Battery",
"settings-none": "None", "settings-none": "None",
"settings-save": "Save settings", "settings-save": "Save settings",
"settings-updater": "Check for updates" "settings-updater": "Check for updates"
} }

30
assets/lang/fa-IR.json Normal file
View file

@ -0,0 +1,30 @@
{
"loading_screen_start": "درحال پیاده سازی ArmCord…",
"loading_screen_offline": "به نظر می‌رسد شما آفلاین هستید. لطفا به اینترنت متصل شده و سپس دوباره تلاش کنید.",
"loading_screen_update": "نسخه جدید ArmCord در دسترس است. لطفا به آخرین نسخه بروزرسانی کنید.",
"setup_question1": "انتخاب کنید که چگونه میخواهید نصب کنید:",
"setup_question1_answer1": "راه‌اندازی سریع",
"setup_question1_answer2": "راه‌اندازی کامل",
"setup_offline": "به نظر می‌رسد شما آفلاین هستید. لطفا به اینترنت وصل شده و سپس نصب ArmCord را از ابتدا شروع کنید.",
"setup_question2": "نوع دیسکورد را انتخاب کنید:",
"setup_question3": "آیا میخواهید ArmCord تغییرات کلاینت را خودکار اعمال کند؟",
"yes": "بله",
"no": "خیر",
"next": "بعدی",
"setup_question4": "نوع اصلاح‌ساز برنامه که میخواهید نصب کنید انتخاب کنید:",
"setup_question4_clientmodnotice": "چرا همه نه؟ داشتن اصلاح‌سازهای زیاد به صورت همزمان می‌تواند خرابی به بار آورد. اگر واقعا می‌خواهید انجامش دهید، به دیسکورد ما سر بزنید.",
"settings-theme": "تم ArmCord:",
"settings-theme-default": "پیش‌فرض",
"settings-theme-native": "محلی",
"settings-tray": "مینیماز در نوارابزار کوچک",
"settings-patches": "اعمال تغییرات به صورت خودکار",
"settings-channel": "نوع دیسکورد:",
"settings-invitewebsocket": "وب سوکت دعوت",
"settings-mod": "نوع اصلاح‌ساز کلاینت:",
"settings-prfmMode": "حالت عملکرد:",
"settings-prfmMode-performance": "قدرت بیشتر",
"settings-prfmMode-battery": "ذخیره برای باتری",
"settings-none": "هیچکدام",
"settings-save": "ذخیره تنظیمات",
"settings-updater": "بررسی برای بروزرسانی"
}

View file

@ -13,15 +13,15 @@
"setup_question4_clientmodnotice": "Pourquoi pas tous ? Le fait d'avoir plusieurs clients mods en même temps peut causer des problèmes. Si vous voulez vraiment le faire, consultez notre Discord.", "setup_question4_clientmodnotice": "Pourquoi pas tous ? Le fait d'avoir plusieurs clients mods en même temps peut causer des problèmes. Si vous voulez vraiment le faire, consultez notre Discord.",
"loading_screen_offline": "Vous semblez être hors ligne. Veuillez vous connecter à internet et réessayer.", "loading_screen_offline": "Vous semblez être hors ligne. Veuillez vous connecter à internet et réessayer.",
"setup_offline": "Vous semblez être hors ligne. Veuillez vous connecter à internet et redémarrer l'installateur ArmCord.", "setup_offline": "Vous semblez être hors ligne. Veuillez vous connecter à internet et redémarrer l'installateur ArmCord.",
"settings-tray": "Minimize to tray", "settings-tray": "Minimiser dans la zone de notification",
"settings-channel": "Discord channel:", "settings-channel": "Canaux Discord :",
"settings-mod": "Client mod:", "settings-mod": "Modification client :",
"settings-save": "Save settings", "settings-save": "Sauvegarder les paramètres",
"settings-updater": "Check for updates", "settings-updater": "Vérifier les mises à jour",
"settings-theme": "Thème ArmCord :", "settings-theme": "Thème ArmCord :",
"settings-theme-default": "Default", "settings-theme-default": "Default",
"settings-theme-native": "Native", "settings-theme-native": "Native",
"settings-patches": "Automatic Patches", "settings-patches": "Correctifs automatiques",
"settings-invitewebsocket": "Lien discord.gg", "settings-invitewebsocket": "Lien discord.gg",
"settings-prfmMode": "Mode performance :", "settings-prfmMode": "Mode performance :",
"settings-prfmMode-performance": "Performance", "settings-prfmMode-performance": "Performance",

View file

@ -14,7 +14,6 @@
"setup_question4": "Select a client mod you want to install:", "setup_question4": "Select a client mod you want to install:",
"setup_question4_clientmodnotice": "Why not all of them? Having many client mods at the same time can cause issues. If you really want to do it though, check our documentation.", "setup_question4_clientmodnotice": "Why not all of them? Having many client mods at the same time can cause issues. If you really want to do it though, check our documentation.",
"settings-theme": "ArmCord Theme:", "settings-theme": "ArmCord Theme:",
"settings-theme-tabs": "Tabs (experimental)",
"settings-theme-default": "Default", "settings-theme-default": "Default",
"settings-theme-native": "Native", "settings-theme-native": "Native",
"settings-tray": "Minimize to tray", "settings-tray": "Minimize to tray",

View file

@ -19,7 +19,6 @@
"settings-updater": "Controlla gli aggiornamenti", "settings-updater": "Controlla gli aggiornamenti",
"settings-mod": "Client mod:", "settings-mod": "Client mod:",
"settings-theme": "ArmCord Theme:", "settings-theme": "ArmCord Theme:",
"settings-theme-tabs": "Tabs (experimental)",
"settings-theme-default": "Default", "settings-theme-default": "Default",
"settings-theme-native": "Native", "settings-theme-native": "Native",
"settings-patches": "Automatic Patches", "settings-patches": "Automatic Patches",

View file

@ -19,7 +19,6 @@
"settings-save": "Save settings", "settings-save": "Save settings",
"settings-updater": "Check for updates", "settings-updater": "Check for updates",
"settings-theme": "ArmCord Theme:", "settings-theme": "ArmCord Theme:",
"settings-theme-tabs": "Tabs (experimental)",
"settings-theme-default": "Default", "settings-theme-default": "Default",
"settings-theme-native": "Native", "settings-theme-native": "Native",
"settings-patches": "Automatic Patches", "settings-patches": "Automatic Patches",

View file

@ -20,7 +20,6 @@
"settings-updater": "Check voor updates", "settings-updater": "Check voor updates",
"settings-patches": "Automatische Patches", "settings-patches": "Automatische Patches",
"settings-theme": "ArmCord Thema:", "settings-theme": "ArmCord Thema:",
"settings-theme-tabs": "Tabs (experimenteel)",
"settings-theme-default": "Standaard", "settings-theme-default": "Standaard",
"settings-theme-native": "Native", "settings-theme-native": "Native",
"settings-invitewebsocket": "discord.gg support", "settings-invitewebsocket": "discord.gg support",

View file

@ -19,7 +19,6 @@
"settings-save": "Zapisz ustawienia", "settings-save": "Zapisz ustawienia",
"settings-mod": "Modyfikacja klienta:", "settings-mod": "Modyfikacja klienta:",
"settings-theme": "Motyw ArmCord:", "settings-theme": "Motyw ArmCord:",
"settings-theme-tabs": "Karty (eksperymentalne)",
"settings-theme-default": "Domyślny", "settings-theme-default": "Domyślny",
"settings-theme-native": "Natywny", "settings-theme-native": "Natywny",
"settings-patches": "Automatyczne łatki", "settings-patches": "Automatyczne łatki",

View file

@ -1,28 +1,28 @@
{ {
"loading_screen_start": "กำลังเริ่ม ArmCord…", "loading_screen_start": "กำลังเริ่มต้น ArmCord…",
"loading_screen_offline": "ดูเหมือนว่าคุณออฟไลน์อยู่ โปรดเชื่อมต่ออินเทอร์เน็ตและลองใหม่อีกครั้ง", "loading_screen_offline": "ดูเหมือนว่าคุณออฟไลน์อยู่ โปรดเชื่อมต่ออินเทอร์เน็ตและลองใหม่อีกครั้ง",
"loading_screen_update": "ArmCord เวอร์ชันใหม่พร้อมใช้งานแล้ว โปรดอัปเดตเป็นเวอร์ชันล่าสุด", "loading_screen_update": "ArmCord เวอร์ชันใหม่พร้อมใช้งานแล้ว โปรดอัปเดตเป็นเวอร์ชันล่าสุด",
"setup_question1": "เลือกประเภทการติดตั้งที่คุณต้องการ:", "setup_question1": "เลือกประเภทการติดตั้งที่คุณต้องการ:",
"setup_question1_answer1": "ติดตั้งแบบน้ำหนักเบา", "setup_question1_answer1": "ติดตั้งแบบรวดเร็ว",
"setup_question1_answer2": "ติดตั้งแบบเต็ม", "setup_question1_answer2": "ติดตั้งเต็มรูปแบบ",
"setup_offline": "ดูเหมือนว่าคุณออฟไลน์อยู่ โปรดเชื่อมต่ออินเทอร์เน็ตและลองใหม่อีกครั้ง", "setup_offline": "ดูเหมือนว่าคุณออฟไลน์อยู่ โปรดเชื่อมต่ออินเทอร์เน็ตและลองเริ่ม ArmCord ใหม่อีกครั้ง",
"setup_question2": "เลือกช่อง/อินสแตนส์ Discord:", "setup_question2": "เลือกช่อง/อินสแตนส์ Discord:",
"setup_question3": "ต้องการให้ ArmCord จัดการการติดตั้งมอดของไคลเอนต์หรือไม่?", "setup_question3": "ต้องการให้ ArmCord จัดการการติดตั้งมอดของไคลเอนต์หรือไม่?",
"yes": "ใช่", "yes": "ใช่",
"no": "ไม่", "no": "ไม่ใช่",
"next": "ถัดไป", "next": "ถัดไป",
"setup_question4": "เลือกไคลเอนต์มอดที่ต้องการติดตั้ง:", "setup_question4": "เลือกไคลเอนต์มอดที่ต้องการติดตั้ง:",
"settings-prfmMode-battery": "แบตเตอรี่", "settings-prfmMode-battery": "ประหยัดแบตเตอรี่",
"setup_question4_clientmodnotice": "ทำไมไม่ใช้ทั้งหมดล่ะ? การมีไคลเอนต์มอดหลายตัวพร้อมกันอาจทำให้เกิดปัญหาได้ หากต้องการที่จะทำจริงๆ ให้ไปดูใน Discord ของเรา", "setup_question4_clientmodnotice": "ทำไมไม่ใช้พร้อมกันทั้งหมดล่ะ? การมีไคลเอนต์มอดหลายตัวพร้อมกันอาจทำให้เกิดปัญหาได้ หากต้องการที่จะทำจริงๆ ให้ไปดูใน Discord ของเรา",
"settings-theme": "ธีม ArmCord:", "settings-theme": "ธีม ArmCord:",
"settings-theme-default": "ค่าเริ่มต้น", "settings-theme-default": "ค่าเริ่มต้น",
"settings-theme-native": "ดั้งเดิม", "settings-theme-native": "ดั้งเดิม",
"settings-tray": "ย่อลงไปในถาดงาน", "settings-tray": "ย่อขนาดหน้าต่าง",
"settings-patches": "แพทช์อัตโนมัติ", "settings-patches": "แพทช์อัตโนมัติ",
"settings-channel": "ช่อง Discord:", "settings-channel": "ช่อง Discord:",
"settings-invitewebsocket": "ใช้ Websocket สำหรับการเชิญ", "settings-invitewebsocket": "ใช้ Websocket สำหรับการเชิญ",
"settings-prfmMode": "โหมดประสิทธิภาพ:", "settings-prfmMode": "โหมดประสิทธิภาพ:",
"settings-prfmMode-performance": "ประสิทธิภาพ", "settings-prfmMode-performance": "ประสิทธิภาพสูงสุด",
"settings-mod": "ไคลแอนต์มอด:", "settings-mod": "ไคลแอนต์มอด:",
"settings-none": "ไม่มี", "settings-none": "ไม่มี",
"settings-save": "บันทึกการตั้งค่า", "settings-save": "บันทึกการตั้งค่า",

Binary file not shown.

BIN
build/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View file

@ -26,10 +26,10 @@
"@types/node": "^17.0.42", "@types/node": "^17.0.42",
"@types/ws": "^8.5.3", "@types/ws": "^8.5.3",
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"electron": "^19.0.4", "electron": "^19.0.7",
"electron-builder": "^23.0.3", "electron-builder": "^23.0.3",
"husky": "^8.0.1", "husky": "^8.0.1",
"prettier": "^2.7.0", "prettier": "^2.7.1",
"typescript": "^4.7.3" "typescript": "^4.7.3"
}, },
"dependencies": { "dependencies": {
@ -47,7 +47,7 @@
"linux": { "linux": {
"icon": "build/icon.icns", "icon": "build/icon.icns",
"category": "Network", "category": "Network",
"maintainer": "smartfrigde@gmail.com", "maintainer": "smartfridge@vivaldi.net",
"target": [ "target": [
"deb", "deb",
"tar.gz", "tar.gz",

View file

@ -1,14 +1,16 @@
.notice-2HEN-u { .notice-2HEN-u {
display: none; display: none;
} }
.sidebar-1tnWFu { [customTitlebar] .sidebar-1tnWFu {
border-top-left-radius: 8px; border-top-left-radius: 8px;
} }
.scroller-3X7KbA { [customTitlebar] .scroller-3X7KbA {
padding: 0; padding: 0;
padding-top: 4px; padding-top: 4px;
} }
* {
outline: none;
}
[class^="socialLinks-"] + [class^="info-"] { [class^="socialLinks-"] + [class^="info-"] {
padding-right: 0; padding-right: 0;
} }

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
/*MIT License /*MIT License
Copyright (c) 2021 GooseMod Copyright (c) 2022 GooseMod
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -20,11 +20,18 @@ 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/ SOFTWARE.*/
:root { :root {
--background-primary: #282b30; --background-secondary: #2f3136;
--background-secondary: rgba(255, 255, 255, 0.1); --background-secondary-alt: #292b2f;
--brand-experiment: #5865f2; --background-floating: #18191c;
--header-primary: #fff; --background-modifier-hover: rgba(106, 116, 128, 0.16);
--brand-experiment: #7289da;
--brand-experiment-560: #5c6fb1;
--brand-experiment-600: #4e5d94;
--interactive-normal: #b9bbbe;
--interactive-hover: #dcddde;
--text-muted: #72767d; --text-muted: #72767d;
--font-primary: "Whitney";
--header-primary: #fff;
} }
@font-face { @font-face {
@ -36,12 +43,19 @@ SOFTWARE.*/
html, html,
body { body {
overflow: hidden; overflow-x: hidden;
overflow-y: scroll;
margin: 0;
padding: 0; padding: 0;
margin: 2%; margin: 2%;
background: var(--background-primary); background: var(--background-secondary);
}
body::-webkit-scrollbar {
width: 0.4em;
background: transparent;
}
body::-webkit-scrollbar-thumb {
background: var(--background-floating);
border-radius: 25px;
} }
* { * {
@ -58,31 +72,39 @@ body {
vertical-align: middle; vertical-align: middle;
} }
.header { .header {
color: white; color: var(--header-primary);
font-size: 1.5em; font-size: 1.46em;
} }
.center { .center {
text-align: center; text-align: center;
left: 50%;
margin-right: 50%;
transform: translateX(50%);
float: right;
} }
/*buttons*/ /*buttons*/
button { button {
background-color: #7289da; background: var(--brand-experiment);
font-family: Whitney, "Helvetica Neue", Helvetica, Arial, sans-serif; color: var(--header-primary);
color: #ffffff;
padding: 4px;
border-radius: 5px;
margin-top: 5px;
text-align: center;
border-style: none;
outline: none; outline: none;
border: none;
border-radius: 5px;
padding: 8px;
transition: 0.17s ease;
}
button:hover {
background: var(--brand-experiment-560);
cursor: pointer;
transition: 0.17s ease;
} }
button:hover { button:active {
background-color: #687dc6; background: var(--brand-experiment-600);
border-style: none;
outline: none;
cursor: pointer; cursor: pointer;
transition: 0.17s ease;
}
#save {
font-size: 15px;
} }
.tgl { .tgl {
display: none; display: none;
@ -135,42 +157,47 @@ button:hover {
height: 100%; height: 100%;
} }
.tgl + .tgl-btn:after { .tgl + .tgl-btn:after {
left: 0; left: 1px;
} }
.tgl + .tgl-btn:before { .tgl + .tgl-btn:before {
display: none; display: none;
} }
.tgl:checked + .tgl-btn:after { .tgl:checked + .tgl-btn:after {
left: 50%; left: 56%;
} }
.tgl-light + .tgl-btn { .tgl-light + .tgl-btn {
background: #5c5757; background: var(--text-muted);
border-radius: 2em; border-radius: 25px;
padding: 2px; padding: 4px;
transition: all 0.4s ease; transition: all 0.4s ease;
} }
.tgl-light + .tgl-btn:after { .tgl-light + .tgl-btn:after {
border-radius: 50%; border-radius: 50px;
position: relative;
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 24px;
background: rgb(255, 255, 255); background: rgb(255, 255, 255);
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.tgl-light:checked + .tgl-btn { .tgl-light:checked + .tgl-btn {
background: #47ca5a; background: var(--brand-experiment);
} }
select { select {
-webkit-appearance: button; -webkit-appearance: button;
-moz-appearance: button; -moz-appearance: button;
background-color: #2c2f33; background-color: var(--background-secondary-alt);
background-position: center right; background-position: center right;
background-repeat: no-repeat; background-repeat: no-repeat;
border: 1px solid #aaa; border: 1px solid var(--background-floating);
border-radius: 2px; border-radius: 2px;
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
color: #fff; color: #fff;
font-size: 1.2em; font-size: 1.2em;
margin: 0; margin: 0;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
outline: none !important;
} }

View file

@ -1,11 +1,11 @@
@import url("https://armcord.smartfridge.space/logofont.css");
/* Meta {{{ */ /* Meta {{{ */
:root { :root {
--background-primary: #282b30; --background-primary: #282b30;
--background-secondary: rgba(255, 255, 255, 0.1); --background-secondary: rgba(255, 255, 255, 0.1);
--background-modifier-hover: rgba(106, 116, 128, 0.16); --background-modifier-hover: rgba(106, 116, 128, 0.16);
--brand-experiment: #7289da; --brand-experiment: #7289da;
--brand-experiment-560: #5c6fb1;
--brand-experiment-600: #4e5d94;
--interactive-normal: #b9bbbe; --interactive-normal: #b9bbbe;
--interactive-hover: #dcddde; --interactive-hover: #dcddde;
--text-muted: #72767d; --text-muted: #72767d;
@ -109,7 +109,12 @@ body {
height: 100%; height: 100%;
width: 33%; width: 33%;
} }
[armcord-platform="darwin"] .titlebar #window-controls-container {
margin-left: -26px;
}
[armcord-platform="darwin"] .titlebar #window-controls-container #minimize {
transform: translateX(5px);
}
/* }}} */ /* }}} */
/* Buttons {{{ */ /* Buttons {{{ */
@ -130,10 +135,18 @@ button {
border: none; border: none;
border-radius: 4px; border-radius: 4px;
padding: 8px 20px; padding: 8px 20px;
transition: 0.17s ease;
} }
button:hover { button:hover {
filter: brightness(85%); background: var(--brand-experiment-560);
cursor: pointer; cursor: pointer;
transition: 0.17s ease;
}
button:active {
background: var(--brand-experiment-600);
cursor: pointer;
transition: 0.17s ease;
} }
/* }}} */ /* }}} */
@ -157,5 +170,9 @@ select {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
text-align: center;
}
option {
text-align: left;
} }
/* }}} */ /* }}} */

View file

@ -1,6 +1,6 @@
/*MIT License /*MIT License
Copyright (c) 2021 GooseMod Copyright (c) 2022 GooseMod
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -22,7 +22,7 @@ SOFTWARE.*/
:root { :root {
--background-primary: #282b30; --background-primary: #282b30;
--background-secondary: rgba(255, 255, 255, 0.1); --background-secondary: rgba(255, 255, 255, 0.1);
--brand-experiment: #5865f2; --brand-experiment: #7289da;
--header-primary: #fff; --header-primary: #fff;
--text-muted: #72767d; --text-muted: #72767d;
} }

View file

@ -47,17 +47,105 @@
} }
/* ArmCord on Linux */ /* ArmCord on Linux */
[armcord-platform="linux"] .container-2RRFHK {
padding-top: 45px;
top: -45px;
}
[armcord-platform="linux"] .titlebar {
height: 45px;
line-height: 45px;
}
[armcord-platform="linux"] .titlebar #window-controls-container {
line-height: 45px;
transform: translateY(-8px);
}
[armcord-platform="linux"] .titlebar #window-controls-container #minimize:hover { [armcord-platform="linux"] .titlebar #window-controls-container #minimize:hover {
background-color: #99aab5; background-color: var(--background-modifier-hover);
transition: 0.2s ease;
} }
[armcord-platform="linux"] .titlebar #window-controls-container #maximize:hover { [armcord-platform="linux"] .titlebar #window-controls-container #maximize:hover {
background-color: #99aab5; background-color: var(--background-modifier-hover);
transition: 0.2s ease;
}
[armcord-platform="linux"] .titlebar #window-controls-container #minimize:hover #minimize-icon {
background-color: var(--interactive-hover);
transition: 0.2s ease;
}
[armcord-platform="linux"] .titlebar #window-controls-container #maximize:hover #maximize-icon {
background-color: var(--interactive-hover);
transition: 0.2s ease;
} }
[armcord-platform="linux"] .titlebar #window-controls-container #quit:hover { [armcord-platform="linux"] .titlebar #window-controls-container #quit:hover {
background-color: #f04747; background-color: var(--brand-experiment-560);
transition: 0.2s ease;
}
[armcord-platform="linux"] .titlebar #window-controls-container #quit #quit-icon {
background-color: #ffffff;
display: list-item;
transition: 0.1s ease;
-webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='9' height='9' 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='9' height='9' 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%;
}
[armcord-platform="linux"] .titlebar #window-controls-container #minimize-icon {
background-color: var(--interactive-normal);
display: list-item;
-webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='9' height='9' 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='9' height='9' 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%;
}
[armcord-platform="linux"] .titlebar #window-controls-container #maximize-icon {
background-color: var(--interactive-normal);
display: list-item;
-webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='9' height='9' 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='9' height='9' 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%;
}
[armcord-platform="linux"][isMaximized] .titlebar #window-controls-container #maximize-icon {
background-color: var(--interactive-normal);
display: list-item;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='9' height='9'%3E%3Cstyle%3E%3C/style%3E%3Cpath fill-rule='evenodd' d='m6 0h24v24h-6v6h-24v-24h6zm3 6h15v15h3v-18h-18zm-6 21h18v-18h-18z'/%3E%3C/svg%3E")
no-repeat 50% 50%;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='9' height='9'%3E%3Cstyle%3E%3C/style%3E%3Cpath fill-rule='evenodd' d='m6 0h24v24h-6v6h-24v-24h6zm3 6h15v15h3v-18h-18zm-6 21h18v-18h-18z'/%3E%3C/svg%3E")
no-repeat 50% 50%;
}
[armcord-platform="linux"] .titlebar #window-controls-container #minimize {
background-color: transparent;
transition: 0.1s ease;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='25' height='25'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='25' height='25'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
}
[armcord-platform="linux"] .titlebar #window-controls-container #maximize {
background-color: transparent;
transition: 0.1s ease;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='25' height='25'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='25' height='25'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
}
[armcord-platform="linux"] .titlebar #window-controls-container #quit {
background-color: var(--brand-experiment);
transition: 0.1s ease;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='25' height='25'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='25' height='25'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
}
[armcord-platform="linux"] .titlebar #window-controls-container #quit:active {
background-color: var(--brand-experiment-600);
transition: 0.1s ease;
} }
/* ArmCord on Windows */ /* ArmCord on Windows */
[armcord-platform="win32"] .titlebar #window-controls-container {
width: 142px;
}
[armcord-platform="win32"] .titlebar #window-controls-container #minimize:hover { [armcord-platform="win32"] .titlebar #window-controls-container #minimize:hover {
background-color: var(--background-modifier-hover); background-color: var(--background-modifier-hover);
transition: 0.2s ease; transition: 0.2s ease;
@ -102,8 +190,7 @@
background-color: #000000cc; background-color: #000000cc;
transition: 0.1s ease; transition: 0.1s ease;
} }
[armcord-platform="win32"] .titlebar #window-controls-container #quit-icon {
.titlebar #window-controls-container #quit-icon {
background-color: var(--interactive-normal); background-color: var(--interactive-normal);
display: list-item; display: list-item;
-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") -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")
@ -111,7 +198,7 @@
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") 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%; no-repeat 50% 50%;
} }
.titlebar #window-controls-container #minimize-icon { [armcord-platform="win32"] .titlebar #window-controls-container #minimize-icon {
background-color: var(--interactive-normal); background-color: var(--interactive-normal);
display: list-item; display: list-item;
-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") -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")
@ -119,7 +206,7 @@
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") 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%; no-repeat 50% 50%;
} }
.titlebar #window-controls-container #maximize-icon { [armcord-platform="win32"] .titlebar #window-controls-container #maximize-icon {
background-color: var(--interactive-normal); background-color: var(--interactive-normal);
display: list-item; display: list-item;
-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") -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")
@ -128,7 +215,7 @@
no-repeat 50% 50%; no-repeat 50% 50%;
} }
[isMaximized] .titlebar #window-controls-container #maximize-icon { [armcord-platform="win32"][isMaximized] .titlebar #window-controls-container #maximize-icon {
background-color: var(--interactive-normal); background-color: var(--interactive-normal);
display: list-item; display: list-item;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='11' height='11'%3E%3Cstyle%3E%3C/style%3E%3Cpath fill-rule='evenodd' d='m6 0h24v24h-6v6h-24v-24h6zm3 6h15v15h3v-18h-18zm-6 21h18v-18h-18z'/%3E%3C/svg%3E") -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='11' height='11'%3E%3Cstyle%3E%3C/style%3E%3Cpath fill-rule='evenodd' d='m6 0h24v24h-6v6h-24v-24h6zm3 6h15v15h3v-18h-18zm-6 21h18v-18h-18z'/%3E%3C/svg%3E")
@ -137,7 +224,124 @@
no-repeat 50% 50%; no-repeat 50% 50%;
} }
.window-title { /* ArmCord on MacOS (Why would you do this?) */
[armcord-platform="darwin"] .container-2RRFHK {
padding-top: 45px;
top: -45px;
}
[armcord-platform="darwin"] .titlebar {
height: 45px;
line-height: 45px;
}
[armcord-platform="darwin"] .titlebar #window-controls-container {
float: left;
width: 150px;
height: 60%;
line-height: 45px;
-webkit-app-region: no-drag;
transform: translate(-78px, 4px);
}
[armcord-platform="darwin"] .titlebar #window-controls-container:hover #minimize #minimize-icon,
[armcord-platform="darwin"] .titlebar #window-controls-container:hover #maximize #maximize-icon,
[armcord-platform="darwin"] .titlebar #window-controls-container:hover #quit #quit-icon {
display: list-item;
}
[armcord-platform="darwin"] .titlebar #window-controls-container #quit #quit-icon {
background-color: #79282b;
-webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNS4yOTI4OSA2TDIuODE4MDEgMy41MjUxM0wzLjUyNTEyIDIuODE4MDJMNS45OTk5OSA1LjI5Mjg5TDguNDc0ODcgMi44MTgwMkw5LjE4MTk3IDMuNTI1MTNMNi43MDcxIDZMOS4xODE5NyA4LjQ3NDg3TDguNDc0ODcgOS4xODE5OEw1Ljk5OTk5IDYuNzA3MTFMMy41MjUxMiA5LjE4MTk4TDIuODE4MDEgOC40NzQ4N0w1LjI5Mjg5IDZaIiBmaWxsPSJyZ2JhKDEyOCwgNiwgMCwgMSkiLz48L3N2Zz4=")
no-repeat 50% 50%;
mask: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNS4yOTI4OSA2TDIuODE4MDEgMy41MjUxM0wzLjUyNTEyIDIuODE4MDJMNS45OTk5OSA1LjI5Mjg5TDguNDc0ODcgMi44MTgwMkw5LjE4MTk3IDMuNTI1MTNMNi43MDcxIDZMOS4xODE5NyA4LjQ3NDg3TDguNDc0ODcgOS4xODE5OEw1Ljk5OTk5IDYuNzA3MTFMMy41MjUxMiA5LjE4MTk4TDIuODE4MDEgOC40NzQ4N0w1LjI5Mjg5IDZaIiBmaWxsPSJyZ2JhKDEyOCwgNiwgMCwgMSkiLz48L3N2Zz4=")
no-repeat 50% 50%;
transform: translate(-0.3px, -11.7px);
}
[armcord-platform="darwin"] .titlebar #window-controls-container #minimize #minimize-icon {
background-color: #7d631b;
-webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTAgNS4zOTk5OUgyVjYuNTk5OTlIMTBWNS4zOTk5OVoiIGZpbGw9IiM5ODY4MDEiLz48L3N2Zz4=")
no-repeat 50% 50%;
mask: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTAgNS4zOTk5OUgyVjYuNTk5OTlIMTBWNS4zOTk5OVoiIGZpbGw9IiM5ODY4MDEiLz48L3N2Zz4=")
no-repeat 50% 50%;
transform: translate(-0px, -11.7px);
}
[armcord-platform="darwin"] .titlebar #window-controls-container #maximize #maximize-icon {
background-color: #1d7525;
-webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC41ODgyMyA2Ljk5MDE1TDUuMDA5NzkgMy40MTE3QzQuODU1ODMgMy4yNTc3NCA0Ljk1ODYgMi45OTQyMiA1LjE3NjE0IDIuOTg1MTRMOC45MTA0MiAyLjgyOTMxQzkuMDU2NTggMi44MjMyMSA5LjE3NjczIDIuOTQzMzUgOS4xNzA2MyAzLjA4OTUyTDkuMDE0NzkgNi44MjM4QzkuMDA1NzEgNy4wNDEzNCA4Ljc0MjE5IDcuMTQ0MTEgOC41ODgyMyA2Ljk5MDE1WiIgZmlsbD0iIzEyNUUxRSIvPjxwYXRoIGQ9Ik0zLjQxMTc3IDUuMDA5ODJMNi45OTAyMSA4LjU4ODI3QzcuMTQ0MTcgOC43NDIyMyA3LjA0MTQgOS4wMDU3NSA2LjgyMzg2IDkuMDE0ODNMMy4wODk1OCA5LjE3MDY2QzIuOTQzNDIgOS4xNzY3NiAyLjgyMzI3IDkuMDU2NjEgMi44MjkzNyA4LjkxMDQ1TDIuOTg1MjEgNS4xNzYxN0MyLjk5NDI5IDQuOTU4NjMgMy4yNTc4MSA0Ljg1NTg2IDMuNDExNzcgNS4wMDk4MloiIGZpbGw9IiMxMjVFMUUiLz48L3N2Zz4=")
no-repeat 50% 50%;
mask: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOC41ODgyMyA2Ljk5MDE1TDUuMDA5NzkgMy40MTE3QzQuODU1ODMgMy4yNTc3NCA0Ljk1ODYgMi45OTQyMiA1LjE3NjE0IDIuOTg1MTRMOC45MTA0MiAyLjgyOTMxQzkuMDU2NTggMi44MjMyMSA5LjE3NjczIDIuOTQzMzUgOS4xNzA2MyAzLjA4OTUyTDkuMDE0NzkgNi44MjM4QzkuMDA1NzEgNy4wNDEzNCA4Ljc0MjE5IDcuMTQ0MTEgOC41ODgyMyA2Ljk5MDE1WiIgZmlsbD0iIzEyNUUxRSIvPjxwYXRoIGQ9Ik0zLjQxMTc3IDUuMDA5ODJMNi45OTAyMSA4LjU4ODI3QzcuMTQ0MTcgOC43NDIyMyA3LjA0MTQgOS4wMDU3NSA2LjgyMzg2IDkuMDE0ODNMMy4wODk1OCA5LjE3MDY2QzIuOTQzNDIgOS4xNzY3NiAyLjgyMzI3IDkuMDU2NjEgMi44MjkzNyA4LjkxMDQ1TDIuOTg1MjEgNS4xNzYxN0MyLjk5NDI5IDQuOTU4NjMgMy4yNTc4MSA0Ljg1NTg2IDMuNDExNzcgNS4wMDk4MloiIGZpbGw9IiMxMjVFMUUiLz48L3N2Zz4=")
no-repeat 50% 50%;
transform: translate(-0.2px, -11.7px);
}
[armcord-platform="darwin"] .titlebar #window-controls-container #minimize {
background-color: #fac536;
border: 1px solid #da9e10;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='13' height='13'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='13' height='13'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
transform: translateX(-21.5px);
}
[armcord-platform="darwin"] .titlebar #window-controls-container #maximize {
background-color: #39ea49;
border: 1px solid #13c11e;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='13' height='13'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='13' height='13'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
transform: translateX(21.5px);
}
[armcord-platform="darwin"] .titlebar #window-controls-container #quit {
background-color: #f25056;
border: 1px solid #d52735;
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='13' height='13'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30' width='13' height='13'%3E%3Cstyle%3E.a%7Bfill:%23808080%7D%3C/style%3E%3Ccircle class='a' cx='15' cy='15' r='15'/%3E%3C/svg%3E")
no-repeat 50% 50%;
}
[armcord-platform="darwin"] .titlebar #window-controls-container:hover #maximize:active {
background-color: #13c11e;
}
[armcord-platform="darwin"] .titlebar #window-controls-container:hover #minimize:active {
background-color: #da9e10;
}
[armcord-platform="darwin"] .titlebar #window-controls-container:hover #quit:active {
background-color: #d52735;
}
[armcord-platform="darwin"] .titlebar #window-controls-container #spacer,
[armcord-platform="darwin"] .titlebar #window-controls-container #minimize,
[armcord-platform="darwin"] .titlebar #window-controls-container #maximize,
[armcord-platform="darwin"] .titlebar #window-controls-container #quit {
float: right;
height: 80%;
width: 13%;
text-align: center;
color: transparent;
cursor: default;
}
[armcord-platform="darwin"] .titlebar #window-controls-container #minimize-icon,
[armcord-platform="darwin"] .titlebar #window-controls-container #maximize-icon,
[armcord-platform="darwin"] .titlebar #window-controls-container #quit-icon {
display: none;
}
[armcord-platform="darwin"] .titlebar #window-controls-container #spacer {
display: none;
}
[armcord-platform="darwin"] .window-title {
content: var(--wordmark-svg);
height: 10px;
left: 50%;
margin-right: 50%;
transform: translate(50%, 9.5px);
float: right;
padding: 0;
}
[armcord-platform="linux"] .window-title,
[armcord-platform="win32"] .window-title {
content: var(--wordmark-svg); content: var(--wordmark-svg);
height: 10px; height: 10px;
margin-left: initial; margin-left: initial;
@ -146,6 +350,12 @@
padding: 0; padding: 0;
} }
[wordmark="discord"] .window-title {
content: var(--discord-wordmark-svg);
height: 11.7px;
width: 56px;
}
.withFrame-haYltI { .withFrame-haYltI {
height: 30px !important; height: 30px !important;
} }

View file

@ -12,9 +12,7 @@
<body> <body>
<div class="container"> <div class="container">
<div id="warning" class="hidden"> <div id="warning" class="hidden">
<p id="setup_offline"> <p id="setup_offline">You appear to be offline. Please connect to the internet and restart ArmCord.</p>
You appear to be offline. Please connect to the internet and restart ArmCord Setup.
</p>
</div> </div>
<div id="setup"> <div id="setup">
<div id="logo" class="hidden"></div> <div id="logo" class="hidden"></div>
@ -123,6 +121,7 @@
automaticPatches: false, automaticPatches: false,
mods: "cumcord", mods: "cumcord",
inviteWebsocket: true, inviteWebsocket: true,
trayIcon: "ac_plug_colored",
performanceMode: "none" performanceMode: "none"
}); });
setTimeout(() => window.armcordinternal.restart(), 5000); setTimeout(() => window.armcordinternal.restart(), 5000);
@ -153,6 +152,7 @@
minimizeToTray: true, minimizeToTray: true,
automaticPatches: false, automaticPatches: false,
performanceMode: "none", performanceMode: "none",
trayIcon: "ac_plug_colored",
mods: options.mod, mods: options.mod,
inviteWebsocket: true inviteWebsocket: true
}); });
@ -168,11 +168,13 @@
autoLaunch: true, autoLaunch: true,
mods: "none", mods: "none",
performanceMode: "none", performanceMode: "none",
trayIcon: "ac_plug_colored",
inviteWebsocket: true inviteWebsocket: true
}); });
setTimeout(() => window.armcordinternal.restart(), 500); setTimeout(() => window.armcordinternal.restart(), 500);
} }
}); });
document.body.setAttribute("insetup", "");
</script> </script>
</body> </body>
</html> </html>

View file

@ -6,6 +6,13 @@
<style> <style>
@import url("css/splash.css"); @import url("css/splash.css");
</style> </style>
<script>
window.onbeforeunload = function () {
const style = document.createElement("style");
style.textContent = "body { display: none; }";
document.head.append(style);
};
</script>
</head> </head>
<body> <body>
@ -23,7 +30,7 @@
text.innerHTML = await armcord.getLang("loading_screen_offline"); text.innerHTML = await armcord.getLang("loading_screen_offline");
} else { } else {
text.innerHTML = await armcord.getLang("loading_screen_start"); text.innerHTML = await armcord.getLang("loading_screen_start");
if (window.armcord.version === "DEV") { if (window.armcord.version === "3.1.0") {
console.log("Running a development build of ArmCord. Skipping updater."); console.log("Running a development build of ArmCord. Skipping updater.");
} else { } else {
const response = await fetch("https://armcord.xyz/latest.json"); const response = await fetch("https://armcord.xyz/latest.json");

View file

@ -1,6 +1,6 @@
//https://github.com/GooseMod/GooseMod/wiki/Stuck-Updater-or-Blank-Window-Fix //https://github.com/GooseMod/GooseMod/wiki/Stuck-Updater-or-Blank-Window-Fix
/* /*
Copyright 2021 GooseMod Copyright 2022 GooseMod
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@ -60,6 +60,6 @@ electron.app.whenReady().then(async () => {
if (await getConfig("armcordCSP")) { if (await getConfig("armcordCSP")) {
unstrictCSP(); unstrictCSP();
} else { } else {
console.log("ArmCord CSP is disabled. The CSP should be managed by third-party plugin."); console.log("ArmCord CSP is disabled. The CSP should be managed by a third-party plugin(s).");
} }
}); });

View file

@ -1,7 +1,7 @@
//ipc stuff //ipc stuff
import {app, ipcMain, shell, desktopCapturer} from "electron"; import {app, ipcMain, shell, desktopCapturer} from "electron";
import {mainWindow} from "./window"; import {mainWindow} from "./window";
import {setConfigBulk, getVersion, getConfig, setLang, getLang} from "./utils"; import {setConfigBulk, getVersion, getConfig, setLang, getLang, getWindowState} from "./utils";
import {customTitlebar} from "./main"; import {customTitlebar} from "./main";
import {createSettingsWindow} from "./settings/main"; import {createSettingsWindow} from "./settings/main";
export function registerIpc() { export function registerIpc() {
@ -23,6 +23,9 @@ export function registerIpc() {
ipcMain.on("win-isMaximized", (event, arg) => { ipcMain.on("win-isMaximized", (event, arg) => {
event.returnValue = mainWindow.isMaximized(); event.returnValue = mainWindow.isMaximized();
}); });
ipcMain.on("win-isNormal", (event, arg) => {
event.returnValue = mainWindow.isNormal();
});
ipcMain.on("win-minimize", (event, arg) => { ipcMain.on("win-minimize", (event, arg) => {
mainWindow.minimize(); mainWindow.minimize();
}); });
@ -41,8 +44,22 @@ export function registerIpc() {
ipcMain.on("get-app-version", (event) => { ipcMain.on("get-app-version", (event) => {
event.returnValue = getVersion(); event.returnValue = getVersion();
}); });
ipcMain.on("splashEnd", (event, arg) => { ipcMain.on("splashEnd", async (event, arg) => {
mainWindow.setSize(800, 600); try {
var width = await getWindowState("width") ?? 800;
var height= await getWindowState("height") ?? 600;
var isMaximized = await getWindowState("isMaximized") ?? false;
} catch (e) {
console.log("No window state file found. Fallbacking to default values.")
mainWindow.setSize(800, 600);
}
if (isMaximized) {
mainWindow.setSize(800, 600); //just so the whole thing doesn't cover whole screen
mainWindow.maximize()
} else {
mainWindow.setSize(width, height);
console.log("Not maximized.")
}
}); });
ipcMain.on("restart", (event, arg) => { ipcMain.on("restart", (event, arg) => {
app.relaunch(); app.relaunch();
@ -60,6 +77,9 @@ export function registerIpc() {
ipcMain.on("clientmod", async (event, arg) => { ipcMain.on("clientmod", async (event, arg) => {
event.returnValue = await getConfig("mods"); event.returnValue = await getConfig("mods");
}); });
ipcMain.on("trayIcon", async (event, arg) => {
event.returnValue = await getConfig("trayIcon");
});
ipcMain.on("titlebar", (event, arg) => { ipcMain.on("titlebar", (event, arg) => {
event.returnValue = customTitlebar; event.returnValue = customTitlebar;
}); });

View file

@ -10,7 +10,7 @@ import "./shortcuts";
export var settings: any; export var settings: any;
export var customTitlebar: boolean; export var customTitlebar: boolean;
export var clientName: "ArmCord";
if (process.platform == "linux") { if (process.platform == "linux") {
if (process.env.$XDG_SESSION_TYPE == "wayland") { if (process.env.$XDG_SESSION_TYPE == "wayland") {
@ -34,7 +34,7 @@ app.whenReady().then(async () => {
case "native": case "native":
createNativeWindow(); createNativeWindow();
break; break;
case "discord": case "basic":
createNativeWindow(); createNativeWindow();
break; break;
default: default:
@ -68,6 +68,7 @@ app.whenReady().then(async () => {
createCustomWindow(); createCustomWindow();
break; break;
} }
console.log("userDataPath = " + app.getPath("userData"));
}); });
}); });

View file

@ -15,7 +15,6 @@ contextBridge.exposeInMainWorld("armcord", {
}, },
electron: process.versions.electron, electron: process.versions.electron,
channel: ipcRenderer.sendSync("channel"), channel: ipcRenderer.sendSync("channel"),
openTab: (number: number) => ipcRenderer.sendSync("openTab", number),
setLang: (lang: string) => ipcRenderer.send("setLang", lang), setLang: (lang: string) => ipcRenderer.send("setLang", lang),
getLang: (toGet: string) => getLang: (toGet: string) =>
ipcRenderer.invoke("getLang", toGet).then((result) => { ipcRenderer.invoke("getLang", toGet).then((result) => {

View file

@ -28,6 +28,9 @@ const clientMods = {
}; };
console.log("ArmCord"); console.log("ArmCord");
ipcRenderer.on("themeLoader", (event, message) => {
addStyle(message);
});
if (window.location.href.indexOf("splash.html") > -1) { if (window.location.href.indexOf("splash.html") > -1) {
console.log("Skipping titlebar injection and client mod injection."); console.log("Skipping titlebar injection and client mod injection.");
} else { } else {
@ -90,6 +93,5 @@ setInterval(() => {
el.textContent = `\nArmCord Version: ${version}`; el.textContent = `\nArmCord Version: ${version}`;
el.onclick = () => ipcRenderer.send("openSettingsWindow"); el.onclick = () => ipcRenderer.send("openSettingsWindow");
host.append(el); host.append(el);
}, 2000); }, 2000);

View file

@ -2,7 +2,7 @@ import {ipcRenderer} from "electron";
import {addStyle} from "../utils"; import {addStyle} from "../utils";
import * as fs from "fs"; import * as fs from "fs";
import * as path from "path"; import * as path from "path";
import {platform} from "node:process"; import os from "os";
export function injectTitlebar() { export function injectTitlebar() {
document.addEventListener("DOMContentLoaded", function (event) { document.addEventListener("DOMContentLoaded", function (event) {
var elem = document.createElement("div"); var elem = document.createElement("div");
@ -25,7 +25,8 @@ export function injectTitlebar() {
const wordmarkcssPath = path.join(__dirname, "../", "/content/css/logos.css"); const wordmarkcssPath = path.join(__dirname, "../", "/content/css/logos.css");
addStyle(fs.readFileSync(titlebarcssPath, "utf8")); addStyle(fs.readFileSync(titlebarcssPath, "utf8"));
addStyle(fs.readFileSync(wordmarkcssPath, "utf8")); addStyle(fs.readFileSync(wordmarkcssPath, "utf8"));
document.body.setAttribute("armcord-platform", platform); document.body.setAttribute("customTitlebar", "");
document.body.setAttribute("armcord-platform", "win32");
var minimize = document.getElementById("minimize"); var minimize = document.getElementById("minimize");
var maximize = document.getElementById("maximize"); var maximize = document.getElementById("maximize");
@ -38,7 +39,8 @@ export function injectTitlebar() {
maximize!.addEventListener("click", () => { maximize!.addEventListener("click", () => {
if (ipcRenderer.sendSync("win-isMaximized") == true) { if (ipcRenderer.sendSync("win-isMaximized") == true) {
ipcRenderer.send("win-unmaximize"); ipcRenderer.send("win-unmaximize");
} else { document.body.removeAttribute("isMaximized");
} else if (ipcRenderer.sendSync("win-isNormal") == true) {
ipcRenderer.send("win-maximize"); ipcRenderer.send("win-maximize");
} }
}); });
@ -52,6 +54,3 @@ export function injectTitlebar() {
}); });
}); });
} }
export function removeTitlebar() {
document.querySelector("#titlebar")!.remove();
}

View file

@ -66,7 +66,18 @@
</select> </select>
<p class="header" id="settings-prfmMode">Performance mode:</p> <p class="header" id="settings-prfmMode">Performance mode:</p>
</div> </div>
<button id="settings-save" class="center">Save settings</button> <div class="switch">
<select name="trayIcon" id="trayIcon" class="left">
<option value="ac_plug_colored">Default</option>
<option value="dsc-tray">Discord Icon</option>
<option value="ac_white_plug">White Icon</option>
<option value="ac_black_plug">Black Icon</option>
<option value="ac_white_plug_hollow">White Hollowed Icon</option>
<option value="ac_black_plug_hollow">Black Hollowed Icon</option>
</select>
<p class="header" id="settings-trayIcon">Tray icon:</p>
</div>
<button id="settings-save" class="center">Save Settings</button>
</body> </body>
<script> <script>
async function loadLang() { async function loadLang() {
@ -101,6 +112,7 @@
document.getElementById("channel").value = await settings.get("channel"); document.getElementById("channel").value = await settings.get("channel");
document.getElementById("theme").value = await settings.get("windowStyle"); document.getElementById("theme").value = await settings.get("windowStyle");
document.getElementById("prfmMode").value = await settings.get("performanceMode"); document.getElementById("prfmMode").value = await settings.get("performanceMode");
document.getElementById("trayIcon").value = await settings.get("trayIcon");
} }
loadSettings(); loadSettings();
document.getElementById("settings-save").addEventListener("click", function () { document.getElementById("settings-save").addEventListener("click", function () {
@ -113,6 +125,7 @@
mods: document.getElementById("mod").value, mods: document.getElementById("mod").value,
inviteWebsocket: document.getElementById("websocket").checked, inviteWebsocket: document.getElementById("websocket").checked,
performanceMode: document.getElementById("prfmMode").value, performanceMode: document.getElementById("prfmMode").value,
trayIcon: document.getElementById("trayIcon").value,
doneSetup: true doneSetup: true
}); });
}); });

View file

@ -14,5 +14,10 @@ app.on("web-contents-created", (webContentsCreatedEvent, webContents) => {
if (shift && control && !alt && !meta && code === "KeyR") { if (shift && control && !alt && !meta && code === "KeyR") {
mainWindow.reload(); mainWindow.reload();
} }
// Shortcut: app reload
if (alt && control && !shift && !meta && code === "KeyR") {
app.relaunch();
app.exit();
}
}); });
}); });

View file

@ -23,7 +23,7 @@ import type {Server, WebSocket} from "ws";
import {inviteWindow, createInviteWindow} from "./window"; import {inviteWindow, createInviteWindow} from "./window";
async function wsLog(message: string, ...args: unknown[]) { async function wsLog(message: string, ...args: unknown[]) {
console.log("[WebSocket]" + message, ...args); console.log("[WebSocket] " + message, ...args);
} }
/** Generates an inclusive range (as `Array`) from `start` to `end`. */ /** Generates an inclusive range (as `Array`) from `start` to `end`. */

View file

@ -1,75 +1,128 @@
import {app, Menu, Tray} from "electron"; import * as fs from "fs";
import {mainWindow} from "./window"; import { app, Menu, Tray } from "electron";
import {getConfig} from "./utils"; import { mainWindow } from "./window";
import { getConfig, getConfigLocation, setWindowState } from "./utils";
import * as path from "path"; import * as path from "path";
import {createSettingsWindow} from "./settings/main"; import { createSettingsWindow } from "./settings/main";
import {platform} from "process";
let tray: any = null; let tray: any = null;
let defaultIcon = "ac_plug_colored";
app.whenReady().then(async () => { app.whenReady().then(async () => {
if (platform == "darwin") { let finishedSetup = (await getConfig("doneSetup"));
defaultIcon = "macos" if ((await getConfig("windowStyle")) == "basic") {
} var clientName = (await getConfig("clientName")) ?? "ArmCord";
if ((await getConfig("windowStyle")) == "discord") { var trayIcon = (await getConfig("trayIcon")) ?? "ac_plug_colored";
tray = new Tray(path.join(__dirname, "../", "/assets/dsc-tray.png")); tray = new Tray(path.join(__dirname, "../", `/assets/${trayIcon}.png`));
const contextMenu = Menu.buildFromTemplate([ const contextMenu = function () {
{ if (finishedSetup == false) {
label: "Open ArmCord", return Menu.buildFromTemplate([
click: function () { {
mainWindow.show(); label: `Finish the setup first!`,
} enabled: false
}, },
{ {
label: "Quit ArmCord", label: `Quit ${clientName}`,
click: function () { click: async function () {
app.quit(); fs.unlink(await getConfigLocation(), (err) => {
} if (err) throw err;
console.log('Closed during setup. "settings.json" was deleted');
app.quit();
});
}
}
]);
} else {
return Menu.buildFromTemplate([
{
label: `Open ${clientName}`,
click: function () {
mainWindow.show();
}
},
{
label: `Quit ${clientName}`,
click: function () {
let [width, height] = mainWindow.getSize()
setWindowState({
width: width,
height: height,
isMaximized: mainWindow.isMaximized()
})
app.quit();
}
}
]);
} }
]); }
tray.setToolTip("Discord"); tray.setToolTip(clientName);
tray.setContextMenu(contextMenu); tray.setContextMenu(contextMenu);
} else { } else {
var trayIcon = (await getConfig("trayIcon")) ?? defaultIcon; var clientName = (await getConfig("clientName")) ?? "ArmCord";
var trayIcon = (await getConfig("trayIcon")) ?? "ac_plug_colored";
tray = new Tray(path.join(__dirname, "../", `/assets/${trayIcon}.png`)); tray = new Tray(path.join(__dirname, "../", `/assets/${trayIcon}.png`));
const contextMenu = Menu.buildFromTemplate([ if (finishedSetup == false) {
{ const contextMenu = Menu.buildFromTemplate([
label: "ArmCord" {
}, label: `Finish the setup first!`,
{ enabled: false
type: "separator" },
}, {
{ label: `Quit ${clientName}`,
label: "Open ArmCord", click: async function () {
click: function () { fs.unlink(await getConfigLocation(), (err) => {
mainWindow.show(); if (err) throw err;
} console.log('Closed during setup. "settings.json" was deleted');
}, app.quit();
{ });
label: "Open Settings", }
click: function () {
createSettingsWindow();
}
},
{
label: "Support Discord Server",
click: function () {
mainWindow.show();
mainWindow.loadURL("https://discord.gg/TnhxcqynZ2");
}
},
{
type: "separator"
},
{
label: "Quit ArmCord",
click: function () {
app.quit();
} }
]);
tray.setContextMenu(contextMenu);
} else {
const contextMenu = Menu.buildFromTemplate([
{
label: `${clientName} ` + app.getVersion(),
enabled: false
},
{
type: "separator"
},
{
label: `Open ${clientName}`,
click: function () {
mainWindow.show();
}
},
{
label: "Open Settings",
click: function () {
createSettingsWindow();
}
},
{
label: "Support Discord Server",
click: function () {
mainWindow.show();
mainWindow.loadURL("https://discord.gg/TnhxcqynZ2");
}
},
{
type: "separator"
},
{
label: `Quit ${clientName}`,
click: function () {
app.quit();
}
}
]);
tray.setContextMenu(contextMenu);
} }
]); }
tray.setToolTip("ArmCord " + app.getVersion()); tray.setToolTip(clientName);
tray.setContextMenu(contextMenu); tray.on('click', function(){
mainWindow.show()
});
} }
}); );

View file

@ -1,7 +1,6 @@
import * as fs from "fs"; import * as fs from "fs";
import {app, dialog} from "electron"; import { app, dialog } from "electron";
import path from "path"; import path from "path";
import {defaultMaxListeners} from "events";
export var firstRun: boolean; export var firstRun: boolean;
export var isSetup: boolean; export var isSetup: boolean;
export var contentPath: string; export var contentPath: string;
@ -44,6 +43,7 @@ export function setup() {
mods: "cumcord", mods: "cumcord",
performanceMode: "none", performanceMode: "none",
inviteWebsocket: true, inviteWebsocket: true,
trayIcon: "ac_plug_colored",
doneSetup: false doneSetup: false
}; };
setConfigBulk({ setConfigBulk({
@ -52,8 +52,8 @@ export function setup() {
} }
export function getVersion() { export function getVersion() {
//to-do better way of doing this //I'm too lazy to replace every mf reference so :p
return "3.1.0"; return app.getVersion();
} }
export async function injectJS(inject: string) { export async function injectJS(inject: string) {
const js = await (await fetch(`${inject}`)).text(); const js = await (await fetch(`${inject}`)).text();
@ -119,12 +119,17 @@ export async function setLang(language: string) {
var language: string; var language: string;
export async function getLang(object: string) { export async function getLang(object: string) {
if (language == undefined) { if (language == undefined) {
const userDataPath = app.getPath("userData"); try {
const storagePath = path.join(userDataPath, "/storage/"); const userDataPath = app.getPath("userData");
const langConfigFile = storagePath + "lang.json"; const storagePath = path.join(userDataPath, "/storage/");
let rawdata = fs.readFileSync(langConfigFile, "utf-8"); const langConfigFile = storagePath + "lang.json";
let parsed = JSON.parse(rawdata); let rawdata = fs.readFileSync(langConfigFile, "utf-8");
language = parsed["lang"]; let parsed = JSON.parse(rawdata);
language = parsed["lang"];
} catch (e) {
console.log("Language config file doesn't exist. Fallback to English.")
language = "en-US"
}
} }
if (language.length == 2) { if (language.length == 2) {
language = language + "-" + language.toUpperCase(); language = language + "-" + language.toUpperCase();
@ -137,6 +142,33 @@ export async function getLang(object: string) {
let parsed = JSON.parse(rawdata); let parsed = JSON.parse(rawdata);
return parsed[object]; return parsed[object];
} }
//ArmCord Window State manager
export interface WindowState {
width: number;
height: number;
isMaximized: boolean;
}
export async function setWindowState(object: WindowState) {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
const saveFile = storagePath + "window.json";
if (!fs.existsSync(saveFile)) {
fs.writeFileSync(saveFile, "{}", "utf-8");
}
let toSave = JSON.stringify(object);
fs.writeFileSync(saveFile, toSave, "utf-8");
}
export async function getWindowState(object: string) {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
const settingsFile = storagePath + "window.json";
let rawdata = fs.readFileSync(settingsFile, "utf-8");
let returndata = JSON.parse(rawdata);
console.log(object + ": " + returndata[object]);
return returndata[object];
}
//ArmCord Settings/Storage manager //ArmCord Settings/Storage manager
export interface Settings { export interface Settings {
@ -148,6 +180,7 @@ export interface Settings {
mods: string; mods: string;
performanceMode: string; performanceMode: string;
inviteWebsocket: boolean; inviteWebsocket: boolean;
trayIcon: string;
doneSetup: boolean; doneSetup: boolean;
} }
export async function getConfig(object: string) { export async function getConfig(object: string) {
@ -165,6 +198,17 @@ export async function getConfig(object: string) {
return "setup"; return "setup";
} }
} }
export async function getConfigLocation() {
try {
const userDataPath = app.getPath("userData");
const storagePath = path.join(userDataPath, "/storage/");
return storagePath + "settings.json";
} catch (e) {
console.log("Config probably doesn't exist yet. Returning setup value.");
firstRun = true;
return "setup";
}
}
export async function setConfig(object: string, toSet: any) { export async function setConfig(object: string, toSet: any) {
try { try {
const userDataPath = app.getPath("userData"); const userDataPath = app.getPath("userData");

View file

@ -2,10 +2,11 @@
// I had to add most of the window creation code here to split both into seperete functions // I had to add most of the window creation code here to split both into seperete functions
// WHY? Because I can't use the same code for both due to annoying bug with value `frame` not responding to variables // WHY? Because I can't use the same code for both due to annoying bug with value `frame` not responding to variables
// I'm sorry for this mess but I'm not sure how to fix it. // I'm sorry for this mess but I'm not sure how to fix it.
import {BrowserWindow, shell, app, dialog} from "electron"; import { BrowserWindow, shell, app, dialog } from "electron";
import path from "path"; import path from "path";
import {checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig, setLang} from "./utils"; import { checkIfConfigIsBroken, firstRun, getConfig, contentPath, isSetup, setConfig, setLang, setWindowState } from "./utils";
import {registerIpc} from "./ipc"; import { registerIpc } from "./ipc";
import * as fs from "fs";
import startServer from "./socket"; import startServer from "./socket";
import contextMenu from "electron-context-menu"; import contextMenu from "electron-context-menu";
import os from "os"; import os from "os";
@ -24,13 +25,13 @@ async function doAfterDefiningTheWindow() {
var ignoreProtocolWarning = await getConfig("ignoreProtocolWarning"); var ignoreProtocolWarning = await getConfig("ignoreProtocolWarning");
checkIfConfigIsBroken(); checkIfConfigIsBroken();
registerIpc(); registerIpc();
// A little sloppy but it works :p // A little sloppy but it works :p
if (osType == 'Windows_NT') { if (osType == 'Windows_NT') {
osType = "Windows " + os.release().split('.')[0] + " (" + os.release() + ")"; osType = "Windows " + os.release().split('.')[0] + " (" + os.release() + ")";
} }
mainWindow.webContents.userAgent = `Mozilla/5.0 (X11; ${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`; //fake useragent for screenshare to work mainWindow.webContents.userAgent = `Mozilla/5.0 (X11; ${osType} ${os.arch()}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`; //fake useragent for screenshare to work
mainWindow.webContents.setWindowOpenHandler(({url}) => { mainWindow.webContents.setWindowOpenHandler(({ url }) => {
if (url.startsWith("https:" || url.startsWith("http:") || url.startsWith("mailto:"))) { if (url.startsWith("https:" || url.startsWith("http:") || url.startsWith("mailto:"))) {
shell.openExternal(url); shell.openExternal(url);
} else { } else {
@ -48,7 +49,7 @@ async function doAfterDefiningTheWindow() {
checkboxChecked: false checkboxChecked: false
}; };
dialog.showMessageBox(mainWindow, options).then(({response, checkboxChecked}) => { dialog.showMessageBox(mainWindow, options).then(({ response, checkboxChecked }) => {
console.log(response, checkboxChecked); console.log(response, checkboxChecked);
if (checkboxChecked) { if (checkboxChecked) {
if (response == 0) { if (response == 0) {
@ -65,13 +66,38 @@ async function doAfterDefiningTheWindow() {
}); });
} }
} }
return {action: "deny"}; return { action: "deny" };
}); });
mainWindow.webContents.session.webRequest.onBeforeRequest((details, callback) => { mainWindow.webContents.session.webRequest.onBeforeRequest((details, callback) => {
if (/api\/v\d\/science$/g.test(details.url)) return callback({cancel: true}); if (/api\/v\d\/science$/g.test(details.url)) return callback({ cancel: true });
return callback({}); return callback({});
}); });
const userDataPath = app.getPath("userData");
const themesFolder = userDataPath + "/themes/";
if (!fs.existsSync(themesFolder)) {
fs.mkdirSync(themesFolder);
console.log("Created missing theme folder");
}
mainWindow.webContents.on('did-finish-load', () => {
fs.readdirSync(themesFolder).forEach((file) => {
try {
const manifest = fs.readFileSync(`${themesFolder}/${file}/manifest.json`, "utf8");
var themeFile = JSON.parse(manifest);
mainWindow.webContents.send("themeLoader", fs.readFileSync(`${themesFolder}/${file}/${themeFile.theme}`, "utf-8"))
console.log(`%cLoaded ${themeFile.name} made by ${themeFile.author}`, "color:red");
} catch (err) {
console.error(err);
}
});
});
mainWindow.on("close", async (e) => { mainWindow.on("close", async (e) => {
let [width, height] = mainWindow.getSize()
setWindowState({
width: width,
height: height,
isMaximized: mainWindow.isMaximized()
})
if (await getConfig("minimizeToTray")) { if (await getConfig("minimizeToTray")) {
e.preventDefault(); e.preventDefault();
mainWindow.hide(); mainWindow.hide();
@ -80,10 +106,10 @@ async function doAfterDefiningTheWindow() {
app.quit(); app.quit();
} }
}); });
mainWindow.on('maximize',() =>{ mainWindow.on('maximize', () => {
mainWindow.webContents.executeJavaScript(`document.body.setAttribute("isMaximized", "");`) mainWindow.webContents.executeJavaScript(`document.body.setAttribute("isMaximized", "");`)
}) })
mainWindow.on('unmaximize',() =>{ mainWindow.on('unmaximize', () => {
mainWindow.webContents.executeJavaScript(`document.body.removeAttribute("isMaximized");`) mainWindow.webContents.executeJavaScript(`document.body.removeAttribute("isMaximized");`)
}) })
console.log(contentPath); console.log(contentPath);