-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsketch.js
29 lines (25 loc) · 796 Bytes
/
sketch.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
var w = window.innerWidth,
h = window.innerHeight,
toolsWidth = document.querySelector(".tools-wrapper").offsetWidth,
toolsHeight = document.querySelector(".tools-wrapper").offsetHeight;
var tree;
var inc = document.querySelector('#inc'),
dec = document.querySelector('#dec'),
szHead = document.querySelector('#szHead');
function setup() {
let canvas = createCanvas(w-toolsWidth , Math.max(h,toolsHeight));
canvas.parent('canvas');
canvas.style('display', 'block');
textFont('Helvetica');
textStyle(BOLD);
textAlign(CENTER);
background(0);
fill(255);
textSize(50);
tree = new Tree();
}
function windowResized() {
w = window.innerWidth;
h = window.innerHeight;
resizeCanvas(w-toolsWidth, Math.max(h,toolsHeight));
}