Skip to content

Commit 1ca2c57

Browse files
palashmonKiselt
authored andcommitted
Merge pull request wesbos#617 from issam-seghir/pull-request
add my project link in the readme
2 parents 25cc793 + 9025315 commit 1ca2c57

3 files changed

Lines changed: 46 additions & 1 deletion

File tree

01 - JavaScript Drum Kit/index-START.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,25 @@
6060

6161
<script>
6262

63+
function playSound(e) {
64+
const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`)
65+
const key = document.querySelector(`.key[data-key="${e.keyCode}"]`)
66+
if(!audio) return; //stop the function from running all together
67+
audio.currentTime = 0; //rewind to the start
68+
audio.play();
69+
key.classList.add('playing');
70+
};
71+
72+
73+
function removeTransition(e) {
74+
if (e.propertyName !== 'transform') return; //skip if it's not a transform
75+
this.classList.remove('playing');
76+
}
77+
78+
const keys = document.querySelectorAll('.key');
79+
keys.forEach(key => key.addEventListener('transitionend', removeTransition));
80+
window.addEventListener('keydown', playSound);
81+
6382
</script>
6483

6584

07 - Array Cardio Day 2/index-START.html

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,41 @@
2727

2828
// Some and Every Checks
2929
// Array.prototype.some() // is at least one person 19 or older?
30-
// Array.prototype.every() // is everyone 19 or older?
30+
// const isAdult = people.some(function(person) {
31+
// const currentYear = (new Date()).getFullYear();
32+
// if(currentYear - person.year >= 19) {
33+
// return true;
34+
// }
35+
// });
3136

37+
const isAdult = people.some(person => ((new Date()).getFullYear()) - person.year >= 19);
38+
39+
console.log(isAdult);
40+
// Array.prototype.every() // is everyone 19 or older?
41+
const allAdults = people.every(person => ((new Date()).getFullYear()) - person.year >= 19);
42+
43+
console.log(allAdults);
3244
// Array.prototype.find()
3345
// Find is like filter, but instead returns just the one you are looking for
3446
// find the comment with the ID of 823423
47+
// const comment = comments.find(function(comment) {
48+
// if(comment.id === 823423) {
49+
// return true;
50+
// }
51+
// });
52+
53+
const comment = comments.find(comment => comment.id === 823423);
54+
55+
console.log(comment);
3556

3657
// Array.prototype.findIndex()
3758
// Find the comment with this ID
3859
// delete the comment with the ID of 823423
60+
const index = comments.findIndex(comment => comment.id === 823423);
61+
console.log(index);
3962

63+
comments.splice(index, 1);
64+
console.table(comments);
4065
</script>
4166
</body>
4267
</html>

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Feel free to submit a PR adding a link to your own recaps, guides or reviews!
5555
* [Mo. Saif's](https://github.com/MoSaif00)note on lessons learned and a [gh-pages showcase](https://mosaif00.github.io/30-Days-JavaScript-Challenge/) for the projects.
5656
* [Stiaannel's](https://stiaannel.co.za/my-projects/javascript30) implementation of the Javascript30 challenge, with small design changes and a couple of extra features.
5757
* [Kelly CHI's](https://kellychi22.github.io/JavaScript30/) complete JavaScript30 challenges! Click the links to check demos and notes of each challenge. 🇹🇼 🌟
58+
* [Issam Seghir](https://issam-seghir.github.io/JavaScript30/) added custom solutions and styles 🍧, improved performance, including fixed bugs/issus 💢. , added articles for each exercise 📝.
5859

5960
## Alternative Implementations
6061
Here are some links of people who have done the tutorials, but in a different language or framework:

0 commit comments

Comments
 (0)