Skip to content

Commit 057ac84

Browse files
author
Jeff S
committed
make array cardio page pretty. unhide project wesbos#5 pages.
1 parent 1468151 commit 057ac84

File tree

4 files changed

+151
-6
lines changed

4 files changed

+151
-6
lines changed

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

+18-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>Array Cardio 💪</title>
6+
<style>
7+
.mw-category {display: none;}
8+
</style>
69
</head>
710
<body>
811
<p><em>Psst: have a look at the JavaScript Console</em> 💁</p>
@@ -74,15 +77,17 @@
7477
// Array.prototype.filter()
7578
// 1. Filter the list of inventors for those who were born in the 1500's
7679
const inventorsC16 = inventors.filter(obj => (obj.year > 1499 && obj.year < 1600));
77-
console.group('inventorsC16');
80+
console.group('1. Array.prototype.filter()');
7881
console.table(inventorsC16);
7982
console.groupEnd();
8083

8184
// Array.prototype.map()
8285
// 2. Give us an array of the inventors' first and last names
8386
// const inventorsNames = inventors.map(obj => obj.first +' '+ obj.last);
8487
const inventorsNames = inventors.map(obj => `${obj.first} ${obj.last}`);
85-
console.log('inventorsNames: ', inventorsNames);
88+
console.group('2. Array.prototype.map()');
89+
console.log(inventorsNames);
90+
console.groupEnd();
8691

8792
// Array.prototype.sort()
8893
// 3. Sort the inventors by birthdate, oldest to youngest
@@ -94,7 +99,7 @@
9499
// }
95100
// });
96101
const inventorsBornFirst = inventors.sort((a,b) => a.year > b.year ? 1 : -1);
97-
console.group('inventorsBornFirst');
102+
console.group('3. Array.prototype.sort()');
98103
console.table(inventorsBornFirst);
99104
console.groupEnd();
100105

@@ -103,15 +108,17 @@
103108
const inventorsLifespan = inventors.reduce((total, inventor) => {
104109
return total + (inventor.passed - inventor.year);
105110
}, 0);
106-
console.log('inventorsLifespan: ', inventorsLifespan);
111+
console.group('4. Array.prototype.reduce()');
112+
console.log(inventorsLifespan);
113+
console.groupEnd();
107114

108115
// 5. Sort the inventors by years lived
109116
const inventorsSeniority = inventors.sort((a,b) => {
110117
const lastOne = a.passed - a.year;
111118
const nextOne = b.passed - b.year;
112119
return lastOne > nextOne ? -1 : 1;
113120
});
114-
console.group('inventorsSeniority');
121+
console.group('5. inventorsSeniority');
115122
console.table(inventorsSeniority);
116123
console.groupEnd();
117124

@@ -120,13 +127,15 @@
120127
const city = document.querySelector('.mw-category');
121128
// const streets = [].slice.call(city.querySelectorAll('a'));
122129
const streets = Array.from(city.querySelectorAll('a'));
130+
console.group('6. Boulevards in Paris');
123131
console.log(streets);
124132
// const deStreets = streets.filter(obj => obj.innerHTML.indexOf('de') > -1);
125133
const deStreets = streets
126134
.map(obj => obj.innerHTML)
127135
// .filter(obj => obj.indexOf('de') > -1);
128136
.filter(obj => obj.includes('de'));
129137
console.log(deStreets);
138+
console.groupEnd();
130139

131140

132141
// 7. sort Exercise
@@ -138,7 +147,9 @@
138147
// console.log(bLast, bFirst);
139148
return aLast > bLast ? 1 : -1;
140149
});
150+
console.group('7. Sort Exercise');
141151
console.log(pplSorted);
152+
console.groupEnd();
142153

143154
// 8. Reduce Exercise
144155
// Sum up the instances of each of these
@@ -151,7 +162,9 @@
151162
obj[item]++;
152163
return obj;
153164
}, {});
165+
console.group('8. Reduce Exercise');
154166
console.log(instances);
167+
console.groupEnd();
155168

