Skip to content

Commit d59e19b

Browse files
committed
Fix merge conflicts with upstream
2 parents 02fa4ac + 5029405 commit d59e19b

14 files changed

Lines changed: 193 additions & 96 deletions

File tree

02_js_css_clock/index-FINISHED.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
minsHand.style.transform = `rotate(${minsDegrees}deg)`;
8686

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

03_css_variables/index-FINISHED.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
5757
margin-bottom: 50px;
5858
}
5959

60-
a {
61-
color: var(--base);
62-
text-decoration: none;
63-
}
64-
6560
input {
6661
width:100px;
6762
}

03_css_variables/index-START.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ <h2>Update CSS Variables with <span class='hl'>JS</span></h2>
4242
margin-bottom: 50px;
4343
}
4444

45-
a {
46-
color: var(--base);
47-
text-decoration: none;
48-
}
49-
5045
input {
5146
width: 100px;
5247
}

04_array_cardio_day_1/index-FINISHED.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<title>Array Cardio 💪</title>
66
</head>
77
<body>
8+
<p><em>Psst: have a look at the JavaScript Console</em> 💁</p>
89
<script>
910
// Get your shorts on - this is an array workout!
1011
// ## Array Cardio Day 1
@@ -19,6 +20,11 @@
1920
{ first: 'Johannes', last: 'Kepler', year: 1571, passed: 1630 },
2021
{ first: 'Nicolaus', last: 'Copernicus', year: 1473, passed: 1543 },
2122
{ first: 'Max', last: 'Planck', year: 1858, passed: 1947 },
23+
{ first: 'Katherine', last: 'Blodgett', year: 1898, passed: 1979 },
24+
{ first: 'Ada', last: 'Lovelace', year: 1815, passed: 1852 },
25+
{ first: 'Sarah E.', last: 'Goode', year: 1855, passed: 1905 },
26+
{ first: 'Lise', last: 'Meitner', year: 1878, passed: 1968 },
27+
{ first: 'Hanna', last: 'Hammarström', year: 1829, passed: 1909 }
2228
];
2329

2430
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 +63,9 @@
5763

5864
// 5. Sort the inventors by years lived
5965
const oldest = inventors.sort(function(a, b) {
60-
const lastGuy = a.passed - a.year;
61-
const nextGuy = b.passed - b.year;
62-
return lastGuy > nextGuy ? -1 : 1;
66+
const lastInventor = a.passed - a.year;
67+
const nextInventor = b.passed - b.year;
68+
return lastInventor > nextInventor ? -1 : 1;
6369
});
6470
console.table(oldest);
6571

@@ -75,8 +81,8 @@
7581
// 7. sort Exercise
7682
// Sort the people alphabetically by last name
7783
const alpha = people.sort((lastOne, nextOne) => {
78-
const [aLast, aFirst] = lastOne.split(', ');
79-
const [bLast, bFirst] = nextOne.split(', ');
84+
const [aFirst, aLast] = lastOne.split(', ');
85+
const [bFirst, bLast] = nextOne.split(', ');
8086
return aLast > bLast ? 1 : -1;
8187
});
8288
console.log(alpha);

04_array_cardio_day_1/index-START.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<title>Array Cardio 💪</title>
66
</head>
77
<body>
8+
<p><em>Psst: have a look at the JavaScript Console</em> 💁</p>
89
<script>
910
// Get your shorts on - this is an array workout!
1011
// ## Array Cardio Day 1
@@ -18,7 +19,12 @@
1819
{ first: 'Marie', last: 'Curie', year: 1867, passed: 1934 },
1920
{ first: 'Johannes', last: 'Kepler', year: 1571, passed: 1630 },
2021
{ first: 'Nicolaus', last: 'Copernicus', year: 1473, passed: 1543 },
21-
{ first: 'Max', last: 'Planck', year: 1858, passed: 1947 }
22+
{ first: 'Max', last: 'Planck', year: 1858, passed: 1947 },
23+
{ first: 'Katherine', last: 'Blodgett', year: 1898, passed: 1979 },
24+
{ first: 'Ada', last: 'Lovelace', year: 1815, passed: 1852 },
25+
{ first: 'Sarah E.', last: 'Goode', year: 1855, passed: 1905 },
26+
{ first: 'Lise', last: 'Meitner', year: 1878, passed: 1968 },
27+
{ first: 'Hanna', last: 'Hammarström', year: 1829, passed: 1909 }
2228
];
2329

2430
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'];
@@ -29,7 +35,7 @@
2935
// 1. Filter the list of inventors for those who were born in the 1500's
3036

