chore: complete update

This commit is contained in:
2025-07-17 16:24:20 +02:00
parent 899227b0a4
commit 64a7051137
1300 changed files with 85570 additions and 2756 deletions

View File

@@ -0,0 +1,42 @@
// js/noise-toggle.js
import { Logger } from "../../core/logger.js";
export function init(config = {}) {
Logger.log('Noise Toggle Init', config);
const {
selector = ".noise-overlay",
toggleKey = "g",
className = "grainy",
enableTransition = true,
} = config;
const body = document.body;
const noiseElement = document.querySelector(selector);
if (!noiseElement) return;
const isInput = noiseElement => ["input", "textarea"].includes(noiseElement.tagName.toLowerCase());
function update() {
if (enableTransition) {
noiseElement.classList.toggle("hidden", !body.classList.contains(className));
} else {
noiseElement.style.display = body.classList.contains(className) ? "block" : "none";
}
}
update();
document.addEventListener("keydown", (e) => {
if (
e.key.toLowerCase() === toggleKey &&
!e.ctrlKey && !e.metaKey && !e.altKey &&
!isInput(e.target)
) {
body.classList.toggle(className);
update();
}
})
}