From f2318deacde703df99fce50800b58f7e6e759e8b Mon Sep 17 00:00:00 2001 From: Rasmus Luha Date: Sat, 5 Nov 2022 23:12:30 +0200 Subject: Little Restructuring --- rannak/algus/kaart/js/kaart.js | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 rannak/algus/kaart/js/kaart.js (limited to 'rannak/algus/kaart/js/kaart.js') 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"; -} -- cgit v1.2.3