idiotik.js 1.0.17 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/idiotik.js +1 -973
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idiotik.js",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "youareanidiot-style chaos toolkit for the browser",
5
5
  "main": "src/idiotik.js",
6
6
  "scripts": {
package/src/idiotik.js CHANGED
@@ -1,973 +1 @@
1
- /**
2
- * idiotik.js — youareanidiot-style chaos toolkit
3
- * recursive by default. you were warned.
4
- *
5
- * CHANGES v4:
6
- * - idiotik.start("preset:name") — queue a preset
7
- * - idiotik.start("effect:name") — queue an effect
8
- * - idiotik.start("say:message") — queue a popup/alert
9
- * - idiotik.start("cursor:name") — queue a cursor
10
- * - idiotik.start("scream") — queue scream
11
- * - idiotik.start("freeze") — queue freeze
12
- * - idiotik.start("fullscreen") — queue fullscreen
13
- * - idiotik.start("haunt") — queue haunt
14
- * - idiotik.start("fakecursor") — queue fakeCursor
15
- * - idiotik.start("gravitywarp") — queue gravityWarp
16
- * - idiotik.start("redirect:url") — queue redirect
17
- * - idiotik.start("audio:url") — queue audio
18
- * - idiotik.start("jumpscare:url") — queue jumpscare
19
- * - idiotik.start(n) — fire task at 1-based queue position n
20
- * - idiotik.start() — fire ALL queued tasks, then clear queue
21
- * - idiotik.startnow("...") — same DSL as start() but fires immediately
22
- * - idiotik.click(target) — bind queued tasks to a click target
23
- * - idiotik.nuke() — kill everything
24
- */
25
-
26
- (function (global) {
27
-
28
- // ─── GLOBAL STATE ───────────────────────────────────────────────────────────
29
- let _recursive = true;
30
- let _volume = 100;
31
- let _popup = true;
32
- let _activeScripts = {};
33
- let _activeEffects = new Set();
34
- let _audioCtx = null;
35
- let _scriptStack = [];
36
- let _taskQueue = [];
37
- let _spawnedWindows = [];
38
- let _globalIntervals = [];
39
- let _globalTimeouts = [];
40
- let _globalNodes = [];
41
-
42
- // ─── RECURSIVE SPAWN ENGINE ─────────────────────────────────────────────────
43
- function _spawnWindow() {
44
- try {
45
- const w = window.open(window.location.href, "_blank",
46
- "width=" + (300 + Math.random() * 700 | 0) +
47
- ",height=" + (200 + Math.random() * 500 | 0) +
48
- ",toolbar=no,menubar=no,scrollbars=no,resizable=yes"
49
- );
50
- if (w) {
51
- _spawnedWindows.push(w);
52
- const id = setInterval(() => {
53
- if (w.closed) { clearInterval(id); if (_recursive) _spawnWindow(); }
54
- }, 500);
55
- _globalIntervals.push(id);
56
- }
57
- } catch(e) {}
58
- }
59
-
60
- function _initRecursion() {
61
- if (!_recursive) return;
62
- _spawnWindow();
63
- const _blockAndSpawn = function(e) {
64
- if (!_recursive) return;
65
- _spawnWindow(); _spawnWindow();
66
- e.preventDefault(); e.returnValue = ""; return "";
67
- };
68
- window.addEventListener("beforeunload", _blockAndSpawn, { capture: true });
69
- window.addEventListener("unload", () => { if (_recursive) { _spawnWindow(); _spawnWindow(); } }, { capture: true });
70
- window.addEventListener("pagehide", () => { if (_recursive) { _spawnWindow(); _spawnWindow(); } }, { capture: true });
71
- document.addEventListener("visibilitychange", () => { if (document.hidden && _recursive) { _spawnWindow(); _spawnWindow(); } });
72
- window.addEventListener("blur", () => { if (_recursive) setTimeout(_spawnWindow, 50); });
73
- }
74
-
75
- if (document.readyState === "loading") {
76
- document.addEventListener("DOMContentLoaded", _initRecursion);
77
- } else {
78
- setTimeout(_initRecursion, 0);
79
- }
80
-
81
- // ─── HELPERS ────────────────────────────────────────────────────────────────
82
- function _getAudioCtx() {
83
- if (!_audioCtx) _audioCtx = new (window.AudioContext || window.webkitAudioContext)();
84
- return _audioCtx;
85
- }
86
-
87
- function _currentScript() {
88
- return _scriptStack.length ? _scriptStack[_scriptStack.length - 1] : null;
89
- }
90
-
91
- function _requireScript(name) {
92
- if (!_currentScript()) throw new Error(`idiotik.${name}() must be inside idiotik.script()`);
93
- }
94
-
95
- function _track(thing, type) {
96
- const ctx = _currentScript();
97
- if (ctx) {
98
- ctx[type] = ctx[type] || [];
99
- ctx[type].push(thing);
100
- } else {
101
- if (type === "intervals") _globalIntervals.push(thing);
102
- if (type === "timeouts") _globalTimeouts.push(thing);
103
- if (type === "htmlNodes") _globalNodes.push(thing);
104
- }
105
- }
106
-
107
- function _buildAudioChain(buffer) {
108
- const ctx = _getAudioCtx();
109
- const source = ctx.createBufferSource();
110
- source.buffer = buffer;
111
- source.loop = true;
112
- const gainNode = ctx.createGain();
113
- const rawVol = _volume;
114
- gainNode.gain.value = rawVol <= 200 ? rawVol / 100 : Math.min(rawVol / 100, 50);
115
- let lastNode = source;
116
- if (rawVol > 200) {
117
- const bb = ctx.createBiquadFilter();
118
- bb.type = "lowshelf"; bb.frequency.value = 200;
119
- bb.gain.value = Math.min(((rawVol - 200) / 4800) * 40, 40);
120
- lastNode.connect(bb); lastNode = bb;
121
- }
122
- if (rawVol >= 450) {
123
- for (const b of [
124
- { type: "lowshelf", freq: 60, gain: 40 },
125
- { type: "peaking", freq: 250, gain: 40 },
126
- { type: "peaking", freq: 500, gain: 40 },
127
- { type: "peaking", freq: 1500, gain: 40 },
128
- { type: "peaking", freq: 4000, gain: 40 },
129
- { type: "peaking", freq: 8000, gain: 40 },
130
- { type: "highshelf", freq: 16000, gain: 40 },
131
- ]) {
132
- const f = ctx.createBiquadFilter();
133
- f.type = b.type; f.frequency.value = b.freq; f.gain.value = b.gain;
134
- lastNode.connect(f); lastNode = f;
135
- }
136
- }
137
- if (rawVol >= 300) {
138
- const dist = ctx.createWaveShaper();
139
- const curve = new Float32Array(256);
140
- const k = Math.min((rawVol - 300) / 10, 400);
141
- for (let i = 0; i < 256; i++) {
142
- const x = (i * 2) / 256 - 1;
143
- curve[i] = ((Math.PI + k) * x) / (Math.PI + k * Math.abs(x));
144
- }
145
- dist.curve = curve; dist.oversample = "4x";
146
- lastNode.connect(dist); lastNode = dist;
147
- }
148
- lastNode.connect(gainNode);
149
- gainNode.connect(ctx.destination);
150
- return source;
151
- }
152
-
153
- async function _loadAndPlay(url) {
154
- const ctx = _getAudioCtx();
155
- const resp = await fetch(url);
156
- const arrayBuf = await resp.arrayBuffer();
157
- const audioBuf = await ctx.decodeAudioData(arrayBuf);
158
- const source = _buildAudioChain(audioBuf);
159
- source.start(0);
160
- return source;
161
- }
162
-
163
- function _parseAudioUrl(urlOrFile) {
164
- if (typeof urlOrFile === "string" && urlOrFile.startsWith("file://"))
165
- return urlOrFile.replace("file://", "");
166
- return urlOrFile;
167
- }
168
-
169
- function _whiteNoise(durationSec) {
170
- const ctx = _getAudioCtx();
171
- const bufferSize = ctx.sampleRate * durationSec;
172
- const buffer = ctx.createBuffer(1, bufferSize, ctx.sampleRate);
173
- const data = buffer.getChannelData(0);
174
- for (let i = 0; i < bufferSize; i++) data[i] = Math.random() * 2 - 1;
175
- const source = ctx.createBufferSource();
176
- source.buffer = buffer;
177
- const gain = ctx.createGain();
178
- gain.gain.value = Math.min(_volume / 100, 5);
179
- source.connect(gain);
180
- gain.connect(ctx.destination);
181
- return source;
182
- }
183
-
184
- // ─── DSL PARSER ─────────────────────────────────────────────────────────────
185
- // Turns "effect:shake", "say:hello world", "preset:robux", "scream", etc.
186
- // into a callable function. Used by both start() and startnow().
187
- function _resolve(ref) {
188
- // already a function — use directly
189
- if (typeof ref === "function") return ref;
190
-
191
- // string DSL
192
- if (typeof ref === "string") {
193
- const colon = ref.indexOf(":");
194
- const cmd = colon === -1 ? ref.trim().toLowerCase() : ref.slice(0, colon).trim().toLowerCase();
195
- const arg = colon === -1 ? "" : ref.slice(colon + 1);
196
-
197
- switch (cmd) {
198
- case "effect": return idiotik.effect(arg);
199
- case "say": return idiotik.say(arg);
200
- case "cursor": return idiotik.cursor(arg);
201
- case "preset": return idiotik.preset(arg);
202
- case "redirect": return idiotik.redirect(arg);
203
- case "audio": return idiotik.audio(arg);
204
- case "jumpscare": return idiotik.jumpscare(arg);
205
- case "scream": return idiotik.scream();
206
- case "freeze": return idiotik.freeze();
207
- case "fullscreen": return idiotik.fullscreen();
208
- case "haunt": return idiotik.haunt();
209
- case "fakecursor": return idiotik.fakeCursor();
210
- case "gravitywarp":return idiotik.gravityWarp();
211
- case "noise": return idiotik.noise(Number(arg) || 1);
212
- default:
213
- console.warn(`idiotik.start: unknown command "${cmd}"`);
214
- return null;
215
- }
216
- }
217
-
218
- return null;
219
- }
220
-
221
- // ─── CURSOR PRESETS ─────────────────────────────────────────────────────────
222
- const _cursorPresets = {
223
- hand: "pointer", none: "none", crosshair: "crosshair", wait: "wait",
224
- rainbow: "__rainbow__", wiggle: "__wiggle__", explode: "__explode__",
225
- ghost: "__ghost__", eyes: "__eyes__",
226
- };
227
-
228
- // ─── EFFECT IMPLEMENTATIONS ─────────────────────────────────────────────────
229
- const _effectImpls = {
230
- shake() {
231
- const id = "__idiotik_shake__"; if (document.getElementById(id)) return;
232
- const s = document.createElement("style"); s.id = id;
233
- s.textContent = `@keyframes __idiotik_shake{0%,100%{transform:translate(0,0)}10%{transform:translate(-8px,8px)}20%{transform:translate(8px,-8px)}30%{transform:translate(-8px,0)}40%{transform:translate(8px,8px)}50%{transform:translate(-4px,-4px)}60%{transform:translate(4px,4px)}70%{transform:translate(-8px,8px)}80%{transform:translate(8px,-8px)}90%{transform:translate(-4px,4px)}}body{animation:__idiotik_shake 0.3s infinite}`;
234
- document.head.appendChild(s);
235
- },
236
- spin() {
237
- const id = "__idiotik_spin__"; if (document.getElementById(id)) return;
238
- const s = document.createElement("style"); s.id = id;
239
- s.textContent = `@keyframes __idiotik_spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}body{animation:__idiotik_spin 2s linear infinite;transform-origin:center center}`;
240
- document.head.appendChild(s);
241
- },
242
- glitch() {
243
- const id = "__idiotik_glitch__"; if (document.getElementById(id)) return;
244
- const s = document.createElement("style"); s.id = id;
245
- s.textContent = `@keyframes __idiotik_glitch1{0%,100%{clip-path:inset(0 0 95% 0)}25%{clip-path:inset(30% 0 50% 0)}50%{clip-path:inset(60% 0 20% 0)}75%{clip-path:inset(10% 0 80% 0)}}@keyframes __idiotik_glitch2{0%,100%{clip-path:inset(80% 0 5% 0);transform:translate(-5px,0)}25%{clip-path:inset(20% 0 70% 0);transform:translate(5px,0)}50%{clip-path:inset(50% 0 30% 0);transform:translate(-3px,0)}75%{clip-path:inset(5% 0 90% 0);transform:translate(3px,0)}}body::before,body::after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:inherit;pointer-events:none;z-index:9999}body::before{animation:__idiotik_glitch1 0.4s infinite;color:red;text-shadow:2px 0 red}body::after{animation:__idiotik_glitch2 0.4s infinite;color:blue;text-shadow:-2px 0 blue}`;
246
- document.head.appendChild(s);
247
- },
248
- rainbow() {
249
- const id = "__idiotik_rainbow__"; if (document.getElementById(id)) return;
250
- const s = document.createElement("style"); s.id = id;
251
- s.textContent = `@keyframes __idiotik_rainbow{0%{background:#ff0000}15%{background:#ff8800}30%{background:#ffff00}45%{background:#00ff00}60%{background:#0000ff}75%{background:#8800ff}90%{background:#ff00ff}100%{background:#ff0000}}body{animation:__idiotik_rainbow 0.5s infinite}`;
252
- document.head.appendChild(s);
253
- },
254
- invert() {
255
- const id = "__idiotik_invert__"; if (document.getElementById(id)) return;
256
- const s = document.createElement("style"); s.id = id;
257
- s.textContent = `body{filter:invert(1)}`;
258
- document.head.appendChild(s);
259
- },
260
- matrix() {
261
- const cid = "__idiotik_matrix__"; if (document.getElementById(cid)) return;
262
- const canvas = document.createElement("canvas"); canvas.id = cid;
263
- canvas.style.cssText = "position:fixed;top:0;left:0;z-index:9998;pointer-events:none;width:100vw;height:100vh;opacity:0.7;";
264
- document.body.appendChild(canvas); _track(canvas, "htmlNodes");
265
- const ctx = canvas.getContext("2d");
266
- canvas.width = window.innerWidth; canvas.height = window.innerHeight;
267
- const cols = Math.floor(canvas.width / 16);
268
- const drops = Array(cols).fill(1);
269
- const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()";
270
- _track(setInterval(() => {
271
- ctx.fillStyle = "rgba(0,0,0,0.05)"; ctx.fillRect(0, 0, canvas.width, canvas.height);
272
- ctx.fillStyle = "#0f0"; ctx.font = "16px monospace";
273
- drops.forEach((y, i) => {
274
- const ch = chars[Math.floor(Math.random() * chars.length)];
275
- ctx.fillText(ch, i * 16, y * 16);
276
- if (y * 16 > canvas.height && Math.random() > 0.975) drops[i] = 0;
277
- drops[i]++;
278
- });
279
- }, 50), "intervals");
280
- },
281
- melt() {
282
- const id = "__idiotik_melt__"; if (document.getElementById(id)) return;
283
- const s = document.createElement("style"); s.id = id;
284
- s.textContent = `@keyframes __idiotik_melt{0%{transform:skewY(0deg) scaleY(1)}50%{transform:skewY(5deg) scaleY(1.1)}100%{transform:skewY(-3deg) scaleY(0.9)}}body{animation:__idiotik_melt 1s ease-in-out infinite alternate;transform-origin:bottom}`;
285
- document.head.appendChild(s);
286
- },
287
- vhs() {
288
- const id = "__idiotik_vhs__"; if (document.getElementById(id)) return;
289
- const s = document.createElement("style"); s.id = id;
290
- s.textContent = `@keyframes __idiotik_vhs_scan{0%{top:-100%}100%{top:100%}}@keyframes __idiotik_vhs_track{0%,95%{transform:none}96%{transform:translate(-4px,0) skewX(-0.5deg)}97%{transform:translate(4px,0) skewX(0.5deg)}98%{transform:translate(-2px,0)}100%{transform:none}}body{animation:__idiotik_vhs_track 3s infinite}body::before{content:'';position:fixed;top:0;left:0;width:100%;height:3px;background:rgba(255,255,255,0.15);z-index:99999;pointer-events:none;animation:__idiotik_vhs_scan 4s linear infinite}body::after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.08) 2px,rgba(0,0,0,0.08) 4px);pointer-events:none;z-index:99998}`;
291
- document.head.appendChild(s);
292
- },
293
- static() {
294
- const cid = "__idiotik_static__"; if (document.getElementById(cid)) return;
295
- const canvas = document.createElement("canvas"); canvas.id = cid;
296
- canvas.width = 256; canvas.height = 256;
297
- canvas.style.cssText = "position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9997;pointer-events:none;opacity:0.12;image-rendering:pixelated;";
298
- document.body.appendChild(canvas); _track(canvas, "htmlNodes");
299
- const ctx = canvas.getContext("2d");
300
- _track(setInterval(() => {
301
- const img = ctx.createImageData(256, 256);
302
- for (let i = 0; i < img.data.length; i += 4) {
303
- const v = Math.random() * 255 | 0;
304
- img.data[i] = img.data[i+1] = img.data[i+2] = v; img.data[i+3] = 255;
305
- }
306
- ctx.putImageData(img, 0, 0);
307
- }, 40), "intervals");
308
- },
309
- zoom() {
310
- const id = "__idiotik_zoom__"; if (document.getElementById(id)) return;
311
- const s = document.createElement("style"); s.id = id;
312
- s.textContent = `@keyframes __idiotik_zoom{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}body{animation:__idiotik_zoom 0.8s ease-in-out infinite}`;
313
- document.head.appendChild(s);
314
- },
315
- bounce() {
316
- const id = "__idiotik_bounce__"; if (document.getElementById(id)) return;
317
- const s = document.createElement("style"); s.id = id;
318
- s.textContent = `@keyframes __idiotik_bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-20px)}}body{animation:__idiotik_bounce 0.5s ease-in-out infinite}`;
319
- document.head.appendChild(s);
320
- },
321
- flip() {
322
- const id = "__idiotik_flip__"; if (document.getElementById(id)) return;
323
- const s = document.createElement("style"); s.id = id;
324
- s.textContent = `@keyframes __idiotik_flip{0%,100%{transform:scaleX(1)}50%{transform:scaleX(-1)}}body{animation:__idiotik_flip 1s step-end infinite}`;
325
- document.head.appendChild(s);
326
- },
327
- blur() {
328
- const id = "__idiotik_blur__"; if (document.getElementById(id)) return;
329
- const s = document.createElement("style"); s.id = id;
330
- s.textContent = `@keyframes __idiotik_blur{0%,100%{filter:blur(0px)}50%{filter:blur(8px)}}body{animation:__idiotik_blur 1s ease-in-out infinite}`;
331
- document.head.appendChild(s);
332
- },
333
- darkmode() {
334
- const id = "__idiotik_darkmode__"; if (document.getElementById(id)) return;
335
- const s = document.createElement("style"); s.id = id;
336
- s.textContent = `@keyframes __idiotik_dark{0%,100%{filter:brightness(1)}50%{filter:brightness(0)}}body{animation:__idiotik_dark 0.3s step-end infinite}`;
337
- document.head.appendChild(s);
338
- },
339
- pixelate() {
340
- const cid = "__idiotik_pixelate__"; if (document.getElementById(cid)) return;
341
- const canvas = document.createElement("canvas"); canvas.id = cid;
342
- canvas.style.cssText = "position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9996;pointer-events:none;image-rendering:pixelated;";
343
- canvas.width = 64; canvas.height = 36;
344
- document.body.appendChild(canvas); _track(canvas, "htmlNodes");
345
- const ctx = canvas.getContext("2d");
346
- let level = 0;
347
- _track(setInterval(() => {
348
- try { ctx.drawImage(document.documentElement, 0, 0, 64, 36); }
349
- catch(e) { ctx.fillStyle = `hsl(${level * 10},100%,50%)`; ctx.fillRect(0, 0, 64, 36); }
350
- level = (level + 1) % 36;
351
- }, 100), "intervals");
352
- },
353
- };
354
-
355
- // ─── PRESET REGISTRY ────────────────────────────────────────────────────────
356
- const _presets = {
357
- classic() {
358
- idiotik.recursive("yes");
359
- idiotik.startnow("effect:rainbow");
360
- idiotik.startnow("effect:shake");
361
- idiotik.start("say:YOU ARE AN IDIOT HA HA HA HA HA HA");
362
- idiotik.repeat("inf");
363
- idiotik.startnow("scream");
364
- },
365
- nuclear() {
366
- idiotik.recursive("yes");
367
- idiotik.volume(5000);
368
- idiotik.startnow("effect:shake");
369
- idiotik.startnow("effect:rainbow");
370
- idiotik.startnow("effect:glitch");
371
- idiotik.startnow("effect:spin");
372
- idiotik.startnow("effect:matrix");
373
- idiotik.startnow("effect:vhs");
374
- idiotik.startnow("effect:static");
375
- idiotik.startnow("effect:zoom");
376
- idiotik.startnow("scream");
377
- idiotik.startnow("fullscreen");
378
- idiotik.startnow("freeze");
379
- idiotik.startnow("cursor:none");
380
- idiotik.startnow("haunt");
381
- idiotik.start("say:💀💀💀 YOU ARE SO COOKED 💀💀💀");
382
- idiotik.repeat("inf");
383
- },
384
- mild() {
385
- idiotik.recursive("no");
386
- idiotik.volume(100);
387
- idiotik.startnow("effect:shake");
388
- idiotik.start("say:gotcha lol");
389
- idiotik.repeat(5);
390
- },
391
- rickroll() {
392
- idiotik.recursive("no");
393
- idiotik.startnow("redirect:https://www.youtube.com/watch?v=dQw4w9WgXcQ");
394
- },
395
- jumpscare() {
396
- idiotik.recursive("yes");
397
- idiotik.volume(300);
398
- idiotik.wait(3000).then(() => {
399
- idiotik.startnow("effect:glitch");
400
- idiotik.startnow("jumpscare:https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/640px-Camponotus_flavomarginatus_ant.jpg");
401
- idiotik.startnow("scream");
402
- });
403
- },
404
- epilepsy() {
405
- idiotik.recursive("yes");
406
- idiotik.volume(450);
407
- idiotik.startnow("effect:rainbow");
408
- idiotik.startnow("effect:shake");
409
- idiotik.startnow("effect:glitch");
410
- idiotik.startnow("effect:invert");
411
- idiotik.startnow("effect:static");
412
- idiotik.startnow("cursor:rainbow");
413
- idiotik.startnow("scream");
414
- },
415
- robux() {
416
- idiotik.recursive("yes");
417
- idiotik.volume(200);
418
- idiotik.startnow("effect:rainbow");
419
- idiotik.startnow("cursor:explode");
420
- idiotik.start("say:FREE ROBUX AT PORNHUB.COM!!!");
421
- idiotik.repeat("inf");
422
- },
423
- villain() {
424
- idiotik.recursive("no");
425
- idiotik.volume(150);
426
- idiotik.startnow("effect:matrix");
427
- idiotik.wait(2000).then(() => idiotik.startnow("effect:glitch"));
428
- idiotik.wait(4000).then(() => {
429
- idiotik.volume(500);
430
- idiotik.startnow("effect:shake");
431
- idiotik.startnow("scream");
432
- idiotik.recursive("yes");
433
- idiotik.start("say:did you really think you were safe 🗿");
434
- idiotik.repeat("inf");
435
- });
436
- },
437
- melt() {
438
- idiotik.recursive("no");
439
- idiotik.volume(100);
440
- idiotik.startnow("effect:melt");
441
- idiotik.startnow("effect:spin");
442
- idiotik.wait(3000).then(() => {
443
- idiotik.volume(300);
444
- idiotik.startnow("effect:rainbow");
445
- idiotik.startnow("scream");
446
- });
447
- },
448
- haunted() {
449
- idiotik.recursive("yes");
450
- idiotik.volume(80);
451
- idiotik.startnow("effect:vhs");
452
- idiotik.startnow("effect:glitch");
453
- idiotik.startnow("cursor:ghost");
454
- idiotik.startnow("haunt");
455
- idiotik.wait(5000).then(() => {
456
- idiotik.volume(600);
457
- idiotik.startnow("scream");
458
- idiotik.startnow("effect:flip");
459
- idiotik.startnow("effect:shake");
460
- idiotik.start("say:👁️ i was here the whole time 👁️");
461
- idiotik.repeat("inf");
462
- });
463
- },
464
- gravity() {
465
- idiotik.recursive("yes");
466
- idiotik.volume(200);
467
- idiotik.startnow("gravitywarp");
468
- idiotik.startnow("effect:melt");
469
- idiotik.startnow("cursor:eyes");
470
- idiotik.wait(3000).then(() => {
471
- idiotik.startnow("effect:rainbow");
472
- idiotik.startnow("scream");
473
- });
474
- },
475
- };
476
-
477
- // ─── CORE OBJECT ────────────────────────────────────────────────────────────
478
- const idiotik = {
479
-
480
- // ── GLOBAL TOGGLES ───────────────────────────────────────────────────────
481
-
482
- recursive(val) {
483
- _recursive = (val === true || val === "yes" || val === 1);
484
- if (_recursive) _initRecursion();
485
- return idiotik;
486
- },
487
-
488
- volume(n) {
489
- _volume = Math.max(0, Math.min(5000, Number(n)));
490
- return idiotik;
491
- },
492
-
493
- popup(val) {
494
- _popup = (val === true || val === "yes" || val === 1);
495
- return idiotik;
496
- },
497
-
498
- // ── PRESET SYSTEM ────────────────────────────────────────────────────────
499
-
500
- preset(name) {
501
- return function() {
502
- if (_presets[name]) _presets[name]();
503
- else console.warn(`idiotik.preset: unknown preset "${name}". try idiotik.list()`);
504
- };
505
- },
506
-
507
- list() {
508
- const names = Object.keys(_presets);
509
- console.log(`%cidiotik.js — available presets (${names.length})`, "font-weight:bold;color:#ff4444;font-size:14px;");
510
- names.forEach(n => console.log(` %c• ${n}`, "color:#ffcc00;"));
511
- console.log('%cusage: idiotik.start("preset:name")', "color:#aaa;font-style:italic;");
512
- return names;
513
- },
514
-
515
- registerPreset(name, fn) {
516
- _presets[name] = fn;
517
- return idiotik;
518
- },
519
-
520
- // ── SCRIPT CONTEXT ───────────────────────────────────────────────────────
521
-
522
- script() {
523
- _scriptStack.push({ id: null, intervals: [], timeouts: [], audioSources: [], htmlNodes: [], _html: null });
524
- return idiotik;
525
- },
526
-
527
- id(name) {
528
- _requireScript("id");
529
- const ctx = _currentScript();
530
- ctx.id = name; _activeScripts[name] = ctx;
531
- return idiotik;
532
- },
533
-
534
- html(code) {
535
- _requireScript("html");
536
- const ctx = _currentScript();
537
- ctx._html = code;
538
- const div = document.createElement("div");
539
- div.innerHTML = code; document.body.appendChild(div); ctx.htmlNodes.push(div);
540
- if (_recursive) {
541
- const id = setInterval(() => {
542
- const d = document.createElement("div"); d.innerHTML = code;
543
- document.body.appendChild(d); ctx.htmlNodes.push(d);
544
- }, 500);
545
- ctx.intervals.push(id);
546
- }
547
- return idiotik;
548
- },
549
-
550
- end() {
551
- if (!_currentScript()) throw new Error("idiotik.end() called outside a script");
552
- _scriptStack.pop();
553
- return idiotik;
554
- },
555
-
556
- // ── QUEUE / START SYSTEM ─────────────────────────────────────────────────
557
-
558
- /**
559
- * idiotik.start(ref)
560
- *
561
- * start() → fire ALL queued tasks, clear queue
562
- * start(n) → fire task at 1-based position n (don't clear)
563
- * start("effect:shake") → enqueue effect
564
- * start("say:hello") → enqueue popup
565
- * start("preset:robux") → enqueue preset
566
- * start("scream") → enqueue scream
567
- * start(fn) → enqueue a raw function
568
- */
569
- start(ref) {
570
- // fire all
571
- if (ref === undefined || ref === null) {
572
- const tasks = [..._taskQueue];
573
- _taskQueue = [];
574
- tasks.forEach(fn => { try { fn(); } catch(e) {} });
575
- return idiotik;
576
- }
577
-
578
- // fire by 1-based index
579
- if (typeof ref === "number") {
580
- const idx = ref - 1;
581
- if (idx >= 0 && idx < _taskQueue.length) {
582
- try { _taskQueue[idx](); } catch(e) {}
583
- } else {
584
- console.warn(`idiotik.start(${ref}): no task at position ${ref} (queue length: ${_taskQueue.length})`);
585
- }
586
- return idiotik;
587
- }
588
-
589
- // resolve and enqueue
590
- const fn = _resolve(ref);
591
- if (fn) _taskQueue.push(fn);
592
- return idiotik;
593
- },
594
-
595
- /**
596
- * idiotik.startnow(ref)
597
- * Same DSL as start() but resolves AND fires immediately.
598
- * Does NOT use the queue.
599
- */
600
- startnow(ref) {
601
- const fn = _resolve(ref);
602
- if (fn) { try { fn(); } catch(e) {} }
603
- return idiotik;
604
- },
605
-
606
- // ── CLICK BINDING ────────────────────────────────────────────────────────
607
-
608
- /**
609
- * idiotik.click(target, ref?)
610
- * Fires queued tasks (or ref) when a matching element is clicked.
611
- * target: CSS selector or plain text matched against clickable elements.
612
- * ref: optional DSL string or function — if omitted, snapshots current queue.
613
- */
614
- click(target, ref) {
615
- const tasksSnapshot = ref ? null : [..._taskQueue];
616
-
617
- const _fire = function(e) {
618
- if (ref) {
619
- const fn = _resolve(ref);
620
- if (fn) { try { fn(e); } catch(err) {} }
621
- } else {
622
- tasksSnapshot.forEach(task => { try { task(e); } catch(err) {} });
623
- }
624
- };
625
-
626
- const _attach = function() {
627
- let els = [];
628
- try { els = [...document.querySelectorAll(target)]; } catch(e) {}
629
- if (!els.length) {
630
- const lower = target.toLowerCase().trim();
631
- els = [...document.querySelectorAll("button,a,input[type='button'],input[type='submit'],[role='button'],label,[onclick]")]
632
- .filter(el => el.textContent.trim().toLowerCase().includes(lower)
633
- || (el.value && el.value.trim().toLowerCase().includes(lower)));
634
- }
635
- if (!els.length) console.warn(`idiotik.click: no elements found for "${target}" — will retry on DOM changes`);
636
- els.forEach(el => {
637
- if (el.__idiotikClick) return;
638
- el.__idiotikClick = true;
639
- el.addEventListener("click", _fire);
640
- _track(el, "htmlNodes");
641
- });
642
- };
643
-
644
- if (document.readyState !== "loading") _attach();
645
- else document.addEventListener("DOMContentLoaded", _attach);
646
-
647
- const observer = new MutationObserver(_attach);
648
- observer.observe(document.body || document.documentElement, { childList: true, subtree: true });
649
- if (!_globalNodes._observers) _globalNodes._observers = [];
650
- _globalNodes._observers.push(observer);
651
-
652
- return idiotik;
653
- },
654
-
655
- queue(ref) {
656
- const fn = _resolve(ref);
657
- if (fn) _taskQueue.push(fn);
658
- return idiotik;
659
- },
660
-
661
- clearQueue() {
662
- _taskQueue = [];
663
- return idiotik;
664
- },
665
-
666
- repeat(n) {
667
- if (!_taskQueue.length) return idiotik;
668
- const fn = _taskQueue[_taskQueue.length - 1];
669
- const infinite = (n === Infinity || n === "inf" || n === "Infinity");
670
- if (infinite) {
671
- _track(setInterval(() => fn(), 100), "intervals");
672
- } else {
673
- let count = 0;
674
- const id = setInterval(() => { fn(); count++; if (count >= n) clearInterval(id); }, 100);
675
- _track(id, "intervals");
676
- }
677
- return idiotik;
678
- },
679
-
680
- get continue() { return idiotik; },
681
-
682
- wait(ms) {
683
- return new Promise(resolve => { _track(setTimeout(resolve, ms), "timeouts"); });
684
- },
685
-
686
- halt(name) {
687
- const ctx = _activeScripts[name];
688
- if (!ctx) return idiotik;
689
- (ctx.intervals || []).forEach(id => clearInterval(id));
690
- (ctx.timeouts || []).forEach(id => clearTimeout(id));
691
- (ctx.audioSources || []).forEach(s => { try { s.stop(); } catch(e){} });
692
- (ctx.htmlNodes || []).forEach(n => { try { n.remove(); } catch(e){} });
693
- delete _activeScripts[name];
694
- return idiotik;
695
- },
696
-
697
- nuke() {
698
- _recursive = false;
699
- _taskQueue = [];
700
- _globalIntervals.forEach(id => clearInterval(id));
701
- _globalTimeouts.forEach(id => clearTimeout(id));
702
- _globalNodes.forEach(n => { try { n.remove(); } catch(e){} });
703
- _globalIntervals = []; _globalTimeouts = []; _globalNodes = [];
704
- Object.keys(_activeScripts).forEach(k => idiotik.halt(k));
705
- idiotik.cleareffects();
706
- document.body.style.cssText = "";
707
- document.body.style.cursor = "";
708
- if (_audioCtx) { try { _audioCtx.close(); } catch(e){} _audioCtx = null; }
709
- _spawnedWindows.forEach(w => { try { w.close(); } catch(e){} });
710
- _spawnedWindows = [];
711
- if (_globalNodes._observers) {
712
- _globalNodes._observers.forEach(obs => { try { obs.disconnect(); } catch(e){} });
713
- _globalNodes._observers = [];
714
- }
715
- console.log("%cidiotik: nuked. RIP.", "color:#ff4444;font-weight:bold;");
716
- return idiotik;
717
- },
718
-
719
- status() {
720
- console.log("%cidiotik STATUS", "color:#ff4444;font-weight:bold;font-size:14px;");
721
- console.log(" recursive:", _recursive);
722
- console.log(" volume:", _volume);
723
- console.log(" popup:", _popup);
724
- console.log(" active effects:", [..._activeEffects]);
725
- console.log(" queued tasks:", _taskQueue.length);
726
- console.log(" active scripts:", Object.keys(_activeScripts));
727
- console.log(" spawned windows:", _spawnedWindows.filter(w => !w.closed).length);
728
- return idiotik;
729
- },
730
-
731
- // ── CONDITIONAL ──────────────────────────────────────────────────────────
732
-
733
- _ifResult: null,
734
-
735
- if(condition) {
736
- idiotik._ifResult = !!condition;
737
- return {
738
- then(fn) {
739
- if (idiotik._ifResult) fn();
740
- return { else(fn2) { if (!idiotik._ifResult) fn2(); return idiotik; } };
741
- }
742
- };
743
- },
744
-
745
- else(fn) {
746
- if (!idiotik._ifResult) fn();
747
- return idiotik;
748
- },
749
-
750
- random(...methods) {
751
- const pick = methods[Math.floor(Math.random() * methods.length)];
752
- if (typeof pick === "function") pick();
753
- return idiotik;
754
- },
755
-
756
- // ── CHAOS METHODS ────────────────────────────────────────────────────────
757
-
758
- say(msg) {
759
- return function _say() {
760
- if (_popup) {
761
- const w = window.open("", "_blank", "width=300,height=150,toolbar=no,menubar=no,scrollbars=no,resizable=no");
762
- if (w) {
763
- w.document.write(`<html><body style="margin:0;display:flex;align-items:center;justify-content:center;height:100vh;font-family:Comic Sans MS,cursive;font-size:1.2rem;background:#fff;text-align:center;padding:1rem;">${msg}</body></html>`);
764
- w.document.close();
765
- if (_recursive) w.onload = () => setTimeout(_say, 100);
766
- if (_recursive) setTimeout(_say, 100);
767
- }
768
- } else {
769
- alert(msg);
770
- if (_recursive) setTimeout(() => _say(), 0);
771
- }
772
- };
773
- },
774
-
775
- redirect(url) { return function() { window.location.href = url; }; },
776
-
777
- freeze() {
778
- return function() {
779
- document.addEventListener("keydown", e => e.preventDefault(), true);
780
- document.addEventListener("mousedown", e => e.preventDefault(), true);
781
- document.addEventListener("contextmenu", e => e.preventDefault(), true);
782
- };
783
- },
784
-
785
- fullscreen() {
786
- return function _fs() {
787
- const el = document.documentElement;
788
- if (el.requestFullscreen) el.requestFullscreen();
789
- else if (el.webkitRequestFullscreen) el.webkitRequestFullscreen();
790
- document.addEventListener("fullscreenchange", () => {
791
- if (!document.fullscreenElement && _recursive) setTimeout(_fs, 100);
792
- });
793
- };
794
- },
795
-
796
- jumpscare(imgUrl, sfxUrl) {
797
- return function _js() {
798
- const div = document.createElement("div");
799
- div.style.cssText = "position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:99999;background:#000;display:flex;align-items:center;justify-content:center;";
800
- const img = document.createElement("img");
801
- img.src = imgUrl; img.style.cssText = "max-width:100%;max-height:100%;object-fit:contain;";
802
- div.appendChild(img); document.body.appendChild(div); _track(div, "htmlNodes");
803
- if (sfxUrl) _loadAndPlay(_parseAudioUrl(sfxUrl));
804
- const ctx = _currentScript(); if (ctx) ctx.htmlNodes.push(div);
805
- if (_recursive) setTimeout(() => { div.remove(); _js(); }, 1000);
806
- };
807
- },
808
-
809
- scream() {
810
- return function _scream() {
811
- const ctx = _getAudioCtx();
812
- const osc = ctx.createOscillator();
813
- const gain = ctx.createGain();
814
- osc.type = "sawtooth"; osc.frequency.value = 880;
815
- osc.frequency.linearRampToValueAtTime(440, ctx.currentTime + 1);
816
- osc.frequency.linearRampToValueAtTime(1760, ctx.currentTime + 2);
817
- gain.gain.value = Math.min(_volume / 100, 10);
818
- osc.connect(gain); gain.connect(ctx.destination);
819
- osc.start(); setTimeout(() => osc.stop(), 2000);
820
- if (_recursive) setTimeout(_scream, 2100);
821
- };
822
- },
823
-
824
- noise(durationSec) {
825
- const dur = durationSec || 1;
826
- return function _noise() {
827
- const source = _whiteNoise(dur);
828
- source.start(); source.stop(_getAudioCtx().currentTime + dur);
829
- if (_recursive) setTimeout(_noise, dur * 1000 + 100);
830
- };
831
- },
832
-
833
- haunt() {
834
- const msgs = ["👁️", "i see you", "leave.", "you can't close this", "help", "HA", "why", "🩸", "turn around"];
835
- return function _haunt() {
836
- const span = document.createElement("div");
837
- span.textContent = msgs[Math.floor(Math.random() * msgs.length)];
838
- span.style.cssText = `position:fixed;left:${Math.random()*90}vw;top:${Math.random()*90}vh;font-size:${16+Math.random()*40}px;color:rgba(255,0,0,${0.3+Math.random()*0.7});pointer-events:none;z-index:99990;font-family:serif;font-style:italic;transition:opacity 1s;text-shadow:0 0 10px red;`;
839
- document.body.appendChild(span); _track(span, "htmlNodes");
840
- setTimeout(() => { span.style.opacity = "0"; setTimeout(() => span.remove(), 1000); }, 1500);
841
- if (_recursive) setTimeout(_haunt, 800 + Math.random() * 1200);
842
- };
843
- },
844
-
845
- fakeCursor() {
846
- return function() {
847
- const cur = document.createElement("div");
848
- cur.textContent = "🖱️";
849
- cur.style.cssText = "position:fixed;font-size:20px;pointer-events:none;z-index:999999;transition:left 0.2s,top 0.2s;";
850
- document.body.appendChild(cur); _track(cur, "htmlNodes");
851
- let mx = 0, my = 0;
852
- document.addEventListener("mousemove", e => { mx = e.clientX; my = e.clientY; });
853
- _track(setInterval(() => {
854
- cur.style.left = (mx + 15 + Math.sin(Date.now() / 200) * 10) + "px";
855
- cur.style.top = (my + 15 + Math.cos(Date.now() / 200) * 10) + "px";
856
- }, 50), "intervals");
857
- };
858
- },
859
-
860
- gravityWarp() {
861
- return function _gw() {
862
- [...document.querySelectorAll("p,h1,h2,h3,h4,img,div,a,button,span")]
863
- .filter(e => e.children.length === 0 || e.tagName === "IMG")
864
- .forEach(el => {
865
- if (el.dataset.idiotikGravity) return;
866
- el.dataset.idiotikGravity = "1";
867
- const orig = el.style.transform; let vy = 0;
868
- const id = setInterval(() => {
869
- vy += 0.5;
870
- const cur = parseFloat(el.dataset.gy || "0");
871
- el.dataset.gy = cur + vy;
872
- el.style.transform = `${orig} translateY(${cur}px) rotate(${cur * 0.1}deg)`;
873
- if (cur > window.innerHeight * 1.5) clearInterval(id);
874
- }, 50);
875
- });
876
- if (_recursive) setTimeout(_gw, 5000);
877
- };
878
- },
879
-
880
- audio(urlOrFile) {
881
- const parsed = _parseAudioUrl(urlOrFile);
882
- return async function _audio() {
883
- const source = await _loadAndPlay(parsed);
884
- const ctx = _currentScript(); if (ctx) ctx.audioSources.push(source);
885
- if (_recursive) source.addEventListener?.("ended", _audio);
886
- };
887
- },
888
-
889
- effect(name) {
890
- return function() {
891
- if (_effectImpls[name]) { _activeEffects.add(name); _effectImpls[name](); }
892
- else console.warn(`idiotik.effect: unknown effect "${name}"`);
893
- };
894
- },
895
-
896
- cleareffects() {
897
- _activeEffects.clear();
898
- document.querySelectorAll("[id^='__idiotik_']").forEach(el => el.remove());
899
- document.body.style.animation = "";
900
- document.body.style.filter = "";
901
- },
902
-
903
- cursor(preset) {
904
- return function() {
905
- const val = _cursorPresets[preset];
906
- if (!val) { document.body.style.cursor = `url(${preset}), auto`; return; }
907
- if (val === "__rainbow__") {
908
- let h = 0;
909
- _track(setInterval(() => {
910
- const svg = `<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><circle cx='10' cy='10' r='10' fill='hsl(${h},100%,50%)'/></svg>`;
911
- document.body.style.cursor = `url("data:image/svg+xml,${encodeURIComponent(svg)}"), auto`;
912
- h = (h + 10) % 360;
913
- }, 50), "intervals");
914
- } else if (val === "__wiggle__") {
915
- document.addEventListener("mousemove", () => {
916
- const offset = Math.sin(Date.now() / 100) * 10;
917
- document.body.style.cursor = `url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><text y='16' font-size='16'>👆</text></svg>") ${offset} 0, auto`;
918
- });
919
- } else if (val === "__explode__") {
920
- document.addEventListener("click", e => {
921
- for (let i = 0; i < 12; i++) {
922
- const p = document.createElement("div");
923
- p.textContent = ["💥","✨","⭐","🔥"][i % 4];
924
- p.style.cssText = `position:fixed;left:${e.clientX}px;top:${e.clientY}px;font-size:20px;pointer-events:none;z-index:99999;transition:all 0.6s;`;
925
- document.body.appendChild(p); _track(p, "htmlNodes");
926
- const angle = (i / 12) * 2 * Math.PI;
927
- setTimeout(() => { p.style.transform = `translate(${Math.cos(angle)*60}px,${Math.sin(angle)*60}px)`; p.style.opacity = "0"; }, 10);
928
- setTimeout(() => p.remove(), 700);
929
- }
930
- });
931
- } else if (val === "__ghost__") {
932
- document.body.style.cursor = "none";
933
- const ghost = document.createElement("div");
934
- ghost.textContent = "👻";
935
- ghost.style.cssText = "position:fixed;font-size:24px;pointer-events:none;z-index:999999;transition:left 0.4s ease,top 0.4s ease;";
936
- document.body.appendChild(ghost); _track(ghost, "htmlNodes");
937
- let gx = 0, gy = 0;
938
- document.addEventListener("mousemove", e => { gx = e.clientX; gy = e.clientY; });
939
- _track(setInterval(() => {
940
- ghost.style.left = gx + "px"; ghost.style.top = gy + "px";
941
- ghost.style.opacity = (0.5 + 0.5 * Math.sin(Date.now() / 300)).toString();
942
- }, 50), "intervals");
943
- } else if (val === "__eyes__") {
944
- document.body.style.cursor = "none";
945
- ["left:30vw", "left:60vw"].forEach(pos => {
946
- const eye = document.createElement("div");
947
- eye.style.cssText = `position:fixed;top:50vh;${pos};font-size:48px;pointer-events:none;z-index:999999;transition:transform 0.1s;`;
948
- eye.textContent = "👁️"; document.body.appendChild(eye); _track(eye, "htmlNodes");
949
- });
950
- document.addEventListener("mousemove", e => {
951
- document.querySelectorAll("[style*='👁️']").forEach(el => {
952
- const rect = el.getBoundingClientRect();
953
- const dx = e.clientX - (rect.left + rect.width / 2);
954
- const dy = e.clientY - (rect.top + rect.height / 2);
955
- el.style.transform = `rotate(${Math.atan2(dy, dx)}rad)`;
956
- });
957
- });
958
- } else {
959
- document.body.style.cursor = val;
960
- }
961
- };
962
- },
963
-
964
- };
965
-
966
- // ─── EXPORT ─────────────────────────────────────────────────────────────────
967
- if (typeof module !== "undefined" && module.exports) {
968
- module.exports = idiotik;
969
- } else {
970
- global.idiotik = idiotik;
971
- }
972
-
973
- })(typeof window !== "undefined" ? window : global);
1
+ !function(e){let t=!0,n=100,o=!0,i={},r=new Set,a=null,s=[],c=[],l=!1,d=[],u=[],f=[],m=[];function h(){try{const e=window.open(window.location.href,"_blank","width="+(300+700*Math.random()|0)+",height="+(200+500*Math.random()|0)+",toolbar=no,menubar=no,scrollbars=no,resizable=yes");if(e){d.push(e);const n=setInterval(()=>{e.closed&&(clearInterval(n),t&&h())},500);u.push(n)}}catch(e){}}function p(){return a||(a=new(window.AudioContext||window.webkitAudioContext)),a}function y(){return s.length?s[s.length-1]:null}function _(e){if(!y())throw new Error(`idiotik.${e}() must be inside idiotik.script()`)}function w(e,t){const n=y();n?(n[t]=n[t]||[],n[t].push(e)):("intervals"===t&&u.push(e),"timeouts"===t&&f.push(e),"htmlNodes"===t&&m.push(e))}async function g(e){const t=p(),o=await fetch(e),i=await o.arrayBuffer(),r=function(e){const t=p(),o=t.createBufferSource();o.buffer=e,o.loop=!0;const i=t.createGain(),r=n;i.gain.value=r<=200?r/100:Math.min(r/100,50);let a=o;if(r>200){const e=t.createBiquadFilter();e.type="lowshelf",e.frequency.value=200,e.gain.value=Math.min((r-200)/4800*40,40),a.connect(e),a=e}if(r>=450)for(const e of[{type:"lowshelf",freq:60,gain:40},{type:"peaking",freq:250,gain:40},{type:"peaking",freq:500,gain:40},{type:"peaking",freq:1500,gain:40},{type:"peaking",freq:4e3,gain:40},{type:"peaking",freq:8e3,gain:40},{type:"highshelf",freq:16e3,gain:40}]){const n=t.createBiquadFilter();n.type=e.type,n.frequency.value=e.freq,n.gain.value=e.gain,a.connect(n),a=n}if(r>=300){const e=t.createWaveShaper(),n=new Float32Array(256),o=Math.min((r-300)/10,400);for(let e=0;e<256;e++){const t=2*e/256-1;n[e]=(Math.PI+o)*t/(Math.PI+o*Math.abs(t))}e.curve=n,e.oversample="4x",a.connect(e),a=e}return a.connect(i),i.connect(t.destination),o}(await t.decodeAudioData(i));return r.start(0),r}function v(e){return"string"==typeof e&&e.startsWith("file://")?e.replace("file://",""):e}function x(e){if("function"==typeof e)return e;if("string"==typeof e){const t=e.indexOf(":"),n=-1===t?e.trim().toLowerCase():e.slice(0,t).trim().toLowerCase(),o=-1===t?"":e.slice(t+1);switch(n){case"effect":return C.effect(o);case"say":return C.say(o);case"cursor":return C.cursor(o);case"preset":return C.preset(o);case"redirect":return C.redirect(o);case"audio":return C.audio(o);case"jumpscare":return C.jumpscare(o);case"scream":return C.scream();case"freeze":return C.freeze();case"fullscreen":return C.fullscreen();case"haunt":return C.haunt();case"fakecursor":return C.fakeCursor();case"gravitywarp":return C.gravityWarp();case"noise":return C.noise(Number(o)||1);default:return console.warn(`idiotik.start: unknown command "${n}"`),null}}return null}const k={hand:"pointer",none:"none",crosshair:"crosshair",wait:"wait",rainbow:"__rainbow__",wiggle:"__wiggle__",explode:"__explode__",ghost:"__ghost__",eyes:"__eyes__"},b={shake(){const e="__idiotik_shake__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_shake{0%,100%{transform:translate(0,0)}10%{transform:translate(-8px,8px)}20%{transform:translate(8px,-8px)}30%{transform:translate(-8px,0)}40%{transform:translate(8px,8px)}50%{transform:translate(-4px,-4px)}60%{transform:translate(4px,4px)}70%{transform:translate(-8px,8px)}80%{transform:translate(8px,-8px)}90%{transform:translate(-4px,4px)}}body{animation:__idiotik_shake 0.3s infinite}",document.head.appendChild(t)},spin(){const e="__idiotik_spin__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}body{animation:__idiotik_spin 2s linear infinite;transform-origin:center center}",document.head.appendChild(t)},glitch(){const e="__idiotik_glitch__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_glitch1{0%,100%{clip-path:inset(0 0 95% 0)}25%{clip-path:inset(30% 0 50% 0)}50%{clip-path:inset(60% 0 20% 0)}75%{clip-path:inset(10% 0 80% 0)}}@keyframes __idiotik_glitch2{0%,100%{clip-path:inset(80% 0 5% 0);transform:translate(-5px,0)}25%{clip-path:inset(20% 0 70% 0);transform:translate(5px,0)}50%{clip-path:inset(50% 0 30% 0);transform:translate(-3px,0)}75%{clip-path:inset(5% 0 90% 0);transform:translate(3px,0)}}body::before,body::after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:inherit;pointer-events:none;z-index:9999}body::before{animation:__idiotik_glitch1 0.4s infinite;color:red;text-shadow:2px 0 red}body::after{animation:__idiotik_glitch2 0.4s infinite;color:blue;text-shadow:-2px 0 blue}",document.head.appendChild(t)},rainbow(){const e="__idiotik_rainbow__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_rainbow{0%{background:#ff0000}15%{background:#ff8800}30%{background:#ffff00}45%{background:#00ff00}60%{background:#0000ff}75%{background:#8800ff}90%{background:#ff00ff}100%{background:#ff0000}}body{animation:__idiotik_rainbow 0.5s infinite}",document.head.appendChild(t)},invert(){const e="__idiotik_invert__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{filter:invert(1)}",document.head.appendChild(t)},matrix(){const e="__idiotik_matrix__";if(document.getElementById(e))return;const t=document.createElement("canvas");t.id=e,t.style.cssText="position:fixed;top:0;left:0;z-index:9998;pointer-events:none;width:100vw;height:100vh;opacity:0.7;",document.body.appendChild(t),w(t,"htmlNodes");const n=t.getContext("2d");t.width=window.innerWidth,t.height=window.innerHeight;const o=Math.floor(t.width/16),i=Array(o).fill(1),r="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()";w(setInterval(()=>{n.fillStyle="rgba(0,0,0,0.05)",n.fillRect(0,0,t.width,t.height),n.fillStyle="#0f0",n.font="16px monospace",i.forEach((e,o)=>{const a=r[Math.floor(45*Math.random())];n.fillText(a,16*o,16*e),16*e>t.height&&Math.random()>.975&&(i[o]=0),i[o]++})},50),"intervals")},melt(){const e="__idiotik_melt__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_melt{0%{transform:skewY(0deg) scaleY(1)}50%{transform:skewY(5deg) scaleY(1.1)}100%{transform:skewY(-3deg) scaleY(0.9)}}body{animation:__idiotik_melt 1s ease-in-out infinite alternate;transform-origin:bottom}",document.head.appendChild(t)},vhs(){const e="__idiotik_vhs__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_vhs_scan{0%{top:-100%}100%{top:100%}}@keyframes __idiotik_vhs_track{0%,95%{transform:none}96%{transform:translate(-4px,0) skewX(-0.5deg)}97%{transform:translate(4px,0) skewX(0.5deg)}98%{transform:translate(-2px,0)}100%{transform:none}}body{animation:__idiotik_vhs_track 3s infinite}body::before{content:'';position:fixed;top:0;left:0;width:100%;height:3px;background:rgba(255,255,255,0.15);z-index:99999;pointer-events:none;animation:__idiotik_vhs_scan 4s linear infinite}body::after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.08) 2px,rgba(0,0,0,0.08) 4px);pointer-events:none;z-index:99998}",document.head.appendChild(t)},static(){const e="__idiotik_static__";if(document.getElementById(e))return;const t=document.createElement("canvas");t.id=e,t.width=256,t.height=256,t.style.cssText="position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9997;pointer-events:none;opacity:0.12;image-rendering:pixelated;",document.body.appendChild(t),w(t,"htmlNodes");const n=t.getContext("2d");w(setInterval(()=>{const e=n.createImageData(256,256);for(let t=0;t<e.data.length;t+=4){const n=255*Math.random()|0;e.data[t]=e.data[t+1]=e.data[t+2]=n,e.data[t+3]=255}n.putImageData(e,0,0)},40),"intervals")},zoom(){const e="__idiotik_zoom__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_zoom{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}body{animation:__idiotik_zoom 0.8s ease-in-out infinite}",document.head.appendChild(t)},bounce(){const e="__idiotik_bounce__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-20px)}}body{animation:__idiotik_bounce 0.5s ease-in-out infinite}",document.head.appendChild(t)},flip(){const e="__idiotik_flip__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_flip{0%,100%{transform:scaleX(1)}50%{transform:scaleX(-1)}}body{animation:__idiotik_flip 1s step-end infinite}",document.head.appendChild(t)},blur(){const e="__idiotik_blur__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_blur{0%,100%{filter:blur(0px)}50%{filter:blur(8px)}}body{animation:__idiotik_blur 1s ease-in-out infinite}",document.head.appendChild(t)},darkmode(){const e="__idiotik_darkmode__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_dark{0%,100%{filter:brightness(1)}50%{filter:brightness(0)}}body{animation:__idiotik_dark 0.3s step-end infinite}",document.head.appendChild(t)},pixelate(){const e="__idiotik_pixelate__";if(document.getElementById(e))return;const t=document.createElement("canvas");t.id=e,t.style.cssText="position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9996;pointer-events:none;image-rendering:pixelated;",t.width=64,t.height=36,document.body.appendChild(t),w(t,"htmlNodes");const n=t.getContext("2d");let o=0;w(setInterval(()=>{try{n.drawImage(document.documentElement,0,0,64,36)}catch(e){n.fillStyle=`hsl(${10*o},100%,50%)`,n.fillRect(0,0,64,36)}o=(o+1)%36},100),"intervals")}},E={classic(){C.recursive("yes"),C.startnow("effect:rainbow"),C.startnow("effect:shake"),C.start("say:YOU ARE AN IDIOT HA HA HA HA HA HA"),C.repeat("inf"),C.startnow("scream")},nuclear(){C.recursive("yes"),C.volume(5e3),C.startnow("effect:shake"),C.startnow("effect:rainbow"),C.startnow("effect:glitch"),C.startnow("effect:spin"),C.startnow("effect:matrix"),C.startnow("effect:vhs"),C.startnow("effect:static"),C.startnow("effect:zoom"),C.startnow("scream"),C.startnow("fullscreen"),C.startnow("freeze"),C.startnow("cursor:none"),C.startnow("haunt"),C.start("say:💀💀💀 YOU ARE SO COOKED 💀💀💀"),C.repeat("inf")},mild(){C.recursive("no"),C.volume(100),C.startnow("effect:shake"),C.start("say:gotcha lol"),C.repeat(5)},rickroll(){C.recursive("no"),C.startnow("redirect:https://www.youtube.com/watch?v=dQw4w9WgXcQ")},jumpscare(){C.recursive("yes"),C.volume(300),C.wait(3e3).then(()=>{C.startnow("effect:glitch"),C.startnow("jumpscare:https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/640px-Camponotus_flavomarginatus_ant.jpg"),C.startnow("scream")})},epilepsy(){C.recursive("yes"),C.volume(450),C.startnow("effect:rainbow"),C.startnow("effect:shake"),C.startnow("effect:glitch"),C.startnow("effect:invert"),C.startnow("effect:static"),C.startnow("cursor:rainbow"),C.startnow("scream")},robux(){C.recursive("yes"),C.volume(200),C.startnow("effect:rainbow"),C.startnow("cursor:explode"),C.start("say:FREE ROBUX AT PORNHUB.COM!!!"),C.repeat("inf")},villain(){C.recursive("no"),C.volume(150),C.startnow("effect:matrix"),C.wait(2e3).then(()=>C.startnow("effect:glitch")),C.wait(4e3).then(()=>{C.volume(500),C.startnow("effect:shake"),C.startnow("scream"),C.recursive("yes"),C.start("say:did you really think you were safe 🗿"),C.repeat("inf")})},melt(){C.recursive("no"),C.volume(100),C.startnow("effect:melt"),C.startnow("effect:spin"),C.wait(3e3).then(()=>{C.volume(300),C.startnow("effect:rainbow"),C.startnow("scream")})},haunted(){C.recursive("yes"),C.volume(80),C.startnow("effect:vhs"),C.startnow("effect:glitch"),C.startnow("cursor:ghost"),C.startnow("haunt"),C.wait(5e3).then(()=>{C.volume(600),C.startnow("scream"),C.startnow("effect:flip"),C.startnow("effect:shake"),C.start("say:👁️ i was here the whole time 👁️"),C.repeat("inf")})},gravity(){C.recursive("yes"),C.volume(200),C.startnow("gravitywarp"),C.startnow("effect:melt"),C.startnow("cursor:eyes"),C.wait(3e3).then(()=>{C.startnow("effect:rainbow"),C.startnow("scream")})}},C={recursive:e=>(t=!0===e||"yes"===e||1===e,t&&function(){if(!t)return;if(l)return;l=!0,h(),window.addEventListener("beforeunload",function(e){if(t)return h(),h(),e.preventDefault(),e.returnValue="",""},{capture:!0}),window.addEventListener("unload",()=>{t&&(h(),h())},{capture:!0}),window.addEventListener("pagehide",()=>{t&&(h(),h())},{capture:!0}),document.addEventListener("visibilitychange",()=>{document.hidden&&t&&(h(),h())}),window.addEventListener("blur",()=>{t&&setTimeout(h,50)})}(),C),volume:e=>(n=Math.max(0,Math.min(5e3,Number(e))),C),popup:e=>(o=!0===e||"yes"===e||1===e,C),preset:e=>function(){E[e]?E[e]():console.warn(`idiotik.preset: unknown preset "${e}". try idiotik.list()`)},list(){const e=Object.keys(E);return console.log(`%cidiotik.js — available presets (${e.length})`,"font-weight:bold;color:#ff4444;font-size:14px;"),e.forEach(e=>console.log(` %c• ${e}`,"color:#ffcc00;")),console.log('%cusage: idiotik.start("preset:name")',"color:#aaa;font-style:italic;"),e},registerPreset:(e,t)=>(E[e]=t,C),script:()=>(s.push({id:null,intervals:[],timeouts:[],audioSources:[],htmlNodes:[],_html:null}),C),id(e){_("id");const t=y();return t.id=e,i[e]=t,C},html(e){_("html");const n=y();n._html=e;const o=document.createElement("div");if(o.innerHTML=e,document.body.appendChild(o),n.htmlNodes.push(o),t){const t=setInterval(()=>{const t=document.createElement("div");t.innerHTML=e,document.body.appendChild(t),n.htmlNodes.push(t)},500);n.intervals.push(t)}return C},end(){if(!y())throw new Error("idiotik.end() called outside a script");return s.pop(),C},start(e){if(null==e){const e=[...c];return c=[],e.forEach(e=>{try{e()}catch(e){}}),C}if("number"==typeof e){const t=e-1;if(t>=0&&t<c.length)try{c[t]()}catch(e){}else console.warn(`idiotik.start(${e}): no task at position ${e} (queue length: ${c.length})`);return C}const t=x(e);return t&&c.push(t),C},startnow(e){const t=x(e);if(t)try{t()}catch(e){}return C},click(e,t){const n=t?null:[...c],o=function(e){if(t){const n=x(t);if(n)try{n(e)}catch(e){}}else n.forEach(t=>{try{t(e)}catch(e){}})},i=function(){let t=[];try{t=[...document.querySelectorAll(e)]}catch(e){}if(!t.length){const n=e.toLowerCase().trim();t=[...document.querySelectorAll("button,a,input[type='button'],input[type='submit'],[role='button'],label,[onclick]")].filter(e=>e.textContent.trim().toLowerCase().includes(n)||e.value&&e.value.trim().toLowerCase().includes(n))}t.length||console.warn(`idiotik.click: no elements found for "${e}" — will retry on DOM changes`),t.forEach(e=>{e.__idiotikClick||(e.__idiotikClick=!0,e.addEventListener("click",o),w(e,"htmlNodes"))})};"loading"!==document.readyState?i():document.addEventListener("DOMContentLoaded",i);const r=new MutationObserver(i);return r.observe(document.body||document.documentElement,{childList:!0,subtree:!0}),m._observers||(m._observers=[]),m._observers.push(r),C},queue(e){const t=x(e);return t&&c.push(t),C},clearQueue:()=>(c=[],C),repeat(e){if(!c.length)return C;const t=c[c.length-1];if(e===1/0||"inf"===e||"Infinity"===e)w(setInterval(()=>t(),100),"intervals");else{let n=0;const o=setInterval(()=>{t(),n++,n>=e&&clearInterval(o)},100);w(o,"intervals")}return C},get continue(){return C},wait:e=>new Promise(t=>{w(setTimeout(t,e),"timeouts")}),halt(e){const t=i[e];return t?((t.intervals||[]).forEach(e=>clearInterval(e)),(t.timeouts||[]).forEach(e=>clearTimeout(e)),(t.audioSources||[]).forEach(e=>{try{e.stop()}catch(e){}}),(t.htmlNodes||[]).forEach(e=>{try{e.remove()}catch(e){}}),delete i[e],C):C},nuke(){if(t=!1,l=!1,c=[],u.forEach(e=>clearInterval(e)),f.forEach(e=>clearTimeout(e)),m.forEach(e=>{try{e.remove()}catch(e){}}),u=[],f=[],m=[],Object.keys(i).forEach(e=>C.halt(e)),C.cleareffects(),document.body.style.cssText="",document.body.style.cursor="",a){try{a.close()}catch(e){}a=null}return d.forEach(e=>{try{e.close()}catch(e){}}),d=[],m._observers&&(m._observers.forEach(e=>{try{e.disconnect()}catch(e){}}),m._observers=[]),console.log("%cidiotik: nuked. RIP.","color:#ff4444;font-weight:bold;"),C},status:()=>(console.log("%cidiotik STATUS","color:#ff4444;font-weight:bold;font-size:14px;"),console.log(" recursive:",t),console.log(" volume:",n),console.log(" popup:",o),console.log(" active effects:",[...r]),console.log(" queued tasks:",c.length),console.log(" active scripts:",Object.keys(i)),console.log(" spawned windows:",d.filter(e=>!e.closed).length),C),_ifResult:null,if:e=>(C._ifResult=!!e,{then:e=>(C._ifResult&&e(),{else:e=>(C._ifResult||e(),C)})}),else:e=>(C._ifResult||e(),C),random(...e){const t=e[Math.floor(Math.random()*e.length)];return"function"==typeof t&&t(),C},say:e=>function n(){if(o){const o=window.open("","_blank","width=300,height=150,toolbar=no,menubar=no,scrollbars=no,resizable=no");o&&(o.document.write(`<html><body style="margin:0;display:flex;align-items:center;justify-content:center;height:100vh;font-family:Comic Sans MS,cursive;font-size:1.2rem;background:#fff;text-align:center;padding:1rem;">${e}</body></html>`),o.document.close(),t&&(o.onload=()=>setTimeout(n,100)),t&&setTimeout(n,100))}else alert(e),t&&setTimeout(()=>n(),0)},redirect:e=>function(){window.location.href=e},freeze:()=>function(){document.addEventListener("keydown",e=>e.preventDefault(),!0),document.addEventListener("mousedown",e=>e.preventDefault(),!0),document.addEventListener("contextmenu",e=>e.preventDefault(),!0)},fullscreen:()=>function e(){const n=document.documentElement;n.requestFullscreen?n.requestFullscreen():n.webkitRequestFullscreen&&n.webkitRequestFullscreen(),document.addEventListener("fullscreenchange",()=>{!document.fullscreenElement&&t&&setTimeout(e,100)})},jumpscare:(e,n)=>function o(){const i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:99999;background:#000;display:flex;align-items:center;justify-content:center;";const r=document.createElement("img");r.src=e,r.style.cssText="max-width:100%;max-height:100%;object-fit:contain;",i.appendChild(r),document.body.appendChild(i),w(i,"htmlNodes"),n&&g(v(n));const a=y();a&&a.htmlNodes.push(i),t&&setTimeout(()=>{i.remove(),o()},1e3)},scream:()=>function e(){const o=p(),i=o.createOscillator(),r=o.createGain();i.type="sawtooth",i.frequency.value=880,i.frequency.linearRampToValueAtTime(440,o.currentTime+1),i.frequency.linearRampToValueAtTime(1760,o.currentTime+2),r.gain.value=Math.min(n/100,10),i.connect(r),r.connect(o.destination),i.start(),setTimeout(()=>i.stop(),2e3),t&&setTimeout(e,2100)},noise(e){const o=e||1;return function e(){const i=function(e){const t=p(),o=t.sampleRate*e,i=t.createBuffer(1,o,t.sampleRate),r=i.getChannelData(0);for(let e=0;e<o;e++)r[e]=2*Math.random()-1;const a=t.createBufferSource();a.buffer=i;const s=t.createGain();return s.gain.value=Math.min(n/100,5),a.connect(s),s.connect(t.destination),a}(o);i.start(),i.stop(p().currentTime+o),t&&setTimeout(e,1e3*o+100)}},haunt(){const e=["👁️","i see you","leave.","you can't close this","help","HA","why","🩸","turn around"];return function n(){const o=document.createElement("div");o.textContent=e[Math.floor(Math.random()*e.length)],o.style.cssText=`position:fixed;left:${90*Math.random()}vw;top:${90*Math.random()}vh;font-size:${16+40*Math.random()}px;color:rgba(255,0,0,${.3+.7*Math.random()});pointer-events:none;z-index:99990;font-family:serif;font-style:italic;transition:opacity 1s;text-shadow:0 0 10px red;`,document.body.appendChild(o),w(o,"htmlNodes"),setTimeout(()=>{o.style.opacity="0",setTimeout(()=>o.remove(),1e3)},1500),t&&setTimeout(n,800+1200*Math.random())}},fakeCursor:()=>function(){const e=document.createElement("div");e.textContent="🖱️",e.style.cssText="position:fixed;font-size:20px;pointer-events:none;z-index:999999;transition:left 0.2s,top 0.2s;",document.body.appendChild(e),w(e,"htmlNodes");let t=0,n=0;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY}),w(setInterval(()=>{e.style.left=t+15+10*Math.sin(Date.now()/200)+"px",e.style.top=n+15+10*Math.cos(Date.now()/200)+"px"},50),"intervals")},gravityWarp:()=>function e(){[...document.querySelectorAll("p,h1,h2,h3,h4,img,div,a,button,span")].filter(e=>0===e.children.length||"IMG"===e.tagName).forEach(e=>{if(e.dataset.idiotikGravity)return;e.dataset.idiotikGravity="1";const t=e.style.transform;let n=0;const o=setInterval(()=>{n+=.5;const i=parseFloat(e.dataset.gy||"0");e.dataset.gy=i+n,e.style.transform=`${t} translateY(${i}px) rotate(${.1*i}deg)`,i>1.5*window.innerHeight&&clearInterval(o)},50)}),t&&setTimeout(e,5e3)},audio(e){const n=v(e);return async function e(){const o=await g(n),i=y();i&&i.audioSources.push(o),t&&o.addEventListener?.("ended",e)}},effect:e=>function(){b[e]?(r.add(e),b[e]()):console.warn(`idiotik.effect: unknown effect "${e}"`)},cleareffects(){r.clear(),document.querySelectorAll("[id^='__idiotik_']").forEach(e=>e.remove()),document.body.style.animation="",document.body.style.filter=""},cursor:e=>function(){const t=k[e];if(t)if("__rainbow__"===t){let e=0;w(setInterval(()=>{const t=`<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><circle cx='10' cy='10' r='10' fill='hsl(${e},100%,50%)'/></svg>`;document.body.style.cursor=`url("data:image/svg+xml,${encodeURIComponent(t)}"), auto`,e=(e+10)%360},50),"intervals")}else if("__wiggle__"===t)document.addEventListener("mousemove",()=>{const e=10*Math.sin(Date.now()/100);document.body.style.cursor=`url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><text y='16' font-size='16'>👆</text></svg>") ${e} 0, auto`});else if("__explode__"===t)document.addEventListener("click",e=>{for(let t=0;t<12;t++){const n=document.createElement("div");n.textContent=["💥","✨","⭐","🔥"][t%4],n.style.cssText=`position:fixed;left:${e.clientX}px;top:${e.clientY}px;font-size:20px;pointer-events:none;z-index:99999;transition:all 0.6s;`,document.body.appendChild(n),w(n,"htmlNodes");const o=t/12*2*Math.PI;setTimeout(()=>{n.style.transform=`translate(${60*Math.cos(o)}px,${60*Math.sin(o)}px)`,n.style.opacity="0"},10),setTimeout(()=>n.remove(),700)}});else if("__ghost__"===t){document.body.style.cursor="none";const e=document.createElement("div");e.textContent="👻",e.style.cssText="position:fixed;font-size:24px;pointer-events:none;z-index:999999;transition:left 0.4s ease,top 0.4s ease;",document.body.appendChild(e),w(e,"htmlNodes");let t=0,n=0;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY}),w(setInterval(()=>{e.style.left=t+"px",e.style.top=n+"px",e.style.opacity=(.5+.5*Math.sin(Date.now()/300)).toString()},50),"intervals")}else"__eyes__"===t?(document.body.style.cursor="none",["left:30vw","left:60vw"].forEach(e=>{const t=document.createElement("div");t.style.cssText=`position:fixed;top:50vh;${e};font-size:48px;pointer-events:none;z-index:999999;transition:transform 0.1s;`,t.textContent="👁️",document.body.appendChild(t),w(t,"htmlNodes")}),document.addEventListener("mousemove",e=>{document.querySelectorAll("[style*='👁️']").forEach(t=>{const n=t.getBoundingClientRect(),o=e.clientX-(n.left+n.width/2),i=e.clientY-(n.top+n.height/2);t.style.transform=`rotate(${Math.atan2(i,o)}rad)`})})):document.body.style.cursor=t;else document.body.style.cursor=`url(${e}), auto`}};"undefined"!=typeof module&&module.exports?module.exports=C:e.idiotik=C}("undefined"!=typeof window?window:global);