From eebcada7dee9d3b5d7cd59269fd8a075ff710090 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Mon, 26 Mar 2018 17:24:16 +1300 Subject: [PATCH 01/14] Add 01 implementation --- 01 - JavaScript Drum Kit/index-START.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..80344d00c5 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,7 +58,27 @@ From 3b4e0ef079c1e1bc52597135546f1aaca8183791 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Mon, 26 Mar 2018 17:56:19 +1300 Subject: [PATCH 02/14] Implement 03 --- 03 - CSS Variables/index-START.html | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index 8a4f0d556e..2d1a543820 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -21,6 +21,21 @@

Update CSS Variables with JS

From d51c6656ad050c45ab17e170a16b1f58e1f4085f Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Wed, 28 Mar 2018 23:25:14 +1300 Subject: [PATCH 03/14] Implement 04 --- 04 - Array Cardio Day 1/index-START.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index eec0ffc31d..1c15fccea8 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -32,15 +32,32 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's +const old_inventors = inventors.filter(inventor => inventor.year >= 1500 && + inventor.year < 1600) +console.table(old_inventors) + // Array.prototype.map() // 2. Give us an array of the inventors' first and last names +let full_names = inventors.map(inventor => `${inventor.first} ${inventor.last}`) +console.log(full_names) + // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest +let sorted_inventors = inventors.sort((a, b) => { + return a.year > b.year ? 1 : -1 +}) +console.table(sorted_inventors) + // Array.prototype.reduce() // 4. How many years did all the inventors live? + let yearsLived = inventors.reduce((memo, inventor) => { + return memo + (inventor.passed - inventor.year) + }, 0) +console.log(yearsLived) + // 5. Sort the inventors by years lived // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name From 33fa291c325de1f75d1aac333160a59f122190cf Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Wed, 28 Mar 2018 23:57:17 +1300 Subject: [PATCH 04/14] Implement 05 --- 05 - Flex Panel Gallery/index-START.html | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index c6509bed02..0a7ac8c4a2 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index-START.html @@ -24,6 +24,7 @@ .panels { min-height:100vh; overflow: hidden; + display: flex; } .panel { @@ -41,6 +42,9 @@ font-size: 20px; background-size:cover; background-position:center; + flex: 1; + display: flex; + flex-direction: column; } @@ -54,8 +58,17 @@ margin:0; width: 100%; transition:transform 0.5s; + flex: 1 0 auto; + display: flex; + justify-content: center; + align-items: center; } + .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 p { text-transform: uppercase; font-family: 'Amatic SC', cursive; @@ -68,6 +81,7 @@ .panel.open { font-size:40px; + flex: 5; } @@ -102,6 +116,21 @@ From 852261a4947ab6ba71f3cb002cb3d828e6e8f7ec Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Thu, 29 Mar 2018 16:54:51 +1300 Subject: [PATCH 05/14] Implement 06 async stuff is just useless here --- 06 - Type Ahead/index-START.html | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 1436886918..bdfa469516 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -17,6 +17,56 @@ From 099accdd7a5fd699dad9f438ae498f5213c933e8 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Tue, 3 Apr 2018 20:12:58 +1200 Subject: [PATCH 06/14] Implement 07 --- 07 - Array Cardio Day 2/index-START.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index 969566ff78..c9ae28850e 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -28,14 +28,29 @@ // Array.prototype.some() // is at least one person 19 or older? // Array.prototype.every() // is everyone 19 or older? +function wasBornIn80s(person) { + return person.year >= 1980 && person.year <= 1989 +} + + let somePeopleWerebornIn80s = people.some(person => wasBornIn80s(person)) +console.log(somePeopleWerebornIn80s) + +let allPeopleWereBornIn80s = people.every(person => wasBornIn80s(person)) +console.log(allPeopleWereBornIn80s) + // Array.prototype.find() // Find is like filter, but instead returns just the one you are looking for // find the comment with the ID of 823423 +let comment = comments.find(comment => comment.id === 523423) +console.log(comment) + // Array.prototype.findIndex() // Find the comment with this ID // delete the comment with the ID of 823423 +let index = comments.findIndex(comment => comment.id === 523423) +console.log("index:", index) From b536bcf8825c44a76e67eb8575a9b32919386070 Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Thu, 5 Apr 2018 13:47:57 +1200 Subject: [PATCH 07/14] Implement 08 --- 08 - Fun with HTML5 Canvas/index-START.html | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 37c148df07..d3a025e48c 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -7,6 +7,38 @@