diff --git a/Calculater/index.html b/Calculater/index.html deleted file mode 100644 index 7c1f339..0000000 --- a/Calculater/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - Simple Calculator - - - -

SIMPLE CALCULATOR

-
-
-
-

0

-
-
- - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - \ No newline at end of file diff --git a/Calculater/script.js b/Calculater/script.js deleted file mode 100644 index d7f2ad0..0000000 --- a/Calculater/script.js +++ /dev/null @@ -1,104 +0,0 @@ -document.addEventListener("DOMContentLoaded", function() { - const display = document.querySelector(".display p"); - const buttons = document.querySelectorAll(".main button"); - let currentInput = ''; - let previousInput = ''; - let operator = ''; - - buttons.forEach(button => { - button.addEventListener("click", function() { - const value = this.textContent; - - if (this.classList.contains("num")) { - handleNumber(value); - } else if (this.classList.contains("op")) { - handleOperator(value); - } else if (this.classList.contains("ac")) { - clearAll(); - } else if (this.classList.contains("cancle")) { - cancelLast(); - } else if (this.classList.contains("ans")) { - calculateResult(); - } - - updateDisplay(); - }); - }); - - function handleNumber(value) { - if (currentInput.length < 12) { // Limiting input length - if (value === '.' && currentInput.includes('.')) { - return; // Prevent multiple decimals - } - currentInput += value; - } - } - - function handleOperator(value) { - if (currentInput === '' && value === '-') { - currentInput = '-'; - } else if (currentInput !== '') { - if (previousInput !== '') { - calculateResult(); - } - operator = value; - previousInput = currentInput; - currentInput = ''; - } - } - - function clearAll() { - currentInput = ''; - previousInput = ''; - operator = ''; - } - - function cancelLast() { - currentInput = currentInput.slice(0, -1); - } - - function calculateResult() { - if (previousInput !== '' && currentInput !== '') { - const num1 = parseFloat(previousInput); - const num2 = parseFloat(currentInput); - let result; - - switch (operator) { - case '+': - result = num1 + num2; - break; - case '-': - result = num1 - num2; - break; - case '*': - result = num1 * num2; - break; - case '/': - if (num2 === 0) { - result = 'Error'; // Handle division by zero - } else { - result = num1 / num2; - } - break; - case '%': - result = num1 % num2; - break; - default: - return; - } - - currentInput = result.toString(); - previousInput = ''; - operator = ''; - } - } - - function updateDisplay() { - if (operator && previousInput && !currentInput) { - display.textContent = previousInput + operator; - } else { - display.textContent = currentInput || '0'; - } - } -}); - diff --git a/Calculater/style.css b/Calculater/style.css deleted file mode 100644 index 4fb2180..0000000 --- a/Calculater/style.css +++ /dev/null @@ -1,98 +0,0 @@ -* { - margin: 0; - padding: 0; -} - -body { - background-color: rgb(79, 154, 220); -} - -h1 { - margin-left: 600px; - margin-top: 20px; - color: brown; -} - -.con { - margin-top: 50px; - display: flex; - align-items: center; - justify-content: center; -} - -.container { - width: 450px; - height: 600px; - background-color: #2b2d42; - display: flex; - flex-direction: column; - align-items: center; - border-radius: 10px; -} - -.display { - width: 100%; - height: 30%; - display: flex; - align-items: flex-end; - border-radius: 18px; - justify-content: flex-end; - font-size: 4em; - background-color: #14213d; - margin-bottom: 10px; - color: white; - -} - -p { - padding-right: 15px; -} - -button { - width: 102px; - height: 77px; - padding: 3; - border-radius: 30%; - font-size: 2em; - color: #ffba08; - transform: all 1s ease; - transition-duration: 0.5s; -} - -button:hover { - width: 105px; - height: 80px; - padding: 0; - background-color: #B0C7BD; - color: #8D5A97; - -} - -.main { - display: flex; - flex-wrap: wrap; - margin-left: 7px; - margin-bottom: 10px; - gap: 5px; -} - -.ans { - color: #000000; - background-color: #b8c0ff; -} -.cancle{ - transform: all 1s ease; - transition-duration: 0.5s; - color: #E03616; -} -.cancle:hover{ - background-color: #ffb3c1; -} -.ac{ - transform: all 1s ease; - transition-duration: 0.5s; -} -.ac:hover{ - background-color: #ff758f; - color: #004e89; -} \ No newline at end of file diff --git a/index.html b/index.html index f456be6..c81fe33 100644 --- a/index.html +++ b/index.html @@ -37,7 +37,7 @@

Developer

href="https://www.linkedin.com/in/md-ibran-831729293?utm_source=share&utm_campaign=share_via&utm_content=profile&utm_medium=android_app"> -
+
@@ -46,7 +46,7 @@

Developer

- Ibran + Ibran

Click me!

@@ -72,7 +72,7 @@

MY PROJECTS

-
+
@@ -101,7 +101,7 @@

QR WEDS

-
+
@@ -129,7 +129,7 @@

Fit mania


-
+
diff --git a/project.html b/project.html index fc56170..84640f7 100644 --- a/project.html +++ b/project.html @@ -54,7 +54,7 @@

QR WEDS

-
+
@@ -82,7 +82,7 @@

Fit mania


-
+