diff --git a/Training/CSS-Practice/practice-1.html b/Training/CSS-Practice/practice-1.html index 9f6fed7..da29851 100644 --- a/Training/CSS-Practice/practice-1.html +++ b/Training/CSS-Practice/practice-1.html @@ -12,21 +12,24 @@ font-family: Arial, sans-serif; background-color: #f0f0f0; /* TASK 1: PLACE THE ITEMS IN THE CENTRE OF THE WEBPAGE */ - /* margin: ; - padding: ; - display: ; - justify-content: ; - align-items: ; - height: ; */ + margin: 0; + padding: 0; + display: flex; + justify-content:center; + align-items: center; + /*height: ; */ } .container { background-color: #fff; + margin-top: 50px; padding: 20px; /* TASK 2: CREATE YOUR OWN CURVED BORDER */ - /* border: ; - border-radius: ; */ + border: 1px solid; + border-radius: 6px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); + color:#a00; + transition: background-color 0.5s; } h1 { diff --git a/Training/JS-Practice/factorial.html b/Training/JS-Practice/factorial.html index 40d9ebb..b14c711 100644 --- a/Training/JS-Practice/factorial.html +++ b/Training/JS-Practice/factorial.html @@ -41,13 +41,17 @@

Factorial Calculator

const result = document.getElementById("result"); const calculateFactorial = (number) => { - // TASK: CREATE YOUR FACTORIAL CALCULATION LOGIC HERE + if (number == 0 || number == 1) { + return 1; + } else { + return number * calculateFactorial(number - 1); + } }; calculateButton.addEventListener("click", () => { const inputValue = parseInt(numberInput.value); - if (!isNaN(inputValue)) { + if (!isNaN(inputValue) || inputValue > 0) { const factorialResult = calculateFactorial(inputValue); result.textContent = `Factorial: ${factorialResult}`; } else { diff --git a/Training/JS-Practice/rectangle.html b/Training/JS-Practice/rectangle.html index dbaeba6..6313beb 100644 --- a/Training/JS-Practice/rectangle.html +++ b/Training/JS-Practice/rectangle.html @@ -43,7 +43,7 @@

Rectangle Area Calculator

const result = document.getElementById("result"); const calculateRectangleArea = (length, width) => { - // TASK: CREATE YOUR AREA CALCULATION LOGIC HERE + return length*(width) }; calculateButton.addEventListener("click", () => {