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 @@ + 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) } - - + 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

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) 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..144d9eb4a7 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,20 @@ .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; 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 +126,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)); + + 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/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 đź‘€ - - - - -
- - -
- - - 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 đź‘€ - - - - -
- - -
- - - 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 đź‘€ + + + + +
+ + +
+ + + 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 = [ 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/08 - Fun with HTML5 Canvas/index.html b/08 - Fun with HTML5 Canvas/index.html new file mode 100644 index 0000000000..f62e52e56b --- /dev/null +++ b/08 - Fun with HTML5 Canvas/index.html @@ -0,0 +1,76 @@ + + + + + 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 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; 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 + + + + + + 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 @@