156169
</script>
157170
</body>
+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Flex Panels 💪</title>
6+
<link href='https://fonts.googleapis.com/css?family=Amatic+SC' rel='stylesheet' type='text/css'>
7+
</head>
8+
<body>
9+
<style>
10+
html {
11+
box-sizing: border-box;
12+
background:#ffc600;
13+
font-family:'helvetica neue';
14+
font-size: 20px;
15+
font-weight: 200;
16+
}
17+
body {
18+
margin: 0;
19+
}
20+
*, *:before, *:after {
21+
box-sizing: inherit;
22+
}
23+
24+
.panels {
25+
min-height:100vh;
26+
overflow: hidden;
27+
}
28+
29+
.panel {
30+
background:#6B0F9C;
31+
box-shadow:inset 0 0 0 5px rgba(255,255,255,0.1);
32+
color:white;
33+
text-align: center;
34+
align-items:center;
35+
/* Safari transitionend event.propertyName === flex */
36+
/* Chrome + FF transitionend event.propertyName === flex-grow */
37+
transition:
38+
font-size 0.7s cubic-bezier(0.61,-0.19, 0.7,-0.11),
39+
flex 0.7s cubic-bezier(0.61,-0.19, 0.7,-0.11),
40+
background 0.2s;
41+
font-size: 20px;
42+
background-size:cover;
43+
background-position:center;
44+
}
45+
46+
47+
.panel1 { background-image:url(https://source.unsplash.com/gYl-UtwNg_I/1500x1500); }
48+
.panel2 { background-image:url(https://source.unsplash.com/1CD3fd8kHnE/1500x1500); }
49+
.panel3 { background-image:url(https://images.unsplash.com/photo-1465188162913-8fb5709d6d57?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&cs=tinysrgb&w=1500&h=1500&fit=crop&s=967e8a713a4e395260793fc8c802901d); }
50+
.panel4 { background-image:url(https://source.unsplash.com/ITjiVXcwVng/1500x1500); }
51+
.panel5 { background-image:url(https://source.unsplash.com/3MNzGlQM7qs/1500x1500); }
52+
53+
.panel > * {
54+
margin:0;
55+
width: 100%;
56+
transition:transform 0.5s;
57+
}
58+
59+
.panel p {
60+
text-transform: uppercase;
61+
font-family: 'Amatic SC', cursive;
62+
text-shadow:0 0 4px rgba(0, 0, 0, 0.72), 0 0 14px rgba(0, 0, 0, 0.45);
63+
font-size: 2em;
64+
}
65+
.panel p:nth-child(2) {
66+
font-size: 4em;
67+
}
68+
69+
.panel.open {
70+
font-size:40px;
71+
}
72+
73+
.cta {
74+
color:white;
75+
text-decoration: none;
76+
}
77+
78+
</style>
79+
80+
81+
<div class="panels">
82+
<div class="panel panel1">
83+
<p>Hey</p>
84+
<p>Let's</p>
85+
<p>Dance</p>
86+
</div>
87+
<div class="panel panel2">
88+
<p>Give</p>
89+
<p>Take</p>
90+
<p>Receive</p>
91+
</div>
92+
<div class="panel panel3">
93+
<p>Experience</p>
94+
<p>It</p>
95+
<p>Today</p>
96+
</div>
97+
<div class="panel panel4">
98+
<p>Give</p>
99+
<p>All</p>
100+
<p>You can</p>
101+
</div>
102+
<div class="panel panel5">
103+
<p>Life</p>
104+
<p>In</p>
105+
<p>Motion</p>
106+
</div>
107+
</div>
108+
109+
<script>
110+
111+
</script>
112+
113+
114+
115+
</body>
116+
</html>

05 - Flex Panel Gallery/index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Flex Panels 💪</title>
6+
</head>
7+
<body>
8+
9+
<ul>
10+
<li><a href="index-START.html">START</a></li>
11+
<li><a href="index-FINISHED.html">FINISHED</a></li>
12+
<li><a href="index-jds.html">jds</a></li>
13+
</ul>
14+
15+
</body>
16+
</html>

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<li><a href="02 - JS + CSS Clock/index.html">02 - JS + CSS Clock</a></li>
1212
<li><a href="03 - CSS Variables/index.html">03 - CSS Variables</a></li>
1313
<li><a href="04 - Array Cardio Day 1/index.html">04 - Array Cardio Day 1</a></li>
14-
<!-- <li><a href="05 - Flex Panel Gallery/index.html">05 - Flex Panel Gallery</a></li> -->
14+
<li><a href="05 - Flex Panel Gallery/index.html">05 - Flex Panel Gallery</a></li>
1515
<!-- <li><a href="06 - Type Ahead/index.html">06 - Type Ahead</a></li> -->
1616
<!-- <li><a href="07 - Array Cardio Day 2/index.html">07 - Array Cardio Day 2</a></li> -->
1717
<!-- <li><a href="08 - Fun with HTML5 Canvas/index.html">08 - Fun with HTML5 Canvas</a></li> -->

0 commit comments

Comments
 (0)