From ff3046ca1bd75ce2e33bd04c42fe45db4c7e1a95 Mon Sep 17 00:00:00 2001 From: ferricles Date: Sun, 4 Apr 2021 12:45:03 -0700 Subject: [PATCH] cleaner atlas code + unglaso added --- atlas.js | 19 ++++++------------- media/memes/unglaso.png | Bin 0 -> 3148 bytes 2 files changed, 6 insertions(+), 13 deletions(-) create mode 100644 media/memes/unglaso.png diff --git a/atlas.js b/atlas.js index 34dc4a4..2111d72 100644 --- a/atlas.js +++ b/atlas.js @@ -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%);"; diff --git a/media/memes/unglaso.png b/media/memes/unglaso.png new file mode 100644 index 0000000000000000000000000000000000000000..53aef6a36b54a313eefef6324a5917871ceb6fde GIT binary patch literal 3148 zcmV-S472lzP)Px>21!IgRCt{2oq22=)g8w_cH$**j1wmg5OR=&CIJdPlCm^a0~S|X^+>x^1&V-* zqN)`2P!$nGiHu5HS{g)KL20QfRi$dn(QOJ!fdm3MoowP@5{JXaM`I^o9A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