diff options
author | Rasmus Luha <rasmus.luha@gmail.com> | 2022-11-05 23:12:30 +0200 |
---|---|---|
committer | Rasmus Luha <rasmus.luha@gmail.com> | 2022-11-05 23:12:30 +0200 |
commit | f2318deacde703df99fce50800b58f7e6e759e8b (patch) | |
tree | 02dab380cd28f78afa5b016ef68483f5fbee95ac /rannak/algus/kaart/js/kaart.js | |
parent | 4744277ad0678edfc69841f185dedc5912d90ac9 (diff) |
Little Restructuring
Diffstat (limited to 'rannak/algus/kaart/js/kaart.js')
-rw-r--r-- | rannak/algus/kaart/js/kaart.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/rannak/algus/kaart/js/kaart.js b/rannak/algus/kaart/js/kaart.js deleted file mode 100644 index 5224d79..0000000 --- a/rannak/algus/kaart/js/kaart.js +++ /dev/null @@ -1,30 +0,0 @@ -const riigid = document.querySelectorAll("svg path") - -// Praegu Eesti, Portugal, Holland -const leitavad = ["EE", "PT", "NL"] -let leitud = []; - -// Add click listener -for (let i = 0; i < riigid.length; i++){ - if (leitavad.includes(riigid[i].id)){ - riigid[i].addEventListener("click", e => { - e.target.style.fill = "#00FF00"; - if (!leitud.includes(e.target.id)) - leitud.push(riigid[i].id); - - if (leitavad.length == leitud.length) - moveOnEnable(); - }) - } - else{ - riigid[i].addEventListener("click", e => { - e.target.style.fill = "#FF0000"; - }) - } -} - -function moveOnEnable(){ - const btn = document.querySelector(".moveOn"); - btn.disabled = false; - btn.onclick = () => location.href = "../utlused"; -} |