From e2ca547b2eaf131e036647439d6a382ff1900376 Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Wed, 18 Dec 2024 22:08:42 -0500
Subject: [PATCH] Restrict DisableAnimations
---
.../disableAnimations/{index.ts => index.tsx} | 48 +++++++++++--------
.../disableAnimations/styles.css | 12 +++++
.../neverPausePreviews/index.tsx | 2 +-
3 files changed, 42 insertions(+), 20 deletions(-)
rename src/equicordplugins/disableAnimations/{index.ts => index.tsx} (51%)
create mode 100644 src/equicordplugins/disableAnimations/styles.css
diff --git a/src/equicordplugins/disableAnimations/index.ts b/src/equicordplugins/disableAnimations/index.tsx
similarity index 51%
rename from src/equicordplugins/disableAnimations/index.ts
rename to src/equicordplugins/disableAnimations/index.tsx
index 865e9cf0..dcaea0cd 100644
--- a/src/equicordplugins/disableAnimations/index.ts
+++ b/src/equicordplugins/disableAnimations/index.tsx
@@ -19,35 +19,45 @@
import { EquicordDevs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findAll } from "@webpack";
+import { Forms } from "@webpack/common";
export default definePlugin({
name: "DisableAnimations",
description: "Disables most of Discord's animations.",
authors: [EquicordDevs.seth],
+ settingsAboutComponent: () => <>
+
+ This plugin will only work on Equibop Vesktop and Discord Desktop
+
+ >,
start() {
- this.springs = findAll((mod) => {
- if (!mod.Globals) return false;
- return true;
- });
-
- for (const spring of this.springs) {
- spring.Globals.assign({
- skipAnimation: true,
+ if (IS_EQUIBOP || IS_VESKTOP || IS_DISCORD_DESKTOP) {
+ this.springs = findAll(mod => {
+ if (!mod.Globals) return false;
+ return true;
});
+
+ for (const spring of this.springs) {
+ spring.Globals.assign({
+ skipAnimation: true,
+ });
+ }
+
+ this.css = document.createElement("style");
+ this.css.innerText = "* { transition: none !important; animation: none !important; }";
+
+ document.head.appendChild(this.css);
}
-
- this.css = document.createElement("style");
- this.css.innerText = "* { transition: none !important; animation: none !important; }";
-
- document.head.appendChild(this.css);
},
stop() {
- for (const spring of this.springs) {
- spring.Globals.assign({
- skipAnimation: false,
- });
- }
+ if (IS_EQUIBOP || IS_VESKTOP || IS_DISCORD_DESKTOP) {
+ for (const spring of this.springs) {
+ spring.Globals.assign({
+ skipAnimation: false,
+ });
+ }
- if (this.css) this.css.remove();
+ if (this.css) this.css.remove();
+ }
}
});
diff --git a/src/equicordplugins/disableAnimations/styles.css b/src/equicordplugins/disableAnimations/styles.css
new file mode 100644
index 00000000..1696ac63
--- /dev/null
+++ b/src/equicordplugins/disableAnimations/styles.css
@@ -0,0 +1,12 @@
+.platform-warning {
+ font-size: 16px !important;
+ background-color: rgb(240 71 71 / 10%);
+ color: rgb(240 71 71) !important;
+ border: 1px solid rgb(240 71 71 / 60%) !important;
+ border-radius: 5px !important;
+ font-weight: 500;
+ padding: 6px 10px;
+ text-align: center;
+ margin-top: 10px;
+ font-style: bold;
+}
diff --git a/src/equicordplugins/neverPausePreviews/index.tsx b/src/equicordplugins/neverPausePreviews/index.tsx
index bd9481ea..160bbf57 100644
--- a/src/equicordplugins/neverPausePreviews/index.tsx
+++ b/src/equicordplugins/neverPausePreviews/index.tsx
@@ -28,7 +28,7 @@ export default definePlugin({
authors: [EquicordDevs.vappstar],
settingsAboutComponent: () => <>
- This plugin will cause discord to use more resources than normal.
+ This plugin will cause discord to use more resources than normal
>,
patches: [