From 5e8a37ca16b19b778fdffdf431e962c61c222696 Mon Sep 17 00:00:00 2001 From: funix Date: Sun, 12 Dec 2021 01:33:34 +0100 Subject: [PATCH] layout --- app.js | 27 +++++++-- index.html | 162 ++++++++++++++++++++++++++--------------------------- style.css | 20 ++++++- 3 files changed, 120 insertions(+), 89 deletions(-) diff --git a/app.js b/app.js index 463c472..1aea4c8 100644 --- a/app.js +++ b/app.js @@ -10,6 +10,16 @@ var current = [] var colors = ["var(--red)", "var(--brown)", "var(--green)", "var(--blue)", "var(--yellow)", "var(--orange)", "var(--white)"] function go() { + + let divs = document.getElementsByClassName("row") + + for (let div = 0; div < divs.length; div++) { + if (div != turn) { + document.getElementsByClassName("row")[div].classList.add("disabledButtons"); + } + } + + document.getElementsByClassName("choiceEl1")[turn].addEventListener("click", function() { this.style.background = colors[n0] current[0] = colors[n0] @@ -45,6 +55,8 @@ function go() { n3 = 0 } }) + + } go() @@ -100,15 +112,20 @@ function check() { if (areEqual(current, riddle)) { alert("win") } - if (turn == 6) { alert("stop") } + turn++ - console.log(turn) - if (turn == 6) { - alert("stop") - } + current = [] go() +} + +function checkpre() { + if (current.length == 4) { + check() + } else { + console.log("sdv") + } } \ No newline at end of file diff --git a/index.html b/index.html index 90792a9..21d107f 100644 --- a/index.html +++ b/index.html @@ -11,97 +11,97 @@ - -
-
- - - - -
-
- - - - -
-
-
-
- - - - -
-
- - - - -
-
-
-
- - - - +
+
+
+ + + + +
+
+ + + + +
-
- - - - +
+
+ + + + +
+
+ + + + +
-
-
-
- - - - -
-
- - - - +
+
+ + + + +
+
+ + + + +
-
-
-
- - - - +
+
+ + + + +
+
+ + + + +
-
- - - - +
+
+ + + + +
+
+ + + + +
-
-
-
- - - - +
+
+ + + + +
+
+ + + + +
-
- - - - -
-
-
+
- + diff --git a/style.css b/style.css index d6e13ce..29ff1f1 100644 --- a/style.css +++ b/style.css @@ -15,11 +15,20 @@ html { padding: 0; width: 100%; height: 100%; + /* background-color: #000; */ +} + +.mother { + /* border: solid; */ + height: 90%; + display: flex; + flex-direction: column; + justify-content: space-evenly; } button { - width: 20px; - height: 20px; + width: 35px; + height: 35px; border-radius: 40%; } @@ -27,7 +36,7 @@ button { border: solid; display: flex; flex-direction: row; - height: 60px; + height: 15%; width: 90%; justify-content: space-evenly; margin-left: 5%; @@ -98,4 +107,9 @@ button { bottom: 5px; left: 2%; border-radius: 30px; +} + +.disabledbutton { + pointer-events: none; + opacity: 0.4; } \ No newline at end of file