-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.ts
48 lines (44 loc) · 952 Bytes
/
dev.ts
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
43
44
45
46
47
48
import { canvasJp } from "canvas-jp";
import { makeUserElements } from "./src/client/canvas/makeUserElements";
import { TwitchUser } from "./src/TwitchUser";
const user: TwitchUser = {
messageCount: 36,
id: "253152270",
displayName: "superroipatate",
};
const container: HTMLElement | null = document.querySelector("#container");
if (!container) {
throw new Error(
"Invalid HTML: should contain an element with id `container`."
);
}
const width = 200;
const height = 400;
canvasJp(
container,
async function (t, frame, random) {
return {
elements: makeUserElements(
random,
width,
height,
user,
undefined,
undefined,
false
),
};
},
{
width: width,
height: height,
resolution: 1,
title: "TwitchArt",
animation: false,
loop: false,
embed: false,
exportSketch: false,
numberOfFrames: 0,
interactive: true,
}
);