Skip to content

Update 11 Days Progress #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 91 commits into from
Aug 16, 2024
Merged
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
41937f6
Merge pull request #30 from yashksaini-coder/backup
yashksaini-coder Jul 21, 2024
40841b4
Add Empty Task list for Day-10
yashksaini-coder Jul 21, 2024
066966f
Add Updated Activities Task list for Day-10
yashksaini-coder Jul 22, 2024
9737561
Activity-1 completed for Day-10
yashksaini-coder Jul 22, 2024
9b793bd
Activity-1 completed for Day-10
yashksaini-coder Jul 22, 2024
ea4131a
Activity-1 completed for Day-10
yashksaini-coder Jul 22, 2024
aa2bf66
Activity-2 completed for Day-10
yashksaini-coder Jul 22, 2024
9518da8
Activity-3 completed for Day-10
yashksaini-coder Jul 22, 2024
52205a9
Activity-4 completed for Day-10
yashksaini-coder Jul 22, 2024
fe08828
Activity-5 completed for Day-10
yashksaini-coder Jul 22, 2024
ae5ed69
All Activities completed for Day-10
yashksaini-coder Jul 22, 2024
bb03bb6
Update READMEfor Day-10
yashksaini-coder Jul 22, 2024
b8f2f6e
Add Activity list for Day-11
yashksaini-coder Jul 23, 2024
3b9c26d
Add index.js for Day-11
yashksaini-coder Jul 23, 2024
d46aa92
Activity-1 completed for Day-11
yashksaini-coder Jul 23, 2024
e361ef9
Activity-2 completed for Day-11
yashksaini-coder Jul 23, 2024
3ffaccd
Activity-4 completed for Day-11
yashksaini-coder Jul 23, 2024
a62e172
Activity-5 completed for Day-11
yashksaini-coder Jul 23, 2024
c309b36
All Activities completed for Day-11
yashksaini-coder Jul 23, 2024
c6d84b4
Add Activity list for Day-11
yashksaini-coder Jul 24, 2024
b31b907
Add index.js
yashksaini-coder Jul 24, 2024
46a3793
Activity 1 completed for Day-12
yashksaini-coder Jul 24, 2024
9ded98f
Activity 2 completed for Day-12
yashksaini-coder Jul 24, 2024
6ffcd37
Activity 3 completed for Day-12
yashksaini-coder Jul 24, 2024
16f85f2
Activity 4 completed for Day-12
yashksaini-coder Jul 24, 2024
483002b
Activity 5 completed for Day-12
yashksaini-coder Jul 24, 2024
403d86b
Update README: All Activities completed for Day-12
yashksaini-coder Jul 24, 2024
80d5606
Chore: Add Activity List for Day-13
yashksaini-coder Jul 25, 2024
b043a2f
Chore: Add index.js
yashksaini-coder Jul 25, 2024
f543fed
Activity-1 completed for Day-13
yashksaini-coder Jul 25, 2024
5efd1f5
Activity-2 completed for Day-13
yashksaini-coder Jul 25, 2024
4cbf28b
Activity-3 completed for Day-13
yashksaini-coder Jul 25, 2024
0b01371
Activity-4 completed for Day-13
yashksaini-coder Jul 25, 2024
a4bc992
Activity-5 completed for Day-13
yashksaini-coder Jul 25, 2024
a58aecc
All the Activities completed for Day-13
yashksaini-coder Jul 25, 2024
9a7d886
Add Activity list for Day-14
yashksaini-coder Jul 27, 2024
e83176e
Add index.js
yashksaini-coder Jul 27, 2024
16c3797
Activity-1 completed for Day-14
yashksaini-coder Jul 27, 2024
310b091
Activity-2 completed for Day-14
yashksaini-coder Jul 27, 2024
0224d49
Activity-3 completed for Day-14
yashksaini-coder Jul 29, 2024
4d18191
Activity-4 completed for Day-14
yashksaini-coder Jul 29, 2024
38447ef
Activity-5 completed for Day-14
yashksaini-coder Jul 29, 2024
31772e3
Add Activities list for Day-15
yashksaini-coder Jul 29, 2024
70fc2b9
Activity-1 completed for Day-15
yashksaini-coder Jul 29, 2024
d0faeb6
Activity-2 completed for Day-15
yashksaini-coder Jul 29, 2024
ee4fb69
Activity-3 completed for Day-15
yashksaini-coder Jul 29, 2024
125f1c2
Activity-4 completed for Day-15
yashksaini-coder Jul 29, 2024
acfb22a
Activity-5 completed for Day-15
yashksaini-coder Jul 29, 2024
250ee31
Chore: Update Folder Index
yashksaini-coder Aug 6, 2024
d2cbba9
Chore: Update All Folders Index
yashksaini-coder Aug 6, 2024
8ec5170
Chore: Update README && TODO:[Continue from today]
yashksaini-coder Aug 6, 2024
895551e
Chore: Add index.js for Day-16
yashksaini-coder Aug 7, 2024
9ec3d14
Chore: Add Activity list for Day-16
yashksaini-coder Aug 7, 2024
db48988
Chore: Completed Activity-1 for Day-16
yashksaini-coder Aug 7, 2024
64bc544
Chore: Completed Activity-2 for Day-16
yashksaini-coder Aug 7, 2024
e731428
Chore: Completed Activity-3 for Day-16
yashksaini-coder Aug 7, 2024
6100355
Chore: Completed Activity-4 for Day-16
yashksaini-coder Aug 7, 2024
472cd6d
Chore: Completed Activity-5 for Day-16
yashksaini-coder Aug 7, 2024
49a7cef
Chore: Completed All Activities for Day-16
yashksaini-coder Aug 7, 2024
423c620
Chore: Add Activity list for Day-17
yashksaini-coder Aug 8, 2024
48479c4
Chore: Completed Activity-1 for Day-17
yashksaini-coder Aug 8, 2024
b211e4a
Chore: Completed Activity-2 for Day-17
yashksaini-coder Aug 8, 2024
ac0371b
Chore: Completed Activity-3 for Day-17
yashksaini-coder Aug 8, 2024
4295bc4
Chore: Completed Activity-4 for Day-17
yashksaini-coder Aug 8, 2024
8311206
Chore: Completed Activity-5 for Day-17
yashksaini-coder Aug 8, 2024
b56d6d2
Chore: Completed All Activities for Day-17
yashksaini-coder Aug 8, 2024
301ecfa
Chore: Add files for Day-18
yashksaini-coder Aug 9, 2024
012f90c
Chore: Add Activity list for Day-18
yashksaini-coder Aug 9, 2024
cdc50bd
Chore: Completed Activity-1 for Day-18
yashksaini-coder Aug 9, 2024
052e75c
Chore: Completed Activity-2 for Day-18
yashksaini-coder Aug 9, 2024
7de5e5d
Chore: Completed Activity-3 for Day-18
yashksaini-coder Aug 9, 2024
c9d9b0f
Chore: Completed Activity-4 for Day-18
yashksaini-coder Aug 9, 2024
c714548
Chore: Completed Activity-5 for Day-18
yashksaini-coder Aug 9, 2024
7017036
Chore: All Activities Completed for Day-18
yashksaini-coder Aug 9, 2024
ff8a654
Chore: Add Files for Day-19
yashksaini-coder Aug 10, 2024
1e8371c
Chore: Add Activity List for Day-19
yashksaini-coder Aug 10, 2024
383cae9
Chore: Activity-1 Completed for Day-19
yashksaini-coder Aug 10, 2024
170ad2a
Chore: Activity-2 Completed for Day-19
yashksaini-coder Aug 10, 2024
613ac8a
Chore: Activity-3 Completed for Day-19
yashksaini-coder Aug 10, 2024
1dbc803
Chore: Activity-4 Completed for Day-19
yashksaini-coder Aug 10, 2024
c5170fb
Chore: Activity-5 Completed for Day-19
yashksaini-coder Aug 10, 2024
ca4c10d
Chore: All Activities Completed for Day-19
yashksaini-coder Aug 10, 2024
34a4910
Chore: Add Files for Day-20
yashksaini-coder Aug 11, 2024
fba0b5e
Chore: Update index.js for Day-20
yashksaini-coder Aug 11, 2024
28a7090
Chore: Add Activities List for Day-20
yashksaini-coder Aug 11, 2024
172c0f8
Merge branch 'main' of https://github.com/yashksaini-coder/30DaysJava…
yashksaini-coder Aug 11, 2024
a47cfbf
Fix: Add required `node-localStorgae` package
yashksaini-coder Aug 11, 2024
3b6a8f0
Chore: Activity-1 Completed for Day-20
yashksaini-coder Aug 11, 2024
b907d3f
Chore: Activity-2 Completed for Day-20
yashksaini-coder Aug 11, 2024
8d35021
Chore: Created Activity-2 files seperately in Day-20/ folder
yashksaini-coder Aug 16, 2024
3fbc079
Chore: Activity-2 completed for Day-20
yashksaini-coder Aug 16, 2024
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
22 changes: 22 additions & 0 deletions Day10/Activity-1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Activity-1</title>
</head>
<body>
<!-- Add a click event listener to a button that changes the text content of a paragraph. -->
<p>The Button is not clicked</p>
<button onclick="clicked()">Click Me!</button>
<br>
<br>
<!-- Add a double-click event listener to an image that toggles its visibility. -->
<img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" alt="Google Logo" ondblclick="this.style.display = 'none'">
<script>
function clicked() {
document.querySelector('p').innerHTML = "The Button is clicked";
}
</script>
</body>
</html>
61 changes: 61 additions & 0 deletions Day10/Activity-2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Activity-2</title>
</head>
<body>
<style>
.container{
padding: 15px;
border: 10px solid black;
color: red;
display: inline-flex;
gap: 20px;
justify-items: center;
align-items: center;
}
.box {
width: 200px;
height: 200px;
border: 5px solid black;
background-color: lightblue;
display: flex;
justify-content: center;
align-items: center;
}
.box2{
width: 200px;
height: 200px;
border: 5px solid black;
background-color: rgb(138, 181, 28);
display: flex;
justify-content: center;
align-items: center;
}
</style>
<div class="container">
<!-- Add a mouseover event listener to an element that changes its background color. -->
<div class="box">
<p>Hover over me!</p>
</div>

