From c14db380b22a1b4f7113c0eec8bcf67890adbc85 Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Tue, 20 Dec 2016 16:29:38 -0500 Subject: [PATCH 01/11] hook up drum kit --- 01 - JavaScript Drum Kit/index-START.html | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..ff4b449b3a 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,6 +58,30 @@ From 2acab3206a4f9415d6935a59a84ff42e9e53a618 Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Wed, 21 Dec 2016 09:24:26 -0500 Subject: [PATCH 02/11] first commit --- 02 - JS + CSS Clock/index-START.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 2712384201..8d554e0bfa 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -61,11 +61,26 @@ background:black; position: absolute; top:50%; + transform-origin: 100%; + transform: rotate(90deg); + transition: all 0.0 5s; + transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1); } From c26e0a3e76431e9cfe8f420f3a8dd0b83d2bf537 Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Thu, 22 Dec 2016 08:59:21 -0500 Subject: [PATCH 03/11] clock commit --- 02 - JS + CSS Clock/index-START.html | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 8d554e0bfa..669f7e8e9d 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -73,11 +73,22 @@ function setDate() { const now = new Date(); - const seconds = now.getSeconds(); - const secondsDegrees = (seconds / 60) * 360 - console.log(secondsDegrees); + // second hand + const seconds = now.getSeconds(); + const secondsDegrees = (seconds / 60) * 360; document.querySelector('.second-hand').style.transform = `rotate(${secondsDegrees + 90}deg)`; + + // minute hand + const minutes = now.getMinutes(); + const minutesDegrees = (minutes / 60) * 360; + document.querySelector('.min-hand').style.transform = `rotate(${minutesDegrees + 90}deg)`; + + // hour hand + const hours = now.getHours(); + const hourDegrees = (hours / 12) * 360; + document.querySelector('.hour-hand').style.transform = `rotate(${hourDegrees + 90}deg)`; + } setInterval(setDate, 1000); From 634481075130a2428ef84961160fa125f0133af3 Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Fri, 23 Dec 2016 14:48:01 -0500 Subject: [PATCH 04/11] css variables --- 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 7171607a8b..e0064769af 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -22,6 +22,23 @@

Update CSS Variables with JS

From 111db5619d9567fc39f0e55bb9676454cb400035 Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Tue, 27 Dec 2016 17:10:00 -0500 Subject: [PATCH 05/11] array cardio day 1 --- 04 - Array Cardio Day 1/index-START.html | 55 +++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 317883a4c1..6130faf69c 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -31,28 +31,81 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + const fifteen = inventors.filter(inventor => { + return 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 => { + return `${inventor.first} ${inventor.last}`; + }); + // console.log(fullNames); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + const birthDate = inventors.sort(function(a, b) { + if (a.year > b.year) { + return 1; + } + + if (a.year < b.year) { + return -1; + } + + // a must be equal to b + return 0; + }); + // console.table(birthDate); // 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 thisGuy = b.passed - b.year; + return lastGuy > thisGuy ? -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(street => street.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]++ + return obj; + }, {}); + console.log(transportation); From f32b89f003bf560ec6b2a9e204a3f38fef47c4b9 Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Mon, 2 Jan 2017 16:07:20 -0500 Subject: [PATCH 06/11] flex panel gallery --- 05 - Flex Panel Gallery/index-START.html | 43 ++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index e1d643ad5c..24f6555661 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,6 +60,26 @@ 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 > *:last-child { + transform: translateY(100%); + } + + .panel.open-active > *:first-child { + transform: translateY(0); + } + + .panel.open-active > *:last-child { + transform: translateY(0); } .panel p { @@ -67,6 +93,7 @@ } .panel.open { + flex: 5; font-size:40px; } @@ -107,6 +134,22 @@ From 38b0a1d0d419671c203e1325cad2211d88a154bb Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Tue, 3 Jan 2017 10:26:09 -0500 Subject: [PATCH 07/11] city state search call --- 06 - Type Ahead/index-START.html | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 1436886918..79667cf730 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -17,6 +17,47 @@ From 3dd4417d61d9fc7f20b4a0bd5c1acc61a4fec17d Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Thu, 19 Jan 2017 15:13:30 -0500 Subject: [PATCH 08/11] array cardio day 2 --- 07 - Array Cardio Day 2/index-START.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index 969566ff78..7859e57ba0 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -26,15 +26,33 @@ // Some and Every Checks // Array.prototype.some() // is at least one person 19 or older? + const isAdult = people.some(function(person) { + const currentYear = (new Date()).getFullYear(); + return currentYear - person.year >= 19; + }); + // Array.prototype.every() // is everyone 19 or older? + const allAdults = people.every(function(person) { + const currentYear = (new Date()).getFullYear(); + return currentYear - person.year >= 19; + }); + + console.log({isAdult, allAdults}); // 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 indexOfComment = comments.findIndex(comment => comment.id === 823423); + comments.splice(indexOfComment, 1); + + console.log(comments); From 00671777140707d4b49502723defc4189a3b94f1 Mon Sep 17 00:00:00 2001 From: Elise Kain Date: Thu, 19 Jan 2017 16:41:55 -0500 Subject: [PATCH 09/11] HTML5 canvas --- 08 - Fun with HTML5 Canvas/index-START.html | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 37c148df07..df2a015d71 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -7,6 +7,47 @@