-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (68 loc) · 1.88 KB
/
index.html
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>绘图测试</title>
</head>
<body>
<script src="./dist/flowings.js"></script>
<script>
(async function () {
console.log("Flowing", window, $);
const { canvas, context } = new $.Flowings();
const layerHelper = new $.LayerHelper();
layerHelper.layers = {
images: [
{
image_url:
"https://img.laiye.com/cLvgXicdq4RMvFgMeyiarFciatqCEPrkGudP9N6SceHhmA4Tl2unDvK4rNVCFroJZcfqMnUGvnBeDLaZpDYW0TRl9lxmD47gs70.jpg",
x: 48,
y: 48,
width: 150,
height: 150,
border_radius: 25,
resize: true,
rotate: 45,
},
{
x: 0,
width: 750,
height: 750,
image_url: "https://img.laiye.com/checkinAlbum_20200316083737_htqvLACrln.jpg",
z: 1,
opacity: 0.5,
},
],
texts: [
{
x: 0,
z: 200,
content: "我爱北京天安门,呵呵哈尔呵呵,呵呵哈尔呵呵,呵呵哈尔呵呵",
size: 36,
line_height: 50,
font_style: "normal",
font_weight: "bold",
align: "center",
limit: 750,
color: "red",
},
],
lines: [
{
color: "blue",
x1: 10,
x2: 200,
y1: 10,
y2: 10,
line_width: 1,
},
],
};
await layerHelper.load();
// layerHelper.prepareToRender();
layerHelper.render(context);
})();
</script>
</body>
</html>