From a2f9026aca896ebda3790836473c87b4e815e05f Mon Sep 17 00:00:00 2001 From: syrene <144994323+shb1383@users.noreply.github.com> Date: Thu, 16 May 2024 16:56:42 +0900 Subject: [PATCH 01/15] added funtionality and styling to drumkit --- 01 - JavaScript Drum Kit/index-START.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 8a2f8e8417..7dd9d9cb6a 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -59,7 +59,24 @@ From 1f987092afb0eee13b9d45ecf860524b1408a030 Mon Sep 17 00:00:00 2001 From: syrene <144994323+shb1383@users.noreply.github.com> Date: Thu, 16 May 2024 17:08:31 +0900 Subject: [PATCH 02/15] added functionality and styling to clock hands --- 02 - JS and CSS Clock/index-START.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index-START.html index 55ab1a5331..8e22abba6f 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index-START.html @@ -63,13 +63,35 @@ background: black; position: absolute; top: 50%; + transform-origin: 100%; + transform: rotate(90deg); + transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1); } From 9ba8afe6e40ffd5d7b2b936a184ced4992e0e85b Mon Sep 17 00:00:00 2001 From: syrene <144994323+shb1383@users.noreply.github.com> Date: Mon, 20 May 2024 21:34:58 +0900 Subject: [PATCH 03/15] created handle documents and function to update its properties --- 03 - CSS Variables/index-START.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index d5fcc3a2ae..5bac9ecef7 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -22,7 +22,21 @@

Update CSS Variables with JS

From 9e61433d5f746e91925082920db79a3eaefefa17 Mon Sep 17 00:00:00 2001 From: syrene <144994323+shb1383@users.noreply.github.com> Date: Tue, 21 May 2024 21:43:49 +0900 Subject: [PATCH 04/15] created various methods to sort given data --- 04 - Array Cardio Day 1/index-START.html | 52 +++++++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 0dcfd00f40..6ff531f3d9 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -35,32 +35,80 @@ 'Berne, Eric', 'Berra, Yogi', 'Berry, Wendell', 'Bevan, Aneurin', 'Ben-Gurion, David', 'Bevel, Ken', 'Biden, Joseph', 'Bennington, Chester', 'Bierce, Ambrose', 'Billings, Josh', 'Birrell, Augustine', 'Blair, Tony', 'Beecher, Henry', 'Biondo, Frank' ]; - + // Array.prototype.filter() // 1. Filter the list of inventors for those who were born in the 1500's + const fifteen = inventors.filter(inventor => (inventor.year >= 1500 && inventor.year < 1600)) + + console.table(fifteen); // 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 ordered = inventors.sort(function(a, b) { + // if(a.year > b.year) { + // return 1; + // } else { + // return -1; + // } + // }); + + const ordered = inventors.sort((a, b) => a.year > b.year ? 1 : -1); // Array.prototype.reduce() + + console.table(ordered); - // Array.prototype.reduce() // 4. How many years did all the inventors live all together? + const totalYears = inventors.reduce((total, inventor) => { + return total + (inventor.passed - inventor.year); + }, 0); + + console.log(totalYears); // 5. Sort the inventors by years lived + const oldest = inventors.sort(function(a, b) { + const lastGuy = a.passed - a.year; + const nextGuy = b.passed - b.year; + return lastGuy > nextGuy ? -1 : 1; + }); + console.table(oldest) // 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 = Array.from(document.querySelectorAll('a')); + const de = links + .map(link => link.textContent) + .filter(streetName => streetName.includes('de')); + // 7. sort Exercise // Sort the people alphabetically by last name + const alpha = people.sort(function(lastOne, nextOne) { + const [aLast, aFirst] = lastOne.split(', '); + const [bLast, bFirst] = nextOne.split(', '); + return aLast > bLast ? 1 : -1; + }); + console.log(alpha); // 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(function(obj, item) { + if(!obj[item]) { + obj[item] = 0; + } + obj[item]++; + return obj; + }, {}); + + console.log(transportation); + From a38312308260501750107cd31907f8484d15b553 Mon Sep 17 00:00:00 2001 From: syrene <144994323+shb1383@users.noreply.github.com> Date: Wed, 22 May 2024 21:19:06 +0900 Subject: [PATCH 05/15] added styling and toggle functions to panels --- 05 - Flex Panel Gallery/index-START.html | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index 88a4f1d1e2..db9d26958c 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index-START.html @@ -27,6 +27,7 @@ .panels { min-height: 100vh; overflow: hidden; + display: flex; } .panel { @@ -44,6 +45,11 @@ font-size: 20px; background-size: cover; background-position: center; + flex: 1; + justify-content: center; + align-items: center; + display: flex; + flex-direction: column; } .panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); } @@ -57,8 +63,17 @@ 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; @@ -71,6 +86,7 @@ } .panel.open { + flex: 5; font-size: 40px; } @@ -106,7 +122,20 @@ From 314b55fd980c7e4d38c86d3de6842e718e64aea6 Mon Sep 17 00:00:00 2001 From: syrene <144994323+shb1383@users.noreply.github.com> Date: Fri, 24 May 2024 15:42:23 +0900 Subject: [PATCH 06/15] created fetch and functions to retieve data and display results for search input --- 06 - Type Ahead/index-START.html | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 5a9aa7e4e8..942010c63a 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -18,6 +18,47 @@ From 3aa1f51d6d9a6f25dfbec93ccab6cd665070e4d1 Mon Sep 17 00:00:00 2001 From: syrene <144994323+shb1383@users.noreply.github.com> Date: Fri, 24 May 2024 16:07:50 +0900 Subject: [PATCH 07/15] created code using various array methods to complete tasks --- 07 - Array Cardio Day 2/index-START.html | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index 4ca34c7536..0268c4520b 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -27,16 +27,40 @@ // Some and Every Checks // Array.prototype.some() // is at least one person 19 or older? + + const isAdult = people.some(person => ((new Date()). + getFullYear()) - person.year >= 19); + + console.log({isAdult}); + // Array.prototype.every() // is everyone 19 or older? - // Array.prototype.find() + const allAdults = people.every(person => ((new Date()). + getFullYear()) - person.year >= 19); + + console.log({allAdults}); + + // 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 comment = comments.find(comment => comment.id === 823423); + + console.log(comment); + // Array.prototype.findIndex() // Find the comment with this ID // delete the comment with the ID of 823423 + const index = comments.findIndex(comment => comment.id === 823423); + + console.log(index); + + const newComments = [ + ...comments.slice(0, index), + ...comments.slice(index + 1) + ]; + From fc562b05369eb637d55a16b8f1a846def276ab01 Mon Sep 17 00:00:00 2001 From: syrene <144994323+shb1383@users.noreply.github.com> Date: Sun, 26 May 2024 22:43:49 +0900 Subject: [PATCH 08/15] created and styled drawing function on canvas --- 08 - Fun with HTML5 Canvas/index-START.html | 51 +++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index f70ad2059b..e0b97db3ca 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -8,6 +8,57 @@