diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..be2282c893 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,7 +58,31 @@ diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index-START.html index ee7eaefb1f..eb854f0835 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index-START.html @@ -62,12 +62,35 @@ background:black; position: absolute; top:50%; + transform-origin:100%; + transition-timing-function: cubic-bezier(.21, 1.84, .56, 1.06); + transition: all .5s; + transform:rotate(90deg); } diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index ca2b59d077..2b9c30381a 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -22,7 +22,22 @@

Update CSS Variables with JS

diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index eec0ffc31d..4c7f831444 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -31,17 +31,38 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + console.table( inventors.filter(person => person.year >= 1500 && person.year < 1600) ); // Array.prototype.map() // 2. Give us an array of the inventors' first and last names + console.log(inventors.map(inventor => `${inventor.first} ${inventor.last}`)); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + const ordered = inventors.sort( (a,b) => { + if(a.year > b.year) { + return 1; + } else { + return -1; + } + }); + + console.table(ordered); // Array.prototype.reduce() // 4. How many years did all the inventors live? + const totalYearsLived = inventors + .map(inventor => inventor.passed-inventor.year) + .reduce( (accum, current) => accum + current, 0); + + console.log(totalYearsLived); // 5. Sort the inventors by years lived + console.table( + inventors + .map(inventor => ({name: inventor.first + ' ' + inventor.last, age: inventor.passed-inventor.year}) ) + .sort( (a,b) => a.age > b.age ? 1 : -1) + ); // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name // https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris @@ -49,11 +70,27 @@ // 7. sort Exercise // Sort the people alphabetically by last name + const sortedPeople = people.map( person => { + return { + first: person.split(', ')[0], + last: person.split(', ')[1] + } + }).sort( (a,b) => a.last > b.last ? 1 : -1 ); + console.table(sortedPeople); + // 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' ]; + dataCounts = data.reduce( (counts, next) => { + counts[next] = counts[next] || 0; + counts[next]++; + return counts; + }, {} ); + + console.log(dataCounts); + diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index 31c9167e16..fd33bdd563 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index-START.html @@ -24,6 +24,8 @@ .panels { min-height:100vh; overflow: hidden; + display:flex; + flex-direction: row; } .panel { @@ -41,6 +43,10 @@ font-size: 20px; background-size:cover; background-position:center; + justify-content: center; + flex-direction: column; + flex:1; + display:flex; } @@ -54,6 +60,24 @@ margin:0; width: 100%; transition:transform 0.5s; + border: 1px solid red; + display:flex; + flex: 1 0 auto; + 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 { @@ -68,6 +92,7 @@ .panel.open { font-size:40px; + flex:5; } @@ -102,7 +127,20 @@ diff --git a/06 - Type Ahead/.directory b/06 - Type Ahead/.directory new file mode 100644 index 0000000000..2dde53d454 --- /dev/null +++ b/06 - Type Ahead/.directory @@ -0,0 +1,5 @@ +[Dolphin] +SortOrder=1 +Timestamp=2017,3,20,18,35,52 +Version=3 +ViewMode=1 diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 1436886918..f6aa3e1cb4 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -16,6 +16,42 @@