Skip to content

Commit

Permalink
new ploogin
Browse files Browse the repository at this point in the history
  • Loading branch information
E-boi committed Dec 24, 2022
1 parent 48c325e commit 74c4a29
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/channelMenu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./style.css";
19 changes: 19 additions & 0 deletions plugins/channelMenu/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "dev.eboi.blurnsfw",
"name": "Blur NSFW",
"description": "Blur Images/Videos in NSFW channels until hovered",
"author": {
"name": "ugly-patootie",
"discordID": "458805348669718559",
"github": "E-boi"
},
"version": "1.0.0",
"updater": {
"type": "github",
"id": "E-boi/replugged-plugins"
},
"license": "MIT",
"type": "replugged-plugin",
"renderer": "index.ts",
"plaintextPatches": "plaintextPatches.ts"
}
13 changes: 13 additions & 0 deletions plugins/channelMenu/plaintextPatches.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { PlaintextPatch } from "replugged/dist/types";

export default [
{
find: "renderAttachments=function",
replacements: [
{
match: /className:o\(\).{15}er/g,
replace: "$&,this?.props?.channel?.nsfw&&'rp-blurNsfw'",
},
],
},
] as PlaintextPatch[];
18 changes: 18 additions & 0 deletions plugins/channelMenu/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
:root {
--blur-effect: blur(10px);
--blur-timing: 1s;
}

.rp-blurNsfw [class*="originalLink-"] {
z-index: 0;
}
.rp-blurNsfw img,
.rp-blurNsfw video {
transition: var(--blur-timing) !important;
filter: var(--blur-effect) !important;
}
.rp-blurNsfw img:hover,
.rp-blurNsfw video:hover {
transition: var(--blur-timing) !important;
filter: none !important;
}

0 comments on commit 74c4a29

Please sign in to comment.