-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathui-cells.htm
More file actions
88 lines (67 loc) · 2.69 KB
/
ui-cells.htm
File metadata and controls
88 lines (67 loc) · 2.69 KB
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
<!DOCTYPE html>
<html>
<head>
<title>UI CELLS</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel="stylesheet" type="text/css" href="basic/basic.min.css">
<script src="basic/basic.min.js" type="text/javascript" charset="utf-8"></script>
<script src="components/ui-cells.js" type="text/javascript" charset="utf-8"></script>
<script>
var start = function() {
page.color = "white";
// BOX: Page container.
const box = createBox(0, 0, 600, getDefaultContainerBox().height);
// CELLS: 4 vertical cells:
UICells.create(box, UICells.alignType.VERTICAL, [120, "auto", "auto", 90]);
box.cell(0).color = "whitesmoke";
box.cell(1).color = "white";
box.cell(2).color = "whitesmoke";
box.cell(3).color = "white";
// CELLS: 4 horizontal cells in box.cell(1)
UICells.create(box.cell(1), UICells.alignType.HORIZONTAL, ["auto", "auto", "auto"]);
box.cell(1).cell(0).color = "white";
box.cell(1).cell(1).color = "#E1F0FF";
box.cell(1).cell(2).color = "white";
// Cells count:
console.log(box.cell.getCount());
console.log(box.cell(1).cell.getCount());
// IMAGE:
createImage(0, 0, 60, 60);
that.load("assets/cards/olives.png");
box.cell(0).add(that);
that.center();
// IMAGE:
createImage(0, 0, 60, 60);
that.load("assets/cards/rosehip.png");
box.cell(1).cell(0).add(that);
that.center();
// IMAGE:
createImage(0, 0, 90, 90);
that.load("assets/cards/juniper.png");
box.cell(1).cell(1).add(that);
that.center();
// IMAGE:
createImage(0, 0, 60, 60);
that.load("assets/cards/pepper.png");
box.cell(1).cell(2).add(that);
that.center();
// IMAGE:
createImage(0, 0, 60, 60);
that.load("assets/cards/dill.png");
box.cell(2).add(that);
that.center();
// LABEL:
createLabel(0, 0, "auto", "auto");
that.text = "cell(3)";
box.cell(3).add(that);
that.onResize(function(self) {
self.center();
});
}
</script>
</head>
<body>
<!-- HTML content -->
</body>
</html>