summaryrefslogtreecommitdiff
path: root/rannak
diff options
context:
space:
mode:
authorRasmus Luha <rasmus.luha@gmail.com>2022-09-24 19:56:37 +0300
committerRasmus Luha <rasmus.luha@gmail.com>2022-09-24 19:56:37 +0300
commit03f99c33287e99e4db9e4cb4d3877fcf4114b877 (patch)
treee013ef265ccba7a310567370b926bd656ae164c6 /rannak
parentcc12746da2f264ed0d485867a757d96bae620a64 (diff)
ristsõna numbrid ja enter
Diffstat (limited to 'rannak')
-rw-r--r--rannak/mangud/perenaine/ristsona/index.html222
-rw-r--r--rannak/mangud/perenaine/ristsona/script.js28
2 files changed, 132 insertions, 118 deletions
diff --git a/rannak/mangud/perenaine/ristsona/index.html b/rannak/mangud/perenaine/ristsona/index.html
index cd4fc21..f947eb7 100644
--- a/rannak/mangud/perenaine/ristsona/index.html
+++ b/rannak/mangud/perenaine/ristsona/index.html
@@ -17,7 +17,7 @@
<p>Lahenda ristsõna. Lahenduseks on kuulus
Eesti roog, mille retsepti jaoks vajalikud
- koostiosad ongi vaja leida (vms?)
+ koostiosad ongi vaja leida.
</p>
<div class="text-center">
@@ -82,86 +82,102 @@
<table class="text-center text-white">
<!-- Essa Rida-->
<tr>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td class="hernes"><sup>8</sup><span>H</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>8.</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td>4.</td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td class="hernes"><span>H</span></td>
+ <td></td>
+ <td>10.</td>
+ <td></td>
+ <td></td>
</tr>
<!-- Teine Rida-->
<tr>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td class="vorst"><sup>4</sup><span>V</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td>1.</td>
+ <td></td>
+ <td></td>
+ <td class="vorst"><span>V</span></td>
+ <td></td>
+ <td>6.</td>
+ <td></td>
<td class="hernes"><span>E</span></td>
- <td></span></td>
- <td class="sibul"><sup>10</sup><span>S</span></td>
- <td></span></td>
- <td></span></td>
+ <td>9.</td>
+ <td class="sibul"><span>S</span></td>
+ <td></td>
+ <td>12.</td>
</tr>
<!-- Kolmas Rida-->
<tr>
- <td></span></td>
- <td class="kurk"><sup>1</sup><span>K</span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td class="kurk"><span>K</span></td>
+ <td></td>
+ <td>3.</td>
<td class="vorst"><span>O</span></td>
- <td></span></td>
- <td class="sool"><sup>6</sup><span>S</span></td>
- <td></span></td>
+ <td></td>
+ <td class="sool"><span>S</span></td>
+ <td></td>
<td class="hernes"><span>R</span></td>
- <td class="muna"><sup>9</sup><span>M</span></td>
+ <td class="muna"><span>M</span></td>
<td class="sibul"><span>I</span></td>
- <td></span></td>
- <td class="kartul"><sup>12</sup><span>K</span></td>
+ <td></td>
+ <td class="kartul"><span>K</span></td>
</tr>
<!-- Neljas Rida-->
<tr>
- <td></span></td>
+ <td></td>
<td class="kurk"><span>U</span></td>
- <td></span></td>
- <td class="porgand"><sup>3</sup><span>P</span></td>
+ <td>2.</td>
+ <td class="porgand"><span>P</span></td>
<td class="vorst"><span>R</span></td>
- <td></span></td>
+ <td>5.</td>
<td class="sool"><span>O</span></td>
- <td></span></td>
+ <td>7.</td>
<td class="hernes"><span>N</span></td>
<td class="muna"><span>U</span></td>
<td class="sibul"><span>B</span></td>
- <td></span></td>
+ <td>11.</td>
<td class="kartul"><span>A</span></td>
</tr>
<!-- Viies Rida-->
<tr>
- <td></span></td>
+ <td></td>
<td class="kurk"><span>R</span></td>
- <td class="majonees"><sup>2</sup><span>M</span></td>
+ <td class="majonees"><span>M</span></td>
<td class="porgand"><span>O</span></td>
<td class="vorst"><span>S</span></td>
- <td class="õun"><sup>5</sup><span>Õ</span></td>
+ <td class="õun"><span>Õ</span></td>
<td class="sool"><span>O</span></td>
- <td class="pipar"><sup>7</sup><span>P</span></td>
+ <td class="pipar"><span>P</span></td>
<td class="hernes"><span>E</span></td>
<td class="muna"><span>N</span></td>
<td class="sibul"><span>U</span></td>
- <td class="hapukoor"><sup>11</sup><span>H</span></td>
+ <td class="hapukoor"><span>H</span></td>
<td class="kartul"><span>R</span></td>
</tr>
@@ -184,104 +200,104 @@
<!-- Seitsmes Rida-->
<tr>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
<td class="majonees"><span>J</span></td>
<td class="porgand"><span>G</span></td>
- <td></span></td>
+ <td></td>
<td class="õun"><span>N</span></td>
- <td></span></td>
+ <td></td>
<td class="pipar"><span>P</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
<td class="hapukoor"><span>P</span></td>
<td class="kartul"><span>U</span></td>
</tr>
<!-- Kaheksas Rida-->
<tr>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
<td class="majonees"><span>O</span></td>
<td class="porgand"><span>A</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
<td class="pipar"><span>A</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
<td class="hapukoor"><span>U</span></td>
<td class="kartul"><span>L</span></td>
</tr>
<!-- Üheksas Rida-->
<tr>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
<td class="majonees"><span>N</span></td>
<td class="porgand"><span>N</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
<td class="pipar"><span>R</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
<td class="hapukoor"><span>K</span></td>
- <td></span></td>
+ <td></td>
</tr>
<!-- Kümnes Rida-->
<tr>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
<td class="majonees"><span>E</span></td>
<td class="porgand"><span>D</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
<td class="hapukoor"><span>O</span></td>
- <td></span></td>
+ <td></td>
</tr>
<!-- 11 Rida-->
<tr>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
<td class="majonees"><span>E</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
<td class="hapukoor"><span>O</span></td>
- <td></span></td>
+ <td></td>
</tr>
<!-- 12 Rida-->
<tr>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
<td class="majonees"><span>S</span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
- <td></span></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
<td class="hapukoor"><span>R</span></td>
- <td></span></td>
+ <td></td>
</tr>
</table>
diff --git a/rannak/mangud/perenaine/ristsona/script.js b/rannak/mangud/perenaine/ristsona/script.js
index 121bfab..cacda18 100644
--- a/rannak/mangud/perenaine/ristsona/script.js
+++ b/rannak/mangud/perenaine/ristsona/script.js
@@ -12,13 +12,9 @@ function message(msg, color){
function õigeVastus(nr, vastus){
message("Õige!", "green");
- console.log(nr);
let tähed = document.querySelectorAll("."+vastus);
for (let i = 0; i < tähed.length; i++) {
- if (i == 0)
- tähed[i].childNodes[1].style.display = "inline";
- else
tähed[i].childNodes[0].style.display = "inline";
}
@@ -26,8 +22,6 @@ function õigeVastus(nr, vastus){
õiged.push(nr);
counter++;
}
- console.log(counter);
- console.log(õiged);
if (counter >= 12)
moveOnEnable();
}
@@ -37,23 +31,18 @@ function valeVastus(tähed, nr, vastus){
message("Vale pakumine, proovi uuesti", "red");
for (let i = 0; i < tähed.length; i++) {
- if (i == 0)
- tähed[i].childNodes[1].style.display = "none";
- else
tähed[i].childNodes[0].style.display = "none";
}
if (õiged.includes(nr)) {
delete õiged[õiged.indexOf(nr)];
counter--;
- console.log(counter)
}
}
function kontrolliVastus(nr, vastus){
nr += ''; // dont know, andis errorit
- console.log(nr);
switch (nr) {
case "1":
@@ -167,9 +156,6 @@ function kontrolliVastus(nr, vastus){
-
-
-
function getInputValue() {
// Selecting the input element and get its value
let inputVal = document.getElementById("inputId").value;
@@ -185,7 +171,19 @@ function getInputValue() {
-// Button func
+// Button funcs
+
+function enterSubmit(){
+ document.getElementById('inputId')
+ .addEventListener('keyup', event => {
+ if (event.code === 'Enter')
+ {
+ event.preventDefault();
+ getInputValue();
+ }
+ });
+}
+enterSubmit()
function moveOnEnable(){
const btn = document.querySelector(".moveOn");