-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
42 lines (34 loc) · 971 Bytes
/
main.js
File metadata and controls
42 lines (34 loc) · 971 Bytes
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
37
38
39
40
41
42
const canvasSketch = require("canvas-sketch");
import { createPane } from "./util/tweak-pane-util";
import { params } from "./util/pane-data";
//methods
("Frequency Grid");
import { SimpleGrid } from "./methods/simple-grid";
import { FrequencyGrid } from "./methods/frequency-grid";
const settings = {
dimensions: [1024, 1024],
animate: true,
hotkeys: true,
resizeCanvas: true,
};
const sketch = ({ canvas }) => {
return {
render({ context, width, height, frame }) {
context.fillStyle = params["main"].backgroundColor;
context.fillRect(0, 0, width, height);
switch (params["main"].template) {
case "Simple Grid":
return SimpleGrid({ context, width, height });
break;
case "Frequency Grid":
return FrequencyGrid({ context, width, height, frame });
break;
default:
return;
break;
}
},
};
};
createPane();
canvasSketch(sketch, settings);