cleaner atlas code + unglaso added

This commit is contained in:
ferricles 2021-04-04 12:45:03 -07:00
parent 36722f3f00
commit ff3046ca1b
2 changed files with 6 additions and 13 deletions

View file

@ -39,19 +39,12 @@ function atlasClick() {
atlas_img.style.zIndex = 1;
atlas.classList.add("atlas");
let roll = Math.random();
let rollchance = 0.03;
if (roll < rollchance) {
atlas_img.src = "/media/memes/lmoa.png";
} else if (roll < 2*rollchance) {
atlas_img.src = "/media/memes/doom.png";
} else if (roll < 3*rollchance) {
atlas_img.src = "/media/memes/agony.png";
} else if (roll < 4*rollchance) {
atlas_img.src = "/media/memes/enraged.png";
} else if (roll < 5*rollchance) {
atlas_img.src = "/media/memes/sunglaso.png";
} else if (roll < 6*rollchance) {
atlas_img.src = "/media/memes/thonk.png";
let rollchance = 0.0069;
let rollList = ["lmoa","doom","agony","enraged","sunglaso","thonk","unglaso"];
for (let i = rollList.length-1; i > -1; i--) {
if (roll < (i+1) * rollchance) {
atlas_img.src = "./media/memes/" + rollList[i] + ".png";
}
}
atlas.appendChild(atlas_img);
atlas.style = "background-image: radial-gradient(closest-side, #" + Math.round(255*Math.random()).toString(16)+Math.round(255*Math.random()).toString(16)+Math.round(255*Math.random()).toString(16) + " 0%," + "#121516 120%);";

BIN
media/memes/unglaso.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB