From f05f15dbe108e3fd10af8d15fb15c1b27e689f96 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Fri, 10 Mar 2023 19:09:53 +0200 Subject: added Muusika and Kuulamine --- rannak/kaart/js/kaart.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) mode change 100644 => 100755 rannak/kaart/js/kaart.js (limited to 'rannak/kaart/js/kaart.js') diff --git a/rannak/kaart/js/kaart.js b/rannak/kaart/js/kaart.js old mode 100644 new mode 100755 index f0921b5..e905fb5 --- 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{ -- cgit v1.2.3