Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Training/CSS-Practice/practice-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
<style>
/* Your CSS rules for element placement go here */
body {
text-align: center;
font-family: Arial, sans-serif;
background-color: #f0f0f0;

margin: 0;
padding: 0;
height: 100vh;
display: flex;
justify-content: center; /* Center horizontally along the main axis*/
align-items: center; /* Center vertically along the cross axis, perpendicular to the main axis */

/* TASK 1: PLACE THE ITEMS IN THE CENTRE OF THE WEBPAGE */
/* margin: ;
padding: ;
Expand All @@ -23,6 +32,7 @@
.container {
background-color: #fff;
padding: 20px;

/* TASK 2: CREATE YOUR OWN CURVED BORDER */
/* border: ;
border-radius: ; */
Expand Down
3 changes: 3 additions & 0 deletions Training/Counter/counter.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ <h1>Click Counter</h1>
const clickButton = document.getElementById("clickButton");
const counter = document.getElementById("counter");

let result = 0;
clickButton.addEventListener("click", () => {
// counter.textContent = `Click count: ${}`;
result ++;
counter.textContent = `${result}`;
});
</script>
</body>
Expand Down
9 changes: 8 additions & 1 deletion Training/JS-Practice/factorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,17 @@ <h1>Factorial Calculator</h1>

const calculateFactorial = (number) => {
// TASK: CREATE YOUR FACTORIAL CALCULATION LOGIC HERE

let factorial = 1;
for (let i = 1; i <= number; i++) {
factorial *= i;
}
return factorial;

};

calculateButton.addEventListener("click", () => {
const inputValue = parseInt(numberInput.value);
const inputValue = parseInt(numberInput.value); //parseInt(): convert whatever input into Int

if (!isNaN(inputValue)) {
const factorialResult = calculateFactorial(inputValue);
Expand Down
2 changes: 2 additions & 0 deletions Training/JS-Practice/rectangle.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ <h1>Rectangle Area Calculator</h1>

const calculateRectangleArea = (length, width) => {
// TASK: CREATE YOUR AREA CALCULATION LOGIC HERE
const area = length*width;
return area;
};

calculateButton.addEventListener("click", () => {
Expand Down