diff options
author | Rasmus <rasmus.luha@gmail.com> | 2023-03-10 19:09:53 +0200 |
---|---|---|
committer | Rasmus <rasmus.luha@gmail.com> | 2023-03-10 19:09:53 +0200 |
commit | f05f15dbe108e3fd10af8d15fb15c1b27e689f96 (patch) | |
tree | 5f6d888bbf5f2dbce5a21df15323c3f8e143b19b /rannak/kaart/js | |
parent | c525b29ceb91c0abacfe9916aafb1b0b48d47880 (diff) |
added Muusika and Kuulamine
Diffstat (limited to 'rannak/kaart/js')
-rwxr-xr-x[-rw-r--r--] | rannak/kaart/js/kaart.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/rannak/kaart/js/kaart.js b/rannak/kaart/js/kaart.js index f0921b5..e905fb5 100644..100755 --- a/rannak/kaart/js/kaart.js +++ b/rannak/kaart/js/kaart.js @@ -55,6 +55,8 @@ const zoom = (direction) => { }; + + // Event Listeners document.getElementById("left-button").onclick = () => pan("left"); @@ -67,24 +69,29 @@ document.getElementById("zoom-out-button").onclick = () => zoom("out"); + + + // ******************** Other Stuff **************************** // const riigid = document.querySelectorAll("svg path") -// Praegu Eesti, Portugal, Holland -const leitavad = ["EE", "PT", "NL"] + +const leitavad = ["IS", "LV", "LT", "UA", "HU", "Russian Federation", "France"] let leitud = []; // Add click listener for (let i = 0; i < riigid.length; i++){ - if (leitavad.includes(riigid[i].id)){ + if (leitavad.includes(riigid[i].id) || leitavad.includes(riigid[i].className.baseVal)){ riigid[i].addEventListener("click", e => { e.target.style.fill = "#00FF00"; - if (!leitud.includes(e.target.id)) - leitud.push(riigid[i].id); + if (!leitud.includes(i)) + leitud.push(i); if (leitavad.length == leitud.length) moveOnEnable(); + + console.log(leitud.length); }) } else{ |