From 2963d358fecd49fd9b140c4df1fea7de04cb5757 Mon Sep 17 00:00:00 2001 From: Rasmus Luha Date: Fri, 6 Jan 2023 23:22:44 +0200 Subject: Sissejuhatus Popup and sonaragastik dif colors --- rannak/endPage/main.js | 3 +- rannak/mangud/kaitseliitlane/kuulsused/script.js | 6 ++++ rannak/mangud/partorg/kuulsused/script.js | 6 ++++ rannak/mangud/partorg/plakat/main.js | 6 ++++ rannak/mangud/partorg/sonaragastik/index.html | 2 +- rannak/mangud/partorg/sonaragastik/script.js | 35 ++++++++++++++++++++---- rannak/mangud/partorg/sonaragastik/style.css | 8 ++++++ rannak/mangud/perenaine/memori/script.js | 6 ++++ rannak/mangud/perenaine/ristsona/index.html | 2 +- rannak/mangud/perenaine/ristsona/script.js | 8 +++++- rannak/mangud/uliopilane/ajatelg/script.js | 7 +++++ rannak/mangud/uliopilane/tSark/main.js | 7 +++++ rannak/mangud/uliopilane/utlused/js/main.js | 7 +++++ 13 files changed, 94 insertions(+), 9 deletions(-) diff --git a/rannak/endPage/main.js b/rannak/endPage/main.js index c6da3fc..b38f354 100644 --- a/rannak/endPage/main.js +++ b/rannak/endPage/main.js @@ -1,7 +1,8 @@ let rollSpan = document.querySelector("span"); ; -if (rollSpan != undefined){ +if (rollSpan.roll !=undefined){ rollSpan.innerHTML = localStorage.roll; + console.log(localStorage.roll); delete localStorage.roll; } diff --git a/rannak/mangud/kaitseliitlane/kuulsused/script.js b/rannak/mangud/kaitseliitlane/kuulsused/script.js index 95e322d..daa263d 100644 --- a/rannak/mangud/kaitseliitlane/kuulsused/script.js +++ b/rannak/mangud/kaitseliitlane/kuulsused/script.js @@ -1,3 +1,9 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + const list_items = document.querySelectorAll(".list-item"); const lists = document.querySelectorAll(".list"); diff --git a/rannak/mangud/partorg/kuulsused/script.js b/rannak/mangud/partorg/kuulsused/script.js index e1b994b..60c3ffa 100644 --- a/rannak/mangud/partorg/kuulsused/script.js +++ b/rannak/mangud/partorg/kuulsused/script.js @@ -1,3 +1,9 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + const list_items = document.querySelectorAll(".list-item"); const lists = document.querySelectorAll(".list"); diff --git a/rannak/mangud/partorg/plakat/main.js b/rannak/mangud/partorg/plakat/main.js index 925db66..48626c6 100644 --- a/rannak/mangud/partorg/plakat/main.js +++ b/rannak/mangud/partorg/plakat/main.js @@ -1,3 +1,9 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + /* Inital Setup*/ diff --git a/rannak/mangud/partorg/sonaragastik/index.html b/rannak/mangud/partorg/sonaragastik/index.html index 6b82639..f2aabe8 100644 --- a/rannak/mangud/partorg/sonaragastik/index.html +++ b/rannak/mangud/partorg/sonaragastik/index.html @@ -195,7 +195,7 @@ - L + L E T I diff --git a/rannak/mangud/partorg/sonaragastik/script.js b/rannak/mangud/partorg/sonaragastik/script.js index 6151b9e..c08aef8 100644 --- a/rannak/mangud/partorg/sonaragastik/script.js +++ b/rannak/mangud/partorg/sonaragastik/script.js @@ -1,3 +1,9 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + function randomLetters(){ for (let node of document.querySelectorAll("td")) { if (node.textContent != "") continue; @@ -36,11 +42,18 @@ function message(msg, color){ const vastused = ["valuuta", "tuusik", "tsaika", "redis", "plaanimajandus", "rubla", "letialuneKaup", "talongid", "maantee", - "piiritsoon", "defitsiit"] + "piiritsoon", "defitsiit"]; + +const horisontaalis = ["letialuneKaup", "talongid", "maantee", + "piiritsoon", "defitsiit" ]; + let õiged = new Array(); let õigedCounter = 0; function proovi(){ + + let dones = new Array(); + for (let klass of vastused){ const ruudud = document.querySelectorAll("."+klass); @@ -60,18 +73,30 @@ function proovi(){ for (let ruut of ruudud){ ruut.classList.remove("selected"); - ruut.classList.add("done"); - if (ruut.classList.length == 2) + //ruut.classList.add("done"); + + dones.push(ruut); + + if (ruut.classList.length == 1) hetkeKlass = ruut.classList[0]; } - console.log(hetkeKlass); + //console.log("hetkeKlass: ",hetkeKlass); + + for (let el of dones){ + if (horisontaalis.includes(hetkeKlass)) + el.classList.add("doneH"); + else + el.classList.add("doneV"); + } + + //console.log(document.querySelector(".V"+hetkeKlass).classList); document.querySelector(".V"+hetkeKlass).classList.add("done"); if (!õiged.includes(hetkeKlass)) { õiged.push(hetkeKlass); õigedCounter++; - console.log(õigedCounter); + //console.log(õigedCounter); } if (õigedCounter >= 11) moveOnEnable(); diff --git a/rannak/mangud/partorg/sonaragastik/style.css b/rannak/mangud/partorg/sonaragastik/style.css index fa8ec1e..2d86c63 100644 --- a/rannak/mangud/partorg/sonaragastik/style.css +++ b/rannak/mangud/partorg/sonaragastik/style.css @@ -83,6 +83,14 @@ button:disabled{ background-color: lime !important; } +.doneV{ + background-color: #562ABF; +} + +.doneH{ + background-color: #FF0883; +} + .done{ background-color: green; } diff --git a/rannak/mangud/perenaine/memori/script.js b/rannak/mangud/perenaine/memori/script.js index 1e9215b..8d74ec9 100644 --- a/rannak/mangud/perenaine/memori/script.js +++ b/rannak/mangud/perenaine/memori/script.js @@ -1,3 +1,9 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + const cards = document.querySelectorAll('.memory-card'); let hasFlippedCard = false; diff --git a/rannak/mangud/perenaine/ristsona/index.html b/rannak/mangud/perenaine/ristsona/index.html index e10aa1c..5e106c7 100644 --- a/rannak/mangud/perenaine/ristsona/index.html +++ b/rannak/mangud/perenaine/ristsona/index.html @@ -13,7 +13,7 @@ - diff --git a/rannak/mangud/perenaine/ristsona/script.js b/rannak/mangud/perenaine/ristsona/script.js index b542037..e6f56c7 100644 --- a/rannak/mangud/perenaine/ristsona/script.js +++ b/rannak/mangud/perenaine/ristsona/script.js @@ -1,4 +1,9 @@ -//TODO delete arr not good and also undefined passing into õigeVastus ja valeVastus funks +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + let counter = 0; let õiged = new Array(); @@ -187,6 +192,7 @@ function enterSubmit(){ enterSubmit() + // If All Else Done diff --git a/rannak/mangud/uliopilane/ajatelg/script.js b/rannak/mangud/uliopilane/ajatelg/script.js index c636836..ffea3d9 100644 --- a/rannak/mangud/uliopilane/ajatelg/script.js +++ b/rannak/mangud/uliopilane/ajatelg/script.js @@ -1,3 +1,10 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + + const list_items = document.querySelectorAll(".list-item"); const lists = document.querySelectorAll(".list"); diff --git a/rannak/mangud/uliopilane/tSark/main.js b/rannak/mangud/uliopilane/tSark/main.js index e21fb49..485c189 100644 --- a/rannak/mangud/uliopilane/tSark/main.js +++ b/rannak/mangud/uliopilane/tSark/main.js @@ -1,3 +1,10 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + + /*Muutused Stuff*/ // Särgi color diff --git a/rannak/mangud/uliopilane/utlused/js/main.js b/rannak/mangud/uliopilane/utlused/js/main.js index 31b42da..07b8d27 100644 --- a/rannak/mangud/uliopilane/utlused/js/main.js +++ b/rannak/mangud/uliopilane/utlused/js/main.js @@ -1,3 +1,10 @@ +document.addEventListener('DOMContentLoaded', () => { + let btn = document.querySelector('.modalButton'); + btn.click(); +}); + + + // Detecting part const isMobile = function(){ const match = window.matchMedia('(pointer:coarse)'); -- cgit v1.2.3