diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32..bac7aeb 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -1,66 +1,77 @@ - - - JS Drum Kit - - - - - -
-
- A - clap -
-
- S - hihat -
-
- D - kick -
-
- F - openhat -
-
- G - boom -
-
- H - ride + + + JS Drum Kit + + + +
+
+ A + clap +
+
+ S + hihat +
+
+ D + kick +
+
+ F + openhat +
+
+ G + boom +
+
+ H + ride +
+
+ J + snare +
+
+ K + tom +
+
+ L + tink +
-
- J - snare -
-
- K - tom -
-
- L - tink -
-
- - - - - - - - - - - - + + + + + + + + + - + + -- knotmirror 0.0.1 From 47aa6abd171a972072a3013d074c5ba57e594aa0 Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Thu, 18 Feb 2021 21:29:18 -0500 Subject: [PATCH 02/10] 2 done --- 02 - JS and CSS Clock/index-START.html | 126 ++++++++++++++----------- 1 file changed, 71 insertions(+), 55 deletions(-) diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index-START.html index 7a6d27d..a3f2787 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index-START.html @@ -1,12 +1,10 @@ - - - JS + CSS Clock - - - - + + + JS + CSS Clock + +
@@ -15,60 +13,78 @@
+ - + - + const hour = now.getHours(); + const hourDeg = (hour / 12) * 360; + minHand.style.transform = `rotate(${hourDeg + 90}deg)`; + } + setInterval(setDate, 1000); + + -- knotmirror 0.0.1 From 564776cc947c512d6a953b701b48bb6353971ab1 Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Thu, 18 Feb 2021 21:46:12 -0500 Subject: [PATCH 03/10] 3 done --- 03 - CSS Variables/index-START.html | 115 +++++++++++++++++++--------- 1 file changed, 79 insertions(+), 36 deletions(-) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index 6b9b539..8a5edb9 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -1,51 +1,94 @@ - - - Scoped CSS Variables and JS - - -

Update CSS Variables with JS

+ + + Scoped CSS Variables and JS + + +

Update CSS Variables with JS

