Skip to content

Commit caa5e21

Browse files
author
Lauren McCarthy
committed
updating homepage sketch
1 parent db5645c commit caa5e21

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html><html><head>
2+
<script src="../../js/p5.min.js"></script>
3+
<link rel="stylesheet" type="text/css" href="style.css">
4+
<meta charset="utf-8">
5+
6+
</head>
7+
<body>
8+
<script src="sketch.js"></script>
9+
10+
11+
</body></html>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
function setup() {
2+
createCanvas(windowWidth, windowHeight);
3+
background(255);
4+
colorMode(HSB);
5+
//for loop that creates prints all the shapes
6+
for (var x = 0; x < 100; x++) {
7+
8+
for (var y = 0; y < 100; y++) {
9+
//changes color for specific regions
10+
11+
fill(170+x, 10, 255, 100);
12+
// if (x%10 >= 4 && x%10 <= 5) {
13+
// fill(200, 10, 255, 100);
14+
// }
15+
16+
// else if( x%10 >= 2 && x%10 <=7){
17+
// fill(255, 255, 255, 100);
18+
// }
19+
20+
// else{
21+
// fill(255, 255, 255, 100);
22+
// }
23+
//actually prints the moons
24+
moon(x, y);
25+
26+
}
27+
28+
}
29+
}
30+
31+
//makes the moons and colors
32+
function moon(x, y) {
33+
noStroke();
34+
//location and repeat of the moon
35+
ellipse(x * 40 + 20, y * 40 + 20, 40, 40);
36+
fill(255);
37+
ellipse(x * 40 + 30, y * 41 + 25, 40, 40);
38+
39+
40+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
html, body {
2+
margin: 0;
3+
padding: 0;
4+
}
5+
canvas {
6+
display: block;
7+
}

0 commit comments

Comments
 (0)