From 02ca1971108831f7b09e2d36571b8a43454384a2 Mon Sep 17 00:00:00 2001 From: Suss <167750109+therealsuss@users.noreply.github.com> Date: Thu, 6 Feb 2025 13:52:47 +1100 Subject: [PATCH] chaos.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit okay, so i made this and posted a screenshot of it on the discord, with no plans of releasing this. but then, people were like “you should publish this” for SOME reason. it just randomizes the position, rotation and scale of everything on the page with a 15 second delay, so you have time to uninstall it if you dont want it anymore (and im sure nobody would want this) --- mods/chaos.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 mods/chaos.js diff --git a/mods/chaos.js b/mods/chaos.js new file mode 100644 index 00000000..00008d1e --- /dev/null +++ b/mods/chaos.js @@ -0,0 +1,32 @@ +function getRandomSize(min, max) { + return Math.floor(Math.random() * (max - min + 1)) + min; +} + +function randomizeall() { + const elements = document.querySelectorAll('*'); + + elements.forEach(element => { + const randomFontSize = getRandomSize(1, 150); + element.style.fontSize = `${randomFontSize}px`; + + if (element.offsetWidth > 0 && element.offsetHeight > 0) { + const randomWidth = getRandomSize(1, 500); + const randomHeight = getRandomSize(1, 500); + element.style.width = `${randomWidth}px`; + element.style.height = `${randomHeight}px`; + } + + if (window.getComputedStyle(element).position === 'absolute' || window.getComputedStyle(element).position === 'relative') { + const randomTop = getRandomSize(1, window.innerHeight - 1); + const randomLeft = getRandomSize(1, window.innerWidth - 1); + element.style.position = 'absolute'; + element.style.top = `${randomTop}px`; + element.style.left = `${randomLeft}px`; + } + + const randomRotation = getRandomSize(-360, 360); + element.style.transform = `rotate(${randomRotation}deg)`; + }); +} + +setTimeout(randomizeall, 15000); \ No newline at end of file