-
Notifications
You must be signed in to change notification settings - Fork 4
/
ui-page-control.htm
175 lines (140 loc) · 6.17 KB
/
ui-page-control.htm
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html>
<head>
<title>UI Page Control</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-page-control.js" type="text/javascript" charset="utf-8"></script>
<script src="components/ui-tabs.js" type="text/javascript" charset="utf-8"></script>
<script>
const tabsDataList = [
{ id: "home", text: "Home" },
{ id: "tasks", text: "Tasks" },
{ id: "settings", text: "Settings" }
];
var uiPageControl1
var uiTabs1
const start = function() {
page.color = "whitesmoke";
// *** EXAMPLE 1:
UIPageControl.resetDefault();
//UIPageControl.default.startWithMotion = 1;
//UIPageControl.default.motionString = "opacity 0.3s";
//UIPageControl.default.changePageWithMotion = 1;
//UIPageControl.default.changePageMotionString = "left 0.2s";
// UI PAGE CONTROL: Object description.
uiPageControl1 = UIPageControl.create({ width: getDefaultContainerBox().width - 40, height: 500 });
//that.color = "lightgray"
that.round = 14;
that.center();
// PAGE 1:
uiPageControl1.createNewPageWithId("home")
uiPageControl1.home.color = "Lavender"
//var pageContainerBox = uiPageControl1.home;
//var pageId = uiPageControl1.home.id;
//var pageIndex = uiPageControl1.getPageIndexById("home");
// LABEL: Description text
uiPageControl1.home.lblDescription = createLabel(0, 0, "auto", "auto");
uiPageControl1.home.add(that);
that.text = "Lavender";
that.textColor = "#734f96";
that.onResize(function(self) {
self.center();
})
// PAGE 2:
uiPageControl1.createNewPageWithId("tasks")
uiPageControl1.tasks.color = "PaleTurquoise"
// LABEL: Description text
uiPageControl1.tasks.lblDescription = createLabel(0, 0, "auto", "auto")
uiPageControl1.tasks.add(that)
that.text = "Pale Turquoise";
that.textColor = "#0F4E4E";
that.onResize(function(self) {
self.center()
})
// PAGE 3:
uiPageControl1.createNewPageWithId("settings")
uiPageControl1.settings.color = "Bisque"
// LABEL: Description text
uiPageControl1.settings.lblDescription = createLabel(0, 0, "auto", "auto");
uiPageControl1.settings.add(that);
that.text = "Bisque";
that.textColor = "#B86500";
that.onResize(function(self) {
self.center();
})
uiPageControl1.openPageById("home");
//var selectedPageId = uiPageControl1.getSelectedPageId();
//var pageCount = uiPageControl1.getPageCount();
//uiPageControl1.openNextpage()
//uiPageControl1.openPreviousPage()
//var pageIdList = uiPageControl1.getPageIdList();
//uiPageControl1.removePageById("home");
//uiPageControl1.removeAllPages()
//uiPageControl1.setSizes(500, 500);
/* border
var boxBorder = createBox();
that.color = "transparent";
that.border = 2;
that.top = uiPageControl1.top;
that.left = uiPageControl1.left;
that.width = uiPageControl1.width;
that.height = uiPageControl1.height;
that.round = uiPageControl1.round;
that.borderColor = "rgba(0, 0, 0, 0.2)"
*/
// *** END OF EXAMPLE ***
//UITabs.default.backgroundColor = "#EBEAE8"
//UITabs.default.itemIconSize = 20
//UITabs.default.round = 13
// IU SEGMENT:
uiTabs1 = UITabs.create();
that.opacity = 0;
that.setMotion("opacity 0.3s");
that.onResize(function(self) {
uiTabs1.aline(uiPageControl1, "top", 10, "center");
})
uiTabs1.onChange(function(selectedItem, selectedIndex) {
console.log("uiTabs1: " + selectedItem.getData().id);
uiPageControl1.openPageById(selectedItem.getData().id);
})
that.setItemsByDataList(tabsDataList);
uiTabs1.withMotion(function(self) {
self.opacity = 1;
})
//uiPageControl1.boxPageGroup.dontMotion()
//uiPageControl1.boxPageGroup.setMotion("none")
/*
uiPageControl1.withMotion(function(self) {
uiPageControl1.changePageBy()
})
*/
//uiPageControl1.changePageById("settings")
/*
UITabs.default.backgroundColor = "#141414"
UITabs.default.itemOuterSpace = 4
uiTabs1 = UITabs.create({ width: getDefaultContainerBox().width - 40, height: 70 })
that.onResize(function(self) {
repositionComponents()
})
that.setItemsByDataList(itemDataList1)
that.onChange(function(selectedItem, selectedIndex) {
console.log("uiTabs1: " + selectedItem.getData().id)
// selectedItem.getData().text
})
that.selectItemByIndex(1)
*/
page.onResize(pageResized);
}
const pageResized = function() {
uiPageControl1.center();
uiTabs1.aline(uiPageControl1, "top", 10, "center");
}
</script>
</head>
<body>
<!-- HTML content -->
</body>
</html>