idiotik.js 1.0.13 → 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.
- package/package.json +1 -1
- package/src/idiotik.js +1 -632
- package/presets/classic.js +0 -11
- package/presets/epilepsy.js +0 -13
- package/presets/jumpscare.js +0 -17
- package/presets/melt.js +0 -13
- package/presets/mild.js +0 -10
- package/presets/nuclear.js +0 -18
- package/presets/rickroll.js +0 -6
- package/presets/robux.js +0 -16
- package/presets/villain.js +0 -23
package/package.json
CHANGED
package/src/idiotik.js
CHANGED
|
@@ -1,632 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* idiotik.js — youareanidiot-style chaos toolkit
|
|
3
|
-
* recursive by default. you were warned.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
(function (global) {
|
|
7
|
-
|
|
8
|
-
// ─── GLOBAL STATE ───────────────────────────────────────────────────────────
|
|
9
|
-
let _recursive = true;
|
|
10
|
-
let _volume = 100;
|
|
11
|
-
let _popup = true;
|
|
12
|
-
let _activeScripts = {};
|
|
13
|
-
let _activeEffects = new Set();
|
|
14
|
-
let _audioCtx = null;
|
|
15
|
-
let _lastStarted = null;
|
|
16
|
-
let _scriptStack = [];
|
|
17
|
-
|
|
18
|
-
// ─── PRESET REGISTRY ────────────────────────────────────────────────────────
|
|
19
|
-
const _presets = {
|
|
20
|
-
classic: function() {
|
|
21
|
-
idiotik.recursive("yes");
|
|
22
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
23
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
24
|
-
idiotik.start(idiotik.say("YOU ARE AN IDIOT HA HA HA HA HA HA"));
|
|
25
|
-
idiotik.repeat("inf");
|
|
26
|
-
idiotik.continue;
|
|
27
|
-
idiotik.start(idiotik.scream())();
|
|
28
|
-
},
|
|
29
|
-
nuclear: function() {
|
|
30
|
-
idiotik.recursive("yes");
|
|
31
|
-
idiotik.volume(5000);
|
|
32
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
33
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
34
|
-
idiotik.start(idiotik.effect("glitch"))();
|
|
35
|
-
idiotik.start(idiotik.effect("spin"))();
|
|
36
|
-
idiotik.start(idiotik.effect("matrix"))();
|
|
37
|
-
idiotik.start(idiotik.scream())();
|
|
38
|
-
idiotik.start(idiotik.fullscreen())();
|
|
39
|
-
idiotik.start(idiotik.freeze())();
|
|
40
|
-
idiotik.start(idiotik.cursor("none"))();
|
|
41
|
-
idiotik.start(idiotik.say("💀💀💀 YOU ARE SO COOKED 💀💀💀"));
|
|
42
|
-
idiotik.repeat("inf");
|
|
43
|
-
},
|
|
44
|
-
mild: function() {
|
|
45
|
-
idiotik.recursive("no");
|
|
46
|
-
idiotik.volume(100);
|
|
47
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
48
|
-
idiotik.start(idiotik.say("gotcha lol"));
|
|
49
|
-
idiotik.repeat(5);
|
|
50
|
-
},
|
|
51
|
-
rickroll: function() {
|
|
52
|
-
idiotik.recursive("no");
|
|
53
|
-
idiotik.start(idiotik.redirect("https://www.youtube.com/watch?v=dQw4w9WgXcQ"))();
|
|
54
|
-
},
|
|
55
|
-
jumpscare: function() {
|
|
56
|
-
idiotik.recursive("yes");
|
|
57
|
-
idiotik.volume(300);
|
|
58
|
-
idiotik.wait(3000).then(() => {
|
|
59
|
-
idiotik.start(idiotik.effect("glitch"))();
|
|
60
|
-
idiotik.start(idiotik.jumpscare(
|
|
61
|
-
"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/640px-Camponotus_flavomarginatus_ant.jpg"
|
|
62
|
-
))();
|
|
63
|
-
idiotik.start(idiotik.scream())();
|
|
64
|
-
});
|
|
65
|
-
},
|
|
66
|
-
epilepsy: function() {
|
|
67
|
-
idiotik.recursive("yes");
|
|
68
|
-
idiotik.volume(450);
|
|
69
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
70
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
71
|
-
idiotik.start(idiotik.effect("glitch"))();
|
|
72
|
-
idiotik.start(idiotik.effect("invert"))();
|
|
73
|
-
idiotik.start(idiotik.cursor("rainbow"))();
|
|
74
|
-
idiotik.start(idiotik.scream())();
|
|
75
|
-
},
|
|
76
|
-
robux: function() {
|
|
77
|
-
idiotik.recursive("yes");
|
|
78
|
-
idiotik.volume(200);
|
|
79
|
-
idiotik.script();
|
|
80
|
-
idiotik.id("robux");
|
|
81
|
-
idiotik.start(idiotik.say("FREE ROBUX AT PORNHUB.COM!!!"));
|
|
82
|
-
idiotik.repeat("inf");
|
|
83
|
-
idiotik.continue;
|
|
84
|
-
idiotik.end();
|
|
85
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
86
|
-
idiotik.start(idiotik.cursor("explode"))();
|
|
87
|
-
},
|
|
88
|
-
villain: function() {
|
|
89
|
-
idiotik.recursive("no");
|
|
90
|
-
idiotik.volume(150);
|
|
91
|
-
idiotik.start(idiotik.effect("matrix"))();
|
|
92
|
-
idiotik.wait(2000).then(() => {
|
|
93
|
-
idiotik.start(idiotik.effect("glitch"))();
|
|
94
|
-
});
|
|
95
|
-
idiotik.wait(4000).then(() => {
|
|
96
|
-
idiotik.volume(500);
|
|
97
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
98
|
-
idiotik.start(idiotik.scream())();
|
|
99
|
-
idiotik.recursive("yes");
|
|
100
|
-
idiotik.start(idiotik.say("did you really think you were safe 🗿"));
|
|
101
|
-
idiotik.repeat("inf");
|
|
102
|
-
});
|
|
103
|
-
},
|
|
104
|
-
melt: function() {
|
|
105
|
-
idiotik.recursive("no");
|
|
106
|
-
idiotik.volume(100);
|
|
107
|
-
idiotik.start(idiotik.effect("melt"))();
|
|
108
|
-
idiotik.start(idiotik.effect("spin"))();
|
|
109
|
-
idiotik.wait(3000).then(() => {
|
|
110
|
-
idiotik.volume(300);
|
|
111
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
112
|
-
idiotik.start(idiotik.scream())();
|
|
113
|
-
});
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// ─── HELPERS ────────────────────────────────────────────────────────────────
|
|
118
|
-
function _getAudioCtx() {
|
|
119
|
-
if (!_audioCtx) _audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
|
120
|
-
return _audioCtx;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function _currentScript() {
|
|
124
|
-
return _scriptStack.length ? _scriptStack[_scriptStack.length - 1] : null;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function _requireScript(name) {
|
|
128
|
-
if (!_currentScript()) throw new Error(`idiotik.${name}() must be inside idiotik.script()`);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function _track(thing, type) {
|
|
132
|
-
const ctx = _currentScript();
|
|
133
|
-
if (!ctx) return;
|
|
134
|
-
ctx[type] = ctx[type] || [];
|
|
135
|
-
ctx[type].push(thing);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function _buildAudioChain(buffer) {
|
|
139
|
-
const ctx = _getAudioCtx();
|
|
140
|
-
const source = ctx.createBufferSource();
|
|
141
|
-
source.buffer = buffer;
|
|
142
|
-
source.loop = true;
|
|
143
|
-
const gainNode = ctx.createGain();
|
|
144
|
-
const rawVol = _volume;
|
|
145
|
-
if (rawVol <= 200) {
|
|
146
|
-
gainNode.gain.value = rawVol / 100;
|
|
147
|
-
} else {
|
|
148
|
-
gainNode.gain.value = Math.min(rawVol / 100, 50);
|
|
149
|
-
}
|
|
150
|
-
let lastNode = source;
|
|
151
|
-
if (rawVol > 200) {
|
|
152
|
-
const bassBoost = ctx.createBiquadFilter();
|
|
153
|
-
bassBoost.type = "lowshelf";
|
|
154
|
-
bassBoost.frequency.value = 200;
|
|
155
|
-
const boostAmount = Math.min(((rawVol - 200) / 4800) * 40, 40);
|
|
156
|
-
bassBoost.gain.value = boostAmount;
|
|
157
|
-
lastNode.connect(bassBoost);
|
|
158
|
-
lastNode = bassBoost;
|
|
159
|
-
}
|
|
160
|
-
if (rawVol >= 450) {
|
|
161
|
-
const bands = [
|
|
162
|
-
{ type: "lowshelf", freq: 60, gain: 40 },
|
|
163
|
-
{ type: "peaking", freq: 250, gain: 40 },
|
|
164
|
-
{ type: "peaking", freq: 500, gain: 40 },
|
|
165
|
-
{ type: "peaking", freq: 1500, gain: 40 },
|
|
166
|
-
{ type: "peaking", freq: 4000, gain: 40 },
|
|
167
|
-
{ type: "peaking", freq: 8000, gain: 40 },
|
|
168
|
-
{ type: "highshelf", freq: 16000, gain: 40 },
|
|
169
|
-
];
|
|
170
|
-
for (const b of bands) {
|
|
171
|
-
const f = ctx.createBiquadFilter();
|
|
172
|
-
f.type = b.type;
|
|
173
|
-
f.frequency.value = b.freq;
|
|
174
|
-
f.gain.value = b.gain;
|
|
175
|
-
lastNode.connect(f);
|
|
176
|
-
lastNode = f;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
lastNode.connect(gainNode);
|
|
180
|
-
gainNode.connect(ctx.destination);
|
|
181
|
-
return source;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
async function _loadAndPlay(url) {
|
|
185
|
-
const ctx = _getAudioCtx();
|
|
186
|
-
const resp = await fetch(url);
|
|
187
|
-
const arrayBuf = await resp.arrayBuffer();
|
|
188
|
-
const audioBuf = await ctx.decodeAudioData(arrayBuf);
|
|
189
|
-
const source = _buildAudioChain(audioBuf);
|
|
190
|
-
source.start(0);
|
|
191
|
-
return source;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function _parseAudioUrl(urlOrFile) {
|
|
195
|
-
if (typeof urlOrFile === "string" && urlOrFile.startsWith("file://")) {
|
|
196
|
-
return urlOrFile.replace("file://", "");
|
|
197
|
-
}
|
|
198
|
-
return urlOrFile;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// ─── CURSOR PRESETS ─────────────────────────────────────────────────────────
|
|
202
|
-
const _cursorPresets = {
|
|
203
|
-
hand: "pointer",
|
|
204
|
-
none: "none",
|
|
205
|
-
crosshair: "crosshair",
|
|
206
|
-
wait: "wait",
|
|
207
|
-
rainbow: "__rainbow__",
|
|
208
|
-
wiggle: "__wiggle__",
|
|
209
|
-
explode: "__explode__",
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
// ─── EFFECT IMPLEMENTATIONS ─────────────────────────────────────────────────
|
|
213
|
-
const _effectImpls = {
|
|
214
|
-
shake() {
|
|
215
|
-
const styleId = "__idiotik_shake__";
|
|
216
|
-
if (document.getElementById(styleId)) return;
|
|
217
|
-
const s = document.createElement("style");
|
|
218
|
-
s.id = styleId;
|
|
219
|
-
s.textContent = `
|
|
220
|
-
@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)} }
|
|
221
|
-
body { animation: __idiotik_shake 0.3s infinite; }
|
|
222
|
-
`;
|
|
223
|
-
document.head.appendChild(s);
|
|
224
|
-
},
|
|
225
|
-
spin() {
|
|
226
|
-
const styleId = "__idiotik_spin__";
|
|
227
|
-
if (document.getElementById(styleId)) return;
|
|
228
|
-
const s = document.createElement("style");
|
|
229
|
-
s.id = styleId;
|
|
230
|
-
s.textContent = `
|
|
231
|
-
@keyframes __idiotik_spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
|
|
232
|
-
body { animation: __idiotik_spin 2s linear infinite; transform-origin: center center; }
|
|
233
|
-
`;
|
|
234
|
-
document.head.appendChild(s);
|
|
235
|
-
},
|
|
236
|
-
glitch() {
|
|
237
|
-
const styleId = "__idiotik_glitch__";
|
|
238
|
-
if (document.getElementById(styleId)) return;
|
|
239
|
-
const s = document.createElement("style");
|
|
240
|
-
s.id = styleId;
|
|
241
|
-
s.textContent = `
|
|
242
|
-
@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)} }
|
|
243
|
-
@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)} }
|
|
244
|
-
body::before, body::after { content:''; position:fixed; top:0;left:0;width:100%;height:100%; background:inherit; pointer-events:none; z-index:9999; }
|
|
245
|
-
body::before { animation: __idiotik_glitch1 0.4s infinite; color:red; text-shadow:2px 0 red; }
|
|
246
|
-
body::after { animation: __idiotik_glitch2 0.4s infinite; color:blue; text-shadow:-2px 0 blue; }
|
|
247
|
-
`;
|
|
248
|
-
document.head.appendChild(s);
|
|
249
|
-
},
|
|
250
|
-
rainbow() {
|
|
251
|
-
const styleId = "__idiotik_rainbow__";
|
|
252
|
-
if (document.getElementById(styleId)) return;
|
|
253
|
-
const s = document.createElement("style");
|
|
254
|
-
s.id = styleId;
|
|
255
|
-
s.textContent = `
|
|
256
|
-
@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} }
|
|
257
|
-
body { animation: __idiotik_rainbow 0.5s infinite; }
|
|
258
|
-
`;
|
|
259
|
-
document.head.appendChild(s);
|
|
260
|
-
},
|
|
261
|
-
invert() {
|
|
262
|
-
const styleId = "__idiotik_invert__";
|
|
263
|
-
if (document.getElementById(styleId)) return;
|
|
264
|
-
const s = document.createElement("style");
|
|
265
|
-
s.id = styleId;
|
|
266
|
-
s.textContent = `body { filter: invert(1); }`;
|
|
267
|
-
document.head.appendChild(s);
|
|
268
|
-
},
|
|
269
|
-
matrix() {
|
|
270
|
-
const canvasId = "__idiotik_matrix__";
|
|
271
|
-
if (document.getElementById(canvasId)) return;
|
|
272
|
-
const canvas = document.createElement("canvas");
|
|
273
|
-
canvas.id = canvasId;
|
|
274
|
-
canvas.style.cssText = "position:fixed;top:0;left:0;z-index:9998;pointer-events:none;width:100vw;height:100vh;opacity:0.7;";
|
|
275
|
-
document.body.appendChild(canvas);
|
|
276
|
-
const ctx = canvas.getContext("2d");
|
|
277
|
-
canvas.width = window.innerWidth;
|
|
278
|
-
canvas.height = window.innerHeight;
|
|
279
|
-
const cols = Math.floor(canvas.width / 16);
|
|
280
|
-
const drops = Array(cols).fill(1);
|
|
281
|
-
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()";
|
|
282
|
-
const id = setInterval(() => {
|
|
283
|
-
ctx.fillStyle = "rgba(0,0,0,0.05)";
|
|
284
|
-
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
285
|
-
ctx.fillStyle = "#0f0";
|
|
286
|
-
ctx.font = "16px monospace";
|
|
287
|
-
drops.forEach((y, i) => {
|
|
288
|
-
const ch = chars[Math.floor(Math.random() * chars.length)];
|
|
289
|
-
ctx.fillText(ch, i * 16, y * 16);
|
|
290
|
-
if (y * 16 > canvas.height && Math.random() > 0.975) drops[i] = 0;
|
|
291
|
-
drops[i]++;
|
|
292
|
-
});
|
|
293
|
-
}, 50);
|
|
294
|
-
_track(id, "intervals");
|
|
295
|
-
},
|
|
296
|
-
melt() {
|
|
297
|
-
const styleId = "__idiotik_melt__";
|
|
298
|
-
if (document.getElementById(styleId)) return;
|
|
299
|
-
const s = document.createElement("style");
|
|
300
|
-
s.id = styleId;
|
|
301
|
-
s.textContent = `
|
|
302
|
-
@keyframes __idiotik_melt { 0%{transform:skewY(0deg) scaleY(1)} 50%{transform:skewY(5deg) scaleY(1.1)} 100%{transform:skewY(-3deg) scaleY(0.9)} }
|
|
303
|
-
body { animation: __idiotik_melt 1s ease-in-out infinite alternate; transform-origin: bottom; }
|
|
304
|
-
`;
|
|
305
|
-
document.head.appendChild(s);
|
|
306
|
-
},
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
// ─── CORE OBJECT ────────────────────────────────────────────────────────────
|
|
310
|
-
const idiotik = {
|
|
311
|
-
|
|
312
|
-
// ── GLOBAL TOGGLES ───────────────────────────────────────────────────────
|
|
313
|
-
|
|
314
|
-
recursive(val) {
|
|
315
|
-
_recursive = (val === true || val === "yes" || val === 1);
|
|
316
|
-
return idiotik;
|
|
317
|
-
},
|
|
318
|
-
|
|
319
|
-
volume(n) {
|
|
320
|
-
_volume = Math.max(0, Math.min(5000, Number(n)));
|
|
321
|
-
return idiotik;
|
|
322
|
-
},
|
|
323
|
-
|
|
324
|
-
popup(val) {
|
|
325
|
-
_popup = (val === true || val === "yes" || val === 1);
|
|
326
|
-
return idiotik;
|
|
327
|
-
},
|
|
328
|
-
|
|
329
|
-
// ── PRESET SYSTEM ────────────────────────────────────────────────────────
|
|
330
|
-
|
|
331
|
-
preset(name) {
|
|
332
|
-
return function() {
|
|
333
|
-
if (_presets[name]) {
|
|
334
|
-
_presets[name]();
|
|
335
|
-
} else {
|
|
336
|
-
console.warn(`idiotik.preset: unknown preset "${name}". run idiotik.list() to see available presets.`);
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
},
|
|
340
|
-
|
|
341
|
-
list() {
|
|
342
|
-
const names = Object.keys(_presets);
|
|
343
|
-
console.log(`%cidiotik.js — available presets (${names.length})`, "font-weight:bold;color:#ff4444;font-size:14px;");
|
|
344
|
-
names.forEach(n => console.log(` %c• ${n}`, "color:#ffcc00;"));
|
|
345
|
-
console.log('%cusage: idiotik.start(idiotik.preset("name"))()', "color:#aaa;font-style:italic;");
|
|
346
|
-
return names;
|
|
347
|
-
},
|
|
348
|
-
|
|
349
|
-
registerPreset(name, fn) {
|
|
350
|
-
_presets[name] = fn;
|
|
351
|
-
return idiotik;
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
// ── SCRIPT CONTEXT ───────────────────────────────────────────────────────
|
|
355
|
-
|
|
356
|
-
script() {
|
|
357
|
-
const ctx = {
|
|
358
|
-
id: null,
|
|
359
|
-
intervals: [],
|
|
360
|
-
timeouts: [],
|
|
361
|
-
audioSources: [],
|
|
362
|
-
htmlNodes: [],
|
|
363
|
-
_html: null,
|
|
364
|
-
};
|
|
365
|
-
_scriptStack.push(ctx);
|
|
366
|
-
return idiotik;
|
|
367
|
-
},
|
|
368
|
-
|
|
369
|
-
id(name) {
|
|
370
|
-
_requireScript("id");
|
|
371
|
-
const ctx = _currentScript();
|
|
372
|
-
ctx.id = name;
|
|
373
|
-
_activeScripts[name] = ctx;
|
|
374
|
-
return idiotik;
|
|
375
|
-
},
|
|
376
|
-
|
|
377
|
-
html(code) {
|
|
378
|
-
_requireScript("html");
|
|
379
|
-
const ctx = _currentScript();
|
|
380
|
-
ctx._html = code;
|
|
381
|
-
const div = document.createElement("div");
|
|
382
|
-
div.innerHTML = code;
|
|
383
|
-
document.body.appendChild(div);
|
|
384
|
-
ctx.htmlNodes.push(div);
|
|
385
|
-
if (_recursive) {
|
|
386
|
-
const id = setInterval(() => {
|
|
387
|
-
const d = document.createElement("div");
|
|
388
|
-
d.innerHTML = code;
|
|
389
|
-
document.body.appendChild(d);
|
|
390
|
-
ctx.htmlNodes.push(d);
|
|
391
|
-
}, 500);
|
|
392
|
-
ctx.intervals.push(id);
|
|
393
|
-
}
|
|
394
|
-
return idiotik;
|
|
395
|
-
},
|
|
396
|
-
|
|
397
|
-
end() {
|
|
398
|
-
if (!_currentScript()) throw new Error("idiotik.end() called outside a script");
|
|
399
|
-
_scriptStack.pop();
|
|
400
|
-
return idiotik;
|
|
401
|
-
},
|
|
402
|
-
|
|
403
|
-
// ── FLOW CONTROL ─────────────────────────────────────────────────────────
|
|
404
|
-
|
|
405
|
-
start(ref) {
|
|
406
|
-
_lastStarted = ref;
|
|
407
|
-
if (typeof ref === "function") ref();
|
|
408
|
-
return idiotik;
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
repeat(n) {
|
|
412
|
-
if (!_lastStarted) return idiotik;
|
|
413
|
-
const fn = _lastStarted;
|
|
414
|
-
const infinite = (n === Infinity || n === "inf" || n === "Infinity");
|
|
415
|
-
if (infinite) {
|
|
416
|
-
const id = setInterval(() => fn(), 100);
|
|
417
|
-
_track(id, "intervals");
|
|
418
|
-
} else {
|
|
419
|
-
let count = 0;
|
|
420
|
-
const id = setInterval(() => {
|
|
421
|
-
fn();
|
|
422
|
-
count++;
|
|
423
|
-
if (count >= n) clearInterval(id);
|
|
424
|
-
}, 100);
|
|
425
|
-
_track(id, "intervals");
|
|
426
|
-
}
|
|
427
|
-
return idiotik;
|
|
428
|
-
},
|
|
429
|
-
|
|
430
|
-
get continue() {
|
|
431
|
-
return idiotik;
|
|
432
|
-
},
|
|
433
|
-
|
|
434
|
-
wait(ms) {
|
|
435
|
-
return new Promise(resolve => {
|
|
436
|
-
const id = setTimeout(resolve, ms);
|
|
437
|
-
_track(id, "timeouts");
|
|
438
|
-
});
|
|
439
|
-
},
|
|
440
|
-
|
|
441
|
-
halt(name) {
|
|
442
|
-
const ctx = _activeScripts[name];
|
|
443
|
-
if (!ctx) return idiotik;
|
|
444
|
-
(ctx.intervals || []).forEach(id => clearInterval(id));
|
|
445
|
-
(ctx.timeouts || []).forEach(id => clearTimeout(id));
|
|
446
|
-
(ctx.audioSources || []).forEach(s => { try { s.stop(); } catch(e){} });
|
|
447
|
-
(ctx.htmlNodes || []).forEach(n => { try { n.remove(); } catch(e){} });
|
|
448
|
-
delete _activeScripts[name];
|
|
449
|
-
return idiotik;
|
|
450
|
-
},
|
|
451
|
-
|
|
452
|
-
// ── CONDITIONAL ──────────────────────────────────────────────────────────
|
|
453
|
-
|
|
454
|
-
_ifResult: null,
|
|
455
|
-
|
|
456
|
-
if(condition) {
|
|
457
|
-
idiotik._ifResult = !!condition;
|
|
458
|
-
return {
|
|
459
|
-
then(fn) {
|
|
460
|
-
if (idiotik._ifResult) fn();
|
|
461
|
-
return { else(fn2) { if (!idiotik._ifResult) fn2(); return idiotik; } };
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
},
|
|
465
|
-
|
|
466
|
-
else(fn) {
|
|
467
|
-
if (!idiotik._ifResult) fn();
|
|
468
|
-
return idiotik;
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
random(...methods) {
|
|
472
|
-
const pick = methods[Math.floor(Math.random() * methods.length)];
|
|
473
|
-
if (typeof pick === "function") pick();
|
|
474
|
-
return idiotik;
|
|
475
|
-
},
|
|
476
|
-
|
|
477
|
-
// ── CHAOS METHODS ────────────────────────────────────────────────────────
|
|
478
|
-
|
|
479
|
-
say(msg) {
|
|
480
|
-
return function _say() {
|
|
481
|
-
if (_popup) {
|
|
482
|
-
const w = window.open("", "_blank", "width=300,height=150,toolbar=no,menubar=no,scrollbars=no,resizable=no");
|
|
483
|
-
if (w) {
|
|
484
|
-
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>`);
|
|
485
|
-
w.document.close();
|
|
486
|
-
if (_recursive) w.onload = () => setTimeout(_say, 100);
|
|
487
|
-
if (_recursive) setTimeout(_say, 100);
|
|
488
|
-
}
|
|
489
|
-
} else {
|
|
490
|
-
alert(msg);
|
|
491
|
-
if (_recursive) setTimeout(() => _say(), 0);
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
|
-
},
|
|
495
|
-
|
|
496
|
-
redirect(url) {
|
|
497
|
-
return function() { window.location.href = url; };
|
|
498
|
-
},
|
|
499
|
-
|
|
500
|
-
freeze() {
|
|
501
|
-
return function() {
|
|
502
|
-
document.addEventListener("keydown", e => e.preventDefault(), true);
|
|
503
|
-
document.addEventListener("mousedown", e => e.preventDefault(), true);
|
|
504
|
-
document.addEventListener("contextmenu", e => e.preventDefault(), true);
|
|
505
|
-
};
|
|
506
|
-
},
|
|
507
|
-
|
|
508
|
-
fullscreen() {
|
|
509
|
-
return function _fs() {
|
|
510
|
-
const el = document.documentElement;
|
|
511
|
-
if (el.requestFullscreen) el.requestFullscreen();
|
|
512
|
-
else if (el.webkitRequestFullscreen) el.webkitRequestFullscreen();
|
|
513
|
-
document.addEventListener("fullscreenchange", () => {
|
|
514
|
-
if (!document.fullscreenElement && _recursive) setTimeout(_fs, 100);
|
|
515
|
-
});
|
|
516
|
-
};
|
|
517
|
-
},
|
|
518
|
-
|
|
519
|
-
jumpscare(imgUrl, sfxUrl) {
|
|
520
|
-
return function _js() {
|
|
521
|
-
const div = document.createElement("div");
|
|
522
|
-
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;";
|
|
523
|
-
const img = document.createElement("img");
|
|
524
|
-
img.src = imgUrl;
|
|
525
|
-
img.style.cssText = "max-width:100%;max-height:100%;object-fit:contain;";
|
|
526
|
-
div.appendChild(img);
|
|
527
|
-
document.body.appendChild(div);
|
|
528
|
-
if (sfxUrl) _loadAndPlay(_parseAudioUrl(sfxUrl));
|
|
529
|
-
const ctx = _currentScript();
|
|
530
|
-
if (ctx) ctx.htmlNodes.push(div);
|
|
531
|
-
if (_recursive) setTimeout(() => { div.remove(); _js(); }, 1000);
|
|
532
|
-
};
|
|
533
|
-
},
|
|
534
|
-
|
|
535
|
-
scream() {
|
|
536
|
-
return function _scream() {
|
|
537
|
-
const ctx = _getAudioCtx();
|
|
538
|
-
const osc = ctx.createOscillator();
|
|
539
|
-
const gain = ctx.createGain();
|
|
540
|
-
osc.type = "sawtooth";
|
|
541
|
-
osc.frequency.value = 880;
|
|
542
|
-
gain.gain.value = Math.min(_volume / 100, 10);
|
|
543
|
-
osc.connect(gain);
|
|
544
|
-
gain.connect(ctx.destination);
|
|
545
|
-
osc.start();
|
|
546
|
-
setTimeout(() => osc.stop(), 2000);
|
|
547
|
-
if (_recursive) setTimeout(_scream, 2100);
|
|
548
|
-
};
|
|
549
|
-
},
|
|
550
|
-
|
|
551
|
-
// ── AUDIO ────────────────────────────────────────────────────────────────
|
|
552
|
-
|
|
553
|
-
audio(urlOrFile) {
|
|
554
|
-
const parsed = _parseAudioUrl(urlOrFile);
|
|
555
|
-
return async function _audio() {
|
|
556
|
-
const source = await _loadAndPlay(parsed);
|
|
557
|
-
const ctx = _currentScript();
|
|
558
|
-
if (ctx) ctx.audioSources.push(source);
|
|
559
|
-
if (_recursive) source.addEventListener?.("ended", _audio);
|
|
560
|
-
};
|
|
561
|
-
},
|
|
562
|
-
|
|
563
|
-
// ── EFFECT ───────────────────────────────────────────────────────────────
|
|
564
|
-
|
|
565
|
-
effect(name) {
|
|
566
|
-
return function() {
|
|
567
|
-
if (_effectImpls[name]) {
|
|
568
|
-
_activeEffects.add(name);
|
|
569
|
-
_effectImpls[name]();
|
|
570
|
-
} else {
|
|
571
|
-
console.warn(`idiotik.effect: unknown effect "${name}"`);
|
|
572
|
-
}
|
|
573
|
-
};
|
|
574
|
-
},
|
|
575
|
-
|
|
576
|
-
cleareffects() {
|
|
577
|
-
_activeEffects.clear();
|
|
578
|
-
document.querySelectorAll("[id^='__idiotik_']").forEach(el => el.remove());
|
|
579
|
-
},
|
|
580
|
-
|
|
581
|
-
// ── CURSOR ───────────────────────────────────────────────────────────────
|
|
582
|
-
|
|
583
|
-
cursor(preset) {
|
|
584
|
-
return function() {
|
|
585
|
-
const val = _cursorPresets[preset];
|
|
586
|
-
if (!val) {
|
|
587
|
-
document.body.style.cursor = `url(${preset}), auto`;
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
if (val === "__rainbow__") {
|
|
591
|
-
let h = 0;
|
|
592
|
-
setInterval(() => {
|
|
593
|
-
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>`;
|
|
594
|
-
document.body.style.cursor = `url("data:image/svg+xml,${encodeURIComponent(svg)}"), auto`;
|
|
595
|
-
h = (h + 10) % 360;
|
|
596
|
-
}, 50);
|
|
597
|
-
} else if (val === "__wiggle__") {
|
|
598
|
-
document.addEventListener("mousemove", () => {
|
|
599
|
-
const offset = Math.sin(Date.now() / 100) * 10;
|
|
600
|
-
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`;
|
|
601
|
-
});
|
|
602
|
-
} else if (val === "__explode__") {
|
|
603
|
-
document.addEventListener("click", e => {
|
|
604
|
-
for (let i = 0; i < 12; i++) {
|
|
605
|
-
const p = document.createElement("div");
|
|
606
|
-
p.textContent = ["💥","✨","⭐","🔥"][i % 4];
|
|
607
|
-
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;`;
|
|
608
|
-
document.body.appendChild(p);
|
|
609
|
-
const angle = (i / 12) * 2 * Math.PI;
|
|
610
|
-
setTimeout(() => {
|
|
611
|
-
p.style.transform = `translate(${Math.cos(angle)*60}px,${Math.sin(angle)*60}px)`;
|
|
612
|
-
p.style.opacity = "0";
|
|
613
|
-
}, 10);
|
|
614
|
-
setTimeout(() => p.remove(), 700);
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
} else {
|
|
618
|
-
document.body.style.cursor = val;
|
|
619
|
-
}
|
|
620
|
-
};
|
|
621
|
-
},
|
|
622
|
-
|
|
623
|
-
};
|
|
624
|
-
|
|
625
|
-
// ─── EXPORT ─────────────────────────────────────────────────────────────────
|
|
626
|
-
if (typeof module !== "undefined" && module.exports) {
|
|
627
|
-
module.exports = idiotik;
|
|
628
|
-
} else {
|
|
629
|
-
global.idiotik = idiotik;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
})(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);
|
package/presets/classic.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* idiotik preset: classic
|
|
3
|
-
* the full youareanidiot experience. no survivors.
|
|
4
|
-
*/
|
|
5
|
-
idiotik.recursive("yes");
|
|
6
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
7
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
8
|
-
idiotik.start(idiotik.say("YOU ARE AN IDIOT HA HA HA HA HA HA"));
|
|
9
|
-
idiotik.repeat("inf");
|
|
10
|
-
idiotik.continue
|
|
11
|
-
idiotik.start(idiotik.scream())();
|
package/presets/epilepsy.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* idiotik preset: epilepsy
|
|
3
|
-
* maximum visual chaos. stack everything.
|
|
4
|
-
* (actual epilepsy warning lol)
|
|
5
|
-
*/
|
|
6
|
-
idiotik.recursive("yes");
|
|
7
|
-
idiotik.volume(450);
|
|
8
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
9
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
10
|
-
idiotik.start(idiotik.effect("glitch"))();
|
|
11
|
-
idiotik.start(idiotik.effect("invert"))();
|
|
12
|
-
idiotik.start(idiotik.cursor("rainbow"))();
|
|
13
|
-
idiotik.start(idiotik.scream())();
|
package/presets/jumpscare.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* idiotik preset: jumpscare
|
|
3
|
-
* wait for it... wait for it...
|
|
4
|
-
*/
|
|
5
|
-
idiotik.recursive("yes");
|
|
6
|
-
idiotik.volume(300);
|
|
7
|
-
|
|
8
|
-
idiotik.script()
|
|
9
|
-
idiotik.id("jumpscare")
|
|
10
|
-
idiotik.wait(3000).then(() => {
|
|
11
|
-
idiotik.start(idiotik.effect("glitch"))();
|
|
12
|
-
idiotik.start(idiotik.jumpscare(
|
|
13
|
-
"https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/640px-Camponotus_flavomarginatus_ant.jpg"
|
|
14
|
-
))();
|
|
15
|
-
idiotik.start(idiotik.scream())();
|
|
16
|
-
});
|
|
17
|
-
idiotik.end()
|
package/presets/melt.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* idiotik preset: melt
|
|
3
|
-
* slow and painful. the page just... gives up.
|
|
4
|
-
*/
|
|
5
|
-
idiotik.recursive("no");
|
|
6
|
-
idiotik.volume(100);
|
|
7
|
-
idiotik.start(idiotik.effect("melt"))();
|
|
8
|
-
idiotik.start(idiotik.effect("spin"))();
|
|
9
|
-
idiotik.wait(3000).then(() => {
|
|
10
|
-
idiotik.volume(300);
|
|
11
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
12
|
-
idiotik.start(idiotik.scream())();
|
|
13
|
-
});
|
package/presets/mild.js
DELETED
package/presets/nuclear.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* idiotik preset: nuclear
|
|
3
|
-
* god help them. seriously.
|
|
4
|
-
*/
|
|
5
|
-
idiotik.recursive("yes");
|
|
6
|
-
idiotik.volume(5000);
|
|
7
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
8
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
9
|
-
idiotik.start(idiotik.effect("glitch"))();
|
|
10
|
-
idiotik.start(idiotik.effect("spin"))();
|
|
11
|
-
idiotik.start(idiotik.effect("matrix"))();
|
|
12
|
-
idiotik.start(idiotik.scream())();
|
|
13
|
-
idiotik.start(idiotik.fullscreen())();
|
|
14
|
-
idiotik.start(idiotik.freeze())();
|
|
15
|
-
idiotik.start(idiotik.cursor("none"))();
|
|
16
|
-
idiotik.start(idiotik.say("💀💀💀 YOU ARE SO COOKED 💀💀💀"));
|
|
17
|
-
idiotik.repeat("inf");
|
|
18
|
-
idiotik.continue
|
package/presets/rickroll.js
DELETED
package/presets/robux.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* idiotik preset: robux
|
|
3
|
-
* free robux guaranteed
|
|
4
|
-
*/
|
|
5
|
-
idiotik.recursive("yes");
|
|
6
|
-
idiotik.volume(200);
|
|
7
|
-
|
|
8
|
-
idiotik.script()
|
|
9
|
-
idiotik.id("robux")
|
|
10
|
-
idiotik.start(idiotik.say("FREE ROBUX AT PORNHUB.COM!!!"));
|
|
11
|
-
idiotik.repeat("inf");
|
|
12
|
-
idiotik.continue
|
|
13
|
-
idiotik.end()
|
|
14
|
-
|
|
15
|
-
idiotik.start(idiotik.effect("rainbow"))();
|
|
16
|
-
idiotik.start(idiotik.cursor("explode"))();
|
package/presets/villain.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* idiotik preset: villain
|
|
3
|
-
* slow burn. maximum dread.
|
|
4
|
-
*/
|
|
5
|
-
idiotik.recursive("no");
|
|
6
|
-
idiotik.volume(150);
|
|
7
|
-
|
|
8
|
-
idiotik.script()
|
|
9
|
-
idiotik.id("villain")
|
|
10
|
-
idiotik.start(idiotik.effect("matrix"))();
|
|
11
|
-
idiotik.continue
|
|
12
|
-
idiotik.wait(2000).then(() => {
|
|
13
|
-
idiotik.start(idiotik.effect("glitch"))();
|
|
14
|
-
});
|
|
15
|
-
idiotik.wait(4000).then(() => {
|
|
16
|
-
idiotik.volume(500);
|
|
17
|
-
idiotik.start(idiotik.effect("shake"))();
|
|
18
|
-
idiotik.start(idiotik.scream())();
|
|
19
|
-
idiotik.recursive("yes");
|
|
20
|
-
idiotik.start(idiotik.say("did you really think you were safe 🗿"));
|
|
21
|
-
idiotik.repeat("inf");
|
|
22
|
-
});
|
|
23
|
-
idiotik.end()
|