diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index.html similarity index 76% rename from 01 - JavaScript Drum Kit/index-START.html rename to 01 - JavaScript Drum Kit/index.html index 4070d32767..973da4ace0 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index.html @@ -58,6 +58,25 @@ diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index.html similarity index 59% rename from 02 - JS and CSS Clock/index-START.html rename to 02 - JS and CSS Clock/index.html index 12f721b183..87eb82b577 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index.html @@ -61,13 +61,39 @@ height: 6px; background: black; position: absolute; - top: 50%; + top: 50%; + transform-origin: 100%; + transform: rotate(90deg); + transition: all 0.1s; + transition-timing-function: cubic-bezier(0, 2.24, 0.58, 1); }
- - - -diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index.html similarity index 64% rename from 03 - CSS Variables/index-START.html rename to 03 - CSS Variables/index.html index 6b9b539c09..cbd505f2cc 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index.html @@ -21,6 +21,17 @@
diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index.html similarity index 68% rename from 04 - Array Cardio Day 1/index-START.html rename to 04 - Array Cardio Day 1/index.html index eec0ffc31d..a2897464ad 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index.html @@ -31,28 +31,59 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + const fifteen = inventors.filter(i => i.year > 1500 && i.year < 1600); + console.table(fifteen); // Array.prototype.map() // 2. Give us an array of the inventors' first and last names + const names = inventors.map(i => `${i.first} ${i.last}`); + console.log(names); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest + const bsorted = inventors.sort((a, b) => a.year > b.year ? 1 : -1); + console.table(bsorted); // Array.prototype.reduce() // 4. How many years did all the inventors live? + const totalYears = inventors.reduce((total, i) => total + (i.passed - i.year), 0); + console.log(totalYears); // 5. Sort the inventors by years lived + const lsorted = inventors.sort((a, b) => { + const aLast = a.passed - a.year; + const bLast = b.passed - b.year; + return aLast > bLast ? 1 : -1; + }); + console.table(lsorted); + // 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 links = Array.from(document.querySelector('.mw-category').querySelectorAll('a')); + // const deBoulevards = links.map(i => i.textContent).filter(name => name.indexOf('de') > 0); // 7. sort Exercise // Sort the people alphabetically by last name + const sortedPeople = people.sort((a, b) => { + const [af, al] = a.split(', '); + const [bf, bl] = b.split(', '); + return al > bl ? 1 : -1; + }); + console.log(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' ]; + const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck', 'pookie pookie' ]; + const freq = data.reduce((acc, item) => { + if (!acc[item]) { + acc[item] = 0; + } + acc[item]++; + return acc; + }, {}); + console.log(freq); diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index.html similarity index 74% rename from 05 - Flex Panel Gallery/index-START.html rename to 05 - Flex Panel Gallery/index.html index 71d1c26f00..da05c66387 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index.html @@ -26,6 +26,7 @@ .panels { min-height: 100vh; overflow: hidden; + display: flex; } .panel { @@ -43,6 +44,11 @@ font-size: 20px; background-size: cover; background-position: center; + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; } .panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); } @@ -56,8 +62,17 @@ margin: 0; width: 100%; transition: transform 0.5s; + flex: 1 0 auto; + justify-content: center; + align-items: center; + display: flex; } + .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 { text-transform: uppercase; font-family: 'Amatic SC', cursive; @@ -71,6 +86,7 @@ .panel.open { font-size: 40px; + flex: 5; } @@ -105,6 +121,21 @@ diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html deleted file mode 100644 index 109c90fb36..0000000000 --- a/06 - Type Ahead/index-START.html +++ /dev/null @@ -1,22 +0,0 @@ - - -
- -
- - -
-