-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader_bg.js
More file actions
29 lines (22 loc) · 814 Bytes
/
header_bg.js
File metadata and controls
29 lines (22 loc) · 814 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
//addBackdrop(25);
function addBackdrop(d) {
const dimensions = d || 50;
const two = new Two({
type: Two.Types.canvas,
width: dimensions,
height: dimensions
});
const r = dimensions / 5;
const center = dimensions / 2;
const a = two.makeLine(center - r, center, center + r, center);
const b = two.makeLine(center, center - r, center, center + r);
a.stroke = b.stroke = '#aaa';
a.linewidth = b.linewidth = 0.25;
two.update();
const container = document.querySelector("header");
// container.style.width = "100%";
// container.style.height = "600px";
container.style.backgroundImage = `url(${two.renderer.domElement.toDataURL()})`;
container.style.backgroundRepeat = 'repeat';
container.style.backgroundSize = `${dimensions}px`;
}