diff --git a/Boolean-Algebra/index.html b/Boolean-Algebra/index.html index 721256b..c85975b 100644 --- a/Boolean-Algebra/index.html +++ b/Boolean-Algebra/index.html @@ -20,10 +20,13 @@
-

CDM

+

CDM Utils

@@ -95,9 +98,9 @@
-
+
-

Step by step

+

Step by step

1.

@@ -106,9 +109,9 @@
-
+
-

Truth Table

+

Truth Table

@@ -122,9 +125,9 @@
-
+
-

Perfect Disjunctive Normal Form

+

Perfect Disjunctive Normal Form

@@ -132,9 +135,9 @@
-
+
-

Perfect Conjunctive Normal Form

+

Perfect Conjunctive Normal Form

diff --git a/Boolean-Algebra/script.js b/Boolean-Algebra/script.js index 7ab29f8..7ea324d 100644 --- a/Boolean-Algebra/script.js +++ b/Boolean-Algebra/script.js @@ -8,7 +8,6 @@ function AddValue() { if (currNumOfValues < 26) { let charNum = 65 + currNumOfValues; - symbols2.push(alphabet[currNumOfValues]); currNumOfValues++; let delBtn = document.querySelectorAll('#delBtn'); @@ -67,7 +66,15 @@ function Evaluate() { let formulaValuesRPNArray = ConvertCharsToValues(formulaRPNArray); let result = SolveRPNFormula(formulaValuesRPNArray); - if (result == undefined) return; + + if (result == undefined || formulaValuesRPNArray.some(x => alphabet.indexOf(x) != -1) || formulaValuesRPNArray.some(x => x == undefined)) { + formulaField.style.backgroundColor = 'rgba(255, 255, 255, 0)'; + formulaField.style.backgroundColor = 'rgba(235, 52, 116, 0.7)'; + formulaField.style.transition = '0.2s'; + setTimeout(() => formulaField.style.backgroundColor = 'rgba(255, 255, 255, 0)', 600); + return; + } + let readableResult = ConvertToReadableResult(result); let resultField = document.getElementById('result'); @@ -274,7 +281,15 @@ function StepByStep() { let formulaValuesRPNArray = ConvertCharsToValues(formulaRPNArray); let result = SolveRPNFormula(formulaValuesRPNArray); - if (result == undefined) return; + + if (result == undefined || formulaValuesRPNArray.some(x => alphabet.indexOf(x) != -1) || formulaValuesRPNArray.some(x => x == undefined)) { + formulaField.style.backgroundColor = 'rgba(255, 255, 255, 0)'; + formulaField.style.backgroundColor = 'rgba(235, 52, 116, 0.7)'; + formulaField.style.transition = '0.2s'; + setTimeout(() => formulaField.style.backgroundColor = 'rgba(255, 255, 255, 0)', 600); + return; + } + let readableResult = ConvertToReadableResult(result); let resultField = document.getElementById('result'); @@ -810,7 +825,7 @@ function Error(errMsg) { //#region Check Input const symbols = ['0', '1']; -const specialSymbols = ['Backspace', 'ArrowLeft', 'ArrowRight', 'Delete']; +const specialSymbols = ['!', '*', '+', '=', '>', '(', ')', 'Backspace', 'ArrowLeft', 'ArrowRight', 'Delete', 'Shift']; function checkInputValue(key, value, id) { if (value.length < 1 && symbols.indexOf(key) !== -1) { @@ -828,7 +843,7 @@ function checkInputValue(key, value, id) { function checkInputProblem(key, id) { - if (symbols2.indexOf(key) != -1) { + if (alphabet.indexOf(key) != -1 || specialSymbols.indexOf(key) != -1) { return true; } else { function backBg() { document.getElementById(id).style.backgroundColor = 'rgba(255, 255, 255, 0)' } @@ -844,9 +859,4 @@ const alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'W', 'X', 'Y', 'Z' ]; -let symbols2 = ['A', 'B', 'Backspace', 'ArrowLeft', 'ArrowRight', 'Delete', 'Shift', - '-', '+', '/', '!', '(', ')' -]; - - //#endregion \ No newline at end of file diff --git a/Knowledgebase/index.html b/Knowledgebase/index.html new file mode 100644 index 0000000..6d2dfc5 --- /dev/null +++ b/Knowledgebase/index.html @@ -0,0 +1,12 @@ + + + + + + + Document + + +

Coming soon

+ + \ No newline at end of file diff --git a/Set-Algebra/index.html b/Set-Algebra/index.html index 5910847..06ebe7d 100644 --- a/Set-Algebra/index.html +++ b/Set-Algebra/index.html @@ -20,10 +20,13 @@
diff --git a/img/cross-close-icon.png b/img/cross-close-icon.png index f0b89ba..7de5ab6 100644 Binary files a/img/cross-close-icon.png and b/img/cross-close-icon.png differ diff --git a/img/question-mark.png b/img/question-mark.png new file mode 100644 index 0000000..8250bd8 Binary files /dev/null and b/img/question-mark.png differ diff --git a/index.html b/index.html index 9f288e6..8b1f7e7 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ - CDM Calculator + CDM Utils @@ -20,10 +20,13 @@
diff --git a/style.css b/style.css index cc0f36d..9cfa706 100644 --- a/style.css +++ b/style.css @@ -390,14 +390,26 @@ input[type=table-end] { transform: translate(0, -3px); margin: 25px 5px 0px 0px; cursor: pointer; - width: 12px; - height: 12px; - opacity: 75%; + width: 20px; + height: 20px; + opacity: 85%; transition: 0.5s; } .close-button:hover { - opacity: 95%; + opacity: 100%; + transition: 0.5s; +} + +.question-mark-button { + width: 20px; + margin: -1px 10px 0px 10px; + opacity: 85%; + transition: 0.5s; +} + +.question-mark-button:hover { + opacity: 100%; transition: 0.5s; }