diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..21df6e6917 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -58,7 +58,29 @@ diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index-START.html index ee7eaefb1f..8e726d9706 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index-START.html @@ -62,13 +62,32 @@ background:black; position: absolute; top:50%; + transform-origin: 100%; + transform: rotate(90deg); + transition: all 0.05; + transition-timing-function: cubic-bezier(0.2, 3.0, 0.5, 1); } diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index ca2b59d077..c8e585d620 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -15,7 +15,7 @@

Update CSS Variables with JS

- + @@ -25,6 +25,21 @@

Update CSS Variables with JS

/* misc styles, nothing to do with CSS variables */ + :root { + --base: #00ffff; + --spacing: 10px; + --blur: 10px; + } + + img { + padding: var(--spacing); + background: var(--base); + filter: blur(var(--blur)); + } + + .hl { + color: var(--base); + } body { text-align: center; @@ -48,6 +63,20 @@

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..2c16533931 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -31,17 +31,27 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + const pastInventors = inventors.filter(inventor => inventor.year >= 1500 && inventor.year < 1600); + console.table(pastInventors); // Array.prototype.map() // 2. Give us an array of the inventors' first and last names + const fullNames = inventors.map(inventor => `${inventor.first} ${inventor.last}`) + console.log(fullNames); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + const inventorsByBirth = inventors.sort((first, second) => first.year - second.year) + console.table(inventorsByBirth); // Array.prototype.reduce() // 4. How many years did all the inventors live? + const totalYears = inventors.reduce((sum, inventor) => sum + (inventor.passed - inventor.year), 0) + console.log(totalYears); // 5. Sort the inventors by years lived + const inventorsByAge = inventors.sort((first, second) => (first.passed - first.year) - (second.passed - second.year)) + console.table(inventorsByAge); // 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 +59,22 @@ // 7. sort Exercise // Sort the people alphabetically by last name + const peopleByName = people.sort((first, second) => (first.split(", ")[0] > second.split(", ")[0]) ? 1 : -1) + console.log(peopleByName); // 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 cars = data.reduce((obj, item) => { + if(!obj[item]) { + obj[item] = 0; + } + obj[item]++; + return obj; + }, {}); + console.log(cars); +