26 Commits

Author SHA1 Message Date
Vendicated
c5165afe7f Unexplode release workflow 2023-04-10 19:38:32 +02:00
Vendicated
e16cdcf387 Bump to 0.1.5 2023-04-10 19:27:14 +02:00
Vendicated
1c2ed4679d Fix custom vencord location 2023-04-10 19:26:59 +02:00
Ryan Cao
af42af070e feat: implement translucency for macOS (#4)
Co-authored-by: Vendicated <vendicated@riseup.net>
2023-04-10 19:21:45 +02:00
Vendicated
07d647ba2e Fix outdated code 2023-04-10 19:20:16 +02:00
Vendicated
90b8c5fdfe lint 2023-04-10 19:18:00 +02:00
Vendicated
c0598821ee Add test workflow 2023-04-10 19:17:01 +02:00
Kode
de3aae1d95 Tray: Option to hide (#7)
Co-authored-by: V <vendicated@riseup.net>
2023-04-10 19:12:58 +02:00
Vendicated
d1acb0490b small fix 2023-04-10 03:26:55 +02:00
Vendicated
60759c142e Increase window size on enable min size 2023-04-10 01:55:48 +02:00
Vendicated
0c77dbec92 Improve SettingsStore, add disableMinSize listener 2023-04-10 01:43:47 +02:00
Vendicated
edfeca15ce add some jsdoc 2023-04-10 01:16:44 +02:00
Vendicated
c2eaa9d35a Rewrite settings proxy to proper store 2023-04-10 01:04:41 +02:00
Vendicated
ddebb6563a apply lint 2023-04-09 22:55:12 +02:00
Vendicated
df53ea549a Add eslint config 2023-04-09 22:55:12 +02:00
Vendicated
a4954570b6 smaller version 2023-04-09 22:31:17 +02:00
Vendicated
ca376d35ab Important splash screen fix 2023-04-09 22:30:34 +02:00
Sofia Lima
db76f111c8 add workflow for updating AUR package (#6) 2023-04-09 21:36:05 +02:00
Vendicated
5efbbe2106 Improve settings texts 2023-04-09 06:05:52 +02:00
Vendicated
c29dd6d2d7 Add option to not minimize to tray 2023-04-09 05:57:45 +02:00
Vendicated
94b80ebe75 Fix comment location 2023-04-09 05:26:50 +02:00
Vendicated
bba8899f67 Implement frameless & windows ctrl q settings 2023-04-09 05:25:45 +02:00
Vendicated
ba0e8fedd0 Add minimum window height & width 2023-04-09 05:04:58 +02:00
V
27b6264c79 Update README.md 2023-04-09 04:35:27 +02:00
V
81929f1733 Add AUR package to README 2023-04-09 04:35:04 +02:00
Vendicated
d7e2dd0593 Remove pacman target its kinda scam 2023-04-09 04:23:52 +02:00
40 changed files with 2622 additions and 259 deletions

63
.eslintrc.json Normal file
View File

@@ -0,0 +1,63 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"ignorePatterns": ["dist", "node_modules"],
"plugins": [
"@typescript-eslint",
"license-header",
"simple-import-sort",
"unused-imports",
"path-alias",
"prettier"
],
"settings": {
"import/resolver": {
"alias": {
"map": []
}
}
},
"rules": {
"license-header/header": ["error", "scripts/header.txt"],
"eqeqeq": ["error", "always", { "null": "ignore" }],
"spaced-comment": ["error", "always", { "markers": ["!"] }],
"yoda": "error",
"prefer-destructuring": ["error", { "object": true, "array": false }],
"operator-assignment": ["error", "always"],
"no-useless-computed-key": "error",
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
"no-invalid-regexp": "error",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-duplicate-imports": "error",
"no-extra-semi": "error",
"dot-notation": "error",
"no-useless-escape": "error",
"no-fallthrough": "error",
"for-direction": "error",
"no-async-promise-executor": "error",
"no-cond-assign": "error",
"no-dupe-else-if": "error",
"no-duplicate-case": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-prototype-builtins": "error",
"no-regex-spaces": "error",
"no-shadow-restricted-names": "error",
"no-unexpected-multiline": "error",
"no-unsafe-optional-chaining": "error",
"no-useless-backreference": "error",
"use-isnan": "error",
"prefer-const": "error",
"prefer-spread": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"unused-imports/no-unused-imports": "error",
"path-alias/no-relative": "error",
"prettier/prettier": "error"
}
}

View File

@@ -1,28 +1,42 @@
name: Release
on:
push:
tags:
- v*
push:
tags:
- v*
jobs:
release:
runs-on: ${{ matrix.os }}
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Check out Git repository
uses: actions/checkout@v3
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Run Electron Builder
uses: samuelmeuli/action-electron-builder@e4b12cd06ddf023422f1ac4e39632bd76f6e6928
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE: true
- name: Run Electron Builder
uses: samuelmeuli/action-electron-builder@e4b12cd06ddf023422f1ac4e39632bd76f6e6928
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE: true
- name: Update AUR package
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt install makepkg
echo $SSH_KEY > ~/.ssh/aur
echo $SSH_PUB_KEY > ~/.ssh/aur.pub
export GIT_SSH_COMMAND="ssh -i ~/.ssh/aur"
./scripts/aur_bump.sh
env:
SSH_KEY: ${{ secrets.AUR_SSH_KEY }}
SSH_PUB_KEY: ${{ secrets.AUR_SSH_PUB_KEY }}

32
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 # Install pnpm using packageManager key in package.json
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test
- name: Test if it compiles
run: |
pnpm build
pnpm build --dev

View File

@@ -5,4 +5,4 @@ trailingComma: none
bracketSpacing: true
arrowParens: avoid
useTabs: false
endOfLine: auto
endOfLine: lf

18
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,18 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

View File

@@ -16,6 +16,10 @@ Download and run Vencord-Desktop-VERSION.dmg from [releases](https://github.com/
### Linux
#### Arch based
Install [vencord-desktop-git](https://aur.archlinux.org/packages/vencord-desktop-git) from the AUR using your favourite AUR helper, for example [yay](https://github.com/Jguer/yay)
#### Ubuntu/Debian based
Download Vencord-Desktop-VERSION.deb from [releases](https://github.com/Vencord/Desktop/releases/latest)
@@ -28,7 +32,7 @@ Download Vencord-Desktop-VERSION.rpm from [releases](https://github.com/Vencord/
Either download Vencord-Desktop-VERSION.AppImage and just run it directly or grab Vencord-Desktop-VERSION.tar.gz, extract it somewhere and run `vencorddesktop`.
An AUR package and flatpak are planned, if you want packages for other repos, feel free to create them and they can be linked as unofficial here
A flatpak is planned, if you want packages for other repos, feel free to create them and they can be linked as unofficial here
## Building

View File

@@ -1,6 +1,6 @@
{
"name": "VencordDesktop",
"version": "0.1.4",
"version": "0.1.5",
"private": true,
"description": "",
"keywords": [],
@@ -12,23 +12,42 @@
"build": "tsx scripts/build/build.mts",
"package": "pnpm build && electron-builder",
"package:dir": "pnpm build && electron-builder --dir",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "pnpm lint --fix",
"start": "pnpm build && electron .",
"start:dev": "pnpm build --dev && electron .",
"start:watch": "tsx scripts/startWatch.mts",
"test": "echo \"Error: no test specified\" && exit 1",
"test": "pnpm lint && pnpm testTypes",
"testTypes": "tsc --noEmit",
"watch": "pnpm build --watch"
},
"devDependencies": {
"@types/node": "^18.15.11",
"@types/react": "^18.0.33",
"@typescript-eslint/eslint-plugin": "^5.57.1",
"@typescript-eslint/parser": "^5.57.1",
"electron": "^23.2.0",
"electron-builder": "^23.6.0",
"esbuild": "^0.17.14",
"eslint": "^8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-license-header": "^0.6.0",
"eslint-plugin-path-alias": "^1.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"prettier": "^2.8.7",
"source-map-support": "^0.5.21",
"tsx": "^3.12.6",
"type-fest": "^3.8.0",
"typescript": "^5.0.2"
},
"packageManager": "pnpm@8.1.1",
"engines": {
"node": ">=18",
"pnpm": ">=8"
},
"build": {
"appId": "dev.vencord.desktop",
"productName": "Vencord Desktop",
@@ -46,8 +65,7 @@
"deb",
"tar.gz",
"rpm",
"AppImage",
"pacman"
"AppImage"
],
"desktop": {
"Name": "Vencord Desktop",

1832
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

20
scripts/aur_bump.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh
set -e
VERSION=$(git describe --tags --abbrev=0 | tr -d 'v')
SHASUM=$(sha256sum "dist/VencordDesktop-$VERSION.tar.gz" | awk '{ print $1 }')
git clone ssh://aur@aur.archlinux.org/vencord-desktop-bin.git aurpkg
cd aurpkg
sed -i "s/^pkgver=.*$/pkgver=$VERSION/" PKGBUILD
sed -i "s/^sha256sums=('.*'/sha256sums=('$SHASUM'/" PKGBUILD
makepkg --printsrcinfo > .SRCINFO
git commit -a -m "Bump version to $VERSION"
git push
cd ..
rm -rf aurpkg

5
scripts/header.txt Normal file
View File

@@ -0,0 +1,5 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/

8
src/globals.d.ts vendored
View File

@@ -1,3 +1,9 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
declare global {
export var VencordDesktopNative: typeof import("preload/VencordDesktopNative").VencordDesktopNative;
export var VencordDesktop: typeof import("renderer/index");
@@ -8,4 +14,4 @@ declare global {
export var IS_DEV: boolean;
}
export { };
export {};

View File

@@ -1,6 +1,13 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { BrowserWindow } from "electron";
import { join } from "path";
import { ICON_PATH, STATIC_DIR } from "shared/paths";
import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally";
export function createAboutWindow() {

View File

@@ -1,12 +1,26 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { app } from "electron";
import { join } from "path";
export const DATA_DIR = process.env.VENCORD_USER_DATA_DIR || join(app.getPath("userData"), "VencordDesktop");
// needs to be inline require because of circular dependency
// as otherwise "DATA_DIR" (which is used by ./settings) will be uninitialised
export const VENCORD_FILES_DIR = require("./settings").Settings.vencordDir || join(DATA_DIR, "vencordDist");
export const VENCORD_SETTINGS_DIR = join(DATA_DIR, "settings");
export const VENCORD_QUICKCSS_FILE = join(VENCORD_SETTINGS_DIR, "quickCss.css");
export const VENCORD_SETTINGS_FILE = join(VENCORD_SETTINGS_DIR, "settings.json");
// needs to be inline require because of circular dependency
// as otherwise "DATA_DIR" (which is used by ./settings) will be uninitialised
export const VENCORD_FILES_DIR =
(require("./settings") as typeof import("./settings")).Settings.store.vencordDir || join(DATA_DIR, "vencordDist");
export const USER_AGENT = `VencordDesktop/${app.getVersion()} (https://github.com/Vencord/Electron)`;
// dimensions shamelessly stolen from Discord Desktop :3
export const MIN_WIDTH = 940;
export const MIN_HEIGHT = 500;
export const DEFAULT_WIDTH = 1280;
export const DEFAULT_HEIGHT = 720;

View File

@@ -1,5 +1,14 @@
import { app, BrowserWindow } from 'electron';
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import "./ipc";
import { app, BrowserWindow } from "electron";
import { join } from "path";
import { ICON_PATH } from "../shared/paths";
import { once } from "../shared/utils/once";
import { DATA_DIR, VENCORD_FILES_DIR } from "./constants";
@@ -7,8 +16,6 @@ import { createMainWindow } from "./mainWindow";
import { Settings } from "./settings";
import { createSplashWindow } from "./splash";
import { ensureVencordFiles } from "./utils/vencordLoader";
import "./ipc";
if (IS_DEV) {
require("source-map-support").install();
}
@@ -33,14 +40,12 @@ if (!app.requestSingleInstanceLock()) {
});
app.whenReady().then(async () => {
if (process.platform === "win32")
app.setAppUserModelId("dev.vencord.desktop");
else if (process.platform === "darwin")
app.dock.setIcon(ICON_PATH);
if (process.platform === "win32") app.setAppUserModelId("dev.vencord.desktop");
else if (process.platform === "darwin") app.dock.setIcon(ICON_PATH);
createWindows();
app.on('activate', () => {
app.on("activate", () => {
if (BrowserWindow.getAllWindows().length === 0) createWindows();
});
});
@@ -58,13 +63,12 @@ async function createWindows() {
splash.destroy();
mainWin!.show();
if (Settings.maximized) {
if (Settings.store.maximized) {
mainWin!.maximize();
}
});
}
app.on("window-all-closed", () => {
if (process.platform !== "darwin")
app.quit();
if (process.platform !== "darwin") app.quit();
});

View File

@@ -1,12 +1,19 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { app, dialog, ipcMain, shell } from "electron";
import { existsSync, readFileSync, watch } from "fs";
import { open, readFile } from "fs/promises";
import { join } from "path";
import { debounce } from "shared/utils/debounce";
import { IpcEvents } from "../shared/IpcEvents";
import { VENCORD_FILES_DIR, VENCORD_QUICKCSS_FILE } from "./constants";
import { mainWin } from "./mainWindow";
import { PlainSettings, setSettings } from "./settings";
import { Settings } from "./settings";
ipcMain.on(IpcEvents.GET_VENCORD_PRELOAD_FILE, e => {
e.returnValue = join(VENCORD_FILES_DIR, "preload.js");
@@ -25,15 +32,15 @@ ipcMain.on(IpcEvents.GET_RENDERER_CSS_FILE, e => {
});
ipcMain.on(IpcEvents.GET_SETTINGS, e => {
e.returnValue = PlainSettings;
e.returnValue = Settings.plain;
});
ipcMain.on(IpcEvents.GET_VERSION, e => {
e.returnValue = app.getVersion();
});
ipcMain.handle(IpcEvents.SET_SETTINGS, (_, settings) => {
setSettings(settings);
ipcMain.handle(IpcEvents.SET_SETTINGS, (_, settings: typeof Settings.store, path?: string) => {
Settings.setData(settings, path);
});
ipcMain.handle(IpcEvents.RELAUNCH, () => {
@@ -69,7 +76,11 @@ function readCss() {
open(VENCORD_QUICKCSS_FILE, "a+").then(fd => {
fd.close();
watch(VENCORD_QUICKCSS_FILE, { persistent: false }, debounce(async () => {
mainWin?.webContents.postMessage("VencordQuickCssUpdate", await readCss());
}, 50));
watch(
VENCORD_QUICKCSS_FILE,
{ persistent: false },
debounce(async () => {
mainWin?.webContents.postMessage("VencordQuickCssUpdate", await readCss());
}, 50)
);
});

View File

@@ -1,12 +1,21 @@
import { BrowserWindow, BrowserWindowConstructorOptions, Menu, Tray, app } from "electron";
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { app, BrowserWindow, BrowserWindowConstructorOptions, Menu, Tray } from "electron";
import { join } from "path";
import { ICON_PATH } from "../shared/paths";
import { createAboutWindow } from "./about";
import { Settings } from "./settings";
import { DEFAULT_HEIGHT, DEFAULT_WIDTH, MIN_HEIGHT, MIN_WIDTH } from "./constants";
import { Settings, VencordSettings } from "./settings";
import { makeLinksOpenExternally } from "./utils/makeLinksOpenExternally";
import { downloadVencordFiles } from "./utils/vencordLoader";
let isQuitting = false;
let tray: Tray;
app.on("before-quit", () => {
isQuitting = true;
@@ -54,7 +63,7 @@ function initTray(win: BrowserWindow) {
}
]);
const tray = new Tray(ICON_PATH);
tray = new Tray(ICON_PATH);
tray.setToolTip("Vencord Desktop");
tray.setContextMenu(trayMenu);
tray.on("click", () => win.show());
@@ -69,7 +78,9 @@ function initTray(win: BrowserWindow) {
}
function initMenuBar(win: BrowserWindow) {
console.log(process.platform);
const isWindows = process.platform === "win32";
const wantCtrlQ = !isWindows || VencordSettings.store.winCtrlQ;
const menu = Menu.buildFromTemplate([
{
label: "Vencord Desktop",
@@ -119,18 +130,16 @@ function initMenuBar(win: BrowserWindow) {
},
{
label: "Quit",
accelerator: process.platform === "win32" ? void 0 : "CmdOrCtrl+Q",
// TODO: Setting
visible: process.platform !== "win32",
accelerator: wantCtrlQ ? "CmdOrCtrl+Q" : void 0,
visible: !isWindows,
click() {
app.quit();
}
},
{
label: "Quit",
accelerator: "Alt+F4",
visible: process.platform === "win32",
acceleratorWorksWhenHidden: false,
accelerator: isWindows ? "Alt+F4" : void 0,
visible: isWindows,
click() {
app.quit();
}
@@ -165,54 +174,78 @@ function initMenuBar(win: BrowserWindow) {
Menu.setApplicationMenu(menu);
}
function getWindowBoundsOptions() {
const options = {} as BrowserWindowConstructorOptions;
function getWindowBoundsOptions(): BrowserWindowConstructorOptions {
const { x, y, width, height } = Settings.store.windowBounds ?? {};
const options = {
width: width ?? DEFAULT_WIDTH,
height: height ?? DEFAULT_HEIGHT
} as BrowserWindowConstructorOptions;
const { x, y, width, height } = Settings.windowBounds ?? {};
if (x != null && y != null) {
options.x = x;
options.y = y;
}
if (width) options.width = width;
if (height) options.height = height;
if (!Settings.store.disableMinSize) {
options.minWidth = MIN_WIDTH;
options.minHeight = MIN_HEIGHT;
}
return options;
}
function initWindowBoundsListeners(win: BrowserWindow) {
win.on("maximize", () => {
Settings.maximized = true;
Settings.minimized = false;
});
const saveState = () => {
Settings.store.maximized = win.isMaximized();
Settings.store.minimized = win.isMinimized();
};
win.on("minimize", () => {
Settings.minimized = true;
});
win.on("unmaximize", () => {
Settings.maximized = false;
Settings.minimized = false;
});
win.on("maximize", saveState);
win.on("minimize", saveState);
win.on("unmaximize", saveState);
const saveBounds = () => {
const [width, height] = win.getSize();
const [x, y] = win.getPosition();
Settings.windowBounds = {
width,
height,
x,
y
};
Settings.store.windowBounds = win.getBounds();
};
win.on("resize", saveBounds);
win.on("move", saveBounds);
}
function initSettingsListeners(win: BrowserWindow) {
Settings.addChangeListener("tray", enable => {
if (enable) initTray(win);
else tray?.destroy();
});
Settings.addChangeListener("disableMinSize", disable => {
if (disable) {
// 0 no work
win.setMinimumSize(1, 1);
} else {
win.setMinimumSize(MIN_WIDTH, MIN_HEIGHT);
const { width, height } = win.getBounds();
win.setBounds({
width: Math.max(width, MIN_WIDTH),
height: Math.max(height, MIN_HEIGHT)
});
}
});
VencordSettings.addChangeListener("macosTranslucency", enabled => {
if (enabled) {
win.setVibrancy("sidebar");
win.setBackgroundColor("#ffffff00");
} else {
win.setVibrancy(null);
win.setBackgroundColor("#ffffff");
}
});
}
export function createMainWindow() {
const win = mainWin = new BrowserWindow({
const win = (mainWin = new BrowserWindow({
show: false,
autoHideMenuBar: true,
webPreferences: {
@@ -223,11 +256,18 @@ export function createMainWindow() {
preload: join(__dirname, "preload.js")
},
icon: ICON_PATH,
frame: VencordSettings.store.frameless !== true,
...(VencordSettings.store.macosTranslucency
? {
vibrancy: "sidebar",
backgroundColor: "#ffffff00"
}
: {}),
...getWindowBoundsOptions()
});
}));
win.on("close", e => {
if (isQuitting) return;
if (isQuitting || Settings.store.minimizeToTray === false || Settings.store.tray === false) return;
e.preventDefault();
win.hide();
@@ -236,13 +276,15 @@ export function createMainWindow() {
});
initWindowBoundsListeners(win);
initTray(win);
if (Settings.store.tray ?? true) initTray(win);
initMenuBar(win);
makeLinksOpenExternally(win);
initSettingsListeners(win);
const subdomain = Settings.discordBranch === "canary" || Settings.discordBranch === "ptb"
? `${Settings.discordBranch}.`
: "";
const subdomain =
Settings.store.discordBranch === "canary" || Settings.store.discordBranch === "ptb"
? `${Settings.store.discordBranch}.`
: "";
win.loadURL(`https://${subdomain}discord.com/app`);

View File

@@ -1,31 +1,34 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { readFileSync, writeFileSync } from "fs";
import { join } from "path";
import type { Settings as TSettings } from "shared/settings";
import { makeChangeListenerProxy } from "shared/utils/makeChangeListenerProxy";
import { DATA_DIR } from "./constants";
import { SettingsStore } from "shared/utils/SettingsStore";
import { DATA_DIR, VENCORD_SETTINGS_FILE } from "./constants";
const SETTINGS_FILE = join(DATA_DIR, "settings.json");
export let PlainSettings = {} as TSettings;
try {
const content = readFileSync(SETTINGS_FILE, "utf8");
function loadSettings<T extends object = any>(file: string, name: string) {
let settings = {} as T;
try {
PlainSettings = JSON.parse(content);
} catch (err) {
console.error("Failed to parse settings.json:", err);
}
} catch { }
const content = readFileSync(file, "utf8");
try {
settings = JSON.parse(content);
} catch (err) {
console.error(`Failed to parse ${name} settings.json:`, err);
}
} catch {}
const makeSettingsProxy = (settings: TSettings) => makeChangeListenerProxy(
settings,
target => writeFileSync(SETTINGS_FILE, JSON.stringify(target, null, 4))
);
const store = new SettingsStore(settings);
store.addGlobalChangeListener(o => writeFileSync(file, JSON.stringify(o, null, 4)));
export let Settings = makeSettingsProxy(PlainSettings);
export function setSettings(settings: TSettings) {
writeFileSync(SETTINGS_FILE, JSON.stringify(settings, null, 4));
PlainSettings = settings;
Settings = makeSettingsProxy(settings);
return store;
}
export const Settings = loadSettings<TSettings>(SETTINGS_FILE, "Vencord Desktop");
export const VencordSettings = loadSettings<any>(VENCORD_SETTINGS_FILE, "Vencord");

View File

@@ -1,3 +1,9 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { BrowserWindow } from "electron";
import { join } from "path";
import { STATIC_DIR } from "shared/paths";

View File

@@ -1,14 +1,22 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { createWriteStream } from "fs";
import type { IncomingMessage } from "http";
import { RequestOptions, get } from "https";
import { get, RequestOptions } from "https";
import { finished } from "stream/promises";
export async function downloadFile(url: string, file: string, options: RequestOptions = {}) {
const res = await simpleReq(url, options);
await finished(
res.pipe(createWriteStream(file, {
autoClose: true
}))
res.pipe(
createWriteStream(file, {
autoClose: true
})
)
);
}
@@ -16,12 +24,8 @@ export function simpleReq(url: string, options: RequestOptions = {}) {
return new Promise<IncomingMessage>((resolve, reject) => {
get(url, options, res => {
const { statusCode, statusMessage, headers } = res;
if (statusCode! >= 400)
return void reject(`${statusCode}: ${statusMessage} - ${url}`);
if (statusCode! >= 300)
return simpleReq(headers.location!, options)
.then(resolve)
.catch(reject);
if (statusCode! >= 400) return void reject(`${statusCode}: ${statusMessage} - ${url}`);
if (statusCode! >= 300) return simpleReq(headers.location!, options).then(resolve).catch(reject);
resolve(res);
});

View File

@@ -1,4 +1,11 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { BrowserWindow, shell } from "electron";
import { Settings } from "../settings";
export function makeLinksOpenExternally(win: BrowserWindow) {
@@ -10,7 +17,7 @@ export function makeLinksOpenExternally(win: BrowserWindow) {
}
try {
var protocol = new URL(url).protocol;
var { protocol } = new URL(url);
} catch {
return { action: "deny" };
}
@@ -18,9 +25,10 @@ export function makeLinksOpenExternally(win: BrowserWindow) {
switch (protocol) {
case "http:":
case "https:":
if (Settings.openLinksWithElectron) {
if (Settings.store.openLinksWithElectron) {
return { action: "allow" };
}
// eslint-disable-next-line no-fallthrough
case "mailto:":
case "steam:":
case "spotify:":

View File

@@ -1,16 +1,18 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { existsSync, mkdirSync } from "fs";
import { join } from "path";
import { USER_AGENT, VENCORD_FILES_DIR } from "../constants";
import { downloadFile, simpleGet } from "./http";
const API_BASE = "https://api.github.com/repos/Vendicated/Vencord";
const FILES_TO_DOWNLOAD = [
"vencordDesktopMain.js",
"preload.js",
"vencordDesktopRenderer.js",
"renderer.css"
];
const FILES_TO_DOWNLOAD = ["vencordDesktopMain.js", "preload.js", "vencordDesktopRenderer.js", "renderer.css"];
export async function githubGet(endpoint: string) {
return simpleGet(API_BASE + endpoint, {
@@ -32,12 +34,8 @@ export async function downloadVencordFiles() {
await Promise.all(
assets
.filter(({ name }) =>
FILES_TO_DOWNLOAD.some(f => name.startsWith(f))
)
.map(({ name, browser_download_url }) =>
downloadFile(browser_download_url, join(VENCORD_FILES_DIR, name))
)
.filter(({ name }) => FILES_TO_DOWNLOAD.some(f => name.startsWith(f)))
.map(({ name, browser_download_url }) => downloadFile(browser_download_url, join(VENCORD_FILES_DIR, name)))
);
}

View File

@@ -1,6 +1,13 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { ipcRenderer } from "electron";
import type { Settings } from "shared/settings";
import type { LiteralUnion } from "type-fest";
import { IpcEvents } from "../shared/IpcEvents";
function invoke<T = any>(event: IpcEvents, ...args: any[]) {
@@ -18,14 +25,13 @@ export const VencordDesktopNative = {
},
fileManager: {
showItemInFolder: (path: string) => invoke<void>(IpcEvents.SHOW_ITEM_IN_FOLDER, path),
selectVencordDir: () => invoke<LiteralUnion<"cancelled" | "invalid", string>>(IpcEvents.SELECT_VENCORD_DIR),
selectVencordDir: () => invoke<LiteralUnion<"cancelled" | "invalid", string>>(IpcEvents.SELECT_VENCORD_DIR)
},
settings: {
get: () => sendSync<Settings>(IpcEvents.GET_SETTINGS),
set: (settings: Settings) => invoke<void>(IpcEvents.SET_SETTINGS, settings)
set: (settings: Settings, path?: string) => invoke<void>(IpcEvents.SET_SETTINGS, settings, path)
},
win: {
focus: () => invoke<void>(IpcEvents.FOCUS)
}
}
};

View File

@@ -1,5 +1,12 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { contextBridge, ipcRenderer, webFrame } from "electron";
import { readFileSync, watch } from "fs";
import { IpcEvents } from "../shared/IpcEvents";
import { VencordDesktopNative } from "./VencordDesktopNative";

View File

@@ -1,13 +1,46 @@
import { getValueAndOnChange, useSettings } from "renderer/settings";
import { Common, Util } from "../vencord";
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import "./settings.css";
import { useSettings } from "renderer/settings";
import { Common, Util } from "../vencord";
const { Margins } = Util;
export default function SettingsUi() {
const Settings = useSettings();
const { Forms: { FormSection, FormText, FormDivider, FormSwitch, FormTitle }, Text, Select, Button } = Common;
const {
Forms: { FormSection, FormText, FormDivider, FormSwitch, FormTitle },
Text,
Select,
Button
} = Common;
const switches: [keyof typeof Settings, string, string, boolean?, (() => boolean)?][] = [
["tray", "Tray Icon", "Add a tray icon for Vencord Desktop", true],
[
"minimizeToTray",
"Minimize to tray",
"Hitting X will make Vencord Desktop minimize to the tray instead of closing",
true,
() => Settings.tray ?? true
],
[
"disableMinSize",
"Disable minimum window size",
"Allows you to make the window as small as your heart desires"
],
[
"openLinksWithElectron",
"Open Links in app (experimental)",
"Opens links in a new Vencord Desktop window instead of your web browser"
]
];
return (
<FormSection>
@@ -15,49 +48,50 @@ export default function SettingsUi() {
Vencord Desktop Settings
</Text>
<FormTitle className={Margins.top16}>
Discord Branch
</FormTitle>
<FormTitle className={Margins.top16}>Discord Branch</FormTitle>
<Select
placeholder="Stable"
options={[
{ label: "Stable", value: "stable", default: true },
{ label: "Canary", value: "canary" },
{ label: "PTB", value: "ptb" },
{ label: "PTB", value: "ptb" }
]}
closeOnSelect={true}
select={v => Settings.discordBranch = v}
select={v => (Settings.discordBranch = v)}
isSelected={v => v === Settings.discordBranch}
serialize={s => s}
/>
<FormDivider className={Margins.top16 + " " + Margins.bottom16} />
<FormSwitch
{...getValueAndOnChange("openLinksWithElectron")}
note={"This will open links in a new window instead of your WebBrowser"}
>
Open Links in app
</FormSwitch>
{switches.map(([key, text, note, def, predicate]) => (
<FormSwitch
value={(Settings[key] ?? def ?? false) && (!predicate || predicate())}
disabled={predicate && !predicate()}
onChange={v => (Settings[key] = v)}
note={note}
key={key}
>
{text}
</FormSwitch>
))}
<FormTitle>Vencord Desktop Location</FormTitle>
<FormTitle>Vencord Location</FormTitle>
<FormText>
Files are loaded from
{" "}
{Settings.vencordDir
? (
<a
href="about:blank"
onClick={e => {
e.preventDefault();
VencordDesktopNative.fileManager.showItemInFolder(Settings.vencordDir!);
}}
>
{Settings.vencordDir}
</a>
)
: "the default location"
}
Vencord files are loaded from{" "}
{Settings.vencordDir ? (
<a
href="about:blank"
onClick={e => {
e.preventDefault();
VencordDesktopNative.fileManager.showItemInFolder(Settings.vencordDir!);
}}
>
{Settings.vencordDir}
</a>
) : (
"the default location"
)}
</FormText>
<div className="vcd-location-btns">
<Button
@@ -78,7 +112,7 @@ export default function SettingsUi() {
<Button
size={Button.Sizes.SMALL}
color={Button.Colors.RED}
onClick={() => Settings.vencordDir = void 0}
onClick={() => (Settings.vencordDir = void 0)}
>
Reset
</Button>

View File

@@ -1 +1,7 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
export { default as Settings } from "./Settings";

View File

@@ -1,4 +1,11 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import "./hideGarbage.css";
import { isFirstRun, localStorage } from "./utils";
// Make clicking Notifications focus the window

View File

@@ -1,7 +1,12 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import "./fixes";
console.log("read if cute :3");
export * as Components from "./components";
export { PlainSettings, Settings } from "./settings";
export { Settings } from "./settings";

View File

@@ -1,28 +1,31 @@
import type { Settings as TSettings } from "shared/settings";
import { makeChangeListenerProxy } from "shared/utils/makeChangeListenerProxy";
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { SettingsStore } from "shared/utils/SettingsStore";
import { Common } from "./vencord";
const signals = new Set<() => void>();
export const PlainSettings = VencordDesktopNative.settings.get() as TSettings;
export const Settings = makeChangeListenerProxy(PlainSettings, s => {
VencordDesktopNative.settings.set(s);
signals.forEach(fn => fn());
});
export const Settings = new SettingsStore(VencordDesktopNative.settings.get());
Settings.addGlobalChangeListener((o, p) => VencordDesktopNative.settings.set(o, p));
export function useSettings() {
const [, update] = Common.React.useReducer(x => x + 1, 0);
Common.React.useEffect(() => {
signals.add(update);
return () => signals.delete(update);
Settings.addGlobalChangeListener(update);
return () => Settings.removeGlobalChangeListener(update);
}, []);
return Settings;
return Settings.store;
}
export function getValueAndOnChange(key: keyof TSettings) {
export function getValueAndOnChange(key: keyof typeof Settings.store) {
return {
value: Settings[key] as any,
onChange: (value: any) => Settings[key] = value
value: Settings.store[key] as any,
onChange: (value: any) => (Settings.store[key] = value)
};
}

View File

@@ -1,4 +1,10 @@
export const localStorage = window.vcdLS = window.localStorage;
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
export const localStorage = (window.vcdLS = window.localStorage);
export const isFirstRun = (() => {
const key = "VCD_FIRST_RUN";

View File

@@ -1,13 +1,13 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
// FIXME: this is terrible
const { Webpack, Plugins, Util } = Vencord;
const { Common } = Webpack;
const { plugins } = Plugins;
export {
Webpack,
Common,
Util,
Plugins,
plugins
};
export { Common, Plugins, plugins, Util, Webpack };

View File

@@ -1,3 +1,9 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
export const enum IpcEvents {
GET_VENCORD_PRELOAD_FILE = "VCD_GET_VC_PRELOAD_FILE",
GET_VENCORD_RENDERER_SCRIPT = "VCD_GET_VC_RENDERER_SCRIPT",
@@ -15,4 +21,3 @@ export const enum IpcEvents {
SELECT_VENCORD_DIR = "VCD_SELECT_VENCORD_DIR"
}

View File

@@ -1,4 +1,10 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { join } from "path";
export const STATIC_DIR = join(__dirname, "..", "..", "static");
export const ICON_PATH = join(STATIC_DIR, "icon.png");
export const STATIC_DIR = /* @__PURE__ */ join(__dirname, "..", "..", "static");
export const ICON_PATH = /* @__PURE__ */ join(STATIC_DIR, "icon.png");

View File

@@ -1,13 +1,19 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import type { Rectangle } from "electron";
export interface Settings {
maximized?: boolean;
minimized?: boolean;
windowBounds?: {
x: number;
y: number;
width: number;
height: number;
};
windowBounds?: Rectangle;
discordBranch?: "stable" | "canary" | "ptb";
openLinksWithElectron?: boolean;
vencordDir?: string;
disableMinSize?: boolean;
tray?: boolean;
minimizeToTray?: boolean;
}

View File

@@ -0,0 +1,147 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
import { LiteralUnion } from "type-fest";
// Resolves a possibly nested prop in the form of "some.nested.prop" to type of T.some.nested.prop
type ResolvePropDeep<T, P> = P extends `${infer Pre}.${infer Suf}`
? Pre extends keyof T
? ResolvePropDeep<T[Pre], Suf>
: any
: P extends keyof T
? T[P]
: any;
/**
* The SettingsStore allows you to easily create a mutable store that
* has support for global and path-based change listeners.
*/
export class SettingsStore<T extends object> {
private pathListeners = new Map<string, Set<(newData: any) => void>>();
private globalListeners = new Set<(newData: T, path: string) => void>();
/**
* The store object. Making changes to this object will trigger the applicable change listeners
*/
public declare store: T;
/**
* The plain data. Changes to this object will not trigger any change listeners
*/
public declare plain: T;
public constructor(plain: T) {
this.plain = plain;
this.store = this.makeProxy(plain);
}
private makeProxy(object: any, root: T = object, path: string = "") {
const self = this;
return new Proxy(object, {
get(target, key: string) {
const v = target[key];
if (typeof v === "object" && v !== null && !Array.isArray(v))
return self.makeProxy(v, root, `${path}${path && "."}${key}`);
return v;
},
set(target, key: string, value) {
if (target[key] === value) return true;
Reflect.set(target, key, value);
const setPath = `${path}${path && "."}${key}`;
self.globalListeners.forEach(cb => cb(root, setPath));
self.pathListeners.get(setPath)?.forEach(cb => cb(value));
return true;
}
});
}
/**
* Set the data of the store.
* This will update this.store and this.plain (and old references to them will be stale! Avoid storing them in variables)
*
* Additionally, all global listeners (or those for pathToNotify, if specified) will be called with the new data
* @param value New data
* @param pathToNotify Optional path to notify instead of globally. Used to transfer path via ipc
*/
public setData(value: T, pathToNotify?: string) {
this.plain = value;
this.store = this.makeProxy(value);
if (pathToNotify) {
let v = value;
const path = pathToNotify.split(".");
for (const p of path) {
if (!v) {
console.warn(
`Settings#setData: Path ${pathToNotify} does not exist in new data. Not dispatching update`
);
return;
}
v = v[p];
}
this.pathListeners.get(pathToNotify)?.forEach(cb => cb(v));
} else {
this.globalListeners.forEach(cb => cb(value, ""));
}
}
/**
* Add a global change listener, that will fire whenever any setting is changed
*/
public addGlobalChangeListener(cb: (data: T, path: string) => void) {
this.globalListeners.add(cb);
}
/**
* Add a scoped change listener that will fire whenever a setting matching the specified path is changed.
*
* For example if path is `"foo.bar"`, the listener will fire on
* ```js
* Setting.store.foo.bar = "hi"
* ```
* but not on
* ```js
* Setting.store.foo.baz = "hi"
* ```
* @param path
* @param cb
*/
public addChangeListener<P extends LiteralUnion<keyof T, string>>(
path: P,
cb: (data: ResolvePropDeep<T, P>) => void
) {
const listeners = this.pathListeners.get(path as string) ?? new Set();
listeners.add(cb);
this.pathListeners.set(path as string, listeners);
}
/**
* Remove a global listener
* @see {@link addGlobalChangeListener}
*/
public removeGlobalChangeListener(cb: (data: T, path: string) => void) {
this.globalListeners.delete(cb);
}
/**
* Remove a scoped listener
* @see {@link addChangeListener}
*/
public removeChangeListener(path: LiteralUnion<keyof T, string>, cb: (data: any) => void) {
const listeners = this.pathListeners.get(path as string);
if (!listeners) return;
listeners.delete(cb);
if (!listeners.size) this.pathListeners.delete(path as string);
}
}

View File

@@ -1,7 +1,21 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
/**
* Returns a new function that will only be called after the given delay.
* Subsequent calls will cancel the previous timeout and start a new one from 0
*
* Useful for grouping multiple calls into one
*/
export function debounce<T extends Function>(func: T, delay = 300): T {
let timeout: NodeJS.Timeout;
return function (...args: any[]) {
clearTimeout(timeout);
timeout = setTimeout(() => { func(...args); }, delay);
timeout = setTimeout(() => {
func(...args);
}, delay);
} as any;
}

View File

@@ -1,20 +0,0 @@
export function makeChangeListenerProxy<T extends object>(object: T, onChange: (object: T) => void, _root = object): T {
return new Proxy(object, {
get(target, key) {
const v = target[key];
if (typeof v === "object" && !Array.isArray(v) && v !== null)
return makeChangeListenerProxy(v, onChange, _root);
return v;
},
set(target, key, value) {
if (target[key] === value) return true;
Reflect.set(target, key, value);
onChange(_root);
return true;
},
});
}

View File

@@ -1,11 +1,21 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
type Func = (...args: any[]) => any;
export function monkeyPatch<O extends object>(object: O, key: keyof O, replacement: (original: Func, ...args: any[]) => any): void {
export function monkeyPatch<O extends object>(
object: O,
key: keyof O,
replacement: (original: Func, ...args: any[]) => any
): void {
const original = object[key] as Func;
const replacer = object[key] = function (this: unknown, ...args: any[]) {
const replacer = (object[key] = function (this: unknown, ...args: any[]) {
return replacement.call(this, original, ...args);
} as any;
} as any);
Object.defineProperties(replacer, Object.getOwnPropertyDescriptors(original));
replacer.toString = () => original.toString();

View File

@@ -1,3 +1,14 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vencord Desktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
*/
/**
* Wraps the given function so that it can only be called once
* @param fn Function to wrap
* @returns New function that can only be called once
*/
export function once<T extends Function>(fn: T): T {
let called = false;
return function (this: any, ...args: any[]) {

View File

@@ -1,29 +1,48 @@
<head>
<style>
body {
margin: 0;
padding: 0;
}
<style>
* {
user-select: none;
}
.wrapper {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: hsl(223 6.7% 20.6%);
border-radius: 6px;
}
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
"Open Sans", "Helvetica Neue", sans-serif;
margin: 0;
padding: 0;
}
p {
color: white;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
"Open Sans", "Helvetica Neue", sans-serif;
}
</style>
.wrapper {
box-sizing: border-box;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: hsl(223 6.7% 20.6%);
border-radius: 8px;
border: 1px solid hsl(220 6.5% 18%);
}
p {
color: rgb(219, 222, 225);
text-align: center;
}
img {
width: 6em;
height: 6em;
}
</style>
</head>
<body>
<div class="wrapper">
<p>Loading...</p>
</div>
<div class="wrapper">
<img
draggable="false"
src="https://cdn.discordapp.com/emojis/1024751291504791654.gif?size=512"
alt="shiggy"
role="presentation"
/>
<p>Loading Vencord Desktop...</p>
</div>
</body>