From c525b29ceb91c0abacfe9916aafb1b0b48d47880 Mon Sep 17 00:00:00 2001 From: Rasmus Luha Date: Fri, 24 Feb 2023 17:31:06 +0200 Subject: =?UTF-8?q?Soome=20m=C3=A4ng=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rannak/mangud/arimees/hinnad/script.js | 69 ---------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 rannak/mangud/arimees/hinnad/script.js (limited to 'rannak/mangud/arimees/hinnad/script.js') diff --git a/rannak/mangud/arimees/hinnad/script.js b/rannak/mangud/arimees/hinnad/script.js deleted file mode 100644 index 3b3e67b..0000000 --- a/rannak/mangud/arimees/hinnad/script.js +++ /dev/null @@ -1,69 +0,0 @@ -document.addEventListener('DOMContentLoaded', () => { - let btn = document.querySelector('.modalButton'); - btn.click(); -}); - - - -const kurss = 15.6; -doneCounter = 0; - - -const kontrollBtns = document.querySelectorAll(".kontrolliKaarti"); -for (let nupp of kontrollBtns){ - nupp.addEventListener("click", (e) => { - let rublaHind = e.target.previousElementSibling.children[0].children[1].innerHTML; - let pakkumine = e.target.previousElementSibling.children[1].children[1].value; - - if (pakkumine*kurss == rublaHind){ - - //Change color - e.target.offsetParent.style.background = "#288654"; - e.target.previousElementSibling.children[0].style.borderRight = ".5rem solid #288654"; - e.target.previousElementSibling.children[1].style.borderLeft = ".5rem solid #288654"; - - //Change Element - - (e.target.previousElementSibling.children[1].children[1]).remove(); - const newEl = document.createElement("span"); - newEl.classList.add("symbol"); - newEl.innerHTML = pakkumine + " M"; - e.target.previousElementSibling.children[1].appendChild(newEl); - - e.target.remove(); - doneCounter++; - - - // InfoTxt - let infoTxt = document.querySelector(".infoTxt") - infoTxt.innerHTML = ""; - - if (doneCounter >= 6){ - enableAllGood(); - } - } - - - else{ - // Inputvalue Reset - e.target.previousElementSibling.children[1].children[1].value = ""; - - // InfoTxt - let infoTxt = document.querySelector(".infoTxt") - infoTxt.style.color = "red"; - infoTxt.innerHTML = "Proovi Uuesti!"; - - } - - - - }) -} - - - -function enableAllGood(){ - const btn = document.querySelector(".moveOn"); - btn.disabled = false; - btn.onclick = () => location.href = ""; -} -- cgit v1.2.3