-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyroJS.js
More file actions
41 lines (35 loc) · 1.07 KB
/
Copy pathPyroJS.js
File metadata and controls
41 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// PyroJS Library
const PyroJS = (() => {
function createGif(src, z = 9999) {
const gif = document.createElement('img');
gif.src = src;
gif.style.position = 'fixed';
gif.style.top = '0';
gif.style.left = '0';
gif.style.width = '100vw';
gif.style.height = '100vh';
gif.style.objectFit = 'cover';
gif.style.zIndex = z;
document.body.appendChild(gif);
}
return {
// Original explode
dynamite: (times = 1) => {
for (let i = 0; i < times; i++) {
createGif('https://raw.githubusercontent.com/prankapple/PyroJS/refs/heads/main/scr/dynamite.gif');
}
},
// Big nuclear-style explosion
nuclear: (times = 1) => {
for (let i = 0; i < times; i++) {
createGif('https://raw.githubusercontent.com/prankapple/PyroJS/refs/heads/main/scr/nuclear.gif', 10000);
}
},
// Smaller fast explosions
tnt: (times = 1) => {
for (let i = 0; i < times; i++) {
createGif('https://raw.githubusercontent.com/prankapple/PyroJS/refs/heads/main/scr/tnt.gif', 9000);
}
}
};
})();