From 5a01fde437b9e55243fdd9a0c4507fc61ee49dc8 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:19:33 -0500 Subject: [PATCH] Properly Restrict --- .../index.ts} | 48 ++++++++----------- .../disableAnimations/styles.css | 12 ----- 2 files changed, 19 insertions(+), 41 deletions(-) rename src/equicordplugins/{disableAnimations/index.tsx => disableAnimations.desktop/index.ts} (51%) delete mode 100644 src/equicordplugins/disableAnimations/styles.css diff --git a/src/equicordplugins/disableAnimations/index.tsx b/src/equicordplugins/disableAnimations.desktop/index.ts similarity index 51% rename from src/equicordplugins/disableAnimations/index.tsx rename to src/equicordplugins/disableAnimations.desktop/index.ts index dcaea0cda..65a754b64 100644 --- a/src/equicordplugins/disableAnimations/index.tsx +++ b/src/equicordplugins/disableAnimations.desktop/index.ts @@ -19,45 +19,35 @@ 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() { - if (IS_EQUIBOP || IS_VESKTOP || IS_DISCORD_DESKTOP) { - this.springs = findAll(mod => { - if (!mod.Globals) return false; - return true; + this.springs = findAll(mod => { + if (!mod.Globals) return false; + return true; + }); + + for (const spring of this.springs) { + spring.Globals.assign({ + skipAnimation: 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() { - 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(); + for (const spring of this.springs) { + spring.Globals.assign({ + skipAnimation: false, + }); } + + if (this.css) this.css.remove(); } }); diff --git a/src/equicordplugins/disableAnimations/styles.css b/src/equicordplugins/disableAnimations/styles.css deleted file mode 100644 index 1696ac63b..000000000 --- a/src/equicordplugins/disableAnimations/styles.css +++ /dev/null @@ -1,12 +0,0 @@ -.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; -}