From 4e2fd913ab175d2811089f22fc83861bcd7f0b4f Mon Sep 17 00:00:00 2001 From: dvdrtrgn Date: Mon, 12 Dec 2016 18:13:50 -0600 Subject: [PATCH 01/28] add record action --- 01 - JavaScript Drum Kit/index.html | 23 +------- 01 - JavaScript Drum Kit/play.js | 20 +++++++ 01 - JavaScript Drum Kit/record.js | 81 +++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 21 deletions(-) create mode 100644 01 - JavaScript Drum Kit/play.js create mode 100644 01 - JavaScript Drum Kit/record.js diff --git a/01 - JavaScript Drum Kit/index.html b/01 - JavaScript Drum Kit/index.html index 246639f990..29bb8a64d0 100644 --- a/01 - JavaScript Drum Kit/index.html +++ b/01 - JavaScript Drum Kit/index.html @@ -57,27 +57,8 @@ - + + diff --git a/01 - JavaScript Drum Kit/play.js b/01 - JavaScript Drum Kit/play.js new file mode 100644 index 0000000000..324e24ceba --- /dev/null +++ b/01 - JavaScript Drum Kit/play.js @@ -0,0 +1,20 @@ +var lastKey; + +function playSound(e) { + const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`); + const key = document.querySelector(`.key[data-key="${e.keyCode}"]`); + if (!audio) return; // stop the function from running all together + audio.currentTime = 0; // rewind to the start + audio.play(); + key.classList.add('playing'); + lastKey = e.keyCode; +} + +function removeTransition(e) { + if (e.propertyName !== 'transform') return; // skip it if it's not a transform + this.classList.remove('playing'); +} + +const keys = document.querySelectorAll('.key'); +keys.forEach(key => key.addEventListener('transitionend', removeTransition)); +window.addEventListener('keydown', playSound); diff --git a/01 - JavaScript Drum Kit/record.js b/01 - JavaScript Drum Kit/record.js new file mode 100644 index 0000000000..e89f613ecc --- /dev/null +++ b/01 - JavaScript Drum Kit/record.js @@ -0,0 +1,81 @@ +var Record = (function () { + + var recording; + var playing; + var buffer = []; + var index = -1; + + function hitSpace(e) { + if (e.keyCode !== 32) return; + + if (!buffer.length) { + recording = window.setInterval(recordKey, 100); + } else if (!playing) { + window.clearInterval(recording); + startPlaying(); + } else { + stopPlaying(); + } + console.log(buffer); + } + + function playNext() { + insertKey(); + index = (++index % buffer.length); + if (buffer[index]) { + autoKey(buffer[index]); + } + } + + function recordKey() { + if (!lastKey && !buffer.length) return; + // trims leading silence + + buffer.push(lastKey); + cleanKey(); // reset + } + + function insertKey() { + if (!lastKey) return; + buffer[index] = lastKey; + cleanKey(); // reset + } + + function autoKey(key) { + playSound({ + keyCode: key, + }); + cleanKey(); + } + + function stopPlaying() { + window.clearInterval(playing); + playing = undefined; + } + + function startPlaying(num) { + index = num || -1; + if (!playing) { + playing = window.setInterval(playNext, 100); + } + } + + function cleanKey() { + if (lastKey) console.log(lastKey); + lastKey = undefined; + } + + window.addEventListener('keydown', hitSpace); + + return { + addToBuffer: (...arr) => buffer.push(...arr), + }; +}()); + +// cool beat +// [75, 76, 75, 65, 70, 74, 71, undefined, 83, undefined, 72, 76, 74, 76, 76, 71, 74, 83, 76, 71, 75, 76, 65, 65, 74, 74, 75, 68, 83, undefined, 83, 68, 71, undefined] +/* + +progress bar show how far the buffer pointer is + +*/ From 74525dca2e236d4099df1fa006082b21cc6714b4 Mon Sep 17 00:00:00 2001 From: dvdrtrgn Date: Mon, 12 Dec 2016 22:02:20 -0600 Subject: [PATCH 02/28] refine record --- 01 - JavaScript Drum Kit/index.html | 5 + 01 - JavaScript Drum Kit/record.js | 184 +++++++++++++++++++--------- 2 files changed, 128 insertions(+), 61 deletions(-) diff --git a/01 - JavaScript Drum Kit/index.html b/01 - JavaScript Drum Kit/index.html index 29bb8a64d0..c4015e6b88 100644 --- a/01 - JavaScript Drum Kit/index.html +++ b/01 - JavaScript Drum Kit/index.html @@ -7,6 +7,11 @@ +
+

spacebar to play/record+stop/play

+ + +
diff --git a/01 - JavaScript Drum Kit/record.js b/01 - JavaScript Drum Kit/record.js index e89f613ecc..3c14f778d1 100644 --- a/01 - JavaScript Drum Kit/record.js +++ b/01 - JavaScript Drum Kit/record.js @@ -1,81 +1,143 @@ -var Record = (function () { - - var recording; - var playing; - var buffer = []; - var index = -1; +/*global lastKey */ - function hitSpace(e) { - if (e.keyCode !== 32) return; +var Record = (function () { - if (!buffer.length) { - recording = window.setInterval(recordKey, 100); - } else if (!playing) { - window.clearInterval(recording); - startPlaying(); + var Index; + var tempo = 1000 / 8; + var int_rec; + var int_play; + var funky = [75, 76, 75, 65, 70, 74, 71, undefined, 83, undefined, + 72, 76, 74, 76, 76, 71, 74, 83, 76, 71, 75, + 76, 65, 65, 74, 74, 75, 68, 83, undefined, 83, 68, 71, undefined]; + + function keyPress(evt) { + //console.log(evt.keyCode); + if (evt.keyCode === 8) return Key.delete(); + if (evt.keyCode !== 32) return; // not spacebar? + + if (!int_rec && !Buffer.length) { + Index = -1; + int_rec = window.setInterval(Key.record, tempo); + } else if (!int_play) { + int_rec = window.clearInterval(int_rec); + Play.start(Index); } else { - stopPlaying(); - } - console.log(buffer); - } - - function playNext() { - insertKey(); - index = (++index % buffer.length); - if (buffer[index]) { - autoKey(buffer[index]); + Play.stop(); } } - function recordKey() { - if (!lastKey && !buffer.length) return; - // trims leading silence - - buffer.push(lastKey); - cleanKey(); // reset + function advance() { + Meter.set(Index); + Index = (++Index % Buffer.length); } - function insertKey() { - if (!lastKey) return; - buffer[index] = lastKey; - cleanKey(); // reset - } + const Buffer = { + idx2pct: (num) => Math.min(Math.round(100 * num / Buffer.length), 100), + pct2idx: (num) => Math.min(Math.round(num / 100 * Buffer.length), Buffer.length), + arr: funky, + get length() { + return Buffer.arr.length; + }, + get now() { + return Buffer.arr[Index]; + }, + set now(val) { + Buffer.arr[Index] = val; + }, + push: function () { + Buffer.arr.push.apply(Buffer.arr, arguments); + }, + clear: function () { + Buffer.arr.splice(0); + Meter.focus(); + Meter.set(1); + }, + }; - function autoKey(key) { - playSound({ - keyCode: key, - }); - cleanKey(); - } + const Key = { + delete: function () { + Buffer.now = undefined; + }, + record: function () { + console.log('listening'); + if (!lastKey && !Buffer.length) return; // trim leading silence + Buffer.push(lastKey); + Key.clean(true); // reset + }, + insert: function () { + if (!lastKey) return; + Buffer.now = lastKey; + Key.clean(true); // reset + }, + auto: function (key) { + playSound({ + keyCode: key, + }); + Key.clean(); + }, + clean: function (bool) { + if (bool && lastKey) { + console.log(Index, lastKey, Buffer.length); + } + lastKey = undefined; + }, + bind: function () { + window.addEventListener('keydown', keyPress); + }, + }; - function stopPlaying() { - window.clearInterval(playing); - playing = undefined; - } + const Meter = { + ele: document.querySelector('#Meter input'), + del: document.querySelector('#Meter button'), + set: function (num) { + Meter.ele.value = Buffer.idx2pct(num || 0); + }, + read: function () { + Index = Buffer.pct2idx(Meter.ele.value); + }, + focus: function () { + Meter.ele.focus(); + }, + bind: function () { + Meter.ele.addEventListener('mouseup', Meter.read); + Meter.del.addEventListener('mouseup', Buffer.clear); + Meter.set(); + }, + }; - function startPlaying(num) { - index = num || -1; - if (!playing) { - playing = window.setInterval(playNext, 100); - } - } + const Play = { + stop: function () { + window.clearInterval(int_play); + int_play = undefined; + }, + start: function (num) { + Index = num || 0; + if (!int_play) { + int_play = window.setInterval(Play.next, tempo); + } + }, + next: function () { + Key.insert(); + advance(); + if (Buffer.now) { + Key.auto(Buffer.now); + } + }, + }; - function cleanKey() { - if (lastKey) console.log(lastKey); - lastKey = undefined; - } + const Api = { + Buffer, Key, Meter, Play, + }; - window.addEventListener('keydown', hitSpace); + Key.bind(); + Meter.bind(); - return { - addToBuffer: (...arr) => buffer.push(...arr), - }; + console.debug(Api); + return Api; }()); -// cool beat -// [75, 76, 75, 65, 70, 74, 71, undefined, 83, undefined, 72, 76, 74, 76, 76, 71, 74, 83, 76, 71, 75, 76, 65, 65, 74, 74, 75, 68, 83, undefined, 83, 68, 71, undefined] /* -progress bar show how far the buffer pointer is + */ From 8a79db4df72de9b1055d16fe59bbebd116c02fc5 Mon Sep 17 00:00:00 2001 From: dvdrtrgn Date: Tue, 13 Dec 2016 21:44:22 -0600 Subject: [PATCH 03/28] attempt clock --- 02 - JS + CSS Clock/index-START.html | 35 ++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 2712384201..e75cd12af4 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -52,21 +52,52 @@ position: relative; width: 100%; height: 100%; - transform: translateY(-3px); /* account for the height of the clock hands */ + transform: translateY(-3px) rotate(90deg); /* account for the height of the clock hands */ } .hand { width:50%; - height:6px; background:black; position: absolute; top:50%; + transform-origin: right; + } + .second-hand { + background-color: red; + height:2px; + } + .min-hand { + background-color: white; + height:4px; + } + .hour-hand { + background-color: black; + height:8px; } From 53663ca613386bfd15464d600ea3fe5ddd3c759e Mon Sep 17 00:00:00 2001 From: dvdrtrgn Date: Tue, 13 Dec 2016 22:21:15 -0600 Subject: [PATCH 04/28] lil fixes --- 01 - JavaScript Drum Kit/play.js | 3 ++- 01 - JavaScript Drum Kit/record.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/01 - JavaScript Drum Kit/play.js b/01 - JavaScript Drum Kit/play.js index 324e24ceba..30b6a42c73 100644 --- a/01 - JavaScript Drum Kit/play.js +++ b/01 - JavaScript Drum Kit/play.js @@ -11,7 +11,8 @@ function playSound(e) { } function removeTransition(e) { - if (e.propertyName !== 'transform') return; // skip it if it's not a transform + /* this causes sticking + if (e.propertyName !== 'transform') return; // skip it if it's not a transform */ this.classList.remove('playing'); } diff --git a/01 - JavaScript Drum Kit/record.js b/01 - JavaScript Drum Kit/record.js index 3c14f778d1..8144f3aad0 100644 --- a/01 - JavaScript Drum Kit/record.js +++ b/01 - JavaScript Drum Kit/record.js @@ -132,7 +132,7 @@ var Record = (function () { Key.bind(); Meter.bind(); - console.debug(Api); + console.table(Api); return Api; }()); From fcfb498a1ef3894efb2e1f39a553dcb5f47f6f47 Mon Sep 17 00:00:00 2001 From: nadiarasul Date: Fri, 9 Dec 2016 15:21:35 -0500 Subject: [PATCH 05/28] adding women inventors This is a random selection of female inventors for the dataset --- 04 - Array Cardio Day 1/index-START.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 6e28e357d0..9d9e3bef57 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -18,7 +18,12 @@ { 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 }, + { first: 'Katherine', last: 'Blodgett', year: 1898, passed: 1979 }, + { first: 'Ada', last: 'Lovelace', year: 1815, passed: 1852 }, + { first: 'Sarah E.', last: 'Goode', year: 1855, passed: 1905 }, + { first: 'Lise', last: 'Meitner', year: 1878, passed: 1968 }, + { first: 'Hanna', last: 'Hammarström', year: 1829, passed: 1909 } ]; 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']; From b3a96e332c71d9c325d06464d85759286fb1eab3 Mon Sep 17 00:00:00 2001 From: nadiarasul Date: Fri, 9 Dec 2016 15:25:08 -0500 Subject: [PATCH 06/28] female inventors + change in const name A random selection of female inventors for the dataset along with proposed change in const name. --- 04 - Array Cardio Day 1/index-FINISHED.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/04 - Array Cardio Day 1/index-FINISHED.html b/04 - Array Cardio Day 1/index-FINISHED.html index f68d8c3545..2436441cda 100644 --- a/04 - Array Cardio Day 1/index-FINISHED.html +++ b/04 - Array Cardio Day 1/index-FINISHED.html @@ -19,6 +19,11 @@ { 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: 'Katherine', last: 'Blodgett', year: 1898, passed: 1979 }, + { first: 'Ada', last: 'Lovelace', year: 1815, passed: 1852 }, + { first: 'Sarah E.', last: 'Goode', year: 1855, passed: 1905 }, + { first: 'Lise', last: 'Meitner', year: 1878, passed: 1968 }, + { first: 'Hanna', last: 'Hammarström', year: 1829, passed: 1909 } ]; 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']; @@ -57,9 +62,9 @@ // 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; + const lastInventor = a.passed - a.year; + const nextInventor = b.passed - b.year; + return lastInventor > nextInventor ? -1 : 1; }); console.table(oldest); From bc8ad2d070b9ad1915cf9b0485c407b045c6c720 Mon Sep 17 00:00:00 2001 From: Akshay Kadam Date: Sat, 10 Dec 2016 02:01:01 +0530 Subject: [PATCH 07/28] Unused CSS :smile: --- 03 - CSS Variables/index-FINISHED.html | 5 ----- 03 - CSS Variables/index-START.html | 5 ----- 2 files changed, 10 deletions(-) diff --git a/03 - CSS Variables/index-FINISHED.html b/03 - CSS Variables/index-FINISHED.html index 9401d7b339..c3217fc003 100644 --- a/03 - CSS Variables/index-FINISHED.html +++ b/03 - CSS Variables/index-FINISHED.html @@ -57,11 +57,6 @@

Update CSS Variables with JS

margin-bottom: 50px; } - a { - color: var(--base); - text-decoration: none; - } - input { width:100px; } diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index bf0f33e3ba..7171607a8b 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -42,11 +42,6 @@

Update CSS Variables with JS

margin-bottom: 50px; } - a { - color: var(--base); - text-decoration: none; - } - input { width:100px; } From ed7f5f2f8a1e0b7c63fc82852a20f06d5829eeca Mon Sep 17 00:00:00 2001 From: Jake Johnson Date: Fri, 9 Dec 2016 23:46:07 -0500 Subject: [PATCH 08/28] typo: inventory > inventors' --- 04 - Array Cardio Day 1/index-START.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/04 - Array Cardio Day 1/index-START.html b/04 - Array Cardio Day 1/index-START.html index 9d9e3bef57..927fb03540 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -34,7 +34,7 @@ // 1. Filter the list of inventors for those who were born in the 1500's // Array.prototype.map() - // 2. Give us an array of the inventory first and last names + // 2. Give us an array of the inventors' first and last names // Array.prototype.sort() // 3. Sort the inventors by birthdate, oldest to youngest From 0dd3356509c4d345bc75c5fe957a5e255d14fc5a Mon Sep 17 00:00:00 2001 From: PiotrBerebecki Date: Sat, 10 Dec 2016 11:26:08 +0000 Subject: [PATCH 09/28] Fix typo in readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 829f4d07f5..6c4ee28eea 100644 --- a/readme.md +++ b/readme.md @@ -12,4 +12,4 @@ These are meant to be 1:1 copies of what is done in the video. If you found a be The starter files + solutions will be updated if/when the videos are updated. -Thank! +Thanks! From 8421932734f561f19d7ec98c9503d493981ec6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fede=20Guzm=C3=A1n?= Date: Sat, 10 Dec 2016 18:46:32 -0300 Subject: [PATCH 10/28] Removed the extra code from the start file --- 07 - Array Cardio Day 2/index-START.html | 27 ------------------------ 1 file changed, 27 deletions(-) diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index bdf6c44415..b80ab6b650 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -25,42 +25,15 @@ // 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); - - console.log({isAdult}); // Array.prototype.every() // is everyone 19? - 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); - - // comments.splice(index, 1); - - const newComments = [ - ...comments.slice(0, index), - ...comments.slice(index + 1) - ]; From bc57dc610e8493d00963368fe8bc989c258350d5 Mon Sep 17 00:00:00 2001 From: Mitchel van Eijgen Date: Sun, 11 Dec 2016 11:25:38 +0100 Subject: [PATCH 11/28] 7. sort Exercise make it so it sorts on last name In your video you still sort on the first name of the array but you called it `aLast` and `bLast` but they where in the first position of the array like this: `const [aLast, aFirst]` when changed to `const [aFirst, aLast]` it will filter on the second part of the array. There for it will sort on the last name. To bad there is no way to pull request your video. --- 04 - Array Cardio Day 1/index-FINISHED.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/04 - Array Cardio Day 1/index-FINISHED.html b/04 - Array Cardio Day 1/index-FINISHED.html index 2436441cda..377d786a33 100644 --- a/04 - Array Cardio Day 1/index-FINISHED.html +++ b/04 - Array Cardio Day 1/index-FINISHED.html @@ -80,8 +80,8 @@ // 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(', '); + const [aFirst, aLast] = lastOne.split(', '); + const [bFirst, bLast] = nextOne.split(', '); return aLast > bLast ? 1 : -1; }); console.log(alpha); From fb740b79c0c6ae8747e0a675238500f7e327a80c Mon Sep 17 00:00:00 2001 From: Nitish Dayal Date: Mon, 12 Dec 2016 02:54:03 -0800 Subject: [PATCH 12/28] Update readme.md As requested by Wes Bos. --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index 6c4ee28eea..5a1eaa18c8 100644 --- a/readme.md +++ b/readme.md @@ -6,6 +6,8 @@ Starter Files + Completed solutions for the JavaScript 30 Day Challenge. Grab the course at [https://JavaScript30.com](https://JavaScript30.com) +Text-based guides (unofficial) for the challenges can be found here - [Text Guides](https://github.com/nitishdayal/JavaScript30). + ## Pull Requests These are meant to be 1:1 copies of what is done in the video. If you found a better / different way to do things, great, but I will be keeping them the same as the videos. From b95e8ca2cbffec1e17936786d96762029ebabdc1 Mon Sep 17 00:00:00 2001 From: claudiopro Date: Mon, 12 Dec 2016 19:18:08 +0100 Subject: [PATCH 13/28] =?UTF-8?q?Massages=20Array=20Cardio=20challenges=20?= =?UTF-8?q?=F0=9F=92=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04 - Array Cardio Day 1/index-FINISHED.html | 1 + 04 - Array Cardio Day 1/index-START.html | 1 + 07 - Array Cardio Day 2/index-FINISHED.html | 5 +++-- 07 - Array Cardio Day 2/index-START.html | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/04 - Array Cardio Day 1/index-FINISHED.html b/04 - Array Cardio Day 1/index-FINISHED.html index 377d786a33..e61b94c006 100644 --- a/04 - Array Cardio Day 1/index-FINISHED.html +++ b/04 - Array Cardio Day 1/index-FINISHED.html @@ -5,6 +5,7 @@ Array Cardio 💪 +

Psst: have a look at the JavaScript Console 💁

diff --git a/24 - Sticky Nav/style-START.css b/24 - Sticky Nav/style-START.css index 19961112b4..c6d59a31b3 100644 --- a/24 - Sticky Nav/style-START.css +++ b/24 - Sticky Nav/style-START.css @@ -23,10 +23,6 @@ body { transition: transform 0.5s; } -.fixed-nav .site-wrap { - transform: scale(1); -} - header { text-align: center; height:50vh; @@ -52,11 +48,6 @@ nav { z-index: 1; } -.fixed-nav nav { - position: fixed; - box-shadow: 0 5px rgba(0,0,0,0.1) -} - nav ul { margin: 0; padding:0; @@ -81,10 +72,6 @@ li.logo { font-size: 30px; } -.fixed-nav li.logo { - max-width:500px; -} - li.logo a { color:black; } From 1e0da6f3156c020d891870771312024b072cf157 Mon Sep 17 00:00:00 2001 From: the-wazz Date: Wed, 14 Dec 2016 01:30:07 -0500 Subject: [PATCH 16/28] Update index.html spelling. --- 01 - JavaScript Drum Kit/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01 - JavaScript Drum Kit/index.html b/01 - JavaScript Drum Kit/index.html index 246639f990..8b4fd26880 100644 --- a/01 - JavaScript Drum Kit/index.html +++ b/01 - JavaScript Drum Kit/index.html @@ -63,7 +63,7 @@ function playSound(e) { const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`); const key = document.querySelector(`.key[data-key="${e.keyCode}"]`); - if (!audio) return; // stop the function from running all together + if (!audio) return; // stop the function from running altogether audio.currentTime = 0; // rewind to the start audio.play(); key.classList.add('playing'); From d14a2b7b832a504ab154e20e8c2cdabc1028fc7c Mon Sep 17 00:00:00 2001 From: Beau Smith Date: Wed, 14 Dec 2016 19:02:58 +0530 Subject: [PATCH 17/28] copy-pasta typo --- 02 - JS + CSS Clock/index-FINISHED.html | 2 +- 02 - JS + CSS Clock/index.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/02 - JS + CSS Clock/index-FINISHED.html b/02 - JS + CSS Clock/index-FINISHED.html index d4cb3b56a8..db653a5340 100644 --- a/02 - JS + CSS Clock/index-FINISHED.html +++ b/02 - JS + CSS Clock/index-FINISHED.html @@ -85,7 +85,7 @@ minsHand.style.transform = `rotate(${minsDegrees}deg)`; const hour = now.getHours(); - const hourDegrees = ((mins / 12) * 360) + 90; + const hourDegrees = ((hour / 12) * 360) + 90; hourHand.style.transform = `rotate(${hourDegrees}deg)`; } diff --git a/02 - JS + CSS Clock/index.html b/02 - JS + CSS Clock/index.html index 1c777557da..ae8908f3c9 100644 --- a/02 - JS + CSS Clock/index.html +++ b/02 - JS + CSS Clock/index.html @@ -84,8 +84,8 @@ const minsDegrees = ((mins / 60) * 360) + 90; minsHand.style.transform = `rotate(${minsDegrees}deg)`; - const hour = now.getMinutes(); - const hourDegrees = ((mins / 12) * 360) + 90; + const hour = now.getHours(); + const hourDegrees = ((hour / 12) * 360) + 90; hourHand.style.transform = `rotate(${hourDegrees}deg)`; } From b9b37ed3406f9d9b095558a32ca6237519c732e8 Mon Sep 17 00:00:00 2001 From: Beau Smith Date: Wed, 14 Dec 2016 20:43:52 +0530 Subject: [PATCH 18/28] Only START and FINISHED files are necessary. --- 02 - JS + CSS Clock/index.html | 96 ---------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 02 - JS + CSS Clock/index.html diff --git a/02 - JS + CSS Clock/index.html b/02 - JS + CSS Clock/index.html deleted file mode 100644 index ae8908f3c9..0000000000 --- a/02 - JS + CSS Clock/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - JS + CSS Clock - - - - -
-
-
-
-
-
-
- - - - - - - From 74f9110052ebc7ca2563df0b80f77eba04b0f48f Mon Sep 17 00:00:00 2001 From: Tamara Temple Date: Wed, 14 Dec 2016 21:31:47 -0600 Subject: [PATCH 19/28] Remove Exercise 01 index.html file This doesn't seem like it belongs here. The other exercises have the start and finish files, this one seems like it's already been done for us. --- 01 - JavaScript Drum Kit/index.html | 83 ----------------------------- 1 file changed, 83 deletions(-) delete mode 100644 01 - JavaScript Drum Kit/index.html diff --git a/01 - JavaScript Drum Kit/index.html b/01 - JavaScript Drum Kit/index.html deleted file mode 100644 index 8b4fd26880..0000000000 --- a/01 - JavaScript Drum Kit/index.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 -
-
- - - - - - - - - - - - - - - From c25612af9ab127bed370d90a8a0a8f8215087019 Mon Sep 17 00:00:00 2001 From: Aristotle Rovithis Date: Fri, 16 Dec 2016 06:21:09 -0500 Subject: [PATCH 20/28] removed answer code from index-START.html Ex 13 --- 13 - Slide in on Scroll/index-START.html | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/13 - Slide in on Scroll/index-START.html b/13 - Slide in on Scroll/index-START.html index 12591bad30..0b9fb8fccb 100644 --- a/13 - Slide in on Scroll/index-START.html +++ b/13 - Slide in on Scroll/index-START.html @@ -58,26 +58,6 @@

Slide in on Scroll

}; } - 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'); - } - }); - } - - window.addEventListener('scroll', debounce(checkSlide)); -