From e15ea709a7b9e84653a5e5ba2110a107ef2f0914 Mon Sep 17 00:00:00 2001 From: YC000 Date: Tue, 30 Jun 2020 01:15:54 -0400 Subject: [PATCH 01/27] day 1 --- 01 - JavaScript Drum Kit/index-START.html | 68 ++++++++++++++++++++++- 1 file changed, 66 insertions(+), 2 deletions(-) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index 4070d32767..d97cb740ff 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -7,7 +7,8 @@ - + +
A @@ -58,9 +59,72 @@ + + + + + + + + + + + + + + + From 0842f41152f7bee0787e27551e41e7ba51f4840a Mon Sep 17 00:00:00 2001 From: YC000 Date: Tue, 30 Jun 2020 12:27:37 -0400 Subject: [PATCH 02/27] refactor day 1, wrap with IIFE --- 01 - JavaScript Drum Kit/index-START.html | 98 +++++++++++------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/01 - JavaScript Drum Kit/index-START.html b/01 - JavaScript Drum Kit/index-START.html index d97cb740ff..63692877c3 100644 --- a/01 - JavaScript Drum Kit/index-START.html +++ b/01 - JavaScript Drum Kit/index-START.html @@ -59,55 +59,55 @@ From c73d13fffe639d7a57a4ceba33b7d12276c7d87c Mon Sep 17 00:00:00 2001 From: YC000 Date: Tue, 30 Jun 2020 14:42:27 -0400 Subject: [PATCH 03/27] day 2 try 1 --- 02 - JS and CSS Clock/index-START.html | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index-START.html index 7a6d27d5bd..588c0c6565 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index-START.html @@ -62,12 +62,75 @@ background: black; position: absolute; top: 50%; + transform: rotate(90deg); + transform-origin: 100%; + transition-timing-function: cubic-bezier(0.35, 2.12, 0.58, 1); + transition: all 0.05s; } From 691d6de53a7ad46357f7267056c685d3aabbea7a Mon Sep 17 00:00:00 2001 From: YC000 Date: Tue, 30 Jun 2020 21:20:19 -0400 Subject: [PATCH 04/27] day 2 refactor --- 02 - JS and CSS Clock/index-START.html | 152 +++++++------------------ 02 - JS and CSS Clock/style.css | 58 ++++++++++ 2 files changed, 96 insertions(+), 114 deletions(-) create mode 100644 02 - JS and CSS Clock/style.css diff --git a/02 - JS and CSS Clock/index-START.html b/02 - JS and CSS Clock/index-START.html index 588c0c6565..145fef9cd1 100644 --- a/02 - JS and CSS Clock/index-START.html +++ b/02 - JS and CSS Clock/index-START.html @@ -3,10 +3,10 @@ JS + CSS Clock + -
@@ -15,123 +15,47 @@
- - - - + diff --git a/02 - JS and CSS Clock/style.css b/02 - JS and CSS Clock/style.css new file mode 100644 index 0000000000..c396b7bd7c --- /dev/null +++ b/02 - JS and CSS Clock/style.css @@ -0,0 +1,58 @@ +html { + background: #018DED url(https://unsplash.it/1500/1000?image=881&blur=5); + background-size: cover; + font-family: 'helvetica neue'; + text-align: center; + font-size: 10px; +} + +body { + margin: 0; + font-size: 2rem; + display: flex; + flex: 1; + min-height: 100vh; + align-items: center; +} + +.clock { + width: 30rem; + height: 30rem; + border: 20px solid white; + border-radius: 50%; + margin: 50px auto; + position: relative; + padding: 2rem; + box-shadow: + 0 0 0 4px rgba(0,0,0,0.1), + inset 0 0 0 3px #EFEFEF, + inset 0 0 10px black, + 0 0 10px rgba(0,0,0,0.2); +} + +.clock-face { + position: relative; + width: 100%; + height: 100%; + transform: translateY(-3px); /* account for the height of the clock hands */ +} + +.hand { + width: 50%; + height: 6px; + background: black; + position: absolute; + top: 50%; + transform: rotate(90deg); + transform-origin: 100%; + transition-timing-function: cubic-bezier(0.35, 2.12, 0.58, 1); + transition: all 0.05s; +} + +.min-hand { + background: dimgray; +} + +.second-hand { + background: gray; +} \ No newline at end of file From 91d3749756fc91b4e16956e7a3881021e24082ec Mon Sep 17 00:00:00 2001 From: YC000 Date: Tue, 30 Jun 2020 23:52:18 -0400 Subject: [PATCH 05/27] day 3 --- 03 - CSS Variables/index-START.html | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index 6b9b539c09..c2b46b4757 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -21,6 +21,21 @@

Update CSS Variables with JS

From 0b36e583050876ff9b12e689451e446ac9b0ddec Mon Sep 17 00:00:00 2001 From: YC000 Date: Tue, 30 Jun 2020 23:57:07 -0400 Subject: [PATCH 06/27] update html min value to match css variable, initialize variables to init value in html --- 03 - CSS Variables/index-START.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index c2b46b4757..eb427438d8 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -9,7 +9,7 @@

Update CSS Variables with JS

- + @@ -23,7 +23,7 @@

Update CSS Variables with JS

+ From 788b72ca3391c3bea78b3d0dd7999c93d5723aca Mon Sep 17 00:00:00 2001 From: YC000 Date: Mon, 6 Jul 2020 20:43:00 -0400 Subject: [PATCH 11/27] day 8 exercise 9 and 12 --- 09 - Dev Tools Domination/index-START.html | 38 ++++++++++++++++++++ 12 - Key Sequence Detection/index-START.html | 23 ++++++++++++ 2 files changed, 61 insertions(+) diff --git a/09 - Dev Tools Domination/index-START.html b/09 - Dev Tools Domination/index-START.html index 196fffd719..371237047a 100644 --- a/09 - Dev Tools Domination/index-START.html +++ b/09 - Dev Tools Domination/index-START.html @@ -11,6 +11,8 @@ diff --git a/12 - Key Sequence Detection/index-START.html b/12 - Key Sequence Detection/index-START.html index dc53c4e9e1..132ee01cf7 100644 --- a/12 - Key Sequence Detection/index-START.html +++ b/12 - Key Sequence Detection/index-START.html @@ -7,6 +7,29 @@ From 691a03bd99e305030834931aa8858894d211584f Mon Sep 17 00:00:00 2001 From: YC000 Date: Wed, 8 Jul 2020 01:53:53 -0400 Subject: [PATCH 12/27] day 9 exercise 10 --- .../index-START.html | 58 ++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/10 - Hold Shift and Check Checkboxes/index-START.html b/10 - Hold Shift and Check Checkboxes/index-START.html index 4fd2936ddc..7db98612c7 100644 --- a/10 - Hold Shift and Check Checkboxes/index-START.html +++ b/10 - Hold Shift and Check Checkboxes/index-START.html @@ -53,8 +53,9 @@
@@ -96,6 +97,59 @@
From adb5b78b07a1ffe2925e21215e6399805aea5588 Mon Sep 17 00:00:00 2001 From: YC000 Date: Fri, 10 Jul 2020 01:06:07 -0400 Subject: [PATCH 13/27] day 10 exercise 13 --- 13 - Slide in on Scroll/index-START.html | 69 +++++++++++++++++++----- 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/13 - Slide in on Scroll/index-START.html b/13 - Slide in on Scroll/index-START.html index ad2f0e580a..2656c31e5d 100644 --- a/13 - Slide in on Scroll/index-START.html +++ b/13 - Slide in on Scroll/index-START.html @@ -43,21 +43,64 @@

Slide in on Scroll

From 392efe532711e388244e990b1648b06352b01902 Mon Sep 17 00:00:00 2001 From: YC000 Date: Wed, 15 Jul 2020 23:21:26 -0400 Subject: [PATCH 18/27] day 14 exercise 18 --- .../index-START.html | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/18 - Adding Up Times with Reduce/index-START.html b/18 - Adding Up Times with Reduce/index-START.html index abdf4c91af..9558071b81 100644 --- a/18 - Adding Up Times with Reduce/index-START.html +++ b/18 - Adding Up Times with Reduce/index-START.html @@ -182,6 +182,29 @@ From 0f9cc817126c2ae0b23961ff91a3442c47e5f858 Mon Sep 17 00:00:00 2001 From: YC000 Date: Thu, 16 Jul 2020 17:42:18 -0400 Subject: [PATCH 19/27] day 15 exercise 15 --- 15 - LocalStorage/index-START.html | 83 ++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/15 - LocalStorage/index-START.html b/15 - LocalStorage/index-START.html index d444f1d68b..2fef1b2d10 100644 --- a/15 - LocalStorage/index-START.html +++ b/15 - LocalStorage/index-START.html @@ -26,9 +26,86 @@

LOCAL TAPAS

From 84e9e435f58f81e692a97901f22356a8962d4b9c Mon Sep 17 00:00:00 2001 From: YC000 Date: Mon, 20 Jul 2020 12:29:11 -0400 Subject: [PATCH 20/27] day 18 (skip 3 days), exercise 20 --- 20 - Speech Detection/index-START.html | 66 +++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/20 - Speech Detection/index-START.html b/20 - Speech Detection/index-START.html index 31b4042563..70ef59deed 100644 --- a/20 - Speech Detection/index-START.html +++ b/20 - Speech Detection/index-START.html @@ -10,8 +10,72 @@
From b9837e69e931cf2d4a58fb478e57a9a4d7e84e5a Mon Sep 17 00:00:00 2001 From: YC000 Date: Fri, 31 Jul 2020 18:23:34 -0400 Subject: [PATCH 21/27] day 29 skip 11 days, exercise 22 --- .../index-START.html | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/22 - Follow Along Link Highlighter/index-START.html b/22 - Follow Along Link Highlighter/index-START.html index 8476112b5e..05463c5df4 100644 --- a/22 - Follow Along Link Highlighter/index-START.html +++ b/22 - Follow Along Link Highlighter/index-START.html @@ -26,7 +26,45 @@
From 9fdce1fcdf78a573484c2f6ee6be08b92fc7da26 Mon Sep 17 00:00:00 2001 From: YC000 Date: Fri, 7 Aug 2020 00:01:49 -0400 Subject: [PATCH 22/27] day 35 skipped 6 days, exercise 23 --- 23 - Speech Synthesis/index-START.html | 57 ++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/23 - Speech Synthesis/index-START.html b/23 - Speech Synthesis/index-START.html index e890008d36..c1822ebda1 100644 --- a/23 - Speech Synthesis/index-START.html +++ b/23 - Speech Synthesis/index-START.html @@ -22,19 +22,62 @@

The Voiceinator 5000

- + From 1c7fe73800ae68ec312d87136b6384e3f7f996e0 Mon Sep 17 00:00:00 2001 From: YC000 Date: Wed, 12 Aug 2020 18:10:22 -0400 Subject: [PATCH 23/27] day 38, exercise 21 (note: require mobile device) --- 21 - Geolocation/index-START.html | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/21 - Geolocation/index-START.html b/21 - Geolocation/index-START.html index 6d48c7a6d1..9e8ff90606 100644 --- a/21 - Geolocation/index-START.html +++ b/21 - Geolocation/index-START.html @@ -14,6 +14,15 @@

KM/H

+

+ Latitude: + 0 +

+

+ Longitude: + 0 +

+ From 8539237b6445af32df92f9e2fbd8e18630a16d8c Mon Sep 17 00:00:00 2001 From: YC000 Date: Thu, 20 Aug 2020 17:52:22 -0400 Subject: [PATCH 24/27] day ?? exercise 24 --- 24 - Sticky Nav/index-START.html | 43 ++++++++++++++++++++++++++++++++ 24 - Sticky Nav/style-START.css | 13 ++++++++++ 2 files changed, 56 insertions(+) diff --git a/24 - Sticky Nav/index-START.html b/24 - Sticky Nav/index-START.html index e7bc67e9a5..6d88fe96d3 100644 --- a/24 - Sticky Nav/index-START.html +++ b/24 - Sticky Nav/index-START.html @@ -54,6 +54,49 @@

A story about getting lost.

diff --git a/24 - Sticky Nav/style-START.css b/24 - Sticky Nav/style-START.css index b83b9c01ae..19d5c50db6 100644 --- a/24 - Sticky Nav/style-START.css +++ b/24 - Sticky Nav/style-START.css @@ -25,6 +25,10 @@ body { transition: transform 0.5s; } +.sticky-nav .site-wrap { + transform: scale(1); +} + header { text-align: center; height: 50vh; @@ -50,6 +54,11 @@ nav { z-index: 1; } +body.sticky-nav nav { + position: fixed; + box-shadow: 0 5px 0 rgba(0,0,0,0.1); /* add shadow for beauty */ +} + nav ul { margin: 0; padding:0; @@ -74,6 +83,10 @@ li.logo { font-size: 30px; } +.sticky-nav li.logo { + max-width: 500px; +} + li.logo a { color: black; } From 5c465eb1408ec9000a2897e57558a31903b5947c Mon Sep 17 00:00:00 2001 From: YC000 Date: Sun, 30 Aug 2020 22:36:12 -0400 Subject: [PATCH 25/27] day ? exercise 19 --- 19 - Webcam Fun/index.html | 65 ++++++++++------ 19 - Webcam Fun/scripts.js | 147 ++++++++++++++++++++++++++++++++++++- 2 files changed, 188 insertions(+), 24 deletions(-) diff --git a/19 - Webcam Fun/index.html b/19 - Webcam Fun/index.html index d6cc360cad..6701f2bb18 100755 --- a/19 - Webcam Fun/index.html +++ b/19 - Webcam Fun/index.html @@ -1,45 +1,64 @@ - - Get User Media Code Along! - + + Get User Media Code Along! + -
+
- - +
+ Greenscreen +
+ + + + + + +
+ + + + + + +
+ + + + + +
+
+
-
+
- + - + diff --git a/19 - Webcam Fun/scripts.js b/19 - Webcam Fun/scripts.js index 00355f5a9c..a31168fc9d 100644 --- a/19 - Webcam Fun/scripts.js +++ b/19 - Webcam Fun/scripts.js @@ -2,4 +2,149 @@ const video = document.querySelector('.player'); const canvas = document.querySelector('.photo'); const ctx = canvas.getContext('2d'); const strip = document.querySelector('.strip'); -const snap = document.querySelector('.snap'); +const snapSound = document.querySelector('.snap'); + +const greenScreenInput = document.querySelectorAll('.rgb input'); +const coloringInput = document.querySelectorAll('#coloring input'); +const coloringSwitch = document.querySelector('#coloringSwitch'); +const greenscreenSwitch = document.querySelector('#greenscreenSwitch'); +const splitSwitch = document.querySelector('#splitSwitch'); + +function takeVideo() { + // ask the user for permission for video use + // returns a promise containing a MediaStream + navigator.mediaDevices.getUserMedia({audio: false, video: true}) + .then(mediaStream => { + // note that before a