diff options
author | Vendicated <vendicated@riseup.net> | 2022-11-28 00:55:50 +0100 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-11-28 00:55:50 +0100 |
commit | a9fee6248eb99a12abfa0fc9e5040feb7f5c676f (patch) | |
tree | d90cb985b729fed644b24be27260763a8056f815 | |
parent | f0ee16f173b2b4da32acc987b570e4815bcaaacd (diff) | |
download | Vencord-a9fee6248eb99a12abfa0fc9e5040feb7f5c676f.tar.gz Vencord-a9fee6248eb99a12abfa0fc9e5040feb7f5c676f.tar.bz2 Vencord-a9fee6248eb99a12abfa0fc9e5040feb7f5c676f.zip |
BlurNSFW: Add amount setting
-rw-r--r-- | src/plugins/blurNsfw.ts | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/plugins/blurNsfw.ts b/src/plugins/blurNsfw.ts index f5a272c..d04e497 100644 --- a/src/plugins/blurNsfw.ts +++ b/src/plugins/blurNsfw.ts @@ -16,11 +16,12 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import { Settings } from "../api/settings"; import { Devs } from "../utils/constants"; -import definePlugin from "../utils/types"; +import definePlugin, { OptionType } from "../utils/types"; export default definePlugin({ - name: "BlurNsfw", + name: "BlurNSFW", description: "Blur attachments in NSFW channels until hovered", authors: [Devs.Ven], @@ -37,17 +38,29 @@ export default definePlugin({ } ], + options: { + blurAmount: { + type: OptionType.NUMBER, + description: "Blur Amount", + default: 10, + } + }, + start() { const style = this.style = document.createElement("style"); style.id = "VcBlurNsfw"; document.head.appendChild(style); - style.textContent = ` - .vc-nsfw-img img { - filter: blur(5px); - transition: filter 0.2s ease-in; + this.setCss(); + }, + + setCss() { + this.style.textContent = ` + .vc-nsfw-img [class^=imageWrapper] img { + filter: blur(${Settings.plugins.BlurNSFW.blurAmount}px); + transition: filter 0.2s; } - .vc-nsfw-img:hover img { + .vc-nsfw-img [class^=imageWrapper] img:hover { filter: unset; } `; |