From ca005be7cc0e254351a0d391e1cc119b507aa295 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Sat, 10 Dec 2016 13:51:23 -0700 Subject: [PATCH 01/13] Finish JavaScript Drum Kit exercise --- 01 - JavaScript Drum Kit/index-FINISHED.html | 83 -------------------- 01 - JavaScript Drum Kit/index-START.html | 66 ---------------- 01 - JavaScript Drum Kit/index.html | 25 +++--- 3 files changed, 13 insertions(+), 161 deletions(-) delete mode 100644 01 - JavaScript Drum Kit/index-FINISHED.html delete mode 100644 01 - JavaScript Drum Kit/index-START.html diff --git a/01 - JavaScript Drum Kit/index-FINISHED.html b/01 - JavaScript Drum Kit/index-FINISHED.html deleted file mode 100644 index 1a16d0997c..0000000000 --- a/01 - JavaScript Drum Kit/index-FINISHED.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - JS Drum Kit - - - - - -
-
- A - clap -
-
- S - hihat -
-
- D - kick -
-
- F - openhat -
-
- G - boom -
-
- H - ride -
-
- J - snare -
-
- K - tom -
-
- L - tink -
-
- - - - - - - - - - - - - - - - diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html deleted file mode 100644 index 4070d32767..0000000000 --- a/01 - JavaScript Drum Kit/index-START.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - JS Drum Kit - - - - - -
-
- A - clap -
-
- S - hihat -
-
- D - kick -
-
- F - openhat -
-
- G - boom -
-
- H - ride -
-
- J - snare -
-
- K - tom -
-
- L - tink -
-
- - - - - - - - - - - - - - - - diff --git a/01 - JavaScript Drum Kit/index.html b/01 - JavaScript Drum Kit/index.html index 246639f990..de3e00cb3f 100644 --- a/01 - JavaScript Drum Kit/index.html +++ b/01 - JavaScript Drum Kit/index.html @@ -59,25 +59,26 @@ + From 53f9150db89d5856c022fe0938e69ffe984f256b Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Sun, 11 Dec 2016 16:31:14 -0700 Subject: [PATCH 02/13] Finish CSS clock --- 02 - JS + CSS Clock/index-FINISHED.html | 98 ------------------------- 02 - JS + CSS Clock/index-START.html | 73 ------------------ 02 - JS + CSS Clock/index.html | 38 +++++----- 3 files changed, 20 insertions(+), 189 deletions(-) delete mode 100644 02 - JS + CSS Clock/index-FINISHED.html delete mode 100644 02 - JS + CSS Clock/index-START.html diff --git a/02 - JS + CSS Clock/index-FINISHED.html b/02 - JS + CSS Clock/index-FINISHED.html deleted file mode 100644 index d4cb3b56a8..0000000000 --- a/02 - JS + CSS Clock/index-FINISHED.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - JS + CSS Clock - - - - -
-
-
-
-
-
-
- - - - - - - diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html deleted file mode 100644 index 2712384201..0000000000 --- a/02 - JS + CSS Clock/index-START.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - JS + CSS Clock - - - - -
-
-
-
-
-
-
- - - - - - - diff --git a/02 - JS + CSS Clock/index.html b/02 - JS + CSS Clock/index.html index 1c777557da..d964d6cf30 100644 --- a/02 - JS + CSS Clock/index.html +++ b/02 - JS + CSS Clock/index.html @@ -64,33 +64,35 @@ transform-origin: 100%; transform: rotate(90deg); transition: all 0.05s; - transition-timing-function: cubic-bezier(0.1, 2.7, 0.58, 1); + transition-timing-function: cubic-bezier(0.1, 2,7, 0.5, 1) } - - + From 75c47e8e8ee3406cd49d6bf0e2dab6bc41ed3f72 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Mon, 12 Dec 2016 11:54:54 -0700 Subject: [PATCH 03/13] CSS variable challenge --- 03 - CSS Variables/index-START.html | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index bf0f33e3ba..1ac3879907 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -21,10 +21,21 @@

Update CSS Variables with JS

