diff --git a/01 - JavaScript Drum Kit/index-FINISHED.html b/01 - JavaScript Drum Kit/index-FINISHED.html index 1a16d0997c..4aa120b359 100644 --- a/01 - JavaScript Drum Kit/index-FINISHED.html +++ b/01 - JavaScript Drum Kit/index-FINISHED.html @@ -58,24 +58,42 @@ diff --git a/02 - JS + CSS Clock/index-FINISHED.html b/02 - JS + CSS Clock/index-FINISHED.html index d4cb3b56a8..f17c46bf53 100644 --- a/02 - JS + CSS Clock/index-FINISHED.html +++ b/02 - JS + CSS Clock/index-FINISHED.html @@ -18,8 +18,7 @@ - + setInterval(updateClock, 1000) + diff --git a/03 - CSS Variables/index-FINISHED.html b/03 - CSS Variables/index-FINISHED.html index c3217fc003..8767e43f73 100644 --- a/03 - CSS Variables/index-FINISHED.html +++ b/03 - CSS Variables/index-FINISHED.html @@ -22,15 +22,15 @@

Update CSS Variables with JS

- diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 4162bce339..8b0ff535c9 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -31,19 +31,43 @@ const people = ['Beck, Glenn', 'Becker, Carl', 'Beckett, Samuel', 'Beddoes, Mick', 'Beecher, Henry', 'Beethoven, Ludwig', 'Begin, Menachem', 'Belloc, Hilaire', 'Bellow, Saul', 'Benchley, Robert', 'Benenson, Peter', 'Ben-Gurion, David', 'Benjamin, Walter', 'Benn, Tony', 'Bennington, Chester', 'Benson, Leana', 'Bent, Silas', 'Bentsen, Lloyd', 'Berger, Ric', 'Bergman, Ingmar', 'Berio, Luciano', 'Berle, Milton', 'Berlin, Irving', 'Berne, Eric', 'Bernhard, Sandra', 'Berra, Yogi', 'Berry, Halle', 'Berry, Wendell', 'Bethea, Erin', 'Bevan, Aneurin', 'Bevel, Ken', 'Biden, Joseph', 'Bierce, Ambrose', 'Biko, Steve', 'Billings, Josh', 'Biondo, Frank', 'Birrell, Augustine', 'Black Elk', 'Blair, Robert', 'Blair, Tony', 'Blake, William']; + console.clear() + // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + console.log( + 'inventors born in the 1500s', + inventors.filter(inventor => inventor.year < 1600 && inventor.year > 1499) + ) // Array.prototype.map() // 2. Give us an array of the inventors' first and last names + console.log( + 'inventors first and last names', + inventors.map(inventor => `${inventor.first} ${inventor.last}`) + ) // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + console.log( + 'inventors sorted oldest to youngest', + inventors.sort((inventorA, inventorB) => inventorA.year - inventorB.year) + ) + + const getLifeSpanOfPerson = ({ passed, year }) => passed - year // Array.prototype.reduce() // 4. How many years did all the inventors live? + console.log( + 'years all the inventors lived', + inventors.reduce((accumulator, inventor) => accumulator + getLifeSpanOfPerson(inventor), 0) + ) // 5. Sort the inventors by years lived + console.log( + 'inventors by years lived', + inventors.sort((a, b) => getLifeSpanOfPerson(b) - getLifeSpanOfPerson(a)) + ) // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name // https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris @@ -51,10 +75,25 @@ // 7. sort Exercise // Sort the people alphabetically by last name + const getLastNameOfPerson = person => person.match(/\w+/)[0] + + console.log( + 'sorted people by last name', + people.sort((personA, personB) => getLastNameOfPerson(personA) > getLastNameOfPerson(personB)) + ) // 8. Reduce Exercise // Sum up the instances of each of these const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck' ]; + console.log( + 'instances of words', + data.reduce((accumulator, datum) => { + accumulator[datum] || (accumulator[datum] = 0) + accumulator[datum] += 1 + return accumulator + }, + {}) + ) diff --git a/05 - Flex Panel Gallery/index-FINISHED.html b/05 - Flex Panel Gallery/index-FINISHED.html index 243f8a221d..ad49973a4f 100644 --- a/05 - Flex Panel Gallery/index-FINISHED.html +++ b/05 - Flex Panel Gallery/index-FINISHED.html @@ -43,33 +43,39 @@ background-size:cover; background-position:center; flex: 1; - justify-content: center; display: flex; flex-direction: column; } - .panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); } .panel2 { background-image:url(https://source.unsplash.com/1CD3fd8kHnE/1500x1500); } .panel3 { background-image:url(https://images.unsplash.com/photo-1465188162913-8fb5709d6d57?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&w=1500&h=1500&fit=crop&s=967e8a713a4e395260793fc8c802901d); } .panel4 { background-image:url(https://source.unsplash.com/ITjiVXcwVng/1500x1500); } .panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); } - /* Flex Items */ .panel > * { margin:0; width: 100%; transition:transform 0.5s; - flex: 1 0 auto; - display:flex; - justify-content: center; - align-items: center; + flex: 1; } - .panel > *:first-child { transform: translateY(-100%); } - .panel.open-active > *:first-child { transform: translateY(0); } - .panel > *:last-child { transform: translateY(100%); } - .panel.open-active > *:last-child { transform: translateY(0); } + .panel > *:first-child { + transform: translateY(-100%); + } + + .panel > *:last-child { + transform: translateY(100%); + } + + .panel.open-active > *:first-child, + .panel.open-active > *:last-child { + transform: translateY(0); + } + + .panel.open { + flex: 5; + } .panel p { text-transform: uppercase; @@ -82,7 +88,6 @@ } .panel.open { - flex: 5; font-size:40px; } @@ -123,23 +128,29 @@ + + diff --git a/readme.md b/readme.md index 5a1eaa18c8..15fd8dad6e 100644 --- a/readme.md +++ b/readme.md @@ -1,17 +1,10 @@ -![](https://javascript30.com/images/JS3-social-share.png) +Javascript30.com challenge. -# JavaScript30 +All solutions saved as modified index-FINISHED.html -Starter Files + Completed solutions for the JavaScript 30 Day Challenge. - -Grab the course at [https://JavaScript30.com](https://JavaScript30.com) - -Text-based guides (unofficial) for the challenges can be found here - [Text Guides](https://github.com/nitishdayal/JavaScript30). - -## Pull Requests - -These are meant to be 1:1 copies of what is done in the video. If you found a better / different way to do things, great, but I will be keeping them the same as the videos. - -The starter files + solutions will be updated if/when the videos are updated. - -Thanks! +Completed: +- [x] 01 +- [x] 02 +- [x] 03 +- [x] 04 +- [x] 05