<br>

<!-- Add a mouseout event listener to an element that resets its background color. -->
<div class="box2">
<p>Hover over me!</p>
</div>
</div>
<script>
document.querySelector('.box').addEventListener('mouseover', function() {
this.style.backgroundColor = 'lightgreen';
});

document.querySelector('.box2').addEventListener('mouseout', function() {
this.style.backgroundColor = 'white';
});
</script>
</body>
</html>
59 changes: 59 additions & 0 deletions Day10/Activity-3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Activity-3</title>
</head>
<body>
<style>
.box {
width: 80px;
height: 50px;
left: 15%;
right: 15%;
text-size-adjust: 20px;
position: relative;
border: 5px solid black;
background-color: lightblue;
display: flex;
justify-content: center;
align-items: center;
}

.box2 {
width: 80px;
height: 50px;
left: 15%;
right: 15%;
text-size-adjust: 20px;
position: relative;
border: 5px solid black;
background-color: rgb(17, 20, 227);
display: flex;
justify-content: center;
align-items: center;
}
</style>
<!-- Add a keydown event listener to an input field that logs the key pressed to the console. -->
<h1>Here is the input field</h1><br>
<input type="text" onkeydown="console.log(event.key)"><br>
<h1>You pressed this key</h1><br>
<p class='box'></p><br>