-
- - +
+ + - - + + - - -
+ + +
- + - - input { - width: 100px; - } - + + function handleUpdate() { + const suffix = this.dataset.sizing || ""; + document.documentElement.style.setProperty( + `--${this.name}`, + this.value + suffix + ); + } - + inputs.forEach((input) => input.addEventListener("change", handleUpdate)); + inputs.forEach((input) => + input.addEventListener("mousemove", handleUpdate) + ); + + -- knotmirror 0.0.1 From 2a10aac9018e555b92d32d4d2b0f1a4dd524b8b8 Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Thu, 18 Feb 2021 22:18:27 -0500 Subject: [PATCH 04/10] 4 done --- 04 - Array Cardio Day 1/index-START.html | 193 +++++++++++++++++------ 1 file changed, 143 insertions(+), 50 deletions(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 21bec96..59be152 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -1,65 +1,158 @@ - - - Array Cardio ๐Ÿ’ช - - -

Psst: have a look at the JavaScript Console ๐Ÿ’

- - + // 7. sort Exercise + // Sort the people alphabetically by last name + + const sortedPeople = people.sort((a, b) => (a > b ? 1 : -1)); + console.table(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((acc, str) => { + if (str in acc) { + acc[str] += 1; + } else { + acc[str] = 1; + } + return acc; + }, {}); + console.table(instances); + + -- knotmirror 0.0.1 From 00695c33100a8c02e1fd0acb771b1186d59746de Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Thu, 18 Feb 2021 22:38:47 -0500 Subject: [PATCH 05/10] 5 done --- 05 - Flex Panel Gallery/index-START.html | 243 ++++++++++++++--------- 1 file changed, 144 insertions(+), 99 deletions(-) diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index 71d1c26..6d894e5 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index-START.html @@ -1,114 +1,159 @@ - - - Flex Panels ๐Ÿ’ช - - - - + .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; + text-shadow: 0 0 4px rgba(0, 0, 0, 0.72), 0 0 14px rgba(0, 0, 0, 0.45); + font-size: 2em; + } -
-
-

Hey

-

Let's

-

Dance

-
-
-

Give

-

Take

-

Receive

-
-
-

Experience

-

It

-

Today

-
-
-

Give

-

All

-

You can

-
-
-

Life

-

In

-

Motion

-
-
- - + .panel p:nth-child(2) { + font-size: 4em; + } + .panel.open { + font-size: 40px; + flex: 5; + } + +
+
+

Hey

+

Let's

+

Dance

+
+
+

Give

+

Take

+

Receive

+
+
+

Experience

+

It

+

Today

+
+
+

Give

+

All

+

You can

+
+
+

Life

+

In

+

Motion

+
+
- + + -- knotmirror 0.0.1 From cd4f0fee26d31cae956e046f60617f1057e353b8 Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Thu, 18 Feb 2021 23:08:37 -0500 Subject: [PATCH 06/10] 6 done --- 06 - Type Ahead/index-START.html | 72 ++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 17 deletions(-) diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 109c90f..545767f 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -1,22 +1,60 @@ - - - Type Ahead ๐Ÿ‘€ - - - + + + Type Ahead ๐Ÿ‘€ + + + +
+ +
    +
  • Filter for a city
  • +
  • or a state
  • +
+
+ - + const findMatches = (wordsToMatch, cities) => + cities.filter( + (place) => + place.city.match(new RegExp(wordsToMatch, "gi")) || + place.state.match(new RegExp(wordsToMatch, "gi")) + ); + + function displayMatches() { + const matches = findMatches(this.value, cities); + suggestions.innerHTML = matches + .map((match) => { + const regex = new RegExp(this.value, "gi"); + const cityName = match.city.replace( + regex, + `${this.value}` + ); + const stateName = match.state.replace( + regex, + `${this.value}` + ); + return `
  • + ${cityName}, ${stateName} + ${match.population} +
  • `; + }) + .join(""); + } + + const searchInput = document.querySelector(".search"); + const suggestions = document.querySelector(".suggestions"); + + searchInput.addEventListener("change", displayMatches); + searchInput.addEventListener("keyup", displayMatches); + + -- knotmirror 0.0.1 From 6b472aa91b93f00cc3406dabf19d21613d9d0b09 Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Thu, 18 Feb 2021 23:16:36 -0500 Subject: [PATCH 07/10] 7 done --- 07 - Array Cardio Day 2/index-START.html | 81 ++++++++++++++---------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index 969566f..1b36a60 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -1,41 +1,56 @@ - - - Array Cardio ๐Ÿ’ช๐Ÿ’ช - - -

    Psst: have a look at the JavaScript Console ๐Ÿ’

    - - + // Array.prototype.findIndex() + // Find the comment with this ID + // delete the comment with the ID of 823423 + console.log("Table before"); + console.table(comments); + const toDelete = comments.findIndex((com) => com.id === 823423); + comments.splice(toDelete, 1); + console.log("Table after"); + console.table(comments); + + -- knotmirror 0.0.1 From 8eba659fa6e6eca71434ee04e9798fcababdb863 Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Sat, 20 Feb 2021 07:13:53 -0500 Subject: [PATCH 08/10] 8 done --- 08 - Fun with HTML5 Canvas/index-START.html | 59 ++++++++++++++++----- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 9da9b5b..cdaf2ea 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -1,19 +1,50 @@ - - - HTML5 Canvas - - - - + + + HTML5 Canvas + + + + + + + -- knotmirror 0.0.1 From 04917c2993771fc7d51afd40ced545331dcba31f Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Sat, 20 Feb 2021 07:48:24 -0500 Subject: [PATCH 09/10] 10 done --- .../index-START.html | 208 +++++++++++------- 1 file changed, 123 insertions(+), 85 deletions(-) diff --git a/10 - Hold Shift and Check Checkboxes/index-START.html b/10 - Hold Shift and Check Checkboxes/index-START.html index 4fd2936..df03a33 100644 --- a/10 - Hold Shift and Check Checkboxes/index-START.html +++ b/10 - Hold Shift and Check Checkboxes/index-START.html @@ -1,101 +1,139 @@ - - - Hold Shift to Check Multiple Checkboxes - - - - -
    -
    - -

    This is an inbox layout.

    -
    -
    - -

    Check one item

    -
    -
    - -

    Hold down your Shift key

    -
    -
    - -

    Check a lower item

    -
    -
    - -

    Everything in between should also be set to checked

    -
    -
    - -

    Try to do it without any libraries

    -
    -
    - -

    Just regular JavaScript

    +
    +
    + +

    This is an inbox layout.

    +
    +
    + +

    Check one item

    +
    +
    + +

    Hold down your Shift key

    +
    +
    + +

    Check a lower item

    +
    +
    + +

    Everything in between should also be set to checked

    +
    +
    + +

    Try to do it without any libraries

    +
    +
    + +

    Just regular JavaScript

    +
    +
    + +

    Good Luck!

    +
    +
    + +

    Don't forget to tweet your result!

    +
    -
    - -

    Good Luck!

    -
    -
    - -

    Don't forget to tweet your result!

    -
    -
    - - + + -- knotmirror 0.0.1 From d7c8434faa6822bc296c61c7c0b2872674eaf032 Mon Sep 17 00:00:00 2001 From: Tyler Lawson Date: Sun, 21 Feb 2021 19:15:05 -0500 Subject: [PATCH 10/10] save --- 17 - Sort Without Articles/index-START.html | 156 +++++++++++++------- 1 file changed, 104 insertions(+), 52 deletions(-) diff --git a/17 - Sort Without Articles/index-START.html b/17 - Sort Without Articles/index-START.html index 2b6c954..b76e1f1 100644 --- a/17 - Sort Without Articles/index-START.html +++ b/17 - Sort Without Articles/index-START.html @@ -1,55 +1,107 @@ - - - Sort Without Articles - - - - - -
      - - - - + + + Sort Without Articles + + + + +
        + + +