diff options
author | Rasmus Luha <rasmus.luha@gmail.com> | 2023-02-24 17:31:06 +0200 |
---|---|---|
committer | Rasmus Luha <rasmus.luha@gmail.com> | 2023-02-24 17:31:06 +0200 |
commit | c525b29ceb91c0abacfe9916aafb1b0b48d47880 (patch) | |
tree | 8a7dbb5b051a076e9e7694530bc878be61631664 /rannak/mangud/arimees/soome/script.js | |
parent | 209b1915b0f1879d0055ea17f76464dddcf8089b (diff) |
Soome mäng added
Diffstat (limited to 'rannak/mangud/arimees/soome/script.js')
-rw-r--r-- | rannak/mangud/arimees/soome/script.js | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/rannak/mangud/arimees/soome/script.js b/rannak/mangud/arimees/soome/script.js new file mode 100644 index 0000000..25ffedd --- /dev/null +++ b/rannak/mangud/arimees/soome/script.js @@ -0,0 +1,66 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + +let map = {}; +map["Moikka"] = "tere"; +map["puhuda"] = "rääkida"; +map["Pulma"] = "probleem"; +map["ostoksille"] = "ostlema"; +map["halba"] = "odavat"; +map["pibod"] = "kootudsuusamütsid"; +map["Tpaitad"] = "t-särgid"; +//map["kesähousut"] = "t-särgid"; +map["puserod"] = "sametistdressipluusid" +map["takkid"] = "joped" +map["purukummi"] = "nätsu" +map["pulma"] = "probleemi"; +map["kassi"] = "koti"; +map["puhelin"] = "telefon"; +map["kaikkiKunnossa"] = "kõikkorras"; +map["KaikkiParhaat"] = "kõikehead"; + + +let total = Object.keys(map).length; +rightOnes = new Array(); + + +const words = document.querySelectorAll("span"); + +for (let w of words){ + w.addEventListener('DOMSubtreeModified', () => { + + sone = w.id; + + let x = w.innerText.replace(/\s/g, ""); + let ignoringSpaces = x.toLowerCase(); + + if (ignoringSpaces == map[sone]) { + + let index = rightOnes.indexOf(sone); + if (index == -1) { + rightOnes.push(sone); + } + + w.setAttribute("contenteditable", false); + w.style.color = "lime"; + } + + + if (rightOnes.length == total) + moveOnEnable(); + }); +} + + + +// If All Else Done + +function moveOnEnable(){ + const btn = document.querySelector(".moveOn"); + btn.disabled = false; + btn.onclick = () => location.href = ""; +} + |