From f82f02085a0ef425f81b1947b2bf583ff7cc4d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=E2=82=ACth?= <143244075+wont-stream@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:58:19 -0500 Subject: [PATCH] DisableAnimations: Plugin to disable most of Discord's animations (#111) * DisableAnimations: Plugin to disable most of Discord's animations * Fix GrammarFix author name * Add DisableAnimations to README * Update Count * Remove Extra Spacing --------- Co-authored-by: thororen1234 Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com> --- README.md | 5 +- .../disableAnimations/index.ts | 53 +++++++++++++++++++ 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 src/equicordplugins/disableAnimations/index.ts diff --git a/README.md b/README.md index 8ed574d8..4f87a96c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch ### Extra included plugins
-150 additional plugins +151 additional plugins ### All Platforms - AllCallTimers by MaxHerbold & D3SOX @@ -44,6 +44,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch - DecodeBase64 by ThePirateStoner - DeadMembers by Kyuuhachi - Demonstration by Samwich +- DisableAnimations by S€th - DisableCameras by Joona - DoNotLeak by Perny - DontFilterMe by Samwich @@ -66,7 +67,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch - GodMode by Tolgchu - GoodPerson by nin0dev & mantikafasi - GoogleThat by Samwich -- GrammarFix by unstream +- GrammarFix by S€th - HideChatButtons by iamme - HideMessage by Hanzy - HideServers by bepvte diff --git a/src/equicordplugins/disableAnimations/index.ts b/src/equicordplugins/disableAnimations/index.ts new file mode 100644 index 00000000..865e9cf0 --- /dev/null +++ b/src/equicordplugins/disableAnimations/index.ts @@ -0,0 +1,53 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2022 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +import { EquicordDevs } from "@utils/constants"; +import definePlugin from "@utils/types"; +import { findAll } from "@webpack"; + +export default definePlugin({ + name: "DisableAnimations", + description: "Disables most of Discord's animations.", + authors: [EquicordDevs.seth], + start() { + 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); + }, + stop() { + for (const spring of this.springs) { + spring.Globals.assign({ + skipAnimation: false, + }); + } + + if (this.css) this.css.remove(); + } +});