3137
// Array.prototype.map()
32-
// 2. Give us an array of the inventory first and last names
38+
// 2. Give us an array of the inventors' first and last names
3339

3440
// Array.prototype.sort()
3541
// 3. Sort the inventors by birthdate, oldest to youngest

07_array_cardio_day_2/index-FINISHED.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<title>Document</title>
5+
<title>Array Cardio 💪💪</title>
66
</head>
77
<body>
8+
<p><em>Psst: have a look at the JavaScript Console</em> 💁</p>
89
<script>
910
// ## Array Cardio Day 2
1011

@@ -19,7 +20,7 @@
1920
{ text: 'Love this!', id: 523423 },
2021
{ text: 'Super good', id: 823423 },
2122
{ text: 'You are the best', id: 2039842 },
22-
{ text: 'Ramen in my fav food ever', id: 123523 },
23+
{ text: 'Ramen is my fav food ever', id: 123523 },
2324
{ text: 'Nice Nice Nice!', id: 542328 }
2425
];
2526

07_array_cardio_day_2/index-START.html

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5-
<title>Document</title>
5+
<title>Array Cardio 💪💪</title>
66
</head>
77
<body>
8+
<p><em>Psst: have a look at the JavaScript Console</em> 💁</p>
89
<script>
910
// ## Array Cardio Day 2
1011

@@ -19,48 +20,21 @@
1920
{ text: 'Love this!', id: 523423 },
2021
{ text: 'Super good', id: 823423 },
2122
{ text: 'You are the best', id: 2039842 },
22-
{ text: 'Ramen in my fav food ever', id: 123523 },
23+
{ text: 'Ramen is my fav food ever', id: 123523 },
2324
{ text: 'Nice Nice Nice!', id: 542328 }
2425
];
2526

2627
// Some and Every Checks
2728
// Array.prototype.some() // is at least one person 19?
28-
// const isAdult = people.some(function(person) {
29-
// const currentYear = (new Date()).getFullYear();
30-
// if(currentYear - person.year >= 19) {
31-
// return true;
32-
// }
33-
// });
34-
35-
const isAdult = people.some(person => ((new Date()).getFullYear()) - person.year >= 19);
36-
37-
console.log({isAdult});
3829
// Array.prototype.every() // is everyone 19?
3930

40-
const allAdults = people.every(person => ((new Date()).getFullYear()) - person.year >= 19);
41-
console.log({allAdults});
42-
4331
// Array.prototype.find()
4432
// Find is like filter, but instead returns just the one you are looking for
4533
// find the comment with the ID of 823423
4634

47-
48-
const comment = comments.find(comment => comment.id === 823423);
49-
50-
console.log(comment);
51-
5235
// Array.prototype.findIndex()
5336
// Find the comment with this ID
5437
// delete the comment with the ID of 823423
55-
const index = comments.findIndex(comment => comment.id === 823423);
56-
console.log(index);
57-
58-
// comments.splice(index, 1);
59-
60-
const newComments = [
61-
...comments.slice(0, index),
62-
...comments.slice(index + 1)
63-
];
6438

6539
</script>
6640
</body>

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>

24_sticky_nav/index-START.html

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,7 @@ <h1>A story about getting lost.</h1>
5454
</div>
5555

5656
<script>
57-
const nav = document.querySelector('#main');
58-
const topOfNav = nav.offsetTop;
59-
60-
function fixNav() {
61-
if(window.scrollY >= topOfNav) {
62-
document.body.style.paddingTop = nav.offsetHeight + 'px';
63-
document.body.classList.add('fixed-nav');
64-
} else {
65-
document.body.style.paddingTop = 0;
66-
document.body.classList.remove('fixed-nav');
67-
}
68-
}
69-
70-
window.addEventListener('scroll', fixNav);
57+
7158
</script>
7259

7360
</body>

24_sticky_nav/style-START.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ body {
2323
transition: transform 0.5s;
2424
}
2525

26-
.fixed-nav .site-wrap {
27-
transform: scale(1);
28-
}
29-
3026
header {
3127
text-align: center;
3228
height:50vh;
@@ -52,11 +48,6 @@ nav {
5248
z-index: 1;
5349
}
5450

55-
.fixed-nav nav {
56-
position: fixed;
57-
box-shadow: 0 5px rgba(0,0,0,0.1)
58-
}
59-
6051
nav ul {
6152
margin: 0;
6253
padding:0;
@@ -81,10 +72,6 @@ li.logo {
8172
font-size: 30px;
8273
}
8374

84-
.fixed-nav li.logo {
85-
max-width:500px;
86-
}
87-
8875
li.logo a {
8976
color:black;
9077
}

0 commit comments

Comments
 (0)