<!-- Add a keyup event listener to an input field that displays the current value in a paragraph. -->
<h1>Here is the input field</h1><br>
<input type="text" onkeyup="console.log(event.key)"><br>
<h1>You pressed this key</h1><br>
<p class="box2"></p>
<script>
document.querySelector('input').addEventListener('keydown', function() {
document.querySelector('p').textContent = event.key;
});

document.querySelector('input').addEventListener('keyup', function() {
document.querySelector('.box2').textContent = event.target.value;
});
</script>
</body>
</html>
42 changes: 42 additions & 0 deletions Day10/Activity-4.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Activity-4</title>
</head>
<body>
<style>

</style>

<!-- Add a submit event listener to a form that prevents the default submission and logs the form data to the console. -->
<form action="" onsubmit="event.preventDefault(); console.log(event.target)">
<input type="text" name="name" id="name" placeholder="Name"><br>
<input type="text" name="email" id="email" placeholder="Email"><br>
<input type="submit" value="Submit">
</form>
<br>
<br>
<!-- Add a change event listener to a select dropdown that displays the selected value in a paragraph. -->
<select name="cars" id="cars" onchange="document.querySelector('p').textContent = event.target.value">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
<p>The value is: <span id="selectedValue"></span></p>

<script>
document.querySelector('form').addEventListener('submit', function() {
event.preventDefault();
console.log(event.target);
});

document.querySelector('select').addEventListener('change', function() {
document.querySelector('p').textContent = event.target.value;
});

</script>
</body>
</html>
36 changes: 36 additions & 0 deletions Day10/Activity-5.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Activity-5</title>
</head>
<body>
<!-- Add a click event listener to a list that logs the text content of the clicked list item using event delegation. -->
<ul>
<li onclick="handleClick(event)">Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

<!-- Add an event listener to a parent element that listens for events from dynamically added child elements. -->
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

<script>
document.querySelector('ul').addEventListener('click', function handleClick(event) {
console.log(event.target.textContent);
});

// Add an event listener to a parent element that listens for events from dynamically added child elements.
document.querySelector('ol').addEventListener('click', function handleClick(event) {
if (event.target.tagName === 'LI') {
console.log(event.target.textContent);
}
});
</script>
</body>
</html>
50 changes: 50 additions & 0 deletions Day10/Task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Day 10: Event Handling 🎉