From 83c0211722fe8bc43971a2d4d05bfa3e8420f997 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Tue, 13 Dec 2016 17:25:00 -0700 Subject: [PATCH 04/13] Finish array cardio challenge --- 04 - Array Cardio Day 1/index-START.html | 55 ----------------- .../{index-FINISHED.html => index.html} | 60 ++++++++----------- 2 files changed, 25 insertions(+), 90 deletions(-) delete mode 100644 04 - Array Cardio Day 1/index-START.html rename 04 - Array Cardio Day 1/{index-FINISHED.html => index.html} (68%) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html deleted file mode 100644 index 6e28e357d0..0000000000 --- a/04 - Array Cardio Day 1/index-START.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Array Cardio đź’Ş - - - - - diff --git a/04 - Array Cardio Day 1/index-FINISHED.html b/04 - Array Cardio Day 1/index.html similarity index 68% rename from 04 - Array Cardio Day 1/index-FINISHED.html rename to 04 - Array Cardio Day 1/index.html index f68d8c3545..64698d43c8 100644 --- a/04 - Array Cardio Day 1/index-FINISHED.html +++ b/04 - Array Cardio Day 1/index.html @@ -18,83 +18,73 @@ { first: 'Marie', last: 'Curie', year: 1867, passed: 1934 }, { first: 'Johannes', last: 'Kepler', year: 1571, passed: 1630 }, { first: 'Nicolaus', last: 'Copernicus', year: 1473, passed: 1543 }, - { first: 'Max', last: 'Planck', year: 1858, passed: 1947 }, + { first: 'Max', last: 'Planck', year: 1858, passed: 1947 } ]; + const flavours = ['Chocolate Chip', 'Kulfi', 'Caramel Praline', 'Chocolate', 'Burnt Caramel', 'Pistachio', 'Rose', 'Sweet Coconut', 'Lemon Cookie', 'Toffeeness', 'Toasted Almond', 'Black Raspberry Crunch', 'Chocolate Brownies', 'Pistachio Almond', 'Strawberry', 'Lavender Honey', 'Lychee', 'Peach', 'Black Walnut', 'Birthday Cake', 'Mexican Chocolate', 'Mocha Almond Fudge', 'Raspberry']; + const people = ['Beck, Glenn', 'Becker, Carl', 'Beckett, Samuel', 'Beddoes, Mick', 'Beecher, Henry', 'Beethoven, Ludwig', 'Begin, Menachem', 'Belloc, Hilaire', 'Bellow, Saul', 'Benchley, Robert', 'Benenson, Peter', 'Ben-Gurion, David', 'Benjamin, Walter', 'Benn, Tony', 'Bennington, Chester', 'Benson, Leana', 'Bent, Silas', 'Bentsen, Lloyd', 'Berger, Ric', 'Bergman, Ingmar', 'Berio, Luciano', 'Berle, Milton', 'Berlin, Irving', 'Berne, Eric', 'Bernhard, Sandra', 'Berra, Yogi', 'Berry, Halle', 'Berry, Wendell', 'Bethea, Erin', 'Bevan, Aneurin', 'Bevel, Ken', 'Biden, Joseph', 'Bierce, Ambrose', 'Biko, Steve', 'Billings, Josh', 'Biondo, Frank', 'Birrell, Augustine', 'Black Elk', 'Blair, Robert', 'Blair, Tony', 'Blake, William']; // 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 inventor first and last names - const fullNames = inventors.map(inventor => `${inventor.first} ${inventor.last}`); + // 2. Give us an array of the inventory first and last names + const fullNames = inventors.map(inventor => { + return `${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); + const ordered = inventors.sort((a, b) => a.year > b.year ? 1 : -1) console.table(ordered); // Array.prototype.reduce() // 4. How many years did all the inventors live? const totalYears = inventors.reduce((total, inventor) => { - return total + (inventor.passed - inventor.year); + 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 oldest = inventors.sort((a, b) => { const lastGuy = a.passed - a.year; const nextGuy = b.passed - b.year; - return lastGuy > nextGuy ? -1 : 1; + lastGuy > nextGuy ? -1 : 1; }); - console.table(oldest); + 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(category.querySelectorAll('a')); + // const category = document.querySelector(".mw-category"); + // const links = Array.from(category.querySelectorAll("a")); // const de = links - // .map(link => link.textContent) - // .filter(streetName => streetName.includes('de')); + // .map(link => link.textContent) + // .filter(streetName => streetName.includes('de')); + // 7. sort Exercise // Sort the people alphabetically by last name const alpha = people.sort((lastOne, nextOne) => { - const [aLast, aFirst] = lastOne.split(', '); - const [bLast, bFirst] = nextOne.split(', '); - return aLast > bLast ? 1 : -1; + const [aLast, aFirst] = lastOne.split(", "); + const [bLast, bFirst] = nextOne.split(", "); + 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', 'pogostick']; - - const transportation = data.reduce(function(obj, item) { - if (!obj[item]) { + const data = ['car', 'car', 'truck', 'truck', 'bike', 'walk', 'car', 'van', 'bike', 'walk', 'car', 'van', 'car', 'truck' ]; + const transporation = data.reduce(function(obj, item) { + if(!obj[item]) { obj[item] = 0; } obj[item]++; return obj; - }, {}); - - console.log(transportation); + }, {}) + console.log(transporation) From 03d62efb0e89b64107b3f09a1f755cc4482e61c3 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Wed, 14 Dec 2016 17:39:24 -0700 Subject: [PATCH 05/13] Finish flex panel challenge --- 05 - Flex Panel Gallery/index-START.html | 116 ------------------ .../{index-FINISHED.html => index.html} | 29 ++--- 2 files changed, 15 insertions(+), 130 deletions(-) delete mode 100644 05 - Flex Panel Gallery/index-START.html rename 05 - Flex Panel Gallery/{index-FINISHED.html => index.html} (87%) diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html deleted file mode 100644 index e1d643ad5c..0000000000 --- a/05 - Flex Panel Gallery/index-START.html +++ /dev/null @@ -1,116 +0,0 @@ - - - - - Flex Panels đź’Ş - - - - - - -
-
-

