From 4ca83fded542a344d6ffb314aaab39fc38091529 Mon Sep 17 00:00:00 2001 From: Jenell Pizarro Date: Fri, 9 Dec 2016 15:58:12 -0500 Subject: [PATCH 1/8] query selector bit that logs keyCodes --- 01 - JavaScript Drum Kit/index-START.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..20e5c781ee 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,7 +58,10 @@ From 0b6f28607f27025b3c057dd08c06c6edd6ce5434 Mon Sep 17 00:00:00 2001 From: Jenell Pizarro Date: Fri, 9 Dec 2016 17:37:03 -0500 Subject: [PATCH 2/8] I had forgotten how much I love document.qsa --- 01 - JavaScript Drum Kit/index-START.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 20e5c781ee..f6f42f4a23 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -59,9 +59,17 @@ From a308e9822e3cc7fb47e80d754539ff79d74c272d Mon Sep 17 00:00:00 2001 From: Jenell Pizarro Date: Sat, 10 Dec 2016 12:50:16 -0500 Subject: [PATCH 3/8] finished 01 --- 01 - JavaScript Drum Kit/index-START.html | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index f6f42f4a23..6166204248 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,7 +58,8 @@ From 7e84057fde28f44c34a3d74846fb6a6e727697da Mon Sep 17 00:00:00 2001 From: Jenell Pizarro Date: Sat, 10 Dec 2016 15:29:04 -0500 Subject: [PATCH 4/8] completed! added some styling to the hands to make them more realistic --- 02 - JS + CSS Clock/index-START.html | 45 ++++++++++++++++++++++++++-- 02 - JS + CSS Clock/index.html | 1 + 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 240705d8fe..50a68e45a1 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -2,7 +2,7 @@ - Document + JavaScript Clock @@ -57,16 +57,55 @@ .hand { width:50%; - height:6px; - background:black; + height:3.4px; position: absolute; top:50%; + transform-origin: 100%; + transform: rotate(90deg); + transition: all 0.05s; + transition-timing-function:cubic-bezier(0.8, 0.2, 0.85, 2.35); + } + + .second-hand { + background: red; + } + + .min-hand, .hour-hand { + background: black; + } + + .hand.hour-hand { + width: 45%; + height: 5px; + margin-left: 14.5px; } diff --git a/02 - JS + CSS Clock/index.html b/02 - JS + CSS Clock/index.html index d5c9ec9596..ec12d50d91 100644 --- a/02 - JS + CSS Clock/index.html +++ b/02 - JS + CSS Clock/index.html @@ -66,6 +66,7 @@ transition: all 0.05s; transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1); } + } From e9e38bc740b171963c98c8efdf9dfc1e36b568c4 Mon Sep 17 00:00:00 2001 From: Jenell Pizarro Date: Tue, 13 Dec 2016 10:47:12 -0500 Subject: [PATCH 6/8] this is super fun! Like code katas! --- 04 - Array Cardio Day 1/index-START.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 6e28e357d0..4acef69044 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -27,13 +27,28 @@ // 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 inventory first and last names + // 2. Give us an array of the inventors first and last names + + // const inventorNames = inventors.map(inventor => inventor.first + ' ' + inventor.last) + + const inventorNames = inventors.map(inventor => ` ${inventor.first} ${inventor.last}`) + + console.log(inventorNames) + // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + const birthdate = inventors.sort((firstInventor, secondInventor) => firstInventor.year > secondInventor.year ? 1 : -1) + + console.table(birthdate) + // Array.prototype.reduce() // 4. How many years did all the inventors live? From a316637da4de0cbbdffb5f7920f4b6217bf7da51 Mon Sep 17 00:00:00 2001 From: Jenell Pizarro Date: Tue, 13 Dec 2016 13:52:46 -0500 Subject: [PATCH 7/8] will be redoing this again. I loved it! --- 04 - Array Cardio Day 1/index-START.html | 32 ++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 4acef69044..d8798422e0 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -23,7 +23,7 @@ const flavours = ['Chocolate Chip', 'Kulfi', 'Caramel Praline', 'Chocolate', 'Burnt Caramel', 'Pistachio', 'Rose', 'Sweet Coconut', 'Lemon Cookie', 'Toffeeness', 'Toasted Almond', 'Black Raspberry Crunch', 'Chocolate Brownies', 'Pistachio Almond', 'Strawberry', 'Lavender Honey', 'Lychee', 'Peach', 'Black Walnut', 'Birthday Cake', 'Mexican Chocolate', 'Mocha Almond Fudge', 'Raspberry']; - 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']; + const humans = ['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']; // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's @@ -50,21 +50,49 @@ console.table(birthdate) // Array.prototype.reduce() - // 4. How many years did all the inventors live? + // 4. How many years did all the inventors live? Basically a for loop made easy. The way that reduce() works gives you the running total plus another value. If you don't indicate that it starts at index[0] it will start at index[1] + const totalLife = inventors.reduce((total, inventor) => { return total + (inventor.passed - inventor.year)} , 0) + console.log(totalLife) // 5. Sort the inventors by years lived + const oldest = inventors.sort(function(a,b) { + const last = a.passed - a.year + const next = b.passed - b.year + return last > next ? -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 + // needs to be done in the console on the site above // 7. sort Exercise // Sort the people alphabetically by last name + // you need to practice this exercise sooooooooooo much! + + const peopleNames = humans.sort((lastOne, nextOne) => { + const [ last, first]= lastOne.split(', ') + const [nextLast, nextFirst] = nextOne.split(', ') + return last > nextLast ? 1 : -1 + }) + + console.log(peopleNames) + // 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) From 0baa8cd8988b229e5030e224f507aa2e34ba3706 Mon Sep 17 00:00:00 2001 From: Jenell Pizarro Date: Thu, 29 Dec 2016 22:20:26 -0500 Subject: [PATCH 8/8] This was fun! --- 05 - Flex Panel Gallery/index-START.html | 28 +++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index e1d643ad5c..7f0ace3fe0 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index-START.html @@ -22,11 +22,17 @@ } .panels { + display: flex; min-height:100vh; overflow: hidden; } .panel { + display: flex; + flex-direction: column; + flex-grow: 1; + justify-content: space-between; + align-items: center; background:#6B0F9C; box-shadow:inset 0 0 0 5px rgba(255,255,255,0.1); color:white; @@ -43,6 +49,11 @@ background-position: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);} + .panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); } .panel2 { background-image:url(https://source.unsplash.com/1CD3fd8kHnE/1500x1500); } @@ -68,6 +79,7 @@ .panel.open { font-size:40px; + flex-grow: 6; } .cta { @@ -107,8 +119,22 @@ + panels.forEach(panel => panel.addEventListener('click', toggleOpen)) + panels.forEach(panel => panel.addEventListener('transitionend', toggleActive)) +