diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..f4fc206d27 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -59,6 +59,25 @@ diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 240705d8fe..0e6cd7f249 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -61,13 +61,37 @@ background:black; position: absolute; top:50%; + transform-origin: 100%; + transform: rotate(90deg); + transition: all 0.05s; + transition-timing-function: cubic-bezier(0.82,-0.82, 0, 3.13); } diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index bf0f33e3ba..4cc870e736 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -21,7 +21,21 @@

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 6e28e357d0..ae269854f9 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -27,29 +27,62 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + console.table(inventors.filter(inventor => inventor.year > 1500 && inventor.year < 1600)); // Array.prototype.map() // 2. Give us an array of the inventory first and last names + console.log(inventors.map(({first, last}) => `${first} ${last}`)); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + console.table(inventors.sort((x, y) => x.year > y.year ? 1 : -1)); // Array.prototype.reduce() // 4. How many years did all the inventors live? + console.log(inventors.reduce(((acc, {year, passed}) => acc += (passed - year)), 0)); // 5. Sort the inventors by years lived + console.table(inventors.sort((a,b) => { + const yearsA = a.passed - a.year; + const yearsB = b.passed - b.year; + return yearsA > yearsB ? -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 + // const category = document.querySelector('.mw-category'); + // // const links = [...category.querySelectorAll('a')]; + // const links = Array.from(category.querySelectorAll('a')); + // const de = links + // .map((link) => link.textContent) + // // .filter((text) => text.match(/de/)); + // .filter((text) => text.includes('de')); + // console.log(de); // 7. sort Exercise // Sort the people alphabetically by last name + const alpha = people.sort((a, b) => { + const [aLast, aFirst] = a.split(', '); + const [bLast, bFirst] = b.split(', '); + return aLast > bLast ? 1 : -1; + }); + console.log(alpha); + // this doesn't return the whole name: + // const lastNames = people.map((name) => name.split(',')[0]); + // console.log(lastNames.sort()); // 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 dataSum = data.reduce((acc, item) => { + if (!acc[item]) { + acc[item] = 0; + } + acc[item]++; + return acc; + }, {}); + console.log(dataSum); diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index e1d643ad5c..8413a072fc 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,23 @@ 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 { @@ -68,6 +91,7 @@ .panel.open { font-size:40px; + flex: 5; } .cta { @@ -107,7 +131,20 @@ diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 1436886918..49e3e3a907 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -17,6 +17,46 @@ diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 37c148df07..4e41a77018 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -7,6 +7,56 @@