diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..be02574d6d 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -59,6 +59,29 @@ diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index-START.html index 7cbf5f6ba6..e71e48ef50 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index-START.html @@ -62,12 +62,38 @@ background: black; position: absolute; top: 50%; - } + transform-origin: 100%; + transform: rotate(90deg); + transition: all 0.05s; + transition-timing-function: cubic-bezier(0.15, 2.39, 0.71, 2.21); + + } - diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index 6b9b539c09..97c3157795 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -21,6 +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 eec0ffc31d..5f3f4f5ca1 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -31,29 +31,55 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + const fiftys = inventors.filter((inventor) => inventor.year < 1600 && inventor.year > 1499); + console.log(fiftys); // 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 sorted1 = inventors.sort((a, b) => a.year > b.year ? 1 : -1 ); + console.table(sorted1); // Array.prototype.reduce() // 4. How many years did all the inventors live? + const yearsLived = inventors.reduce((acc, cur) =>{ + return acc + cur.passed - cur.year; + },0); + console.log(yearsLived); // 5. Sort the inventors by years lived - + const sorted2 = inventors.sort((a, b) => (a.passed - a.year) > (b.passed - b.year) ? 1 : -1); + console.log(sorted2); + // 6. create a list of Boulevards in Paris that contain 'de' anywhere in the name // https://en.wikipedia.org/wiki/Category:Boulevards_in_Paris - + // 7. sort Exercise // Sort the people alphabetically by last name + const sortedByLastName = people.sort((a, b) => { + return a > b ? 1 : -1; + }); + + console.table(sortedByLastName); // 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, current) => { + if(!obj[current]){ + obj[current] = 0; + } + obj[current]++; + return obj; + },{}); + + console.log(transportation); diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index 71d1c26f00..b8606534d8 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index-START.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; + justify-content: center; + align-items: center; + flex-flow: column; } .panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); } @@ -51,11 +57,14 @@ .panel4 { background-image:url(https://source.unsplash.com/ITjiVXcwVng/1500x1500); } .panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); } - /* Flex Children */ + /* Flex Items */ .panel > * { margin: 0; width: 100%; transition: transform 0.5s; + border: 1px solid gold; + flex: 1 0 auto; + display: flex; } .panel p { @@ -63,6 +72,24 @@ font-family: 'Amatic SC', cursive; text-shadow: 0 0 4px rgba(0, 0, 0, 0.72), 0 0 14px rgba(0, 0, 0, 0.45); font-size: 2em; + 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:nth-child(2) { @@ -70,6 +97,7 @@ } .panel.open { + flex: 5; font-size: 40px; } @@ -105,6 +133,21 @@ diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 109c90fb36..fc67da70c5 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -17,6 +17,42 @@ diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index 969566ff78..e26ad72fcc 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -26,16 +26,35 @@ // Some and Every Checks // Array.prototype.some() // is at least one person 19 or older? + const anyOver19 = people.some((person) => { + return new Date().getFullYear() - person.year >= 19; + }); + console.log(anyOver19); + // Array.prototype.every() // is everyone 19 or older? + const allOver19 = people.every((person) => { + return new Date().getFullYear() - person.year >= 19; + }); + console.log(allOver19); // 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 theComment = comments.find(comment =>{ + return comment.id === 823423; + }); + console.log(theComment); // Array.prototype.findIndex() // Find the comment with this ID // delete the comment with the ID of 823423 + const foundIndex = comments.findIndex(comment =>{ + return comment.id === 823423; + }); + comments.splice(foundIndex, 1); + console.log(comments); + diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 9da9b5b3c5..985a8458ef 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -7,6 +7,35 @@ - - + body { + margin: 0; + } + + *, + *:before, + *:after { + box-sizing: inherit; + } + + h1 { + margin-top: 0; + } + + .site-wrap { + max-width: 700px; + margin: 100px auto; + background: white; + padding: 40px; + text-align: justify; + } + + .align-left { + float: left; + margin-right: 20px; + } + + .align-right { + float: right; + margin-left: 20px; + } + + .slide-in { + opacity: 0; + transition: all 0.5s; + } + + .align-left.slide-in { + transform: translateX(-30%) scale(0.95); + } + + .align-right.slide-in { + transform: translateX(30%) scale(0.95); + } + + .slide-in.active { + opacity: 1; + transform: translateX(0%) scale(1); + } + +