Welcome to Day 10 of our JavaScript workshop! Today, we will dive into event handling, an essential skill for making web pages interactive and responsive to user actions. 🖱️💻

## Learning Objectives 📚

By the end of these activities, you will:
- Add and handle basic events like click, double-click, mouseover, mouseout, keydown, and keyup.
- Understand and handle form events.
- Implement event delegation to manage events on dynamically added elements.
- Make web pages interactive by responding to various user actions.

## Activities 🛠️

This workshop is divided into several activities:

### Activity 1: Basic Event Handling 🖱️

- [X] **Task 1:** Add a click event listener to a button that changes the text content of a paragraph.
- [X] **Task 2:** Add a double-click event listener to an image that toggles its visibility.

### Activity 2: Mouse Events 🐭

- [X] **Task 3:** Add a mouseover event listener to an element that changes its background color.
- [X] **Task 4:** Add a mouseout event listener to an element that resets its background color.

### Activity 3: Keyboard Events 🎹

- [X] **Task 5:** Add a keydown event listener to an input field that logs the key pressed to the console.
- [X] **Task 6:** Add a keyup event listener to an input field that displays the current value in a paragraph.

### Activity 4: Form Events 📝

- [X] **Task 7:** Add a submit event listener to a form that prevents the default submission and logs the form data to the console.
- [X] **Task 8:** Add a change event listener to a select dropdown that displays the selected value in a paragraph.

### Activity 5: Event Delegation 📋

- [X] **Task 9:** Add a click event listener to a list that logs the text content of the clicked list item using event delegation.
- [X] **Task 10:** Add an event listener to a parent element that listens for events from dynamically added child elements.

## Feature Requests (Optional) 🌟

1. **Click Event Script:** Write a script that adds a click event listener to a button to change the text content of a paragraph.
2. **Mouse Events Script:** Create a script that handles mouseover and mouseout events to change the background color of an element.
3. **Keyboard Events Script:** Write a script that logs key presses and displays input field values using keydown and keyup event listeners.
4. **Form Events Script:** Create a script that handles form submission and change events on a select dropdown.
5. **Event Delegation Script:** Write a script that demonstrates event delegation by handling events on dynamically added child elements.

Happy coding! 💻✨
51 changes: 51 additions & 0 deletions Day11/Task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Day 11: Promises and Async/Await 🚀

Welcome to Day 11 of our JavaScript workshop! Today, we will dive into handling asynchronous operations using Promises and Async/Await.

## Tasks/Activities 📝

### Activity 1: Understanding Promises

- [X] **Task 1:** Create a promise that resolves with a message after a 2-second timeout and log the message to the console.
- [X] **Task 2:** Create a promise that rejects with an error message after a 2-second timeout and handle the error using `.catch()`.

### Activity 2: Chaining Promises

- [X] **Task 3:** Create a sequence of promises that simulate fetching data from a server. Chain the promises to log messages in a specific order.

### Activity 3: Using Async/Await

- [X] **Task 4:** Write an async function that waits for a promise to resolve and then logs the resolved value.
- [X] **Task 5:** Write an async function that handles a rejected promise using try-catch and logs the error message.

### Activity 4: Fetching Data from an API

- [X] **Task 6:** Use the `fetch` API to get data from a public API and log the response data to the console using promises.
- [X] **Task 7:** Use the `fetch` API to get data from a public API and log the response data to the console using async/await.

### Activity 5: Concurrent Promises

- [X] **Task 8:** Use `Promise.all` to wait for multiple promises to resolve and then log all their values.
- [X] **Task 9:** Use `Promise.race` to log the value of the first promise that resolves among multiple promises.

## Feature Request 📋

1. **Promise Creation Script:** Write a script that demonstrates creating and handling promises, including both resolved and rejected states.
2. **Promise Chaining Script:** Create a script that chains multiple promises and logs messages in a specific sequence.
3. **Async/Await Script:** Write a script that uses async/await to handle promises and includes error handling with try-catch.
4. **API Fetch Script:** Create a script that fetches data from a public API using both promises and async/await, and logs the response data.
5. **Concurrent Promises Script:** Write a script that uses `Promise.all` and `Promise.race` to handle multiple promises concurrently and logs the results.

## Achievement 🎓

By the end of these activities, students will:

- ✅ Understand and create promises, including handling resolved and rejected states.
- ✅ Chain multiple promises to perform sequential asynchronous operations.
- ✅ Use async/await to handle asynchronous code more readably.
- ✅ Fetch data from public APIs using both promises and async/await.
- ✅ Manage multiple concurrent promises using `Promise.all` and `Promise.race`.

---

Happy Coding 🚀
Loading
Oops, something went wrong.