Skip to content

Commit f874b1c

Browse files
committed
Im getting loopy
1 parent 7f9ee0f commit f874b1c

File tree

6 files changed

+6822
-1
lines changed

6 files changed

+6822
-1
lines changed

exercises/33 - Etch-a-Sketch/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</div>
1717

1818
</div>
19-
<script src="./etch-a-sketch.js"></script>
19+
<script src="./etch-a-sketch-FINISHED.js"></script>
2020

2121
<style>
2222
body {
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>For Loops</title>
9+
</head>
10+
11+
<body>
12+
<script>
13+
const numbers = [2, 34, 3, 23, 42, 3, 1, 65, 364, 5, 645, 6];
14+
15+
const name = 'Wes Bos👪🏻🎅🏻👩‍👩‍👧‍👦';
16+
17+
const wes = {
18+
name: 'wes',
19+
age: 100,
20+
cool: true
21+
}
22+
23+
// For
24+
// for (let i = 100; i <= 120; i += 2) {
25+
// console.log(i);
26+
// }
27+
28+
// for (let i = 0; i < numbers.length; i++) {
29+
// console.log(numbers[i]);
30+
// }
31+
32+
// For of
33+
34+
for (const letter of name) {
35+
console.log(letter);
36+
}
37+
38+
for (const number of numbers) {
39+
console.log(number)
40+
}
41+
// For in - used for looping over keys of an object
42+
for (const prop in wes) {
43+
console.log(prop)
44+
}
45+
46+
const baseHumanStats = {
47+
feet: 2,
48+
arms: 2,
49+
eyes: 2,
50+
head: 1
51+
};
52+
53+
function Human(name) {
54+
this.name = name;
55+
}
56+
57+
Human.prototype = baseHumanStats;
58+
59+
const wes2 = new Human('wes');
60+
61+
console.log(Object.entries(wes2))
62+
63+
for (const prop in wes2) {
64+
console.log(prop);
65+
}
66+
67+
// While Loop
68+
let cool = true;
69+
let i = 1;
70+
while (cool === true) {
71+
console.log('You are cool');
72+
i++;
73+
if (i > 100) {
74+
cool = false;
75+
}
76+
}
77+
78+
</script>
79+
</body>
80+
81+
</html>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<title>Censorship</title>
7+
<link rel="stylesheet" href="../base.css">
8+
</head>
9+
10+
<body>
11+
<div class="wrap">
12+
<video class="webcam"></video>
13+
<canvas class="video"></canvas>
14+
<canvas class="face"></canvas>
15+
</div>
16+
<script src="./pixelated-face-DEMO.js"></script>
17+
18+
<style>
19+
* {
20+
box-sizing: border-box;
21+
}
22+
23+
body {
24+
margin: 0;
25+
}
26+
27+
.wrap {
28+
position: relative;
29+
min-height: 100vh;
30+
display: grid;
31+
justify-content: center;
32+
align-items: center;
33+
}
34+
35+
.wrap>* {
36+
grid-column: 1;
37+
grid-row: 1;
38+
}
39+
40+
41+
.face {
42+
position: absolute;
43+
}
44+
</style>
45+
</body>
46+
47+
</html>

0 commit comments

Comments
 (0)