-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathschema.js
113 lines (104 loc) · 1.97 KB
/
schema.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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// scene
{
id: Any,
src: String,
width: Integer,
height: Integer,
widgets: [Widget]
}
// widget 箭头
{
type: 'portal',
src: String,
angle: Integer
pos: { x: Integer, y: Integer }
action: Action
}
// widget 图片
{
type: 'image',
src: String,
size: { width: Integer, height: Integer },
pos: { x: Integer, y: Integer },
action: Action
}
// widget 文字
{
type: 'text',
text: String,
pos: { x: Integer, y: Integer },
style: {
font_style: String,
font_variant: String,
font_weight: String,
font_stretch: String,
font_size: Integer, // 18
font_family: String, // Arial
border_weight: Integer, // 4
border_radius: Integer, // 6
backgroud_color: { r: Integer, g: Integer, b: Integer, a: Double}, // 255, 255, 255, 1
text_color: { r: Integer, g: Integer, b: Integer, a: Double}, // 0, 0, 0, 1
border_color: { r: Integer, g: Integer, b: Integer, a: Double}, // 0, 0, 0, 0
text_padding: { left: Integer, right: Integer, bottom: Integer, top: Integer} // 0, 0, 0, 0
},
action: Action
}
// widget 透明可点击区域
{
type: 'transparent',
polygon: [[Integer, Integer]] // [[x, y]]
action: Action
}
// Action
// action 跳转场景
{
name: 'change-scene',
payload: {
destination: Any // scene id
}
}
// Action
// action 播放视频
{
name: 'play-video',
payload: {
sources: [{src: String, type: String}], // MIME types
size: {height: String, width: String}
}
}
// Action
// action 内嵌网页
{
name: 'iframe',
payload: {
url: String
}
}
// Action
// action 以 target = _blank 打开链接
{
name: 'new-tab',
payload: {
url: String
}
}
{
name: 'show-slider',
payload: {
slides: [{
type: 'text',
content: {
header: String,
subheader: String,
paragraphs: [String]
}
} | {
type: 'image',
content: {
src: String,
caption: String,
description: String
}
}]
}
}