-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsketch-005.js
36 lines (30 loc) · 888 Bytes
/
sketch-005.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const canvasSketch = require("canvas-sketch");
const { drawDottedLine } = require("./helper.js");
const settings = {
dimensions: [2048, 2048]
};
const count = 10;
const margin = 0;
const sketch = () => {
return ({ context, width, height }) => {
let x = 0;
// canvas
context.fillStyle = "black";
context.fillRect(0, 0, width, height);
for (let i = 0; i < 40; i++) {
for (let i = 0; i < count; i++) {
drawDottedLine(x, 0 + margin, x, height / 3, 500, "white", context);
x += 10;
}
for (let i = 0; i < count / 2; i++) {
drawDottedLine(x, height / 3, x, height * 2 / 3, 300, "white", context);
x += 10;
}
for (let i = 0; i < count / 4; i++) {
drawDottedLine(x, height * 2 / 3, x, height - margin, 200, "white", context);
x += 10;
}
}
};
};
canvasSketch(sketch, settings);