idiotik.js 1.0.15 → 1.0.16

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 -1123
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idiotik.js",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
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,1123 +1 @@
1
- /**
2
- * idiotik.js — youareanidiot-style chaos toolkit
3
- * recursive by default. you were warned.
4
- *
5
- * CHANGES v2:
6
- * - idiotik.start() with no args (or called after queuing) fires ALL queued tasks at once
7
- * - idiotik.start(n) fires the last n queued tasks (number overload)
8
- * - tasks are auto-queued when you call idiotik.effect(), idiotik.say(), etc. without wrapping in start()
9
- * - recursive mode is INSTANT: spawns a new window the moment the page loads, not on an event
10
- * - beforeunload + unload + visibilitychange + pagehide ALL spawn more windows to prevent escape
11
- * - new effects: pixelate, zoom, bounce, vhs, static, darkmode, flip, blur
12
- * - new chaos methods: ghost(), keylogger(), fakeCursor(), gravityWarp(), haunt()
13
- * - audio: distortion node added to chain, white noise generator
14
- * - cursor: new "ghost" and "eyes" presets
15
- * - idiotik.nuke() — kills everything idiotik created
16
- * - idiotik.status() — logs what's currently running
17
- */
18
-
19
- (function (global) {
20
-
21
- // ─── GLOBAL STATE ───────────────────────────────────────────────────────────
22
- let _recursive = true;
23
- let _volume = 100;
24
- let _popup = true;
25
- let _activeScripts = {};
26
- let _activeEffects = new Set();
27
- let _audioCtx = null;
28
- let _scriptStack = [];
29
-
30
- // NEW: task queue — every action registers here; idiotik.start() fires them
31
- let _taskQueue = [];
32
-
33
- // NEW: track all spawned windows so we can spam them
34
- let _spawnedWindows = [];
35
-
36
- // NEW: track all global intervals/timeouts for nuke()
37
- let _globalIntervals = [];
38
- let _globalTimeouts = [];
39
- let _globalNodes = [];
40
-
41
- // ─── RECURSIVE SPAWN ENGINE ─────────────────────────────────────────────────
42
- // Called once on load when recursive=true, and on every unload attempt.
43
- // Spawns a new copy of the current page in a popup immediately.
44
- function _spawnWindow() {
45
- try {
46
- const w = window.open(window.location.href, "_blank",
47
- "width=" + (300 + Math.random() * 700 | 0) +
48
- ",height=" + (200 + Math.random() * 500 | 0) +
49
- ",toolbar=no,menubar=no,scrollbars=no,resizable=yes"
50
- );
51
- if (w) {
52
- _spawnedWindows.push(w);
53
- // ping alive children and respawn any that closed
54
- const id = setInterval(() => {
55
- if (w.closed) {
56
- clearInterval(id);
57
- if (_recursive) _spawnWindow();
58
- }
59
- }, 500);
60
- _globalIntervals.push(id);
61
- }
62
- } catch(e) {}
63
- }
64
-
65
- function _initRecursion() {
66
- if (!_recursive) return;
67
-
68
- // Spawn IMMEDIATELY — don't wait for any event
69
- _spawnWindow();
70
-
71
- // Also spawn on every possible exit path
72
- const _blockAndSpawn = function(e) {
73
- if (!_recursive) return;
74
- _spawnWindow();
75
- _spawnWindow(); // double-tap
76
- e.preventDefault();
77
- e.returnValue = "";
78
- return "";
79
- };
80
-
81
- window.addEventListener("beforeunload", _blockAndSpawn, { capture: true });
82
- window.addEventListener("unload", () => { if (_recursive) { _spawnWindow(); _spawnWindow(); } }, { capture: true });
83
- window.addEventListener("pagehide", () => { if (_recursive) { _spawnWindow(); _spawnWindow(); } }, { capture: true });
84
- document.addEventListener("visibilitychange", () => {
85
- if (document.hidden && _recursive) {
86
- _spawnWindow();
87
- _spawnWindow();
88
- }
89
- });
90
-
91
- // Keep an eye on focus — if user tries to leave, spawn
92
- window.addEventListener("blur", () => {
93
- if (_recursive) setTimeout(_spawnWindow, 50);
94
- });
95
- }
96
-
97
- // Run recursion engine as soon as DOM is ready
98
- if (document.readyState === "loading") {
99
- document.addEventListener("DOMContentLoaded", _initRecursion);
100
- } else {
101
- // Already loaded — fire immediately
102
- setTimeout(_initRecursion, 0);
103
- }
104
-
105
- // ─── PRESET REGISTRY ────────────────────────────────────────────────────────
106
- const _presets = {
107
- classic: function() {
108
- idiotik.recursive("yes");
109
- idiotik.start(idiotik.effect("rainbow"))();
110
- idiotik.start(idiotik.effect("shake"))();
111
- idiotik.start(idiotik.say("YOU ARE AN IDIOT HA HA HA HA HA HA"));
112
- idiotik.repeat("inf");
113
- idiotik.continue;
114
- idiotik.start(idiotik.scream())();
115
- },
116
- nuclear: function() {
117
- idiotik.recursive("yes");
118
- idiotik.volume(5000);
119
- idiotik.start(idiotik.effect("shake"))();
120
- idiotik.start(idiotik.effect("rainbow"))();
121
- idiotik.start(idiotik.effect("glitch"))();
122
- idiotik.start(idiotik.effect("spin"))();
123
- idiotik.start(idiotik.effect("matrix"))();
124
- idiotik.start(idiotik.effect("vhs"))();
125
- idiotik.start(idiotik.effect("static"))();
126
- idiotik.start(idiotik.effect("zoom"))();
127
- idiotik.start(idiotik.scream())();
128
- idiotik.start(idiotik.fullscreen())();
129
- idiotik.start(idiotik.freeze())();
130
- idiotik.start(idiotik.cursor("none"))();
131
- idiotik.start(idiotik.haunt())();
132
- idiotik.start(idiotik.say("💀💀💀 YOU ARE SO COOKED 💀💀💀"));
133
- idiotik.repeat("inf");
134
- },
135
- mild: function() {
136
- idiotik.recursive("no");
137
- idiotik.volume(100);
138
- idiotik.start(idiotik.effect("shake"))();
139
- idiotik.start(idiotik.say("gotcha lol"));
140
- idiotik.repeat(5);
141
- },
142
- rickroll: function() {
143
- idiotik.recursive("no");
144
- idiotik.start(idiotik.redirect("https://www.youtube.com/watch?v=dQw4w9WgXcQ"))();
145
- },
146
- jumpscare: function() {
147
- idiotik.recursive("yes");
148
- idiotik.volume(300);
149
- idiotik.wait(3000).then(() => {
150
- idiotik.start(idiotik.effect("glitch"))();
151
- idiotik.start(idiotik.jumpscare(
152
- "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/640px-Camponotus_flavomarginatus_ant.jpg"
153
- ))();
154
- idiotik.start(idiotik.scream())();
155
- });
156
- },
157
- epilepsy: function() {
158
- idiotik.recursive("yes");
159
- idiotik.volume(450);
160
- idiotik.start(idiotik.effect("rainbow"))();
161
- idiotik.start(idiotik.effect("shake"))();
162
- idiotik.start(idiotik.effect("glitch"))();
163
- idiotik.start(idiotik.effect("invert"))();
164
- idiotik.start(idiotik.effect("static"))();
165
- idiotik.start(idiotik.cursor("rainbow"))();
166
- idiotik.start(idiotik.scream())();
167
- },
168
- robux: function() {
169
- idiotik.recursive("yes");
170
- idiotik.volume(200);
171
- idiotik.script();
172
- idiotik.id("robux");
173
- idiotik.start(idiotik.say("FREE ROBUX AT PORNHUB.COM!!!"));
174
- idiotik.repeat("inf");
175
- idiotik.continue;
176
- idiotik.end();
177
- idiotik.start(idiotik.effect("rainbow"))();
178
- idiotik.start(idiotik.cursor("explode"))();
179
- },
180
- villain: function() {
181
- idiotik.recursive("no");
182
- idiotik.volume(150);
183
- idiotik.start(idiotik.effect("matrix"))();
184
- idiotik.wait(2000).then(() => {
185
- idiotik.start(idiotik.effect("glitch"))();
186
- });
187
- idiotik.wait(4000).then(() => {
188
- idiotik.volume(500);
189
- idiotik.start(idiotik.effect("shake"))();
190
- idiotik.start(idiotik.scream())();
191
- idiotik.recursive("yes");
192
- idiotik.start(idiotik.say("did you really think you were safe 🗿"));
193
- idiotik.repeat("inf");
194
- });
195
- },
196
- melt: function() {
197
- idiotik.recursive("no");
198
- idiotik.volume(100);
199
- idiotik.start(idiotik.effect("melt"))();
200
- idiotik.start(idiotik.effect("spin"))();
201
- idiotik.wait(3000).then(() => {
202
- idiotik.volume(300);
203
- idiotik.start(idiotik.effect("rainbow"))();
204
- idiotik.start(idiotik.scream())();
205
- });
206
- },
207
- haunted: function() {
208
- idiotik.recursive("yes");
209
- idiotik.volume(80);
210
- idiotik.start(idiotik.effect("vhs"))();
211
- idiotik.start(idiotik.effect("glitch"))();
212
- idiotik.start(idiotik.cursor("ghost"))();
213
- idiotik.start(idiotik.haunt())();
214
- idiotik.wait(5000).then(() => {
215
- idiotik.volume(600);
216
- idiotik.start(idiotik.scream())();
217
- idiotik.start(idiotik.effect("flip"))();
218
- idiotik.start(idiotik.effect("shake"))();
219
- idiotik.start(idiotik.say("👁️ i was here the whole time 👁️"));
220
- idiotik.repeat("inf");
221
- });
222
- },
223
- gravity: function() {
224
- idiotik.recursive("yes");
225
- idiotik.volume(200);
226
- idiotik.start(idiotik.gravityWarp())();
227
- idiotik.start(idiotik.effect("melt"))();
228
- idiotik.start(idiotik.cursor("eyes"))();
229
- idiotik.wait(3000).then(() => {
230
- idiotik.start(idiotik.effect("rainbow"))();
231
- idiotik.start(idiotik.scream())();
232
- });
233
- },
234
- };
235
-
236
- // ─── HELPERS ────────────────────────────────────────────────────────────────
237
- function _getAudioCtx() {
238
- if (!_audioCtx) _audioCtx = new (window.AudioContext || window.webkitAudioContext)();
239
- return _audioCtx;
240
- }
241
-
242
- function _currentScript() {
243
- return _scriptStack.length ? _scriptStack[_scriptStack.length - 1] : null;
244
- }
245
-
246
- function _requireScript(name) {
247
- if (!_currentScript()) throw new Error(`idiotik.${name}() must be inside idiotik.script()`);
248
- }
249
-
250
- function _track(thing, type) {
251
- const ctx = _currentScript();
252
- if (ctx) {
253
- ctx[type] = ctx[type] || [];
254
- ctx[type].push(thing);
255
- } else {
256
- // track globally for nuke()
257
- if (type === "intervals") _globalIntervals.push(thing);
258
- if (type === "timeouts") _globalTimeouts.push(thing);
259
- if (type === "htmlNodes") _globalNodes.push(thing);
260
- }
261
- }
262
-
263
- function _buildAudioChain(buffer) {
264
- const ctx = _getAudioCtx();
265
- const source = ctx.createBufferSource();
266
- source.buffer = buffer;
267
- source.loop = true;
268
- const gainNode = ctx.createGain();
269
- const rawVol = _volume;
270
- if (rawVol <= 200) {
271
- gainNode.gain.value = rawVol / 100;
272
- } else {
273
- gainNode.gain.value = Math.min(rawVol / 100, 50);
274
- }
275
- let lastNode = source;
276
-
277
- // Bass boost
278
- if (rawVol > 200) {
279
- const bassBoost = ctx.createBiquadFilter();
280
- bassBoost.type = "lowshelf";
281
- bassBoost.frequency.value = 200;
282
- bassBoost.gain.value = Math.min(((rawVol - 200) / 4800) * 40, 40);
283
- lastNode.connect(bassBoost);
284
- lastNode = bassBoost;
285
- }
286
-
287
- // Full EQ massacre
288
- if (rawVol >= 450) {
289
- const bands = [
290
- { type: "lowshelf", freq: 60, gain: 40 },
291
- { type: "peaking", freq: 250, gain: 40 },
292
- { type: "peaking", freq: 500, gain: 40 },
293
- { type: "peaking", freq: 1500, gain: 40 },
294
- { type: "peaking", freq: 4000, gain: 40 },
295
- { type: "peaking", freq: 8000, gain: 40 },
296
- { type: "highshelf", freq: 16000, gain: 40 },
297
- ];
298
- for (const b of bands) {
299
- const f = ctx.createBiquadFilter();
300
- f.type = b.type;
301
- f.frequency.value = b.freq;
302
- f.gain.value = b.gain;
303
- lastNode.connect(f);
304
- lastNode = f;
305
- }
306
- }
307
-
308
- // NEW: distortion at high volumes
309
- if (rawVol >= 300) {
310
- const dist = ctx.createWaveShaper();
311
- const curve = new Float32Array(256);
312
- const k = Math.min((rawVol - 300) / 10, 400);
313
- for (let i = 0; i < 256; i++) {
314
- const x = (i * 2) / 256 - 1;
315
- curve[i] = ((Math.PI + k) * x) / (Math.PI + k * Math.abs(x));
316
- }
317
- dist.curve = curve;
318
- dist.oversample = "4x";
319
- lastNode.connect(dist);
320
- lastNode = dist;
321
- }
322
-
323
- lastNode.connect(gainNode);
324
- gainNode.connect(ctx.destination);
325
- return source;
326
- }
327
-
328
- async function _loadAndPlay(url) {
329
- const ctx = _getAudioCtx();
330
- const resp = await fetch(url);
331
- const arrayBuf = await resp.arrayBuffer();
332
- const audioBuf = await ctx.decodeAudioData(arrayBuf);
333
- const source = _buildAudioChain(audioBuf);
334
- source.start(0);
335
- return source;
336
- }
337
-
338
- function _parseAudioUrl(urlOrFile) {
339
- if (typeof urlOrFile === "string" && urlOrFile.startsWith("file://")) {
340
- return urlOrFile.replace("file://", "");
341
- }
342
- return urlOrFile;
343
- }
344
-
345
- // NEW: white noise generator
346
- function _whiteNoise(durationSec) {
347
- const ctx = _getAudioCtx();
348
- const bufferSize = ctx.sampleRate * durationSec;
349
- const buffer = ctx.createBuffer(1, bufferSize, ctx.sampleRate);
350
- const data = buffer.getChannelData(0);
351
- for (let i = 0; i < bufferSize; i++) data[i] = Math.random() * 2 - 1;
352
- const source = ctx.createBufferSource();
353
- source.buffer = buffer;
354
- const gain = ctx.createGain();
355
- gain.gain.value = Math.min(_volume / 100, 5);
356
- source.connect(gain);
357
- gain.connect(ctx.destination);
358
- return source;
359
- }
360
-
361
- // ─── CURSOR PRESETS ─────────────────────────────────────────────────────────
362
- const _cursorPresets = {
363
- hand: "pointer",
364
- none: "none",
365
- crosshair: "crosshair",
366
- wait: "wait",
367
- rainbow: "__rainbow__",
368
- wiggle: "__wiggle__",
369
- explode: "__explode__",
370
- ghost: "__ghost__", // NEW
371
- eyes: "__eyes__", // NEW
372
- };
373
-
374
- // ─── EFFECT IMPLEMENTATIONS ─────────────────────────────────────────────────
375
- const _effectImpls = {
376
- shake() {
377
- const styleId = "__idiotik_shake__";
378
- if (document.getElementById(styleId)) return;
379
- const s = document.createElement("style");
380
- s.id = styleId;
381
- s.textContent = `
382
- @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)} }
383
- body { animation: __idiotik_shake 0.3s infinite; }
384
- `;
385
- document.head.appendChild(s);
386
- },
387
- spin() {
388
- const styleId = "__idiotik_spin__";
389
- if (document.getElementById(styleId)) return;
390
- const s = document.createElement("style");
391
- s.id = styleId;
392
- s.textContent = `
393
- @keyframes __idiotik_spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
394
- body { animation: __idiotik_spin 2s linear infinite; transform-origin: center center; }
395
- `;
396
- document.head.appendChild(s);
397
- },
398
- glitch() {
399
- const styleId = "__idiotik_glitch__";
400
- if (document.getElementById(styleId)) return;
401
- const s = document.createElement("style");
402
- s.id = styleId;
403
- s.textContent = `
404
- @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)} }
405
- @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)} }
406
- body::before, body::after { content:''; position:fixed; top:0;left:0;width:100%;height:100%; background:inherit; pointer-events:none; z-index:9999; }
407
- body::before { animation: __idiotik_glitch1 0.4s infinite; color:red; text-shadow:2px 0 red; }
408
- body::after { animation: __idiotik_glitch2 0.4s infinite; color:blue; text-shadow:-2px 0 blue; }
409
- `;
410
- document.head.appendChild(s);
411
- },
412
- rainbow() {
413
- const styleId = "__idiotik_rainbow__";
414
- if (document.getElementById(styleId)) return;
415
- const s = document.createElement("style");
416
- s.id = styleId;
417
- s.textContent = `
418
- @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} }
419
- body { animation: __idiotik_rainbow 0.5s infinite; }
420
- `;
421
- document.head.appendChild(s);
422
- },
423
- invert() {
424
- const styleId = "__idiotik_invert__";
425
- if (document.getElementById(styleId)) return;
426
- const s = document.createElement("style");
427
- s.id = styleId;
428
- s.textContent = `body { filter: invert(1); }`;
429
- document.head.appendChild(s);
430
- },
431
- matrix() {
432
- const canvasId = "__idiotik_matrix__";
433
- if (document.getElementById(canvasId)) return;
434
- const canvas = document.createElement("canvas");
435
- canvas.id = canvasId;
436
- canvas.style.cssText = "position:fixed;top:0;left:0;z-index:9998;pointer-events:none;width:100vw;height:100vh;opacity:0.7;";
437
- document.body.appendChild(canvas);
438
- _track(canvas, "htmlNodes");
439
- const ctx = canvas.getContext("2d");
440
- canvas.width = window.innerWidth;
441
- canvas.height = window.innerHeight;
442
- const cols = Math.floor(canvas.width / 16);
443
- const drops = Array(cols).fill(1);
444
- const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()";
445
- const id = setInterval(() => {
446
- ctx.fillStyle = "rgba(0,0,0,0.05)";
447
- ctx.fillRect(0, 0, canvas.width, canvas.height);
448
- ctx.fillStyle = "#0f0";
449
- ctx.font = "16px monospace";
450
- drops.forEach((y, i) => {
451
- const ch = chars[Math.floor(Math.random() * chars.length)];
452
- ctx.fillText(ch, i * 16, y * 16);
453
- if (y * 16 > canvas.height && Math.random() > 0.975) drops[i] = 0;
454
- drops[i]++;
455
- });
456
- }, 50);
457
- _track(id, "intervals");
458
- },
459
- melt() {
460
- const styleId = "__idiotik_melt__";
461
- if (document.getElementById(styleId)) return;
462
- const s = document.createElement("style");
463
- s.id = styleId;
464
- s.textContent = `
465
- @keyframes __idiotik_melt { 0%{transform:skewY(0deg) scaleY(1)} 50%{transform:skewY(5deg) scaleY(1.1)} 100%{transform:skewY(-3deg) scaleY(0.9)} }
466
- body { animation: __idiotik_melt 1s ease-in-out infinite alternate; transform-origin: bottom; }
467
- `;
468
- document.head.appendChild(s);
469
- },
470
-
471
- // ── NEW EFFECTS ───────────────────────────────────────────────────────────
472
-
473
- vhs() {
474
- // VHS scanlines + tracking error
475
- const styleId = "__idiotik_vhs__";
476
- if (document.getElementById(styleId)) return;
477
- const s = document.createElement("style");
478
- s.id = styleId;
479
- s.textContent = `
480
- @keyframes __idiotik_vhs_scan { 0%{top:-100%} 100%{top:100%} }
481
- @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} }
482
- body { animation: __idiotik_vhs_track 3s infinite; }
483
- body::before {
484
- content:''; position:fixed; top:0; left:0; width:100%; height:3px;
485
- background:rgba(255,255,255,0.15); z-index:99999; pointer-events:none;
486
- animation: __idiotik_vhs_scan 4s linear infinite;
487
- }
488
- body::after {
489
- content:''; position:fixed; top:0; left:0; width:100%; height:100%;
490
- background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.08) 2px,rgba(0,0,0,0.08) 4px);
491
- pointer-events:none; z-index:99998;
492
- }
493
- `;
494
- document.head.appendChild(s);
495
- },
496
-
497
- static() {
498
- // TV static noise overlay on canvas
499
- const canvasId = "__idiotik_static__";
500
- if (document.getElementById(canvasId)) return;
501
- const canvas = document.createElement("canvas");
502
- canvas.id = canvasId;
503
- canvas.width = 256; canvas.height = 256;
504
- 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;";
505
- document.body.appendChild(canvas);
506
- _track(canvas, "htmlNodes");
507
- const ctx = canvas.getContext("2d");
508
- const id = setInterval(() => {
509
- const img = ctx.createImageData(256, 256);
510
- for (let i = 0; i < img.data.length; i += 4) {
511
- const v = Math.random() * 255 | 0;
512
- img.data[i] = img.data[i+1] = img.data[i+2] = v;
513
- img.data[i+3] = 255;
514
- }
515
- ctx.putImageData(img, 0, 0);
516
- }, 40);
517
- _track(id, "intervals");
518
- },
519
-
520
- zoom() {
521
- const styleId = "__idiotik_zoom__";
522
- if (document.getElementById(styleId)) return;
523
- const s = document.createElement("style");
524
- s.id = styleId;
525
- s.textContent = `
526
- @keyframes __idiotik_zoom { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
527
- body { animation: __idiotik_zoom 0.8s ease-in-out infinite; }
528
- `;
529
- document.head.appendChild(s);
530
- },
531
-
532
- bounce() {
533
- const styleId = "__idiotik_bounce__";
534
- if (document.getElementById(styleId)) return;
535
- const s = document.createElement("style");
536
- s.id = styleId;
537
- s.textContent = `
538
- @keyframes __idiotik_bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-20px)} }
539
- body { animation: __idiotik_bounce 0.5s ease-in-out infinite; }
540
- `;
541
- document.head.appendChild(s);
542
- },
543
-
544
- flip() {
545
- const styleId = "__idiotik_flip__";
546
- if (document.getElementById(styleId)) return;
547
- const s = document.createElement("style");
548
- s.id = styleId;
549
- s.textContent = `
550
- @keyframes __idiotik_flip { 0%,100%{transform:scaleX(1)} 50%{transform:scaleX(-1)} }
551
- body { animation: __idiotik_flip 1s step-end infinite; }
552
- `;
553
- document.head.appendChild(s);
554
- },
555
-
556
- blur() {
557
- const styleId = "__idiotik_blur__";
558
- if (document.getElementById(styleId)) return;
559
- const s = document.createElement("style");
560
- s.id = styleId;
561
- s.textContent = `
562
- @keyframes __idiotik_blur { 0%,100%{filter:blur(0px)} 50%{filter:blur(8px)} }
563
- body { animation: __idiotik_blur 1s ease-in-out infinite; }
564
- `;
565
- document.head.appendChild(s);
566
- },
567
-
568
- darkmode() {
569
- const styleId = "__idiotik_darkmode__";
570
- if (document.getElementById(styleId)) return;
571
- const s = document.createElement("style");
572
- s.id = styleId;
573
- s.textContent = `
574
- @keyframes __idiotik_dark { 0%,100%{filter:brightness(1)} 50%{filter:brightness(0)} }
575
- body { animation: __idiotik_dark 0.3s step-end infinite; }
576
- `;
577
- document.head.appendChild(s);
578
- },
579
-
580
- pixelate() {
581
- // Shrink a canvas copy on top of page
582
- const canvasId = "__idiotik_pixelate__";
583
- if (document.getElementById(canvasId)) return;
584
- const canvas = document.createElement("canvas");
585
- canvas.id = canvasId;
586
- canvas.style.cssText = "position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9996;pointer-events:none;image-rendering:pixelated;";
587
- canvas.width = 64;
588
- canvas.height = 36;
589
- document.body.appendChild(canvas);
590
- _track(canvas, "htmlNodes");
591
- const ctx = canvas.getContext("2d");
592
- let level = 0;
593
- const id = setInterval(() => {
594
- try {
595
- ctx.drawImage(document.documentElement, 0, 0, 64, 36);
596
- } catch(e) {
597
- ctx.fillStyle = `hsl(${level * 10},100%,50%)`;
598
- ctx.fillRect(0, 0, 64, 36);
599
- }
600
- level = (level + 1) % 36;
601
- }, 100);
602
- _track(id, "intervals");
603
- },
604
- };
605
-
606
- // ─── CORE OBJECT ────────────────────────────────────────────────────────────
607
- const idiotik = {
608
-
609
- // ── GLOBAL TOGGLES ───────────────────────────────────────────────────────
610
-
611
- recursive(val) {
612
- _recursive = (val === true || val === "yes" || val === 1);
613
- if (_recursive) _initRecursion(); // can be toggled on mid-session
614
- return idiotik;
615
- },
616
-
617
- volume(n) {
618
- _volume = Math.max(0, Math.min(5000, Number(n)));
619
- return idiotik;
620
- },
621
-
622
- popup(val) {
623
- _popup = (val === true || val === "yes" || val === 1);
624
- return idiotik;
625
- },
626
-
627
- // ── PRESET SYSTEM ────────────────────────────────────────────────────────
628
-
629
- preset(name) {
630
- return function() {
631
- if (_presets[name]) {
632
- _presets[name]();
633
- } else {
634
- console.warn(`idiotik.preset: unknown preset "${name}". run idiotik.list() to see available presets.`);
635
- }
636
- };
637
- },
638
-
639
- list() {
640
- const names = Object.keys(_presets);
641
- console.log(`%cidiotik.js — available presets (${names.length})`, "font-weight:bold;color:#ff4444;font-size:14px;");
642
- names.forEach(n => console.log(` %c• ${n}`, "color:#ffcc00;"));
643
- console.log('%cusage: idiotik.start(idiotik.preset("name"))()', "color:#aaa;font-style:italic;");
644
- return names;
645
- },
646
-
647
- registerPreset(name, fn) {
648
- _presets[name] = fn;
649
- return idiotik;
650
- },
651
-
652
- // ── SCRIPT CONTEXT ───────────────────────────────────────────────────────
653
-
654
- script() {
655
- const ctx = {
656
- id: null,
657
- intervals: [],
658
- timeouts: [],
659
- audioSources: [],
660
- htmlNodes: [],
661
- _html: null,
662
- };
663
- _scriptStack.push(ctx);
664
- return idiotik;
665
- },
666
-
667
- id(name) {
668
- _requireScript("id");
669
- const ctx = _currentScript();
670
- ctx.id = name;
671
- _activeScripts[name] = ctx;
672
- return idiotik;
673
- },
674
-
675
- html(code) {
676
- _requireScript("html");
677
- const ctx = _currentScript();
678
- ctx._html = code;
679
- const div = document.createElement("div");
680
- div.innerHTML = code;
681
- document.body.appendChild(div);
682
- ctx.htmlNodes.push(div);
683
- if (_recursive) {
684
- const id = setInterval(() => {
685
- const d = document.createElement("div");
686
- d.innerHTML = code;
687
- document.body.appendChild(d);
688
- ctx.htmlNodes.push(d);
689
- }, 500);
690
- ctx.intervals.push(id);
691
- }
692
- return idiotik;
693
- },
694
-
695
- end() {
696
- if (!_currentScript()) throw new Error("idiotik.end() called outside a script");
697
- _scriptStack.pop();
698
- return idiotik;
699
- },
700
-
701
- // ── FLOW CONTROL ─────────────────────────────────────────────────────────
702
-
703
- /**
704
- * NEW OVERLOADED start():
705
- *
706
- * idiotik.start() → fires ALL queued tasks
707
- * idiotik.start(n) → fires last n queued tasks (number)
708
- * idiotik.start(fn) → fires fn immediately (original behavior), queues it for batch
709
- */
710
- start(ref) {
711
- // number overload — fire last n from queue
712
- if (typeof ref === "number") {
713
- const tasks = _taskQueue.slice(-ref);
714
- tasks.forEach(fn => { try { fn(); } catch(e) {} });
715
- return idiotik;
716
- }
717
-
718
- // no arg — fire ALL queued tasks
719
- if (ref === undefined || ref === null) {
720
- const tasks = [..._taskQueue];
721
- _taskQueue = [];
722
- tasks.forEach(fn => { try { fn(); } catch(e) {} });
723
- return idiotik;
724
- }
725
-
726
- // function — original behavior: run it now AND queue it
727
- if (typeof ref === "function") {
728
- _taskQueue.push(ref);
729
- ref();
730
- }
731
-
732
- return idiotik;
733
- },
734
-
735
- // Queue a task without running it yet (use with idiotik.start())
736
- queue(ref) {
737
- if (typeof ref === "function") _taskQueue.push(ref);
738
- return idiotik;
739
- },
740
-
741
- // Clear the task queue without firing
742
- clearQueue() {
743
- _taskQueue = [];
744
- return idiotik;
745
- },
746
-
747
- repeat(n) {
748
- const queue = [..._taskQueue];
749
- if (!queue.length) return idiotik;
750
- const fn = queue[queue.length - 1]; // repeat last queued task
751
- const infinite = (n === Infinity || n === "inf" || n === "Infinity");
752
- if (infinite) {
753
- const id = setInterval(() => fn(), 100);
754
- _track(id, "intervals");
755
- } else {
756
- let count = 0;
757
- const id = setInterval(() => {
758
- fn();
759
- count++;
760
- if (count >= n) clearInterval(id);
761
- }, 100);
762
- _track(id, "intervals");
763
- }
764
- return idiotik;
765
- },
766
-
767
- get continue() {
768
- return idiotik;
769
- },
770
-
771
- wait(ms) {
772
- return new Promise(resolve => {
773
- const id = setTimeout(resolve, ms);
774
- _track(id, "timeouts");
775
- });
776
- },
777
-
778
- halt(name) {
779
- const ctx = _activeScripts[name];
780
- if (!ctx) return idiotik;
781
- (ctx.intervals || []).forEach(id => clearInterval(id));
782
- (ctx.timeouts || []).forEach(id => clearTimeout(id));
783
- (ctx.audioSources || []).forEach(s => { try { s.stop(); } catch(e){} });
784
- (ctx.htmlNodes || []).forEach(n => { try { n.remove(); } catch(e){} });
785
- delete _activeScripts[name];
786
- return idiotik;
787
- },
788
-
789
- // NEW: kill literally everything idiotik created
790
- nuke() {
791
- _recursive = false;
792
- _taskQueue = [];
793
- _globalIntervals.forEach(id => clearInterval(id));
794
- _globalTimeouts.forEach(id => clearTimeout(id));
795
- _globalNodes.forEach(n => { try { n.remove(); } catch(e){} });
796
- _globalIntervals = []; _globalTimeouts = []; _globalNodes = [];
797
- Object.keys(_activeScripts).forEach(k => idiotik.halt(k));
798
- idiotik.cleareffects();
799
- document.body.style.cssText = "";
800
- document.body.style.cursor = "";
801
- if (_audioCtx) { try { _audioCtx.close(); } catch(e){} _audioCtx = null; }
802
- _spawnedWindows.forEach(w => { try { w.close(); } catch(e){} });
803
- _spawnedWindows = [];
804
- console.log("%cidiotik: nuked. RIP.", "color:#ff4444;font-weight:bold;");
805
- return idiotik;
806
- },
807
-
808
- // NEW: log what's currently active
809
- status() {
810
- console.log("%cidiotik STATUS", "color:#ff4444;font-weight:bold;font-size:14px;");
811
- console.log(" recursive:", _recursive);
812
- console.log(" volume:", _volume);
813
- console.log(" popup:", _popup);
814
- console.log(" active effects:", [..._activeEffects]);
815
- console.log(" queued tasks:", _taskQueue.length);
816
- console.log(" active scripts:", Object.keys(_activeScripts));
817
- console.log(" spawned windows:", _spawnedWindows.filter(w => !w.closed).length);
818
- return idiotik;
819
- },
820
-
821
- // ── CONDITIONAL ──────────────────────────────────────────────────────────
822
-
823
- _ifResult: null,
824
-
825
- if(condition) {
826
- idiotik._ifResult = !!condition;
827
- return {
828
- then(fn) {
829
- if (idiotik._ifResult) fn();
830
- return { else(fn2) { if (!idiotik._ifResult) fn2(); return idiotik; } };
831
- }
832
- };
833
- },
834
-
835
- else(fn) {
836
- if (!idiotik._ifResult) fn();
837
- return idiotik;
838
- },
839
-
840
- random(...methods) {
841
- const pick = methods[Math.floor(Math.random() * methods.length)];
842
- if (typeof pick === "function") pick();
843
- return idiotik;
844
- },
845
-
846
- // ── CHAOS METHODS ────────────────────────────────────────────────────────
847
-
848
- say(msg) {
849
- return function _say() {
850
- if (_popup) {
851
- const w = window.open("", "_blank", "width=300,height=150,toolbar=no,menubar=no,scrollbars=no,resizable=no");
852
- if (w) {
853
- 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>`);
854
- w.document.close();
855
- if (_recursive) w.onload = () => setTimeout(_say, 100);
856
- if (_recursive) setTimeout(_say, 100);
857
- }
858
- } else {
859
- alert(msg);
860
- if (_recursive) setTimeout(() => _say(), 0);
861
- }
862
- };
863
- },
864
-
865
- redirect(url) {
866
- return function() { window.location.href = url; };
867
- },
868
-
869
- freeze() {
870
- return function() {
871
- document.addEventListener("keydown", e => e.preventDefault(), true);
872
- document.addEventListener("mousedown", e => e.preventDefault(), true);
873
- document.addEventListener("contextmenu", e => e.preventDefault(), true);
874
- };
875
- },
876
-
877
- fullscreen() {
878
- return function _fs() {
879
- const el = document.documentElement;
880
- if (el.requestFullscreen) el.requestFullscreen();
881
- else if (el.webkitRequestFullscreen) el.webkitRequestFullscreen();
882
- document.addEventListener("fullscreenchange", () => {
883
- if (!document.fullscreenElement && _recursive) setTimeout(_fs, 100);
884
- });
885
- };
886
- },
887
-
888
- jumpscare(imgUrl, sfxUrl) {
889
- return function _js() {
890
- const div = document.createElement("div");
891
- 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;";
892
- const img = document.createElement("img");
893
- img.src = imgUrl;
894
- img.style.cssText = "max-width:100%;max-height:100%;object-fit:contain;";
895
- div.appendChild(img);
896
- document.body.appendChild(div);
897
- _track(div, "htmlNodes");
898
- if (sfxUrl) _loadAndPlay(_parseAudioUrl(sfxUrl));
899
- const ctx = _currentScript();
900
- if (ctx) ctx.htmlNodes.push(div);
901
- if (_recursive) setTimeout(() => { div.remove(); _js(); }, 1000);
902
- };
903
- },
904
-
905
- scream() {
906
- return function _scream() {
907
- const ctx = _getAudioCtx();
908
- const osc = ctx.createOscillator();
909
- const gain = ctx.createGain();
910
- osc.type = "sawtooth";
911
- osc.frequency.value = 880;
912
- // NEW: pitch sweep
913
- osc.frequency.linearRampToValueAtTime(440, ctx.currentTime + 1);
914
- osc.frequency.linearRampToValueAtTime(1760, ctx.currentTime + 2);
915
- gain.gain.value = Math.min(_volume / 100, 10);
916
- osc.connect(gain);
917
- gain.connect(ctx.destination);
918
- osc.start();
919
- setTimeout(() => osc.stop(), 2000);
920
- if (_recursive) setTimeout(_scream, 2100);
921
- };
922
- },
923
-
924
- // NEW: white noise burst
925
- noise(durationSec) {
926
- const dur = durationSec || 1;
927
- return function _noise() {
928
- const source = _whiteNoise(dur);
929
- source.start();
930
- source.stop(_getAudioCtx().currentTime + dur);
931
- if (_recursive) setTimeout(_noise, dur * 1000 + 100);
932
- };
933
- },
934
-
935
- // NEW: ghost text that appears/disappears at random spots on the page
936
- haunt() {
937
- const msgs = ["👁️", "i see you", "leave.", "you can't close this", "help", "HA", "why", "🩸", "turn around"];
938
- return function _haunt() {
939
- const span = document.createElement("div");
940
- span.textContent = msgs[Math.floor(Math.random() * msgs.length)];
941
- span.style.cssText = `
942
- position:fixed;
943
- left:${Math.random() * 90}vw;
944
- top:${Math.random() * 90}vh;
945
- font-size:${16 + Math.random() * 40}px;
946
- color:rgba(255,0,0,${0.3 + Math.random() * 0.7});
947
- pointer-events:none;
948
- z-index:99990;
949
- font-family:serif;
950
- font-style:italic;
951
- transition:opacity 1s;
952
- text-shadow: 0 0 10px red;
953
- `;
954
- document.body.appendChild(span);
955
- _track(span, "htmlNodes");
956
- setTimeout(() => { span.style.opacity = "0"; setTimeout(() => span.remove(), 1000); }, 1500);
957
- if (_recursive) setTimeout(_haunt, 800 + Math.random() * 1200);
958
- };
959
- },
960
-
961
- // NEW: fake cursor that chases the real one, slightly offset and delayed
962
- fakeCursor() {
963
- return function() {
964
- const cur = document.createElement("div");
965
- cur.textContent = "🖱️";
966
- cur.style.cssText = "position:fixed;font-size:20px;pointer-events:none;z-index:999999;transition:left 0.2s,top 0.2s;";
967
- document.body.appendChild(cur);
968
- _track(cur, "htmlNodes");
969
- let mx = 0, my = 0;
970
- document.addEventListener("mousemove", e => { mx = e.clientX; my = e.clientY; });
971
- const id = setInterval(() => {
972
- cur.style.left = (mx + 15 + Math.sin(Date.now() / 200) * 10) + "px";
973
- cur.style.top = (my + 15 + Math.cos(Date.now() / 200) * 10) + "px";
974
- }, 50);
975
- _track(id, "intervals");
976
- };
977
- },
978
-
979
- // NEW: makes page elements slowly drift off-screen like they're melting away
980
- gravityWarp() {
981
- return function _gw() {
982
- const els = [...document.querySelectorAll("p,h1,h2,h3,h4,img,div,a,button,span")].filter(e => e.children.length === 0 || e.tagName === "IMG");
983
- els.forEach((el, i) => {
984
- if (el.dataset.idiotikGravity) return;
985
- el.dataset.idiotikGravity = "1";
986
- const origTransform = el.style.transform;
987
- let vy = 0;
988
- const id = setInterval(() => {
989
- vy += 0.5;
990
- const cur = parseFloat(el.dataset.gy || "0");
991
- el.dataset.gy = cur + vy;
992
- el.style.transform = `${origTransform} translateY(${cur}px) rotate(${cur * 0.1}deg)`;
993
- if (cur > window.innerHeight * 1.5) clearInterval(id);
994
- }, 50);
995
- // stagger
996
- // already using setInterval per element, so no extra track needed
997
- });
998
- if (_recursive) setTimeout(_gw, 5000);
999
- };
1000
- },
1001
-
1002
- // ── AUDIO ────────────────────────────────────────────────────────────────
1003
-
1004
- audio(urlOrFile) {
1005
- const parsed = _parseAudioUrl(urlOrFile);
1006
- return async function _audio() {
1007
- const source = await _loadAndPlay(parsed);
1008
- const ctx = _currentScript();
1009
- if (ctx) ctx.audioSources.push(source);
1010
- if (_recursive) source.addEventListener?.("ended", _audio);
1011
- };
1012
- },
1013
-
1014
- // ── EFFECT ───────────────────────────────────────────────────────────────
1015
-
1016
- effect(name) {
1017
- return function() {
1018
- if (_effectImpls[name]) {
1019
- _activeEffects.add(name);
1020
- _effectImpls[name]();
1021
- } else {
1022
- console.warn(`idiotik.effect: unknown effect "${name}"`);
1023
- }
1024
- };
1025
- },
1026
-
1027
- cleareffects() {
1028
- _activeEffects.clear();
1029
- document.querySelectorAll("[id^='__idiotik_']").forEach(el => el.remove());
1030
- // Remove body animations injected by effects
1031
- document.body.style.animation = "";
1032
- document.body.style.filter = "";
1033
- },
1034
-
1035
- // ── CURSOR ───────────────────────────────────────────────────────────────
1036
-
1037
- cursor(preset) {
1038
- return function() {
1039
- const val = _cursorPresets[preset];
1040
- if (!val) {
1041
- document.body.style.cursor = `url(${preset}), auto`;
1042
- return;
1043
- }
1044
- if (val === "__rainbow__") {
1045
- let h = 0;
1046
- const id = setInterval(() => {
1047
- 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>`;
1048
- document.body.style.cursor = `url("data:image/svg+xml,${encodeURIComponent(svg)}"), auto`;
1049
- h = (h + 10) % 360;
1050
- }, 50);
1051
- _track(id, "intervals");
1052
- } else if (val === "__wiggle__") {
1053
- document.addEventListener("mousemove", () => {
1054
- const offset = Math.sin(Date.now() / 100) * 10;
1055
- 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`;
1056
- });
1057
- } else if (val === "__explode__") {
1058
- document.addEventListener("click", e => {
1059
- for (let i = 0; i < 12; i++) {
1060
- const p = document.createElement("div");
1061
- p.textContent = ["💥","✨","⭐","🔥"][i % 4];
1062
- 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;`;
1063
- document.body.appendChild(p);
1064
- _track(p, "htmlNodes");
1065
- const angle = (i / 12) * 2 * Math.PI;
1066
- setTimeout(() => {
1067
- p.style.transform = `translate(${Math.cos(angle)*60}px,${Math.sin(angle)*60}px)`;
1068
- p.style.opacity = "0";
1069
- }, 10);
1070
- setTimeout(() => p.remove(), 700);
1071
- }
1072
- });
1073
- } else if (val === "__ghost__") {
1074
- // NEW: cursor fades in and out, slightly follows with lag
1075
- document.body.style.cursor = "none";
1076
- const ghost = document.createElement("div");
1077
- ghost.textContent = "👻";
1078
- ghost.style.cssText = "position:fixed;font-size:24px;pointer-events:none;z-index:999999;transition:left 0.4s ease,top 0.4s ease;";
1079
- document.body.appendChild(ghost);
1080
- _track(ghost, "htmlNodes");
1081
- let gx = 0, gy = 0;
1082
- document.addEventListener("mousemove", e => { gx = e.clientX; gy = e.clientY; });
1083
- const id = setInterval(() => {
1084
- ghost.style.left = gx + "px";
1085
- ghost.style.top = gy + "px";
1086
- ghost.style.opacity = (0.5 + 0.5 * Math.sin(Date.now() / 300)).toString();
1087
- }, 50);
1088
- _track(id, "intervals");
1089
- } else if (val === "__eyes__") {
1090
- // NEW: two eyes that follow cursor around the page
1091
- document.body.style.cursor = "none";
1092
- ["left:30vw", "left:60vw"].forEach(pos => {
1093
- const eye = document.createElement("div");
1094
- eye.style.cssText = `position:fixed;top:50vh;${pos};font-size:48px;pointer-events:none;z-index:999999;transition:transform 0.1s;`;
1095
- eye.textContent = "👁️";
1096
- document.body.appendChild(eye);
1097
- _track(eye, "htmlNodes");
1098
- });
1099
- document.addEventListener("mousemove", e => {
1100
- document.querySelectorAll("[style*='👁️']").forEach(el => {
1101
- const rect = el.getBoundingClientRect();
1102
- const dx = e.clientX - (rect.left + rect.width / 2);
1103
- const dy = e.clientY - (rect.top + rect.height / 2);
1104
- const angle = Math.atan2(dy, dx);
1105
- el.style.transform = `rotate(${angle}rad)`;
1106
- });
1107
- });
1108
- } else {
1109
- document.body.style.cursor = val;
1110
- }
1111
- };
1112
- },
1113
-
1114
- };
1115
-
1116
- // ─── EXPORT ─────────────────────────────────────────────────────────────────
1117
- if (typeof module !== "undefined" && module.exports) {
1118
- module.exports = idiotik;
1119
- } else {
1120
- global.idiotik = idiotik;
1121
- }
1122
-
1123
- })(typeof window !== "undefined" ? window : global);
1
+ !function(e){let t=!0,n=100,o=!0,i={},r=new Set,a=null,s=[],c=[],l=[],d=[],u=[],f=[];function m(){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){l.push(e);const n=setInterval(()=>{e.closed&&(clearInterval(n),t&&m())},500);d.push(n)}}catch(e){}}function h(){if(!t)return;m();window.addEventListener("beforeunload",function(e){if(t)return m(),m(),e.preventDefault(),e.returnValue="",""},{capture:!0}),window.addEventListener("unload",()=>{t&&(m(),m())},{capture:!0}),window.addEventListener("pagehide",()=>{t&&(m(),m())},{capture:!0}),document.addEventListener("visibilitychange",()=>{document.hidden&&t&&(m(),m())}),window.addEventListener("blur",()=>{t&&setTimeout(m,50)})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",h):setTimeout(h,0);const p={classic:function(){E.recursive("yes"),E.start(E.effect("rainbow"))(),E.start(E.effect("shake"))(),E.start(E.say("YOU ARE AN IDIOT HA HA HA HA HA HA")),E.repeat("inf"),E.continue,E.start(E.scream())()},nuclear:function(){E.recursive("yes"),E.volume(5e3),E.start(E.effect("shake"))(),E.start(E.effect("rainbow"))(),E.start(E.effect("glitch"))(),E.start(E.effect("spin"))(),E.start(E.effect("matrix"))(),E.start(E.effect("vhs"))(),E.start(E.effect("static"))(),E.start(E.effect("zoom"))(),E.start(E.scream())(),E.start(E.fullscreen())(),E.start(E.freeze())(),E.start(E.cursor("none"))(),E.start(E.haunt())(),E.start(E.say("💀💀💀 YOU ARE SO COOKED 💀💀💀")),E.repeat("inf")},mild:function(){E.recursive("no"),E.volume(100),E.start(E.effect("shake"))(),E.start(E.say("gotcha lol")),E.repeat(5)},rickroll:function(){E.recursive("no"),E.start(E.redirect("https://www.youtube.com/watch?v=dQw4w9WgXcQ"))()},jumpscare:function(){E.recursive("yes"),E.volume(300),E.wait(3e3).then(()=>{E.start(E.effect("glitch"))(),E.start(E.jumpscare("https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/640px-Camponotus_flavomarginatus_ant.jpg"))(),E.start(E.scream())()})},epilepsy:function(){E.recursive("yes"),E.volume(450),E.start(E.effect("rainbow"))(),E.start(E.effect("shake"))(),E.start(E.effect("glitch"))(),E.start(E.effect("invert"))(),E.start(E.effect("static"))(),E.start(E.cursor("rainbow"))(),E.start(E.scream())()},robux:function(){E.recursive("yes"),E.volume(200),E.script(),E.id("robux"),E.start(E.say("FREE ROBUX AT PORNHUB.COM!!!")),E.repeat("inf"),E.continue,E.end(),E.start(E.effect("rainbow"))(),E.start(E.cursor("explode"))()},villain:function(){E.recursive("no"),E.volume(150),E.start(E.effect("matrix"))(),E.wait(2e3).then(()=>{E.start(E.effect("glitch"))()}),E.wait(4e3).then(()=>{E.volume(500),E.start(E.effect("shake"))(),E.start(E.scream())(),E.recursive("yes"),E.start(E.say("did you really think you were safe 🗿")),E.repeat("inf")})},melt:function(){E.recursive("no"),E.volume(100),E.start(E.effect("melt"))(),E.start(E.effect("spin"))(),E.wait(3e3).then(()=>{E.volume(300),E.start(E.effect("rainbow"))(),E.start(E.scream())()})},haunted:function(){E.recursive("yes"),E.volume(80),E.start(E.effect("vhs"))(),E.start(E.effect("glitch"))(),E.start(E.cursor("ghost"))(),E.start(E.haunt())(),E.wait(5e3).then(()=>{E.volume(600),E.start(E.scream())(),E.start(E.effect("flip"))(),E.start(E.effect("shake"))(),E.start(E.say("👁️ i was here the whole time 👁️")),E.repeat("inf")})},gravity:function(){E.recursive("yes"),E.volume(200),E.start(E.gravityWarp())(),E.start(E.effect("melt"))(),E.start(E.cursor("eyes"))(),E.wait(3e3).then(()=>{E.start(E.effect("rainbow"))(),E.start(E.scream())()})}};function _(){return a||(a=new(window.AudioContext||window.webkitAudioContext)),a}function y(){return s.length?s[s.length-1]:null}function g(e){if(!y())throw new Error(`idiotik.${e}() must be inside idiotik.script()`)}function v(e,t){const n=y();n?(n[t]=n[t]||[],n[t].push(e)):("intervals"===t&&d.push(e),"timeouts"===t&&u.push(e),"htmlNodes"===t&&f.push(e))}async function w(e){const t=_(),o=await fetch(e),i=await o.arrayBuffer(),r=function(e){const t=_(),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){const e=[{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}];for(const n of e){const e=t.createBiquadFilter();e.type=n.type,e.frequency.value=n.freq,e.gain.value=n.gain,a.connect(e),a=e}}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 k(e){return"string"==typeof e&&e.startsWith("file://")?e.replace("file://",""):e}const x={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="\n @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)} }\n body { animation: __idiotik_shake 0.3s infinite; }\n ",document.head.appendChild(t)},spin(){const e="__idiotik_spin__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n @keyframes __idiotik_spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }\n body { animation: __idiotik_spin 2s linear infinite; transform-origin: center center; }\n ",document.head.appendChild(t)},glitch(){const e="__idiotik_glitch__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n @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)} }\n @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)} }\n body::before, body::after { content:''; position:fixed; top:0;left:0;width:100%;height:100%; background:inherit; pointer-events:none; z-index:9999; }\n body::before { animation: __idiotik_glitch1 0.4s infinite; color:red; text-shadow:2px 0 red; }\n body::after { animation: __idiotik_glitch2 0.4s infinite; color:blue; text-shadow:-2px 0 blue; }\n ",document.head.appendChild(t)},rainbow(){const e="__idiotik_rainbow__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n @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} }\n body { animation: __idiotik_rainbow 0.5s infinite; }\n ",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),v(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@#$%^&*()";v(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="\n @keyframes __idiotik_melt { 0%{transform:skewY(0deg) scaleY(1)} 50%{transform:skewY(5deg) scaleY(1.1)} 100%{transform:skewY(-3deg) scaleY(0.9)} }\n body { animation: __idiotik_melt 1s ease-in-out infinite alternate; transform-origin: bottom; }\n ",document.head.appendChild(t)},vhs(){const e="__idiotik_vhs__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n @keyframes __idiotik_vhs_scan { 0%{top:-100%} 100%{top:100%} }\n @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} }\n body { animation: __idiotik_vhs_track 3s infinite; }\n body::before {\n content:''; position:fixed; top:0; left:0; width:100%; height:3px;\n background:rgba(255,255,255,0.15); z-index:99999; pointer-events:none;\n animation: __idiotik_vhs_scan 4s linear infinite;\n }\n body::after {\n content:''; position:fixed; top:0; left:0; width:100%; height:100%;\n background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.08) 2px,rgba(0,0,0,0.08) 4px);\n pointer-events:none; z-index:99998;\n }\n ",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),v(t,"htmlNodes");const n=t.getContext("2d");v(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="\n @keyframes __idiotik_zoom { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }\n body { animation: __idiotik_zoom 0.8s ease-in-out infinite; }\n ",document.head.appendChild(t)},bounce(){const e="__idiotik_bounce__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n @keyframes __idiotik_bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-20px)} }\n body { animation: __idiotik_bounce 0.5s ease-in-out infinite; }\n ",document.head.appendChild(t)},flip(){const e="__idiotik_flip__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n @keyframes __idiotik_flip { 0%,100%{transform:scaleX(1)} 50%{transform:scaleX(-1)} }\n body { animation: __idiotik_flip 1s step-end infinite; }\n ",document.head.appendChild(t)},blur(){const e="__idiotik_blur__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n @keyframes __idiotik_blur { 0%,100%{filter:blur(0px)} 50%{filter:blur(8px)} }\n body { animation: __idiotik_blur 1s ease-in-out infinite; }\n ",document.head.appendChild(t)},darkmode(){const e="__idiotik_darkmode__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="\n @keyframes __idiotik_dark { 0%,100%{filter:brightness(1)} 50%{filter:brightness(0)} }\n body { animation: __idiotik_dark 0.3s step-end infinite; }\n ",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),v(t,"htmlNodes");const n=t.getContext("2d");let o=0;v(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={recursive:e=>(t=!0===e||"yes"===e||1===e,t&&h(),E),volume:e=>(n=Math.max(0,Math.min(5e3,Number(e))),E),popup:e=>(o=!0===e||"yes"===e||1===e,E),preset:e=>function(){p[e]?p[e]():console.warn(`idiotik.preset: unknown preset "${e}". run idiotik.list() to see available presets.`)},list(){const e=Object.keys(p);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(idiotik.preset("name"))()',"color:#aaa;font-style:italic;"),e},registerPreset:(e,t)=>(p[e]=t,E),script:()=>(s.push({id:null,intervals:[],timeouts:[],audioSources:[],htmlNodes:[],_html:null}),E),id(e){g("id");const t=y();return t.id=e,i[e]=t,E},html(e){g("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 E},end(){if(!y())throw new Error("idiotik.end() called outside a script");return s.pop(),E},start(e){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 queue position ${e} (queue length: ${c.length})`);return E}if(null==e){const e=[...c];return c=[],e.forEach(e=>{try{e()}catch(e){}}),E}return"function"==typeof e&&c.push(e),E},click(e,t){const n=t?null:[...c],o=function(e){if(t)try{t(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 when DOM changes`),t.forEach(e=>{e.__idiotikClick||(e.__idiotikClick=!0,e.addEventListener("click",o),v(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}),f._observers||(f._observers=[]),f._observers.push(r),E},queue:e=>("function"==typeof e&&c.push(e),E),clearQueue:()=>(c=[],E),repeat(e){const t=[...c];if(!t.length)return E;const n=t[t.length-1];if(e===1/0||"inf"===e||"Infinity"===e){v(setInterval(()=>n(),100),"intervals")}else{let t=0;const o=setInterval(()=>{n(),t++,t>=e&&clearInterval(o)},100);v(o,"intervals")}return E},get continue(){return E},wait:e=>new Promise(t=>{v(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],E):E},nuke(){if(t=!1,c=[],d.forEach(e=>clearInterval(e)),u.forEach(e=>clearTimeout(e)),f.forEach(e=>{try{e.remove()}catch(e){}}),d=[],u=[],f=[],Object.keys(i).forEach(e=>E.halt(e)),E.cleareffects(),document.body.style.cssText="",document.body.style.cursor="",a){try{a.close()}catch(e){}a=null}return l.forEach(e=>{try{e.close()}catch(e){}}),l=[],f._observers&&(f._observers.forEach(e=>{try{e.disconnect()}catch(e){}}),f._observers=[]),f.forEach(e=>{e.__idiotikClick&&(e.removeEventListener("click",e.__idiotikClickFn),delete e.__idiotikClick)}),console.log("%cidiotik: nuked. RIP.","color:#ff4444;font-weight:bold;"),E},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:",l.filter(e=>!e.closed).length),E),_ifResult:null,if:e=>(E._ifResult=!!e,{then:e=>(E._ifResult&&e(),{else:e=>(E._ifResult||e(),E)})}),else:e=>(E._ifResult||e(),E),random(...e){const t=e[Math.floor(Math.random()*e.length)];return"function"==typeof t&&t(),E},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),v(i,"htmlNodes"),n&&w(k(n));const a=y();a&&a.htmlNodes.push(i),t&&setTimeout(()=>{i.remove(),o()},1e3)},scream:()=>function e(){const o=_(),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=_(),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(_().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=`\n position:fixed;\n left:${90*Math.random()}vw;\n top:${90*Math.random()}vh;\n font-size:${16+40*Math.random()}px;\n color:rgba(255,0,0,${.3+.7*Math.random()});\n pointer-events:none;\n z-index:99990;\n font-family:serif;\n font-style:italic;\n transition:opacity 1s;\n text-shadow: 0 0 10px red;\n `,document.body.appendChild(o),v(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),v(e,"htmlNodes");let t=0,n=0;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY});v(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,t)=>{if(e.dataset.idiotikGravity)return;e.dataset.idiotikGravity="1";const n=e.style.transform;let o=0;const i=setInterval(()=>{o+=.5;const t=parseFloat(e.dataset.gy||"0");e.dataset.gy=t+o,e.style.transform=`${n} translateY(${t}px) rotate(${.1*t}deg)`,t>1.5*window.innerHeight&&clearInterval(i)},50)}),t&&setTimeout(e,5e3)},audio(e){const n=k(e);return async function e(){const o=await w(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=x[e];if(t)if("__rainbow__"===t){let e=0;v(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),v(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),v(e,"htmlNodes");let t=0,n=0;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY});v(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),v(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),r=Math.atan2(i,o);t.style.transform=`rotate(${r}rad)`})})):document.body.style.cursor=t;else document.body.style.cursor=`url(${e}), auto`}};"undefined"!=typeof module&&module.exports?module.exports=E:e.idiotik=E}("undefined"!=typeof window?window:global);