From 6597ebe03c62a84bf72a00561418efd556468960 Mon Sep 17 00:00:00 2001 From: SeanCox Date: Mon, 12 Dec 2016 21:42:24 -0800 Subject: [PATCH 1/7] compleated 01 --- 01 - JavaScript Drum Kit/index-START.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..68ecf54216 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,9 +58,23 @@ - From 0736edde7a29a39295f39553cd1a82c189d6a4c0 Mon Sep 17 00:00:00 2001 From: SeanCox Date: Tue, 13 Dec 2016 20:34:38 -0800 Subject: [PATCH 2/7] solved 01 --- 02 - JS + CSS Clock/index-START.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 2712384201..8784152242 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -61,13 +61,35 @@ background:black; position: absolute; top:50%; + transform-origin: 100%; + transform: rotate(90deg); + transition: all .05s; + transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1); } From c292d762f2413ba8bc3f8e394a982a1f09dd2ec0 Mon Sep 17 00:00:00 2001 From: SeanCox Date: Thu, 15 Dec 2016 02:38:23 -0800 Subject: [PATCH 3/7] [solved] day 03 --- 03 - CSS Variables/index-START.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index 7171607a8b..0bb1514607 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -21,7 +21,21 @@

Update CSS Variables with JS

From 73db56ef0a0bff3a6fe5b21ec02d0a72aae28114 Mon Sep 17 00:00:00 2001 From: SeanCox Date: Mon, 26 Dec 2016 15:37:50 -0800 Subject: [PATCH 4/7] [solved] day 05 --- 04 - Array Cardio Day 1/index-START.html | 42 ++++++++++++++++++++---- 05 - Flex Panel Gallery/index-START.html | 27 +++++++++++++++ 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 4162bce339..35748b1395 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -33,29 +33,57 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's - +const fifteen = inventors.filter(inventor => inventor.year > 1500 && inventor.year < 1600) +console.table(fifteen) // Array.prototype.map() // 2. Give us an array of the inventors' first and last names - +const fullNames = inventors.map(inventor => `${inventor.first} ${inventor.last}`) +console.log(fullNames) // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest - +const orderded = inventors.sort((a, b) => a.year > b.year ? 1 : -1) +console.table(orderded) // Array.prototype.reduce() // 4. How many years did all the inventors live? - +const totalyears = inventors.reduce((total, inventor) => { + return total + (inventor.passed - inventor.year) +}, 0) +console.log(totalyears); // 5. Sort the inventors by years lived - +const oldest = inventors.sort((a, b) => { + const lastGuy = a.passed - a.year + const nextGuy = b.passed - b.year + return lastGuy > nextGuy ? -1 : 1 +}) +console.table(oldest) // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name // https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris - +// const category = document.querySelector('.mw-category') +// const links = Array.from(category.querySelectorAll('a')) +// +// const de = links +// .map(link => link.textContent) +// .filter(streetName => streetName.includes('de')) // 7. sort Exercise // Sort the people alphabetically by last name - +const alpha = people.sort((lastOne, nextOne)=>{ + const [aLast, afirst] = lastOne.split(', ') + const [bLast, bFirst] = nextOne.split(', ') + return aLast > bLast ? 1 : -1 +}) +console.log(alpha) // 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' ]; +const transportation = data.reduce((obj, item)=>{ + if(!obj[item]) obj[item] = 0 + obj[item] += 1 + return obj +},{}) + +console.log(transportation) diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index e1d643ad5c..bcbfce9de9 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,11 @@ font-size: 20px; background-size:cover; background-position:center; + flex: 1; + justify-content: center; + align-items: center; + display: flex; + flex-direction: column; } @@ -54,8 +60,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; @@ -67,6 +82,7 @@ } .panel.open { + flex: 5; font-size:40px; } @@ -107,7 +123,18 @@ From aedcd73473895179dd01e321d06109e3fe9cd2c8 Mon Sep 17 00:00:00 2001 From: SeanCox Date: Sun, 1 Jan 2017 23:51:28 -0800 Subject: [PATCH 5/7] [solved] day 06 --- 06 - Type Ahead/index-START.html | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 1436886918..c2c89b2e86 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -17,6 +17,43 @@ From 3ac39eaa065f3f4aa869a6d9d86fd6e16bd64abf Mon Sep 17 00:00:00 2001 From: SeanCox Date: Tue, 3 Jan 2017 21:41:58 -0800 Subject: [PATCH 6/7] [solved] day 07 --- 07 - Array Cardio Day 2/index-START.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index 206ec31aa0..63f084a4fd 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -26,16 +26,28 @@ // Some and Every Checks // Array.prototype.some() // is at least one person 19? +const isAdult = people.some(person => (new Date()).getFullYear() - person.year >= 19) +const allAdult = people.every(person => (new Date()).getFullYear() - person.year >= 19) + +console.log({allAdult}); // Array.prototype.every() // is everyone 19? // 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 + const comment = comments.find(comment => comment.id === 823423) + console.log(comment) // Array.prototype.findIndex() // Find the comment with this ID // delete the comment with the ID of 823423 + const index = comments.findIndex(comment => comment.id === 823423) + console.log(index); + const newComments = [ + ...comments.slice(0, index), + ...comments.slice(index + 1) + ] From ce91990c0897325a847244d292b1c86d3f0d5e07 Mon Sep 17 00:00:00 2001 From: SeanCox Date: Tue, 3 Jan 2017 22:28:32 -0800 Subject: [PATCH 7/7] [solved] day 08 --- 08 - Fun with HTML5 Canvas/index-START.html | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 37c148df07..c35162a849 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -7,6 +7,52 @@