Compare commits

...

3 Commits

Author SHA1 Message Date
NetMan 21c57e28f9 HTML: Removed unnecessary commented lines 2024-01-14 00:57:57 +01:00
NetMan e85acb81f0 JS: Removed unecessary, not working code 2024-01-14 00:57:31 +01:00
NetMan 1746e2437c CSS: Minor width change 2024-01-14 00:57:05 +01:00
3 changed files with 18 additions and 41 deletions

View File

@ -13,30 +13,6 @@
<div id="container"> <div id="container">
<div id="view"></div> <div id="view"></div>
<div id="buttons"> <div id="buttons">
<!-- <div class="buttons-flex">
<div class="button">7</div>
<div class="button">8</div>
<div class="button">9</div>
<div class="button">/</div>
</div>
<div class="buttons-flex">
<div class="button">4</div>
<div class="button">5</div>
<div class="button">6</div>
<div class="button">+</div>
</div>
<div class="buttons-flex">
<div class="button">1</div>
<div class="button">2</div>
<div class="button">3</div>
<div class="button">-</div>
</div>
<div class="buttons-flex">
<div class="button">0</div>
<div class="button">.</div>
<div class="button">=</div>
<div class="button">*</div>
</div> -->
</div> </div>
</div> </div>
</div> </div>

View File

@ -28,11 +28,10 @@ function operate(equals) {
} }
function execute(operation) { function execute(operation) {
if (operation.equal) {
const result = operate(operation); const result = operate(operation);
if ("" in operation) {
console.log("BLANK IS HERE");
}
operation.a_b = !operation.a_b; operation.a_b = !operation.a_b;
operation.equal = false;
operation.operator = ""; operation.operator = "";
if (operation.a_b) { if (operation.a_b) {
operation.a = `${result}`; operation.a = `${result}`;
@ -41,12 +40,14 @@ function execute(operation) {
console.table(operation); console.table(operation);
console.log(`Result: ${result}`); console.log(`Result: ${result}`);
} }
}
let operation = { let operation = {
a: "", a: "",
operator: "", operator: "",
b: "", b: "",
a_b: true, a_b: true,
equal: false,
} }
let equal = ""; let equal = "";
@ -57,21 +58,21 @@ function click(value) {
operation.a += value; operation.a += value;
} else { } else {
operation.b += value; operation.b += value;
operation.equal = true;
} }
} else if (value == "=") { } else if (value == "=") {
execute(operation); execute(operation);
} else { } else {
if (operation.operator == "") { if (operation.operator == "") {
operation.a_b = !operation.a_b; operation.a_b = !operation.a_b;
}
operation.operator = value; operation.operator = value;
} }
console.table(operation); if (operation.a_b) {
operation.operator = value;
if ("" in operation) {
console.log("BLANK IS HERE");
} }
} }
console.table(operation);
}
function generateGui() { function generateGui() {

View File

@ -14,7 +14,7 @@ html, body {
width: fit-content; width: fit-content;
} }
#view { #view {
width: 244.5px; width: 246px;
height: 60px; height: 60px;
background-color: #ccc; background-color: #ccc;
border: 1px solid #000; border: 1px solid #000;