From 5d4866000d3a87d53d2ced92192b8f09af9627a9 Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Tue, 13 Feb 2018 16:55:37 -0600 Subject: [PATCH 01/18] Ejercicio 1 --- 01 - JavaScript Drum Kit/index-START.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..ba1eef079b 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,7 +58,24 @@ From f92a9be7377ed8b7ad01425a76d0d53384d5328d Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Tue, 13 Feb 2018 16:59:28 -0600 Subject: [PATCH 02/18] Ejercicio 2 --- 02 - JS and CSS Clock/index-START.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index-START.html index ee7eaefb1f..fbbf4b96c8 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index-START.html @@ -62,12 +62,37 @@ background:black; position: absolute; top:50%; + transform-origin: 100%; + transform: rotate(90deg); + transition: all 0.05s; + transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1); } From 4fde65b12483735141680b94069859d6b969b12f Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Tue, 13 Feb 2018 16:59:55 -0600 Subject: [PATCH 03/18] Ejercicio 3 --- 03 - CSS Variables/index-START.html | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index 8a4f0d556e..d595b552b8 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -21,7 +21,19 @@

Update CSS Variables with JS

From b994240cab4c6162948f430c4ea97266b4222f2f Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Tue, 20 Feb 2018 12:29:55 -0600 Subject: [PATCH 04/18] =?UTF-8?q?Lecci=C3=B3n=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04 - Array Cardio Day 1/index-START.html | 60 ++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index eec0ffc31d..6029565197 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -31,29 +31,83 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + console.log("1. Filter the list of inventors for those who were born in the 1500's"); + const fifteen = inventors.filter(function(inventor){ + if (inventor.year >= 1500 && inventor.year < 1600) { + return true; + } + }); + console.table(fifteen); // Array.prototype.map() // 2. Give us an array of the inventors' first and last names + console.log("2. Give us an array of the inventors: First & last name"); + const fullNames = inventors.map(inventor => inventor.first + ' ' + inventor.last); + console.table(fullNames); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + console.log("3. Sort the inventors by birthdate: oldest to youngest"); + const birth = inventors.sort(function(a, b){ + if (a.year > b.year) { + return 1; + }else{ + return -1; + } + }); + console.table(birth); // Array.prototype.reduce() // 4. How many years did all the inventors live? + console.log("4. How many years did all the inventors live?"); + const lived = inventors.reduce((total,inventor) => { + return total + (inventor.passed - inventor.year); + },0); + console.log(lived); // 5. Sort the inventors by years lived + console.log("5. Sort the inventors by years lived"); + const sortLived = inventors.sort(function(a, b){ + if ((a.passed - a.year)> (b.passed - b.year)) { + return 1; + }else { + return -1; + } + }); + console.table(sortLived); // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name // https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris - + /*console.log("6. Create a list of Boulevards in Paris that contain 'de' anywhere in the name"); + const category = document.querySelector('mw-category'); + const links = Array.from(category.querySelectorAll('a')); + const de = .map(link => link.textContent) + .filter(streetName => streetName.includes('de'));*/ // 7. sort Exercise // Sort the people alphabetically by last name - + console.log("7. Sort the people alphabetically by last name"); + const alphabet = inventors.sort(function(a, b){ + if (a.last > b.last) { + return 1; + }else{ + return -1; + } + }); + console.table(alphabet); // 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(function(obj, item){ + if (!obj[item]) { + obj[item] = 0; + } + obj[item]++; + return obj; + },{}); + console.log(transportation); + - + \ No newline at end of file From 0f2b35c26a5a2e81099ca44fd274682c958a3196 Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Wed, 21 Feb 2018 18:15:42 -0600 Subject: [PATCH 05/18] =?UTF-8?q?Lecci=C3=B3n=20#5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 05 - Flex Panel Gallery/index-START.html | 27 +++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index c6509bed02..94e917a009 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; } @@ -102,7 +118,16 @@ From 80ef3e8b002ced5d7ca267deb74e45be3fa3da82 Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Thu, 1 Mar 2018 13:17:07 -0600 Subject: [PATCH 06/18] =?UTF-8?q?lecci=C3=B3n=20#6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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..8896a6baea 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -17,6 +17,43 @@ From 89c84273fa9170b81a4713977e118ef7daed771e Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Thu, 1 Mar 2018 14:17:46 -0600 Subject: [PATCH 07/18] =?UTF-8?q?lecci=C3=B3n=20#7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 07 - Array Cardio Day 2/index-START.html | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index 969566ff78..7a2d43bfe8 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -26,15 +26,53 @@ // Some and Every Checks // Array.prototype.some() // is at least one person 19 or older? + console.log('Is at least one person 19 or older?'); + const older = people.some(function(person){ + const currentYear = (new Date()).getFullYear(); + if (currentYear - person.year >= 19) { + return true; + } + }); + console.log({older}); + // Array.prototype.every() // is everyone 19 or older? + console.log('Is everyone 19 or older?'); + const everyoneOlder = people.every(function(person){ + const currentYear = (new Date()).getFullYear(); + if (currentYear - person.year >= 19) { + return true; + } + }); + console.log({everyoneOlder}); // 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 + console.log('Find the comment with the ID 823423'); + const find = comments.find(function(people){ + if(people.id == 823423){ + return true; + } + }); + console.log(find); // Array.prototype.findIndex() // Find the comment with this ID // delete the comment with the ID of 823423 + console.log('Find the comment with this ID'); + console.log('Delete the comment with the ID of 823423'); + const findIndex = comments.findIndex(function(people){ + if(people.id == 823423){ + return true; + } + }); + console.log(findIndex); + const newComments = [ + ...comments.slice(0, findIndex), + ...comments.slice(findIndex + 1) + ]; + + From b9e980804a29014cd48dacacca67bec276ee2caf Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Thu, 1 Mar 2018 16:09:17 -0600 Subject: [PATCH 08/18] =?UTF-8?q?Lecci=C3=B3n=20#8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 08 - Fun with HTML5 Canvas/index-START.html | 47 ++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 37c148df07..46e984b329 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -5,8 +5,53 @@ HTML5 Canvas - + From 5f7480fad3005a23386d579da945e123b7e3fb89 Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Tue, 6 Mar 2018 15:33:28 -0600 Subject: [PATCH 17/18] =?UTF-8?q?lecci=C3=B3n=2017?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 17 - Sort Without Articles/index-START.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/17 - Sort Without Articles/index-START.html b/17 - Sort Without Articles/index-START.html index 9bbd250a9b..4fe2e844bd 100644 --- a/17 - Sort Without Articles/index-START.html +++ b/17 - Sort Without Articles/index-START.html @@ -45,8 +45,22 @@ From 3321f62572db5aa893f6ca770f759e19624cebe9 Mon Sep 17 00:00:00 2001 From: Pablo Contreras Date: Tue, 6 Mar 2018 16:45:25 -0600 Subject: [PATCH 18/18] =?UTF-8?q?Lecci=C3=B3n=2018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index-START.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/18 - Adding Up Times with Reduce/index-START.html b/18 - Adding Up Times with Reduce/index-START.html index abdf4c91af..3f5101c093 100644 --- a/18 - Adding Up Times with Reduce/index-START.html +++ b/18 - Adding Up Times with Reduce/index-START.html @@ -182,6 +182,25 @@