diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..d15774c399 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -59,6 +59,33 @@ diff --git a/01 - JavaScript Drum Kit/style.css b/01 - JavaScript Drum Kit/style.css index 3e0a320b37..4c51018c84 100644 --- a/01 - JavaScript Drum Kit/style.css +++ b/01 - JavaScript Drum Kit/style.css @@ -34,7 +34,7 @@ body,html { .playing { transform:scale(1.1); border-color:#ffc600; - box-shadow: 0 0 10px #ffc600; + box-shadow: 0 0 25px #ffc600; } kbd { diff --git a/02 - JS + CSS Clock/index-START.html b/02 - JS + CSS Clock/index-START.html index 2712384201..2c22684826 100644 --- a/02 - JS + CSS Clock/index-START.html +++ b/02 - JS + CSS Clock/index-START.html @@ -9,9 +9,12 @@
-
-
-
+
+
+
+
+
+
@@ -61,12 +64,69 @@ background:black; position: absolute; top:50%; + -ms-transform: rotate(90deg); /* IE 9 */ + -ms-transform-origin: 100%; /* IE 9 */ + -webkit-transform: rotate(90deg); /* Chrome, Safari, Opera */ + -webkit-transform-origin: 100%; /* Chrome, Safari, Opera */ + transform: rotate(90deg); + transform-origin: 100%; + -webkit-transition-timing-function: cubic-bezier(.46,.53,.88,1.26); + transition-timing-function: cubic-bezier(.46,.53,.88,1.26); + -webkit-transition-duration: 0.1s; /* Safari */ + transition-duration: 0.1s; + } + .hour-hand-total { + height: 8px; + border: 0; + background:0; + } + .hour-hand-left { + height: 0px; + width: 25%; + float: left; + border: 0; + background:0; + } + .hour-hand-right { + height: 8px; + width: 75%; + float: right; + background:black; + } + .second-hand { + height: 4px; } diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index 7171607a8b..a14a9e49a9 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -15,13 +15,29 @@

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 index 927fb03540..5b794e45c8 100644 --- a/04 - Array Cardio Day 1/index-START.html +++ b/04 - Array Cardio Day 1/index-START.html @@ -6,11 +6,10 @@ diff --git a/05 - Flex Panel Gallery/index-START.html b/05 - Flex Panel Gallery/index-START.html index e1d643ad5c..5659a88641 100644 --- a/05 - Flex Panel Gallery/index-START.html +++ b/05 - Flex Panel Gallery/index-START.html @@ -24,6 +24,7 @@ .panels { min-height:100vh; overflow: hidden; + display: flex; } .panel { @@ -41,6 +42,11 @@ font-size: 20px; background-size:cover; background-position:center; + flex:1; + justify-content: center; + align-items: center; + display: flex; + flex-direction: column; } @@ -54,8 +60,17 @@ margin:0; width: 100%; transition:transform 0.5s; + flex:1 0 auto; + display:flex; + justify-content:center; + align-items:center; } + .panel > *:first-child {transform:translateY(-100%);} + .panel.open-active > *:first-child {transform:translateY(0);} + .panel > *:last-child {transform:translateY(100%);} + .panel.open-active > *:last-child {transform:translateY(0);} + .panel p { text-transform: uppercase; font-family: 'Amatic SC', cursive; @@ -68,6 +83,7 @@ .panel.open { font-size:40px; + flex: 5; } .cta { @@ -80,34 +96,51 @@
-

Hey

-

Let's

-

Dance

+

Also

+

Think

+

About Others

-

Give

-

Take

-

Receive

+

Work

+

Hard

+

Most Days

-

Experience

-

It

-

Today

+

Think

+

About

+

The World

-

Give

-

All

-

You can

+

It's

+

Your

+

Future

-

Life

-

In

-

Motion

+

The

+

Future

+

Is Change

diff --git a/06 - Type Ahead/index-START.html b/06 - Type Ahead/index-START.html index 1436886918..cbd3a5c78b 100644 --- a/06 - Type Ahead/index-START.html +++ b/06 - Type Ahead/index-START.html @@ -10,12 +10,72 @@
diff --git a/07 - Array Cardio Day 2/index-START.html b/07 - Array Cardio Day 2/index-START.html index b80ab6b650..3fdde2a8b5 100644 --- a/07 - Array Cardio Day 2/index-START.html +++ b/07 - Array Cardio Day 2/index-START.html @@ -23,17 +23,38 @@ { text: 'Nice Nice Nice!', id: 542328 } ]; + var thisYear = (new Date()).getFullYear(); + // Some and Every Checks - // Array.prototype.some() // is at least one person 19? - // Array.prototype.every() // is everyone 19? + // Array.prototype.some() // is at least one person 18? + var supervision = people.some(function(person){ + return (thisYear - person.year) > 17; + }); + console.log('At least one adult? ' + supervision.toString()); + + // Array.prototype.every() // is everyone 18? + var adultParty = people.every(function(person){ + return (thisYear - person.year) > 17; + }); + console.log('All adults? ' + adultParty.toString()); // 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 + var isSuperGood = comments.find(function(comment){ + return comment.id === 823423; + }); + console.table(isSuperGood); // Array.prototype.findIndex() // Find the comment with this ID // delete the comment with the ID of 823423 + var superIndex = comments.find(function(comment){ + return comment.id === 823423; + }); + console.log('We want to remove index: ' + superIndex.toString()); + comments.splice(superIndex, 1); + console.table(comments); diff --git a/08 - Fun with HTML5 Canvas/index-START.html b/08 - Fun with HTML5 Canvas/index-START.html index 37c148df07..f3fbe83676 100644 --- a/08 - Fun with HTML5 Canvas/index-START.html +++ b/08 - Fun with HTML5 Canvas/index-START.html @@ -7,6 +7,71 @@ diff --git a/17 - Sort Without Articles/index-START.html b/17 - Sort Without Articles/index-START.html index cfaf3e0440..5bfffb5ccd 100644 --- a/17 - Sort Without Articles/index-START.html +++ b/17 - Sort Without Articles/index-START.html @@ -43,8 +43,29 @@ diff --git a/18 - Adding Up Times with Reduce/index-START.html b/18 - Adding Up Times with Reduce/index-START.html index 3eaee0f3ef..5beea42c38 100644 --- a/18 - Adding Up Times with Reduce/index-START.html +++ b/18 - Adding Up Times with Reduce/index-START.html @@ -5,6 +5,7 @@ Codestin Search App +

Total Time:

diff --git a/22 - Follow Along Link Highlighter/index-START.html b/22 - Follow Along Link Highlighter/index-START.html index 8476112b5e..88eb10b06d 100644 --- a/22 - Follow Along Link Highlighter/index-START.html +++ b/22 - Follow Along Link Highlighter/index-START.html @@ -26,7 +26,22 @@ diff --git a/22 - Follow Along Link Highlighter/style.css b/22 - Follow Along Link Highlighter/style.css index 222e27ae68..dbf96e3f1d 100644 --- a/22 - Follow Along Link Highlighter/style.css +++ b/22 - Follow Along Link Highlighter/style.css @@ -38,7 +38,7 @@ a { background:white; left:0; z-index: -1; - border-radius:20px; + border-radius:10px; display: block; box-shadow: 0 0 10px rgba(0,0,0,0.2) } diff --git a/24 - Sticky Nav/index-START.html b/24 - Sticky Nav/index-START.html index 4982537eea..54be3aba73 100644 --- a/24 - Sticky Nav/index-START.html +++ b/24 - Sticky Nav/index-START.html @@ -54,20 +54,23 @@

A story about getting lost.

diff --git a/25 - Event Capture, Propagation, Bubbling and Once/index-START.html b/25 - Event Capture, Propagation, Bubbling and Once/index-START.html index 98f5e070c4..5200223173 100644 --- a/25 - Event Capture, Propagation, Bubbling and Once/index-START.html +++ b/25 - Event Capture, Propagation, Bubbling and Once/index-START.html @@ -37,9 +37,25 @@ } - + diff --git a/27 - Click and Drag/index-START.html b/27 - Click and Drag/index-START.html index b8609315f7..708f42d252 100644 --- a/27 - Click and Drag/index-START.html +++ b/27 - Click and Drag/index-START.html @@ -35,6 +35,34 @@ diff --git a/27 - Click and Drag/style.css b/27 - Click and Drag/style.css index 209b32cae5..f25d7ff690 100644 --- a/27 - Click and Drag/style.css +++ b/27 - Click and Drag/style.css @@ -19,7 +19,7 @@ body { } .items { - height:800px; + height:400px; padding: 100px; width:100%; border:1px solid white; diff --git a/29 - Countown Timer/index.html b/29 - Countown Timer/index.html index d54f447dd9..742cbe177b 100644 --- a/29 - Countown Timer/index.html +++ b/29 - Countown Timer/index.html @@ -9,11 +9,11 @@
- - - - - + + + + +
diff --git a/29 - Countown Timer/scripts-START.js b/29 - Countown Timer/scripts-START.js index e69de29bb2..a9022bc91b 100644 --- a/29 - Countown Timer/scripts-START.js +++ b/29 - Countown Timer/scripts-START.js @@ -0,0 +1,62 @@ + + +var Timer = (function() { + var mainTimer = document.getElementsByClassName("display__time-left")[0]; + var timeForm = document.customForm.minutes; + var countDown; + var startTime; + var endTime; + + var timer = function() { + var secondsLeft = Math.round((endTime - Date.now()) / 1000); + if (secondsLeft < 0) { + clearInterval(countDown); + return; + } + displayTimeLeft(secondsLeft); + }; + + var displayTimeLeft = function(seconds) { + var hr = Math.floor(seconds / 3600); + var min = Math.floor(seconds / 60); + var sec = seconds % 60; + if (hr > 0) { + min = min > 9 ? min.toString() : '0' + min; + } + sec = sec > 9 ? sec.toString() : '0' + sec; + var timeString = hr > 0 ? hr + ':' + min + ':' + sec : min + ':' + sec; + mainTimer.textContent = timeString; + document.title = timeString; + }; + + return { + startTimer: function(seconds) { + clearInterval(countDown); + startTime = Date.now(); + endTime = startTime + seconds * 1000; + displayTimeLeft(seconds); + countDown = setInterval(timer, 1000); + }, + attachHandlers: function() { + // handle pre-set buttons + var buttons = document.getElementsByClassName('timer__button'); + for (var i=0; i < buttons.length; i += 1){ + buttons[i].addEventListener('click', function() { + Timer.startTimer(this.dataset['time']); + }); + } + + // handle user-entry box + document.customForm.addEventListener('submit', function(e){ + e.preventDefault(); + var runTime = Math.round(this.minutes.value * 60); + if (!isNaN(runTime)) { + Timer.startTimer(runTime); + } + this.reset(); + }); + } + }; +}()); + +Timer.attachHandlers(); diff --git a/30 - Whack A Mole/index-START.html b/30 - Whack A Mole/index-START.html index 2014ff458c..1d02e87052 100644 --- a/30 - Whack A Mole/index-START.html +++ b/30 - Whack A Mole/index-START.html @@ -9,33 +9,104 @@

Whack-a-mole! 0

- +
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/30 - Whack A Mole/style.css b/30 - Whack A Mole/style.css index 8fec3f5d8e..d04bb1ef03 100644 --- a/30 - Whack A Mole/style.css +++ b/30 - Whack A Mole/style.css @@ -21,6 +21,17 @@ h1 { margin-bottom: 0; } +button { + display:flex; + flex-wrap:wrap; + margin:0 auto; + text-align: center; + font-size: 2rem; + background:rgba(255,255,255,0.2); + border-radius: 5px; + margin-top: 1em; +} + .score { background:rgba(255,255,255,0.2); padding:0 3rem; diff --git a/readme.md b/readme.md index 6c4ee28eea..b33b65741e 100644 --- a/readme.md +++ b/readme.md @@ -1,15 +1,35 @@ -![](https://javascript30.com/images/JS3-social-share.png) +![JavaScript 30 logo](https://javascript30.com/images/JS3-social-share.png) # JavaScript30 -Starter Files + Completed solutions for the JavaScript 30 Day Challenge. +This is forked from the eponymous 30-day coding challenge. Grab the course at [https://JavaScript30.com](https://JavaScript30.com) -## Pull Requests +## Finished Pages -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. +What follows are finished pages from the coding challenge. -The starter files + solutions will be updated if/when the videos are updated. - -Thanks! +1. [Drum Kit](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/01%20-%20JavaScript%20Drum%20Kit/index-START.html) +2. [Clock](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/02%20-%20JS%20%2B%20CSS%20Clock/index-START.html) +3. [CSS Variables](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/03%20-%20CSS%20Variables/index-START.html) +4. [Fancy Arrays](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/04%20-%20Array%20Cardio%20Day%201/index-START.html) +5. [Flex Panel Gallery](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/05%20-%20Flex%20Panel%20Gallery/index-START.html) +6. [AJAX Type Ahead](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/06%20-%20Type%20Ahead/index-START.html) +7. [More Fancy Arrays](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/07%20-%20Array%20Cardio%20Day%202/index-START.html) +8. [HTML Canvas](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/08%20-%20Fun%20with%20HTML5%20Canvas/index-START.html) +9. [Console Fun](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/09%20-%20Dev%20Tools%20Domination/index-START.html) +10. [Checkbox Shifting](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/10%20-%20Hold%20Shift%20and%20Check%20Checkboxes/index-START.html) +12. [The Konami Code](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/12%20-%20Key%20Sequence%20Detection/index-START.html) +13. [Slide in on Scroll](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/13%20-%20Slide%20in%20on%20Scroll/index-START.html) +14. [JavaScript References VS Copying](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/14%20-%20JavaScript%20References%20VS%20Copying/index-START.html) +15. [LocalStorage](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/15%20-%20LocalStorage/index-START.html) +16. [Mouse Move Shadow](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/16%20-%20Mouse%20Move%20Shadow/index-start.html) +17. [Sort Without Articles](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/17%20-%20Sort%20Without%20Articles/index-START.html) +18. [Adding Up Times with Reduce](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/18%20-%20Adding%20Up%20Times%20with%20Reduce/index-START.html) +22. [Follow Along Link Highlighter](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/22%20-%20Follow%20Along%20Link%20Highlighter/index-START.html) +24. [Sticky Nav](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/24%20-%20Sticky%20Nav/index-START.html) +25. [Event Capture, Propagation, Bubbling and Once](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/25%20-%20Event%20Capture%2C%20Propagation%2C%20Bubbling%20and%20Once/index-START.html) +27. [Click and Drag](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/27%20-%20Click%20and%20Drag/index-START.html) +29. [Countown Timer](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/29%20-%20Countown%20Timer/index.html) +30. [Whack A Mole](http://htmlpreview.github.io/?https://github.com/theJollySin/JavaScript30/blob/master/30%20-%20Whack%20A%20Mole/index-START.html)