From 5f02ed1b73953b937b5b179166c0e0874e46eda1 Mon Sep 17 00:00:00 2001 From: valeriaoshiro Date: Mon, 12 Dec 2016 22:48:28 -0800 Subject: [PATCH 1/5] Complete Drum Kit challange --- 01 - JavaScript Drum Kit/index-START.html | 23 ++++++++++++++++++ .../index-START.html alias | Bin 0 -> 992 bytes 2 files changed, 23 insertions(+) create mode 100644 01 - JavaScript Drum Kit/index-START.html alias diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..b66696d79a 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,6 +58,29 @@ diff --git a/01 - JavaScript Drum Kit/index-START.html alias b/01 - JavaScript Drum Kit/index-START.html alias new file mode 100644 index 0000000000000000000000000000000000000000..d9ea222f2a03e3c3aa317348d175b0fef24de0f7 GIT binary patch literal 992 zcmZ9LOHUI~6vyxI3K&DCK!g|*Z-k}8Tx{jxMy8!KM$@E`VhFpT9bmNWn3HKI$9@!dL#f~L>i!t#+_1XW@S6$c zM>$rG!k2zEiEpz1)N6Tb)hKwKWYrAE)Pl5RFCpD%uOXiW2`!G^88mDDzO`0yo>%5~ zlScgx#YcpoyoByUt56xLK?e}Me+X-zEurv=|08pw&;NPNpFi)<-+nXRSHE%1-(+8} zsg3Fr=oGqu1lDgt5~4NHSvtpmkKO~*{o|aGO6@L~Opn9{4jxm|d!RbKFS-vho%_xG z4P3@{Q1>6%wyn>+VpK2-kRS1+JQd@(U}*Dd1p~&T}v%I%vsr$ z6=mg%`GU3Rs)D1Ia@nHF>Gi**IneoJ|41?FWn;_{V}G?~um!x_GqE<>3mM(<_Yk3=1K4wvjop^9|hL^jkXX+T$2GKmD)rb|0BnZlU}_E)@L$((fzJz!aZ=A G`~L^l9&Jhh literal 0 HcmV?d00001 From 8260f76a4c3a8eec6eab78cedf46611ad441b105 Mon Sep 17 00:00:00 2001 From: valeriaoshiro Date: Tue, 13 Dec 2016 05:48:25 -0800 Subject: [PATCH 2/5] Complete JS + CSS Clock challenge --- 02 - JS + CSS Clock/index-START.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 2712384201..5e0f8d1ad2 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -61,12 +61,38 @@ 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 38f6f1ab392272b105d5e742b78c93a2cc371e92 Mon Sep 17 00:00:00 2001 From: valeriaoshiro Date: Wed, 14 Dec 2016 05:35:51 -0800 Subject: [PATCH 3/5] Complete Playing with CSS Variables and JS challenge --- 02 - JS + CSS Clock/index-START.html | 10 +++++++++- 03 - CSS Variables/index-START.html | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 5e0f8d1ad2..a61c661710 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -80,15 +80,23 @@ const seconds = now.getSeconds(); const secondsDegrees = ((seconds / 60) * 360) + 90; secondHand.style.transform = `rotate(${secondsDegrees}deg)`; - console.log(secondsDegrees); + if(secondsDegrees === 450){ + secondHand.style.transition = "none"; + } const mins = now.getMinutes(); const minsDegrees = ((mins / 60) * 360) + 90; minsHand.style.transform = `rotate(${minsDegrees}deg)`; + // if(minsDegrees === 450){ + // minsHand.style.transition = "none"; + // } const hour = now.getHours(); const hourDegrees = ((hour / 12) * 360) + 90; hourHand.style.transform = `rotate(${hourDegrees}deg)`; + // if(hourDegrees === 450){ + // hourHand.style.transition = "none"; + // } } diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index bf0f33e3ba..bcce9119ae 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 620dc6c9cdcd20ed1c5be4308985afffd7148593 Mon Sep 17 00:00:00 2001 From: valeriaoshiro Date: Wed, 14 Dec 2016 05:54:45 -0800 Subject: [PATCH 4/5] Style hands and fix transition --- 02 - JS + CSS Clock/index-START.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index a61c661710..8be1235436 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -80,23 +80,23 @@ const seconds = now.getSeconds(); const secondsDegrees = ((seconds / 60) * 360) + 90; secondHand.style.transform = `rotate(${secondsDegrees}deg)`; - if(secondsDegrees === 450){ + if(secondsDegrees === 90){ secondHand.style.transition = "none"; } const mins = now.getMinutes(); const minsDegrees = ((mins / 60) * 360) + 90; minsHand.style.transform = `rotate(${minsDegrees}deg)`; - // if(minsDegrees === 450){ - // minsHand.style.transition = "none"; - // } + if(minsDegrees === 90){ + minsHand.style.transition = "none"; + } const hour = now.getHours(); const hourDegrees = ((hour / 12) * 360) + 90; hourHand.style.transform = `rotate(${hourDegrees}deg)`; - // if(hourDegrees === 450){ - // hourHand.style.transition = "none"; - // } + if(hourDegrees === 90){ + hourHand.style.transition = "none"; + } } From 57cf4859940bc8f033e0c37982cd0cf0ecae161b Mon Sep 17 00:00:00 2001 From: valeriaoshiro Date: Wed, 21 Dec 2016 19:56:30 -0800 Subject: [PATCH 5/5] Complete challenge --- 04 - Array Cardio Day 1/index-START.html | 41 ++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 6e28e357d0..51def492a2 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -23,33 +23,70 @@ 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 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']; // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + var fifteenHundreds = inventors.filter(function(data){ + return data.year >= 1500 && data.year < 1600; + }); + console.table(fifteenHundreds); + // Array.prototype.map() // 2. Give us an array of the inventory first and last names + var fullNames = inventors.map(function(data){ + return data.first + ' ' + data.last; + }); + console.log(fullNames); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + var ageOrder = inventors.sort(function(a, b){ + return a.year - b.year; + }); + console.table(ageOrder); // Array.prototype.reduce() // 4. How many years did all the inventors live? + var yearsAlive = inventors.reduce(function(total, inventor){ + return total + (inventor.passed - inventor.year); + }, 0); + console.log(yearsAlive); // 5. Sort the inventors by years lived + var livedOrder = inventors.sort(function(a, b){ + return (b.passed - b.year) -(a.passed - a.year); + }); + console.table(livedOrder); // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name // https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris + // var boulevards = Array.from(document.querySelectorAll('.mw-category a')); + // var de = boulevards.map(function(data){return data.textContent}) + // .filter(function(data){return data.includes('de')}); // 7. sort Exercise // Sort the people alphabetically by last name + var alpha = people.sort(function(last, next){ + var [aLast, aFirst] = last.split(', '); + var [bLast, bFirst] = next.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' ]; - + var transportation = data.reduce(function(obj, item){ + if(!obj[item]){ + obj[item] = 0; + } + obj[item]++; + return obj; + }, {}); + console.log(transportation);