Skip to content

Commit 2d32d6d

Browse files
committed
Merge branch 'master' of github.com:wesbos/JavaScript30
2 parents b720bf5 + 8010f0f commit 2d32d6d

File tree

10 files changed

+15
-48
lines changed

10 files changed

+15
-48
lines changed

02 - JS + CSS Clock/index-FINISHED.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@
8181
secondHand.style.transform = `rotate(${secondsDegrees}deg)`;
8282

8383
const mins = now.getMinutes();
84-
const minsDegrees = ((mins / 60) * 360) + 90;
84+
const minsDegrees = ((mins / 60) * 360) + ((seconds/60)*6) + 90;
8585
minsHand.style.transform = `rotate(${minsDegrees}deg)`;
8686

8787
const hour = now.getHours();
88-
const hourDegrees = ((hour / 12) * 360) + 90;
88+
const hourDegrees = ((hour / 12) * 360) + ((mins/60)*30) + 90;
8989
hourHand.style.transform = `rotate(${hourDegrees}deg)`;
9090
}
9191

03 - CSS Variables/index-FINISHED.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
99

1010
<div class="controls">
1111
<label for="spacing">Spacing:</label>
12-
<input type="range" name="spacing" min="10" max="200" value="10" data-sizing="px">
12+
<input id="spacing" type="range" name="spacing" min="10" max="200" value="10" data-sizing="px">
1313

1414
<label for="blur">Blur:</label>
15-
<input type="range" name="blur" min="0" max="25" value="10" data-sizing="px">
15+
<input id="blur" type="range" name="blur" min="0" max="25" value="10" data-sizing="px">
1616

1717
<label for="base">Base Color</label>
18-
<input type="color" name="base" value="#ffc600">
18+
<input id="base" type="color" name="base" value="#ffc600">
1919
</div>
2020

2121
<img src="https://source.unsplash.com/7bwQXzbF6KE/800x500">

03 - CSS Variables/index-START.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
99

1010
<div class="controls">
1111
<label for="spacing">Spacing:</label>
12-
<input type="range" name="spacing" min="10" max="200" value="10" data-sizing="px">
12+
<input id="spacing" type="range" name="spacing" min="10" max="200" value="10" data-sizing="px">
1313

1414
<label for="blur">Blur:</label>
15-
<input type="range" name="blur" min="0" max="25" value="10" data-sizing="px">
15+
<input id="blur" type="range" name="blur" min="0" max="25" value="10" data-sizing="px">
1616

1717
<label for="base">Base Color</label>
18-
<input type="color" name="base" value="#ffc600">
18+
<input id="base" type="color" name="base" value="#ffc600">
1919
</div>
2020

2121
<img src="https://source.unsplash.com/7bwQXzbF6KE/800x500">

04 - Array Cardio Day 1/index-FINISHED.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
// 7. sort Exercise
8282
// Sort the people alphabetically by last name
8383
const alpha = people.sort((lastOne, nextOne) => {
84-
const [aFirst, aLast] = lastOne.split(', ');
85-
const [bFirst, bLast] = nextOne.split(', ');
84+
const [aLast, aFirst] = lastOne.split(', ');
85+
const [bLast, bFirst] = nextOne.split(', ');
8686
return aLast > bLast ? 1 : -1;
8787
});
8888
console.log(alpha);

04 - Array Cardio Day 1/index-START.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
{ first: 'Hanna', last: 'Hammarström', year: 1829, passed: 1909 }
2828
];
2929

30-
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'];
31-
32-
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'];
30+
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'];
3331

3432
// Array.prototype.filter()
3533
// 1. Filter the list of inventors for those who were born in the 1500's

07 - Array Cardio Day 2/index-START.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
];
2626

2727
// Some and Every Checks
28-
// Array.prototype.some() // is at least one person 19?
29-
// Array.prototype.every() // is everyone 19?
28+
// Array.prototype.some() // is at least one person 19 or older?
29+
// Array.prototype.every() // is everyone 19 or older?
3030

3131
// Array.prototype.find()
3232
// Find is like filter, but instead returns just the one you are looking for

11 - Custom Video Player/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div class="progress__filled"></div>
1616
</div>
1717
<button class="player__button toggle" title="Toggle Play"></button>
18-
<input type="range" name="volume" class="player__slider" min=0 max="1" step="0.05" value="1">
18+
<input type="range" name="volume" class="player__slider" min="0" max="1" step="0.05" value="1">
1919
<input type="range" name="playbackRate" class="player__slider" min="0.5" max="2" step="0.1" value="1">
2020
<button data-skip="-10" class="player__button">« 10s</button>
2121
<button data-skip="25" class="player__button">25s »</button>

13 - Slide in on Scroll/index-START.html

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,6 @@ <h1>Slide in on Scroll</h1>
5858
};
5959
}
6060

61-
const sliderImages = document.querySelectorAll('.slide-in');
62-
63-
function checkSlide(e) {
64-
sliderImages.forEach(sliderImage => {
65-
// half way through the image
66-
const slideInAt = (window.scrollY + window.innerHeight) - sliderImage.height / 2;
67-
// bottom of the image
68-
const imageBottom = sliderImage.offsetTop + sliderImage.height;
69-
const isHalfShown = slideInAt > sliderImage.offsetTop;
70-
const isNotScrolledPast = window.scrollY < imageBottom;
71-
if (isHalfShown && isNotScrolledPast) {
72-
sliderImage.classList.add('active');
73-
} else {
74-
sliderImage.classList.remove('active');
75-
}
76-
});
77-
}
78-
79-
window.addEventListener('scroll', debounce(checkSlide));
80-
8161
</script>
8262

8363
<style>

21 - Geolocation/index-START.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,6 @@ <h1 class="speed">
5757
/*Compass: https://thenounproject.com/search/?q=compass&i=592352*/
5858
</style>
5959
<script>
60-
const arrow = document.querySelector('.arrow');
61-
const speed = document.querySelector('.speed-value');
62-
63-
navigator.geolocation.watchPosition((data) => {
64-
console.log(data);
65-
speed.textContent = data.coords.speed;
66-
arrow.style.transform = `rotate(${data.coords.heading}deg)`;
67-
}, (err) => {
68-
console.err(err);
69-
alert('HEY! YOU GOTTA ALLOW THAT TO HAPPEN!!!');
70-
});
71-
7260
</script>
7361
</body>
7462
</html>

27 - Click and Drag/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ body {
3131
cursor: pointer;
3232
transition: all 0.2s;
3333
transform: scale(0.98);
34+
will-change: transform;
3435
position: relative;
3536
background: rgba(255,255,255,0.1);
3637
font-size: 0;

0 commit comments

Comments
 (0)