summaryrefslogtreecommitdiff
path: root/rannak/mangud/partorg/sonaragastik
diff options
context:
space:
mode:
authorRasmus Luha <rasmus.luha@gmail.com>2023-01-06 23:22:44 +0200
committerRasmus Luha <rasmus.luha@gmail.com>2023-01-06 23:22:44 +0200
commit2963d358fecd49fd9b140c4df1fea7de04cb5757 (patch)
tree2ccd3c1d5cc555daed71f7b2329781fdda4eb538 /rannak/mangud/partorg/sonaragastik
parentab1b5e77141ed402b41b16346254d512b458767c (diff)
Sissejuhatus Popup and sonaragastik dif colors
Diffstat (limited to 'rannak/mangud/partorg/sonaragastik')
-rw-r--r--rannak/mangud/partorg/sonaragastik/index.html2
-rw-r--r--rannak/mangud/partorg/sonaragastik/script.js35
-rw-r--r--rannak/mangud/partorg/sonaragastik/style.css8
3 files changed, 39 insertions, 6 deletions
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 @@
<!-- Neljas Rida-->
<tr>
<td></td>
- <td class="valuuta letialuneKaup"><span>L</span></td>
+ <td class="letialuneKaup valuuta"><span>L</span></td>
<td class="letialuneKaup"><span>E</span></td>
<td class="letialuneKaup"><span>T</span></td>
<td class="letialuneKaup tsaika"><span>I</span></td>
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;
}