Skip to content

Commit e4182de

Browse files
authored
Add Image Blackout plugin (#693)
1 parent 898a4bd commit e4182de

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

plugins/ImageBlackout/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Image Blackout (100% Work Safe)
2+
3+
Simple toggle button in the navbar that completely hides all images, videos, hover previews, scrubber sprites, and AI tagger images.
4+
5+
Click 🖼️ to turn black-out on/off.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
(function() {
2+
let enabled = false;
3+
const cssId = 'image-blackout-style';
4+
5+
const blackoutCSS = `img, video, .card-image, .card-image-container, .scene-card-preview-video, .scene-card-preview-image, .scene-scrubber, .scrubber, .scrubber-sprites, .scrubber-viewport, .preview-strip, .tag-card img, .tag-image, .tag-thumbnail, .sprite, .sprites, .sprite-image, .scrubber-sprite, .scrubber-item, [class*="svelte-1d03wug"], .ai-tagger, .ai-tag, .tagger-preview, [class*="sprite"], [class*="preview"], .performer-card img, .scene-card img, .gallery-card img, .hover-card, [class*="hover"] { display: none !important; visibility: hidden !important; background-image: none !important; }`;
6+
7+
function createButton() {
8+
const nav = document.querySelector('.navbar-nav');
9+
if (!nav || document.getElementById('blackout-btn')) return;
10+
11+
const btn = document.createElement('button');
12+
btn.id = 'blackout-btn';
13+
btn.textContent = '🖼️';
14+
btn.style.margin = '0 4px';
15+
btn.style.padding = '2px 8px';
16+
btn.style.border = 'none';
17+
btn.style.borderRadius = '4px';
18+
btn.style.cursor = 'pointer';
19+
btn.style.backgroundColor = '#6c757d';
20+
btn.style.color = 'white';
21+
btn.style.fontSize = '16px';
22+
23+
btn.onclick = function() {
24+
enabled = !enabled;
25+
if (enabled) {
26+
if (!document.getElementById(cssId)) {
27+
const style = document.createElement('style');
28+
style.id = cssId;
29+
style.innerHTML = blackoutCSS;
30+
document.head.appendChild(style);
31+
}
32+
btn.style.backgroundColor = '#28a745';
33+
} else {
34+
document.getElementById(cssId)?.remove();
35+
btn.style.backgroundColor = '#6c757d';
36+
}
37+
};
38+
39+
nav.appendChild(btn);
40+
}
41+
42+
createButton();
43+
const observer = new MutationObserver(createButton);
44+
observer.observe(document.body, { childList: true, subtree: true });
45+
})();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: Image Blackout (100% Work Safe)
2+
description: Toggle button to completely hide all images, videos, hovers, scrubber sprites, tags, and AI previews
3+
version: 1.0
4+
ui:
5+
javascript:
6+
- image-blackout.js

0 commit comments

Comments
 (0)