diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..a8f120cbd4 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -9,56 +9,79 @@
-
+
A clap
-
+
S hihat
-
+
D kick
-
+
F openhat
-
+
G boom
-
+
H ride
-
+
J snare
-
+
K tom
-
+
L tink
- - - - - - - - - + + + + + + + + + diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 2712384201..56000c60aa 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -59,14 +59,61 @@ width:50%; height:6px; background:black; + border-radius:10px; position: absolute; top:50%; + transform-origin: 100%; + transform: rotate(90deg); + transition: all 0.05s; + transition-timing-function: cubic-bezier(0, 1.5, 0.42, 1.36); + } + .hand.hour-hand { + width:30%; + left:20%; + height:12px; + } + .hand.min-hand { + height:9px; } diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index 7171607a8b..1e5be487b4 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -9,10 +9,10 @@

Update CSS Variables with JS

- + - + @@ -21,6 +21,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 927fb03540..639e40d613 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -32,28 +32,76 @@ // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + console.log(inventors.filter(function(v) { + return v.year > 1499 && v.year < 1600; + })); // Array.prototype.map() // 2. Give us an array of the inventors' first and last names + console.log( + inventors.map(function(v){ + return `${v.first} ${v.last}`; + }) + ); + + //Age of each inventor + console.table( + inventors.map(function(v){ + v.age = v.passed-v.year; + return v; + }) + ); // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest - + var sorted = inventors.sort((a,b) => a.year - b.year); + console.table(sorted); + // Array.prototype.reduce() // 4. How many years did all the inventors live? + var totalAges = inventors.reduce(function(a,b){ + a += b.passed-b.year; + return a; + }, 0) + console.log(totalAges); // 5. Sort the inventors by years lived + sorted = inventors.sort((a,b) => (a.age - b.age)); + console.table(sorted); // 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 wholeList = document.querySelector('.mw-category'); + // const links = [...wholeList.querySelectorAll('a')]; + // // const links = Array.from(wholeList.querySelectorAll('a')); + // const deStreets = links + // .map(item => item.textContent) + // .filter(item => item.includes('de')); + // console.log(deStreets); // 7. sort Exercise // Sort the people alphabetically by last name + const sortedPeople = people.sort(function(current, next){ + //if sort returns a negative, then current will be before next + //if it returns a positive, then next will be before current + //if zero, then they won't move relative to each other + var thisLast = current.split(', ')[0]; + var nextLast = next.split(', ')[0]; + return thisLast < nextLast ? -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 instances = data.reduce(function(allVehicles, currentVehicle){ + if (!(currentVehicle in allVehicles)) { + allVehicles[currentVehicle] = 0; //initialize that property + } + allVehicles[currentVehicle]++; + return allVehicles; + },{}); + console.log(instances); diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index e1d643ad5c..98bdd8a8f6 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index-START.html @@ -24,9 +24,11 @@ .panels { min-height:100vh; overflow: hidden; + display: flex; } .panel { + flex: 1; background:#6B0F9C; box-shadow:inset 0 0 0 5px rgba(255,255,255,0.1); color:white; @@ -41,6 +43,10 @@ font-size: 20px; background-size:cover; background-position:center; + justify-content: center; + align-items: center; + display: flex; + flex-direction: column; } @@ -50,12 +56,29 @@ .panel4 { background-image:url(https://source.unsplash.com/ITjiVXcwVng/1500x1500); } .panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); } +/* Flex Children */ .panel > * { 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 { text-transform: uppercase; font-family: 'Amatic SC', cursive; @@ -68,6 +91,7 @@ .panel.open { font-size:40px; + flex: 5; } .cta { @@ -107,7 +131,26 @@
diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 1436886918..773c7f7a6c 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -17,6 +17,45 @@ diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index b80ab6b650..f30faa9180 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -2,7 +2,7 @@ - Document + ArrayCardio pt 2 diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 37c148df07..06069caaf9 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -7,6 +7,46 @@