idiotik.js 1.0.0 → 1.0.1
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/README.md +76 -76
- package/package.json +2 -2
- package/presets/classic.js +11 -0
- package/presets/epilepsy.js +13 -0
- package/presets/jumpscare.js +17 -0
- package/presets/melt.js +13 -0
- package/presets/mild.js +10 -0
- package/presets/nuclear.js +18 -0
- package/presets/rickroll.js +6 -0
- package/presets/robux.js +16 -0
- package/presets/villain.js +23 -0
- package/src/{idiot.js → idiotik.js} +68 -68
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# idiotik.js
|
|
2
2
|
|
|
3
3
|
youareanidiot-style chaos toolkit for the browser. recursive by default. you were warned.
|
|
4
4
|
|
|
@@ -7,13 +7,13 @@ youareanidiot-style chaos toolkit for the browser. recursive by default. you wer
|
|
|
7
7
|
## install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install
|
|
10
|
+
npm install idiotik.js
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
or just drop `src/
|
|
13
|
+
or just drop `src/idiotik.js` into your page:
|
|
14
14
|
|
|
15
15
|
```html
|
|
16
|
-
<script src="
|
|
16
|
+
<script src="idiotik.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
---
|
|
@@ -23,8 +23,8 @@ or just drop `src/idiot.js` into your page:
|
|
|
23
23
|
### global toggles
|
|
24
24
|
|
|
25
25
|
```js
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
idiotik.recursive(yes/no) // default: yes — everything spawns itself
|
|
27
|
+
idiotik.volume(0-5000) // 101-200: loud | 201-449: + bass boost | 450+: full EQ destruction
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
---
|
|
@@ -34,19 +34,19 @@ idiot.volume(0-5000) // 101-200: loud | 201-449: + bass boost | 450+: full
|
|
|
34
34
|
group and tag sequences so you can kill them later.
|
|
35
35
|
|
|
36
36
|
```js
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
idiotik.script()
|
|
38
|
+
idiotik.id("myscript") // name it so idiotik.halt() can kill it
|
|
39
|
+
idiotik.html("<b>chaos</b>") // inject html — ONLY works inside script()
|
|
40
|
+
idiotik.start(idiotik.html)
|
|
41
|
+
idiotik.repeat(inf)
|
|
42
|
+
idiotik.continue // keep running, move on
|
|
43
|
+
idiotik.end()
|
|
44
|
+
|
|
45
|
+
idiotik.halt("myscript") // kills everything under that id
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
- `
|
|
49
|
-
- `
|
|
48
|
+
- `idiotik.html()` **must** be inside `idiotik.script()` — throws if used outside
|
|
49
|
+
- `idiotik.id()` **must** be inside `idiotik.script()`
|
|
50
50
|
- everything else works inside or outside
|
|
51
51
|
|
|
52
52
|
---
|
|
@@ -54,13 +54,13 @@ idiot.halt("myscript") // kills everything under that id
|
|
|
54
54
|
### flow control
|
|
55
55
|
|
|
56
56
|
```js
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
idiotik.start(ref) // fire a method
|
|
58
|
+
idiotik.repeat(n / inf) // repeat last start n times or forever
|
|
59
|
+
idiotik.continue // don't block, keep going (async)
|
|
60
|
+
idiotik.wait(ms) // delay (returns promise)
|
|
61
|
+
idiotik.halt("id") // force stop a named script
|
|
62
|
+
idiotik.random(a, b, c) // picks one randomly and fires it
|
|
63
|
+
idiotik.if(condition).then(fn).else(fn2)
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
---
|
|
@@ -68,12 +68,12 @@ idiot.if(condition).then(fn).else(fn2)
|
|
|
68
68
|
### chaos methods
|
|
69
69
|
|
|
70
70
|
```js
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
idiotik.say("msg") // alert loop
|
|
72
|
+
idiotik.scream() // audio blast via oscillator
|
|
73
|
+
idiotik.jumpscare(imgUrl, sfxUrl) // fullscreen image + sound
|
|
74
|
+
idiotik.redirect(url) // sends em somewhere else
|
|
75
|
+
idiotik.freeze() // disables all user input
|
|
76
|
+
idiotik.fullscreen() // forces fullscreen, fights exit
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
---
|
|
@@ -81,12 +81,12 @@ idiot.fullscreen() // forces fullscreen, fights exit
|
|
|
81
81
|
### audio
|
|
82
82
|
|
|
83
83
|
```js
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
idiotik.audio("https://example.com/sound.mp3") // from url
|
|
85
|
+
idiotik.audio("file://mysound.mp3") // local file (strips file://)
|
|
86
|
+
idiotik.volume(150) // loud
|
|
87
|
+
idiotik.volume(300) // loud + bass boosted
|
|
88
|
+
idiotik.volume(500) // loud + bass boost + every EQ band maxed 💀
|
|
89
|
+
idiotik.volume(5000) // sonic weapon
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
---
|
|
@@ -94,15 +94,15 @@ idiot.volume(5000) // sonic weapon
|
|
|
94
94
|
### effects (stackable)
|
|
95
95
|
|
|
96
96
|
```js
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
idiotik.start(idiotik.effect("shake"))() // seizure mode
|
|
98
|
+
idiotik.start(idiotik.effect("spin"))() // rotating hell
|
|
99
|
+
idiotik.start(idiotik.effect("glitch"))() // css glitch
|
|
100
|
+
idiotik.start(idiotik.effect("rainbow"))() // color flash
|
|
101
|
+
idiotik.start(idiotik.effect("invert"))() // inverts page
|
|
102
|
+
idiotik.start(idiotik.effect("matrix"))() // you already know
|
|
103
|
+
idiotik.start(idiotik.effect("melt"))() // page droops
|
|
104
|
+
|
|
105
|
+
idiotik.cleareffects() // wipe all active effects
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
effects stack — calling multiple adds them all simultaneously.
|
|
@@ -112,13 +112,13 @@ effects stack — calling multiple adds them all simultaneously.
|
|
|
112
112
|
### cursor
|
|
113
113
|
|
|
114
114
|
```js
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
idiotik.start(idiotik.cursor("hand")) // pointer everywhere
|
|
116
|
+
idiotik.start(idiotik.cursor("none")) // cursor gone
|
|
117
|
+
idiotik.start(idiotik.cursor("rainbow")) // color trail
|
|
118
|
+
idiotik.start(idiotik.cursor("wiggle")) // cursor fights you
|
|
119
|
+
idiotik.start(idiotik.cursor("explode")) // particles on click
|
|
120
|
+
idiotik.start(idiotik.cursor("crosshair")) // crosshair
|
|
121
|
+
idiotik.start(idiotik.cursor("https://example.com/cur.png")) // custom url
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
---
|
|
@@ -126,10 +126,10 @@ idiot.start(idiot.cursor("https://example.com/cur.png")) // custom url
|
|
|
126
126
|
### presets
|
|
127
127
|
|
|
128
128
|
```js
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
idiotik.start(idiotik.classic())() // the full youareanidiot experience
|
|
130
|
+
idiotik.start(idiotik.mild())() // annoying but survivable
|
|
131
|
+
idiotik.start(idiotik.nuclear())() // god help them
|
|
132
|
+
idiotik.start(idiotik.rickroll())() // you know what this does
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
---
|
|
@@ -139,44 +139,44 @@ idiot.start(idiot.rickroll())() // you know what this does
|
|
|
139
139
|
### basic alert spam
|
|
140
140
|
|
|
141
141
|
```js
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
idiotik.start(idiotik.say("FREE ROBUX AT PORNHUB.COM!!!"))
|
|
143
|
+
idiotik.repeat(inf)
|
|
144
|
+
idiotik.continue
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
### named script you can kill
|
|
148
148
|
|
|
149
149
|
```js
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
idiotik.script()
|
|
151
|
+
idiotik.id("chaos")
|
|
152
|
+
idiotik.say("YOU ARE AN IDIOT")
|
|
153
|
+
idiotik.start(idiotik.say)
|
|
154
|
+
idiotik.repeat(inf)
|
|
155
|
+
idiotik.continue
|
|
156
|
+
idiotik.end()
|
|
157
157
|
|
|
158
158
|
// somewhere else:
|
|
159
|
-
|
|
159
|
+
idiotik.halt("chaos")
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
### stacked effects
|
|
163
163
|
|
|
164
164
|
```js
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
idiotik.recursive("yes")
|
|
166
|
+
idiotik.volume(5000)
|
|
167
|
+
idiotik.start(idiotik.effect("shake"))()
|
|
168
|
+
idiotik.start(idiotik.effect("rainbow"))()
|
|
169
|
+
idiotik.start(idiotik.effect("glitch"))()
|
|
170
|
+
idiotik.start(idiotik.scream())()
|
|
171
171
|
```
|
|
172
172
|
|
|
173
173
|
### conditional chaos
|
|
174
174
|
|
|
175
175
|
```js
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
idiotik.if(userIsAnnoying).then(() => {
|
|
177
|
+
idiotik.start(idiotik.nuclear())()
|
|
178
178
|
}).else(() => {
|
|
179
|
-
|
|
179
|
+
idiotik.start(idiotik.mild())()
|
|
180
180
|
})
|
|
181
181
|
```
|
|
182
182
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
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())();
|
|
@@ -0,0 +1,13 @@
|
|
|
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())();
|
|
@@ -0,0 +1,17 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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/robux.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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"))();
|
|
@@ -0,0 +1,23 @@
|
|
|
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()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* idiotik.js — youareanidiot-style chaos toolkit
|
|
3
3
|
* recursive by default. you were warned.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
let _activeScripts = {}; // id -> { intervals, timeouts, audioNodes }
|
|
12
12
|
let _activeEffects = new Set();
|
|
13
13
|
let _audioCtx = null;
|
|
14
|
-
let _lastStarted = null; // last method ref passed to
|
|
14
|
+
let _lastStarted = null; // last method ref passed to idiotik.start()
|
|
15
15
|
let _scriptStack = []; // current script context stack
|
|
16
16
|
|
|
17
17
|
// ─── HELPERS ────────────────────────────────────────────────────────────────
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function _requireScript(name) {
|
|
28
|
-
if (!_currentScript()) throw new Error(`
|
|
28
|
+
if (!_currentScript()) throw new Error(`idiotik.${name}() must be inside idiotik.script()`);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
function _track(thing, type) {
|
|
@@ -117,54 +117,54 @@
|
|
|
117
117
|
// ─── EFFECT IMPLEMENTATIONS ─────────────────────────────────────────────────
|
|
118
118
|
const _effectImpls = {
|
|
119
119
|
shake() {
|
|
120
|
-
const styleId = "
|
|
120
|
+
const styleId = "__idiotik_shake__";
|
|
121
121
|
if (document.getElementById(styleId)) return;
|
|
122
122
|
const s = document.createElement("style");
|
|
123
123
|
s.id = styleId;
|
|
124
124
|
s.textContent = `
|
|
125
|
-
@keyframes
|
|
126
|
-
body { animation:
|
|
125
|
+
@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)} }
|
|
126
|
+
body { animation: __idiotik_shake 0.3s infinite; }
|
|
127
127
|
`;
|
|
128
128
|
document.head.appendChild(s);
|
|
129
129
|
},
|
|
130
130
|
spin() {
|
|
131
|
-
const styleId = "
|
|
131
|
+
const styleId = "__idiotik_spin__";
|
|
132
132
|
if (document.getElementById(styleId)) return;
|
|
133
133
|
const s = document.createElement("style");
|
|
134
134
|
s.id = styleId;
|
|
135
135
|
s.textContent = `
|
|
136
|
-
@keyframes
|
|
137
|
-
body { animation:
|
|
136
|
+
@keyframes __idiotik_spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
|
|
137
|
+
body { animation: __idiotik_spin 2s linear infinite; transform-origin: center center; }
|
|
138
138
|
`;
|
|
139
139
|
document.head.appendChild(s);
|
|
140
140
|
},
|
|
141
141
|
glitch() {
|
|
142
|
-
const styleId = "
|
|
142
|
+
const styleId = "__idiotik_glitch__";
|
|
143
143
|
if (document.getElementById(styleId)) return;
|
|
144
144
|
const s = document.createElement("style");
|
|
145
145
|
s.id = styleId;
|
|
146
146
|
s.textContent = `
|
|
147
|
-
@keyframes
|
|
148
|
-
@keyframes
|
|
147
|
+
@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)} }
|
|
148
|
+
@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)} }
|
|
149
149
|
body::before, body::after { content:''; position:fixed; top:0;left:0;width:100%;height:100%; background:inherit; pointer-events:none; z-index:9999; }
|
|
150
|
-
body::before { animation:
|
|
151
|
-
body::after { animation:
|
|
150
|
+
body::before { animation: __idiotik_glitch1 0.4s infinite; color:red; text-shadow:2px 0 red; }
|
|
151
|
+
body::after { animation: __idiotik_glitch2 0.4s infinite; color:blue; text-shadow:-2px 0 blue; }
|
|
152
152
|
`;
|
|
153
153
|
document.head.appendChild(s);
|
|
154
154
|
},
|
|
155
155
|
rainbow() {
|
|
156
|
-
const styleId = "
|
|
156
|
+
const styleId = "__idiotik_rainbow__";
|
|
157
157
|
if (document.getElementById(styleId)) return;
|
|
158
158
|
const s = document.createElement("style");
|
|
159
159
|
s.id = styleId;
|
|
160
160
|
s.textContent = `
|
|
161
|
-
@keyframes
|
|
162
|
-
body { animation:
|
|
161
|
+
@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} }
|
|
162
|
+
body { animation: __idiotik_rainbow 0.5s infinite; }
|
|
163
163
|
`;
|
|
164
164
|
document.head.appendChild(s);
|
|
165
165
|
},
|
|
166
166
|
invert() {
|
|
167
|
-
const styleId = "
|
|
167
|
+
const styleId = "__idiotik_invert__";
|
|
168
168
|
if (document.getElementById(styleId)) return;
|
|
169
169
|
const s = document.createElement("style");
|
|
170
170
|
s.id = styleId;
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
document.head.appendChild(s);
|
|
173
173
|
},
|
|
174
174
|
matrix() {
|
|
175
|
-
const canvasId = "
|
|
175
|
+
const canvasId = "__idiotik_matrix__";
|
|
176
176
|
if (document.getElementById(canvasId)) return;
|
|
177
177
|
const canvas = document.createElement("canvas");
|
|
178
178
|
canvas.id = canvasId;
|
|
@@ -199,31 +199,31 @@
|
|
|
199
199
|
_track(id, "intervals");
|
|
200
200
|
},
|
|
201
201
|
melt() {
|
|
202
|
-
const styleId = "
|
|
202
|
+
const styleId = "__idiotik_melt__";
|
|
203
203
|
if (document.getElementById(styleId)) return;
|
|
204
204
|
const s = document.createElement("style");
|
|
205
205
|
s.id = styleId;
|
|
206
206
|
s.textContent = `
|
|
207
|
-
@keyframes
|
|
208
|
-
body { animation:
|
|
207
|
+
@keyframes __idiotik_melt { 0%{transform:skewY(0deg) scaleY(1)} 50%{transform:skewY(5deg) scaleY(1.1)} 100%{transform:skewY(-3deg) scaleY(0.9)} }
|
|
208
|
+
body { animation: __idiotik_melt 1s ease-in-out infinite alternate; transform-origin: bottom; }
|
|
209
209
|
`;
|
|
210
210
|
document.head.appendChild(s);
|
|
211
211
|
},
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
// ─── CORE
|
|
215
|
-
const
|
|
214
|
+
// ─── CORE idiotik OBJECT ───────────────────────────────────────────────────────
|
|
215
|
+
const idiotik = {
|
|
216
216
|
|
|
217
217
|
// ── GLOBAL TOGGLES ─────────────────────────────────────────────────────────
|
|
218
218
|
|
|
219
219
|
recursive(val) {
|
|
220
220
|
_recursive = (val === true || val === "yes" || val === 1);
|
|
221
|
-
return
|
|
221
|
+
return idiotik;
|
|
222
222
|
},
|
|
223
223
|
|
|
224
224
|
volume(n) {
|
|
225
225
|
_volume = Math.max(0, Math.min(5000, Number(n)));
|
|
226
|
-
return
|
|
226
|
+
return idiotik;
|
|
227
227
|
},
|
|
228
228
|
|
|
229
229
|
// ── SCRIPT CONTEXT ─────────────────────────────────────────────────────────
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
_html: null,
|
|
239
239
|
};
|
|
240
240
|
_scriptStack.push(ctx);
|
|
241
|
-
return
|
|
241
|
+
return idiotik;
|
|
242
242
|
},
|
|
243
243
|
|
|
244
244
|
id(name) {
|
|
@@ -246,20 +246,20 @@
|
|
|
246
246
|
const ctx = _currentScript();
|
|
247
247
|
ctx.id = name;
|
|
248
248
|
_activeScripts[name] = ctx;
|
|
249
|
-
return
|
|
249
|
+
return idiotik;
|
|
250
250
|
},
|
|
251
251
|
|
|
252
252
|
html(code) {
|
|
253
253
|
_requireScript("html");
|
|
254
254
|
const ctx = _currentScript();
|
|
255
255
|
ctx._html = code;
|
|
256
|
-
return
|
|
256
|
+
return idiotik;
|
|
257
257
|
},
|
|
258
258
|
|
|
259
259
|
end() {
|
|
260
|
-
if (!_currentScript()) throw new Error("
|
|
260
|
+
if (!_currentScript()) throw new Error("idiotik.end() called outside a script");
|
|
261
261
|
_scriptStack.pop();
|
|
262
|
-
return
|
|
262
|
+
return idiotik;
|
|
263
263
|
},
|
|
264
264
|
|
|
265
265
|
// ── FLOW CONTROL ───────────────────────────────────────────────────────────
|
|
@@ -269,11 +269,11 @@
|
|
|
269
269
|
if (typeof ref === "function") {
|
|
270
270
|
ref();
|
|
271
271
|
}
|
|
272
|
-
return
|
|
272
|
+
return idiotik;
|
|
273
273
|
},
|
|
274
274
|
|
|
275
275
|
repeat(n) {
|
|
276
|
-
if (!_lastStarted) return
|
|
276
|
+
if (!_lastStarted) return idiotik;
|
|
277
277
|
const fn = _lastStarted;
|
|
278
278
|
const infinite = (n === Infinity || n === "inf" || n === "Infinity");
|
|
279
279
|
if (infinite) {
|
|
@@ -288,12 +288,12 @@
|
|
|
288
288
|
}, 100);
|
|
289
289
|
_track(id, "intervals");
|
|
290
290
|
}
|
|
291
|
-
return
|
|
291
|
+
return idiotik;
|
|
292
292
|
},
|
|
293
293
|
|
|
294
294
|
get continue() {
|
|
295
295
|
// no-op — execution continues naturally (async stuff already running)
|
|
296
|
-
return
|
|
296
|
+
return idiotik;
|
|
297
297
|
},
|
|
298
298
|
|
|
299
299
|
wait(ms) {
|
|
@@ -305,13 +305,13 @@
|
|
|
305
305
|
|
|
306
306
|
halt(name) {
|
|
307
307
|
const ctx = _activeScripts[name];
|
|
308
|
-
if (!ctx) return
|
|
308
|
+
if (!ctx) return idiotik;
|
|
309
309
|
(ctx.intervals || []).forEach(id => clearInterval(id));
|
|
310
310
|
(ctx.timeouts || []).forEach(id => clearTimeout(id));
|
|
311
311
|
(ctx.audioSources || []).forEach(s => { try { s.stop(); } catch(e){} });
|
|
312
312
|
(ctx.htmlNodes || []).forEach(n => { try { n.remove(); } catch(e){} });
|
|
313
313
|
delete _activeScripts[name];
|
|
314
|
-
return
|
|
314
|
+
return idiotik;
|
|
315
315
|
},
|
|
316
316
|
|
|
317
317
|
// ── CONDITIONAL ────────────────────────────────────────────────────────────
|
|
@@ -319,26 +319,26 @@
|
|
|
319
319
|
_ifResult: null,
|
|
320
320
|
|
|
321
321
|
if(condition) {
|
|
322
|
-
|
|
322
|
+
idiotik._ifResult = !!condition;
|
|
323
323
|
return {
|
|
324
324
|
then(fn) {
|
|
325
|
-
if (
|
|
325
|
+
if (idiotik._ifResult) fn();
|
|
326
326
|
return {
|
|
327
|
-
else(fn2) { if (!
|
|
327
|
+
else(fn2) { if (!idiotik._ifResult) fn2(); return idiotik; }
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
331
|
},
|
|
332
332
|
|
|
333
333
|
else(fn) {
|
|
334
|
-
if (!
|
|
335
|
-
return
|
|
334
|
+
if (!idiotik._ifResult) fn();
|
|
335
|
+
return idiotik;
|
|
336
336
|
},
|
|
337
337
|
|
|
338
338
|
random(...methods) {
|
|
339
339
|
const pick = methods[Math.floor(Math.random() * methods.length)];
|
|
340
340
|
if (typeof pick === "function") pick();
|
|
341
|
-
return
|
|
341
|
+
return idiotik;
|
|
342
342
|
},
|
|
343
343
|
|
|
344
344
|
// ── CHAOS METHODS ──────────────────────────────────────────────────────────
|
|
@@ -406,7 +406,7 @@
|
|
|
406
406
|
gain.connect(ctx.destination);
|
|
407
407
|
osc.start();
|
|
408
408
|
setTimeout(() => osc.stop(), 2000);
|
|
409
|
-
if (_recursive) setTimeout(
|
|
409
|
+
if (_recursive) setTimeout(idiotik.scream()(), 2100);
|
|
410
410
|
};
|
|
411
411
|
},
|
|
412
412
|
|
|
@@ -430,14 +430,14 @@
|
|
|
430
430
|
_activeEffects.add(name);
|
|
431
431
|
_effectImpls[name]();
|
|
432
432
|
} else {
|
|
433
|
-
console.warn(`
|
|
433
|
+
console.warn(`idiotik.effect: unknown preset "${name}"`);
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
436
|
},
|
|
437
437
|
|
|
438
438
|
cleareffects() {
|
|
439
439
|
_activeEffects.clear();
|
|
440
|
-
document.querySelectorAll("[id^='
|
|
440
|
+
document.querySelectorAll("[id^='__idiotik_']").forEach(el => el.remove());
|
|
441
441
|
},
|
|
442
442
|
|
|
443
443
|
// ── CURSOR ─────────────────────────────────────────────────────────────────
|
|
@@ -488,41 +488,41 @@
|
|
|
488
488
|
|
|
489
489
|
classic() {
|
|
490
490
|
return function() {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
491
|
+
idiotik.recursive("yes");
|
|
492
|
+
idiotik.start(idiotik.say("YOU ARE AN IDIOT HA HA HA HA HA HA"));
|
|
493
|
+
idiotik.start(idiotik.effect("rainbow"))();
|
|
494
|
+
idiotik.start(idiotik.effect("shake"))();
|
|
495
|
+
idiotik.start(idiotik.scream())();
|
|
496
496
|
};
|
|
497
497
|
},
|
|
498
498
|
|
|
499
499
|
mild() {
|
|
500
500
|
return function() {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
501
|
+
idiotik.recursive("no");
|
|
502
|
+
idiotik.start(idiotik.say("gotcha lol"));
|
|
503
|
+
idiotik.start(idiotik.effect("shake"))();
|
|
504
504
|
};
|
|
505
505
|
},
|
|
506
506
|
|
|
507
507
|
nuclear() {
|
|
508
508
|
return function() {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
509
|
+
idiotik.recursive("yes");
|
|
510
|
+
idiotik.volume(5000);
|
|
511
|
+
idiotik.start(idiotik.effect("shake"))();
|
|
512
|
+
idiotik.start(idiotik.effect("rainbow"))();
|
|
513
|
+
idiotik.start(idiotik.effect("glitch"))();
|
|
514
|
+
idiotik.start(idiotik.effect("spin"))();
|
|
515
|
+
idiotik.start(idiotik.scream())();
|
|
516
|
+
idiotik.start(idiotik.fullscreen())();
|
|
517
|
+
idiotik.start(idiotik.freeze())();
|
|
518
|
+
idiotik.start(idiotik.say("💀💀💀 YOU ARE SO COOKED 💀💀💀"));
|
|
519
519
|
};
|
|
520
520
|
},
|
|
521
521
|
|
|
522
522
|
rickroll() {
|
|
523
523
|
return function() {
|
|
524
|
-
|
|
525
|
-
|
|
524
|
+
idiotik.recursive("no");
|
|
525
|
+
idiotik.start(idiotik.redirect("https://www.youtube.com/watch?v=dQw4w9WgXcQ"))();
|
|
526
526
|
};
|
|
527
527
|
},
|
|
528
528
|
|
|
@@ -538,9 +538,9 @@
|
|
|
538
538
|
|
|
539
539
|
// ─── EXPORT ─────────────────────────────────────────────────────────────────
|
|
540
540
|
if (typeof module !== "undefined" && module.exports) {
|
|
541
|
-
module.exports =
|
|
541
|
+
module.exports = idiotik;
|
|
542
542
|
} else {
|
|
543
|
-
global.
|
|
543
|
+
global.idiotik = idiotik;
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
})(typeof window !== "undefined" ? window : global);
|