Hey

-

Let's

-

Dance

-
-
-

Give

-

Take

-

Receive

-
-
-

Experience

-

It

-

Today

-
-
-

Give

-

All

-

You can

-
-
-

Life

-

In

-

Motion

-
-
- - - - - - - diff --git a/05 - Flex Panel Gallery/index-FINISHED.html b/05 - Flex Panel Gallery/index.html similarity index 87% rename from 05 - Flex Panel Gallery/index-FINISHED.html rename to 05 - Flex Panel Gallery/index.html index 243f8a221d..89ea647bad 100644 --- a/05 - Flex Panel Gallery/index-FINISHED.html +++ b/05 - Flex Panel Gallery/index.html @@ -44,6 +44,7 @@ background-position:center; flex: 1; justify-content: center; + align-items: center; display: flex; flex-direction: column; } @@ -55,21 +56,21 @@ .panel4 { background-image:url(https://source.unsplash.com/ITjiVXcwVng/1500x1500); } .panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); } - /* Flex Items */ .panel > * { margin:0; width: 100%; transition:transform 0.5s; + border: 1px solid red; flex: 1 0 auto; - display:flex; + 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 > *: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; @@ -126,20 +127,20 @@ const panels = document.querySelectorAll('.panel'); function toggleOpen() { - console.log('Hello'); - this.classList.toggle('open'); - } + this.classList.toggle('open') + }; function toggleActive(e) { - console.log(e.propertyName); - if (e.propertyName.includes('flex')) { + if (e.propertyName.includes("flex")) { this.classList.toggle('open-active'); } - } + }; - panels.forEach(panel => panel.addEventListener('click', toggleOpen)); - panels.forEach(panel => panel.addEventListener('transitionend', toggleActive)); + panels.forEach(panel => panel.addEventListener("click", toggleOpen)); + panels.forEach(panel => panel.addEventListener("transitionend", toggleActive)); + + From c0c716c769e792d22f908116479b62064ff403a2 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Fri, 16 Dec 2016 09:54:24 -0700 Subject: [PATCH 06/13] Finish type ahead challenge --- 05 - Flex Panel Gallery/index.html | 1 - 06 - Type Ahead/index-FINISHED.html | 61 ---------------------------- 06 - Type Ahead/index-START.html | 22 ---------- 06 - Type Ahead/index.html | 62 +++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 84 deletions(-) delete mode 100644 06 - Type Ahead/index-FINISHED.html delete mode 100644 06 - Type Ahead/index-START.html create mode 100644 06 - Type Ahead/index.html diff --git a/05 - Flex Panel Gallery/index.html b/05 - Flex Panel Gallery/index.html index 89ea647bad..144d9eb4a7 100644 --- a/05 - Flex Panel Gallery/index.html +++ b/05 - Flex Panel Gallery/index.html @@ -60,7 +60,6 @@ margin:0; width: 100%; transition:transform 0.5s; - border: 1px solid red; flex: 1 0 auto; display: flex; justify-content: center; diff --git a/06 - Type Ahead/index-FINISHED.html b/06 - Type Ahead/index-FINISHED.html deleted file mode 100644 index 5902b43936..0000000000 --- a/06 - Type Ahead/index-FINISHED.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - Type Ahead đź‘€ - - - - -
- -
    -
  • Filter for a city
  • -
  • or a state
  • -
-
- - - diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html deleted file mode 100644 index 1436886918..0000000000 --- a/06 - Type Ahead/index-START.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Type Ahead đź‘€ - - - - -
- -
    -
  • Filter for a city
  • -
  • or a state
  • -
-
- - - diff --git a/06 - Type Ahead/index.html b/06 - Type Ahead/index.html new file mode 100644 index 0000000000..193877644a --- /dev/null +++ b/06 - Type Ahead/index.html @@ -0,0 +1,62 @@ + + + + + Type Ahead đź‘€ + + + + +
+ +
    +
  • Filter for a city
  • +
  • or a state
  • +
+
+ + + From 55d1d340881309a9d9e4b60653ab7d818829a1a0 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Fri, 16 Dec 2016 11:46:59 -0700 Subject: [PATCH 07/13] Finish second array challenge --- 06 - Type Ahead/.vscode/launch.json | 21 ++++++ 07 - Array Cardio Day 2/index-FINISHED.html | 67 ------------------- .../{index-START.html => index.html} | 31 +++++---- 3 files changed, 36 insertions(+), 83 deletions(-) create mode 100644 06 - Type Ahead/.vscode/launch.json delete mode 100644 07 - Array Cardio Day 2/index-FINISHED.html rename 07 - Array Cardio Day 2/{index-START.html => index.html} (73%) diff --git a/06 - Type Ahead/.vscode/launch.json b/06 - Type Ahead/.vscode/launch.json new file mode 100644 index 0000000000..e43a0d3f08 --- /dev/null +++ b/06 - Type Ahead/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + // Use IntelliSense to learn about possible Node.js debug attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "program": "${workspaceRoot}/app.js", + "cwd": "${workspaceRoot}" + }, + { + "type": "node", + "request": "attach", + "name": "Attach to Process", + "port": 5858 + } + ] +} \ No newline at end of file diff --git a/07 - Array Cardio Day 2/index-FINISHED.html b/07 - Array Cardio Day 2/index-FINISHED.html deleted file mode 100644 index e39d35f79a..0000000000 --- a/07 - Array Cardio Day 2/index-FINISHED.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - - Document - - - - - diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index.html similarity index 73% rename from 07 - Array Cardio Day 2/index-START.html rename to 07 - Array Cardio Day 2/index.html index bdf6c44415..3032c39e50 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index.html @@ -24,17 +24,13 @@ ]; // Some and Every Checks - // Array.prototype.some() // is at least one person 19? - // const isAdult = people.some(function(person) { - // const currentYear = (new Date()).getFullYear(); - // if(currentYear - person.year >= 19) { - // return true; - // } - // }); - - const isAdult = people.some(person => ((new Date()).getFullYear()) - person.year >= 19); + + const isAdult = people.some(person => { + return new Date().getFullYear() - person.year >= 19; + }); console.log({isAdult}); + // Array.prototype.every() // is everyone 19? const allAdults = people.every(person => ((new Date()).getFullYear()) - person.year >= 19); @@ -44,17 +40,20 @@ // 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); - const comment = comments.find(comment => comment.id === 823423); - - console.log(comment); - + 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 index = comments.findIndex(comment => { + return comment.id === 823423; + }); + console.log(index); + + + // Ways to delete a comment from the array... // comments.splice(index, 1); const newComments = [ From 8d280b3413296c539f0efe374765f3eefb9132e4 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Sun, 18 Dec 2016 21:33:24 -0700 Subject: [PATCH 08/13] Finish fun with HTML5 Canvas challenge --- 08 - Fun with HTML5 Canvas/index.html | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 08 - Fun with HTML5 Canvas/index.html diff --git a/08 - Fun with HTML5 Canvas/index.html b/08 - Fun with HTML5 Canvas/index.html new file mode 100644 index 0000000000..adfaa7f489 --- /dev/null +++ b/08 - Fun with HTML5 Canvas/index.html @@ -0,0 +1,67 @@ + + + + + HTML5 Canvas + + + + + + + + + From 5823cb3afb0965650db98cfe5fb6aaf9e1256352 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Mon, 19 Dec 2016 14:06:28 -0700 Subject: [PATCH 09/13] Finish dev tool challenge --- 08 - Fun with HTML5 Canvas/index.html | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/08 - Fun with HTML5 Canvas/index.html b/08 - Fun with HTML5 Canvas/index.html index adfaa7f489..f62e52e56b 100644 --- a/08 - Fun with HTML5 Canvas/index.html +++ b/08 - Fun with HTML5 Canvas/index.html @@ -33,18 +33,27 @@ ctx.stroke(); [lastX, lastY] = [e.offsetX, e.offsetY]; hue++; + hueCheck(); + changeLineWidth(); +} + +function hueCheck() { if (hue >= 360) { - hue = 0; + hue = 0; } +} + +function changeLineWidth() { if (ctx.lineWidth >= 80 || ctx.lineWidth <=1 ) { direction = !direction; } if (direction) { ctx.lineWidth++; } else { - ctx.lineWidth--; + ctx.lineWidth--; } -} +} + canvas.addEventListener("mousemove", draw); canvas.addEventListener("mousedown", (e) => { From 3416d6c9f1f6d6a92ca876331cc7aa9088e544c3 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Wed, 21 Dec 2016 09:23:10 -0700 Subject: [PATCH 10/13] FInish shift-checkboxes challenge --- .../index-FINISHED.html | 73 ------------ 08 - Fun with HTML5 Canvas/index-START.html | 19 --- 09 - Dev Tools Domination/index-FINISHED.html | 89 -------------- 09 - Dev Tools Domination/index-START.html | 46 -------- 09 - Dev Tools Domination/index.html | 69 +++++++++++ .../index-START.html | 109 ------------------ .../{index-FINISHED.html => index.html} | 36 +++--- 7 files changed, 85 insertions(+), 356 deletions(-) delete mode 100644 08 - Fun with HTML5 Canvas/index-FINISHED.html delete mode 100644 08 - Fun with HTML5 Canvas/index-START.html delete mode 100644 09 - Dev Tools Domination/index-FINISHED.html delete mode 100644 09 - Dev Tools Domination/index-START.html create mode 100644 09 - Dev Tools Domination/index.html delete mode 100644 10 - Hold Shift and Check Checkboxes/index-START.html rename 10 - Hold Shift and Check Checkboxes/{index-FINISHED.html => index.html} (81%) diff --git a/08 - Fun with HTML5 Canvas/index-FINISHED.html b/08 - Fun with HTML5 Canvas/index-FINISHED.html deleted file mode 100644 index 0791e17d0d..0000000000 --- a/08 - Fun with HTML5 Canvas/index-FINISHED.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - HTML5 Canvas - - - - - - - - - diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html deleted file mode 100644 index 37c148df07..0000000000 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - HTML5 Canvas - - - - - - - - - diff --git a/09 - Dev Tools Domination/index-FINISHED.html b/09 - Dev Tools Domination/index-FINISHED.html deleted file mode 100644 index 55cd3a2f42..0000000000 --- a/09 - Dev Tools Domination/index-FINISHED.html +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Console Tricks! - - - -

Ă—BREAKĂ—DOWNĂ—

- - - - diff --git a/09 - Dev Tools Domination/index-START.html b/09 - Dev Tools Domination/index-START.html deleted file mode 100644 index 196fffd719..0000000000 --- a/09 - Dev Tools Domination/index-START.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Console Tricks! - - - -

Ă—BREAKĂ—DOWNĂ—

- - - - diff --git a/09 - Dev Tools Domination/index.html b/09 - Dev Tools Domination/index.html new file mode 100644 index 0000000000..9f71c72765 --- /dev/null +++ b/09 - Dev Tools Domination/index.html @@ -0,0 +1,69 @@ + + + + + Console Tricks! + + + +

Ă—BREAKĂ—DOWNĂ—

+ + + + diff --git a/10 - Hold Shift and Check Checkboxes/index-START.html b/10 - Hold Shift and Check Checkboxes/index-START.html deleted file mode 100644 index eb7ed310bb..0000000000 --- a/10 - Hold Shift and Check Checkboxes/index-START.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - Document - - - - -
-
- -

This is an inbox layout.

-
-
- -

Check one item

-
-
- -

Hold down your Shift key

-
-
- -

Check a lower item

-
-
- -

Everything inbetween should also be set to checked

-
-
- -

Try do it with out any libraries

-
-
- -

Just regular JavaScript

-
-
- -

Good Luck!

-
-
- -

Don't forget to tweet your result!

-
-
- - - - diff --git a/10 - Hold Shift and Check Checkboxes/index-FINISHED.html b/10 - Hold Shift and Check Checkboxes/index.html similarity index 81% rename from 10 - Hold Shift and Check Checkboxes/index-FINISHED.html rename to 10 - Hold Shift and Check Checkboxes/index.html index 3ce296cc4b..ed279ed6c2 100644 --- a/10 - Hold Shift and Check Checkboxes/index-FINISHED.html +++ b/10 - Hold Shift and Check Checkboxes/index.html @@ -104,34 +104,30 @@ + \ No newline at end of file From 416b3fe5620e3e46716aea3bc3cd41d3c4f6dbc3 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Wed, 21 Dec 2016 22:34:32 -0700 Subject: [PATCH 11/13] Finish custom video player challenge --- 11 - Custom Video Player/index.html | 1 + 11 - Custom Video Player/scripts-FINISHED.js | 55 --------------- 11 - Custom Video Player/scripts.js | 74 ++++++++++++++++++++ 11 - Custom Video Player/style.css | 2 +- 4 files changed, 76 insertions(+), 56 deletions(-) delete mode 100644 11 - Custom Video Player/scripts-FINISHED.js diff --git a/11 - Custom Video Player/index.html b/11 - Custom Video Player/index.html index fe2b55b394..301ca0a9e9 100644 --- a/11 - Custom Video Player/index.html +++ b/11 - Custom Video Player/index.html @@ -19,6 +19,7 @@ + diff --git a/11 - Custom Video Player/scripts-FINISHED.js b/11 - Custom Video Player/scripts-FINISHED.js deleted file mode 100644 index cedacf2f68..0000000000 --- a/11 - Custom Video Player/scripts-FINISHED.js +++ /dev/null @@ -1,55 +0,0 @@ -/* Get Our Elements */ -const player = document.querySelector('.player'); -const video = player.querySelector('.viewer'); -const progress = player.querySelector('.progress'); -const progressBar = player.querySelector('.progress__filled'); -const toggle = player.querySelector('.toggle'); -const skipButtons = player.querySelectorAll('[data-skip]'); -const ranges = player.querySelectorAll('.player__slider'); - -/* Build out functions */ -function togglePlay() { - const method = video.paused ? 'play' : 'pause'; - video[method](); -} - -function updateButton() { - const icon = this.paused ? 'â–ş' : 'âťš âťš'; - console.log(icon); - toggle.textContent = icon; -} - -function skip() { - video.currentTime += parseFloat(this.dataset.skip); -} - -function handleRangeUpdate() { - video[this.name] = this.value; -} - -function handleProgress() { - const percent = (video.currentTime / video.duration) * 100; - progressBar.style.flexBasis = `${percent}%`; -} - -function scrub(e) { - const scrubTime = (e.offsetX / progress.offsetWidth) * video.duration; - video.currentTime = scrubTime; -} - -/* Hook up the event listners */ -video.addEventListener('click', togglePlay); -video.addEventListener('play', updateButton); -video.addEventListener('pause', updateButton); -video.addEventListener('timeupdate', handleProgress); - -toggle.addEventListener('click', togglePlay); -skipButtons.forEach(button => button.addEventListener('click', skip)); -ranges.forEach(range => range.addEventListener('change', handleRangeUpdate)); -ranges.forEach(range => range.addEventListener('mousemove', handleRangeUpdate)); - -let mousedown = false; -progress.addEventListener('click', scrub); -progress.addEventListener('mousemove', (e) => mousedown && scrub(e)); -progress.addEventListener('mousedown', () => mousedown = true); -progress.addEventListener('mouseup', () => mousedown = false); diff --git a/11 - Custom Video Player/scripts.js b/11 - Custom Video Player/scripts.js index e69de29bb2..ed41a1bdd1 100644 --- a/11 - Custom Video Player/scripts.js +++ b/11 - Custom Video Player/scripts.js @@ -0,0 +1,74 @@ +const player = document.querySelector(".player"); +const video = player.querySelector(".viewer"); +const progress = player.querySelector(".progress"); +const progressBar = player.querySelector('.progress__filled'); +const toggle = player.querySelector(".toggle"); +const skipButtons = player.querySelectorAll("[data-skip]"); +const ranges = player.querySelectorAll(".player__slider"); +const fullScreenButton = player.querySelector(".full-screen") + +function togglePlay() { + const method = video.paused ? 'play' : 'pause' + video[method](); +} + +function updateButton() { + const icon = this.paused ? 'â–ş' : 'âťš âťš'; + console.log(icon) + toggle.textContent = icon; +} + +function skip () { + console.log("skip"); + video.currentTime += parseFloat(this.dataset.skip); +} + +function handleRangeUpdate() { + video[this.name] = this.value; +} + +function handleProgress() { + const percent = (video.currentTime / video.duration) * 100; + progressBar.style.flexBasis = `${percent}%`; +} + +function scrub(e) { + const scrubTime = (e.offsetX / progress.offsetWidth) * video. + duration; + video.currentTime = scrubTime; +} + +function makeFullScreen() { + if (video.requestFullscreen) { + video.requestFullscreen(); + } else if (video.mozRequestFullScreen) { + video.mozRequestFullScreen(); // Firefox + } else if (video.webkitRequestFullscreen) { + video.webkitRequestFullscreen(); // Chrome and Safari + } +} + +video.addEventListener("click", togglePlay) +video.addEventListener('play', updateButton) +video.addEventListener('pause', updateButton) +video.addEventListener('timeupdate', handleProgress) + +let mouseDown = false; +progress.addEventListener('click', scrub); +progress.addEventListener('mousemove', (e) => mouseDown && scrub(e)); +progress.addEventListener('mouseup', () => mouseDown = false ); +progress.addEventListener('mousedown', () => mouseDown = true); + + +fullScreenButton.addEventListener("click", makeFullScreen); + +// fullScreen.addEventListener('click', () => { +// if (video.requestFullscreen) { +// video.requestFullscreen(); +// } +// }); + +toggle.addEventListener("click", togglePlay); +skipButtons.forEach(button => button.addEventListener('click', skip)); +ranges.forEach(range => range.addEventListener('change', handleRangeUpdate)); +ranges.forEach(range => range.addEventListener('mousemove', handleRangeUpdate)); \ No newline at end of file diff --git a/11 - Custom Video Player/style.css b/11 - Custom Video Player/style.css index c07581c1c0..605216a4fc 100644 --- a/11 - Custom Video Player/style.css +++ b/11 - Custom Video Player/style.css @@ -18,7 +18,7 @@ body { } .player { - max-width:750px; + max-width: 750px; border:5px solid rgba(0,0,0,0.2); box-shadow:0 0 20px rgba(0,0,0,0.2); position: relative; From 20a6f0e54ca7b75e45050b1d129e48d947d02c70 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Tue, 27 Dec 2016 17:12:52 -0700 Subject: [PATCH 12/13] Finish key sequence detection challenge --- 12 - Key Sequence Detection/index-START.html | 12 ---------- 12 - Key Sequence Detection/index.html | 24 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) delete mode 100644 12 - Key Sequence Detection/index-START.html create mode 100644 12 - Key Sequence Detection/index.html diff --git a/12 - Key Sequence Detection/index-START.html b/12 - Key Sequence Detection/index-START.html deleted file mode 100644 index 8cab786140..0000000000 --- a/12 - Key Sequence Detection/index-START.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Key Detection - - - - - - diff --git a/12 - Key Sequence Detection/index.html b/12 - Key Sequence Detection/index.html new file mode 100644 index 0000000000..7ebd7d28a7 --- /dev/null +++ b/12 - Key Sequence Detection/index.html @@ -0,0 +1,24 @@ + + + + + Key Detection + + + + + + From 7cf15184df222b52ab3b8c1d6acba80437b6b358 Mon Sep 17 00:00:00 2001 From: Nick Pisciotta Date: Mon, 6 Feb 2017 15:03:32 -0700 Subject: [PATCH 13/13] Finish lesson 14 References vs Copying --- 13 - Slide in on Scroll/index-FINISHED.html | 20 +--- .../{index-START.html => index.html} | 25 ++--- .../index-FINISHED.html | 99 ------------------- .../{index-START.html => index.html} | 35 ++++--- 4 files changed, 39 insertions(+), 140 deletions(-) rename 13 - Slide in on Scroll/{index-START.html => index.html} (96%) delete mode 100644 14 - JavaScript References VS Copying/index-FINISHED.html rename 14 - JavaScript References VS Copying/{index-START.html => index.html} (63%) diff --git a/13 - Slide in on Scroll/index-FINISHED.html b/13 - Slide in on Scroll/index-FINISHED.html index bbaf0b6f22..75b30b936e 100644 --- a/13 - Slide in on Scroll/index-FINISHED.html +++ b/13 - Slide in on Scroll/index-FINISHED.html @@ -58,25 +58,13 @@

Slide in on Scroll

}; }; - const sliderImages = document.querySelectorAll('.slide-in'); + const sliderImages = document.querySelectorAll('.slide-in'); function checkSlide(e) { - sliderImages.forEach(sliderImage => { - // half way through the image - const slideInAt = (window.scrollY + window.innerHeight) - sliderImage.height / 2; - // bottom of the image - const imageBottom = sliderImage.offsetTop + sliderImage.height; - const isHalfShown = slideInAt > sliderImage.offsetTop; - const isNotScrolledPast = window.scrollY < imageBottom; - if (isHalfShown && isNotScrolledPast) { - sliderImage.classList.add('active'); - } else { - sliderImage.classList.remove('active'); - } - }); + console.log(e); } - - window.addEventListener('scroll', debounce(checkSlide)); + + window.addEventListener('scroll', checkSlide); diff --git a/13 - Slide in on Scroll/index-START.html b/13 - Slide in on Scroll/index.html similarity index 96% rename from 13 - Slide in on Scroll/index-START.html rename to 13 - Slide in on Scroll/index.html index 12591bad30..f5925fbbd0 100644 --- a/13 - Slide in on Scroll/index-START.html +++ b/13 - Slide in on Scroll/index.html @@ -58,25 +58,26 @@

Slide in on Scroll

}; } - const sliderImages = document.querySelectorAll('.slide-in'); + const sliderImages = document.querySelectorAll('.slide-in'); function checkSlide(e) { sliderImages.forEach(sliderImage => { - // half way through the image - const slideInAt = (window.scrollY + window.innerHeight) - sliderImage.height / 2; - // bottom of the image - const imageBottom = sliderImage.offsetTop + sliderImage.height; - const isHalfShown = slideInAt > sliderImage.offsetTop; - const isNotScrolledPast = window.scrollY < imageBottom; - if (isHalfShown && isNotScrolledPast) { - sliderImage.classList.add('active'); + const slideInAt = (window.scrollY + window.innerHeight) - + sliderImage.height / 2; + console.log(window.innerHeight ) + const imageBottom = sliderImage.offsetTop + sliderImage.height; + const isHalfShown = slideInAt > sliderImage.offsetTop; + const isNotScrolledPast = window.scrollY < imageBottom; + if (isHalfShown && isNotScrolledPast) { + sliderImage.classList.add('active'); } else { - sliderImage.classList.remove('active'); + sliderImage.classList.remove('active'); } - }); + }); } + + window.addEventListener('scroll', debounce(checkSlide)); - window.addEventListener('scroll', debounce(checkSlide)); diff --git a/14 - JavaScript References VS Copying/index-FINISHED.html b/14 - JavaScript References VS Copying/index-FINISHED.html deleted file mode 100644 index be6d1b7646..0000000000 --- a/14 - JavaScript References VS Copying/index-FINISHED.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - JS Reference VS Copy - - - - - - - diff --git a/14 - JavaScript References VS Copying/index-START.html b/14 - JavaScript References VS Copying/index.html similarity index 63% rename from 14 - JavaScript References VS Copying/index-START.html rename to 14 - JavaScript References VS Copying/index.html index 4da1bac2ea..a6e389ff8c 100644 --- a/14 - JavaScript References VS Copying/index-START.html +++ b/14 - JavaScript References VS Copying/index.html @@ -8,16 +8,22 @@