-
Notifications
You must be signed in to change notification settings - Fork 4
/
ui-notice.htm
125 lines (94 loc) · 4.11 KB
/
ui-notice.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
<!DOCTYPE html>
<html>
<head>
<title>UI Notice</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/utils.js" type="text/javascript" charset="utf-8"></script>
<script src="components/ui-notice.js" type="text/javascript" charset="utf-8"></script>
<script>
var start = function() {
page.color = "white";
// *** EXAMPLE 1:
// UI TINY ALERT: Default values.
//notice.resetDefault();
//notice.default.backgroundColor = notice.colors.WHITE;
//notice.default.coverBackgroundColor = "rgba(0, 0, 0, 0.2)";
//notice.default.coverMotionString = "opacity 0.3s";
//notice.default.fontSize = 20;
//notice.default.round = 20;
//notice.default.border = 0;
//notice.default.borderColor = "rgba(0, 0, 0, 0.3)";
//notice.default.spaceX = 24;
//notice.default.spaceY = 18;
//notice.default.shadow = "0px 0px 12px rgba(0, 0, 0, 0.2)";
//notice.default.textMotionString = "opacity 0.3s";
//notice.default.textColor = "rgba(0, 0, 0, 0.8)";
notice.default.displayTime = 2500;
//notice.default.fontFamily = "opensans";
//notice.default.motionTime = 300 + 50;
// BUTTON: Info message.
createButton(30, 30, 250);
that.text = "Info Message";
that.color = "whitesmoke";
that.minimal = 1;
that.border = 1;
that.borderColor = "rgba(0, 0, 0, 0.3)";
that.center("left");
that.onClick(function(self) {
notice.show({ message: "Process completed" });
})
// *** EXAMPLE 2:
// BUTTON: Alert message.
createButton(0, 0, 250);
that.text = "Alert Message";
that.color = notice.colors.YELLOW;
that.minimal = 1;
that.border = 1;
that.borderColor = "rgba(0, 0, 0, 0.3)";
that.onClick(function(self) {
notice.show({
message: "No internet connection.<br><span style='font-size:17px;opacity:0.8;'>Please, try again later.<span>",
backgroundColor: notice.colors.YELLOW,
textColor: "#141414"
});
})
that.aline(previousThat, "bottom", 4);
// *** EXAMPLE 3:
// Alert icon:
var alertIconAsText = Utils.useImageAsText({
fontSpace: 16,
outerSpaceRight: 20,
outerSpaceLeft: 0
}, function editCreatedImage(img) {
img.load("assets/ui-notice/alert.png");
img.width = 28;
img.height = 28;
img.opacity = 0.95;
img.imageElement.style.filter = "grayscale(60%)";
});
//console.log(alertIconAsText)
// BUTTON: Error message.
createButton(0, 0, 250);
that.text = alertIconAsText + "Error Message";
that.color = notice.colors.RED;
that.minimal = 1;
that.border = 1;
that.borderColor = "rgba(0, 0, 0, 0.3)";
that.onClick(function(self) {
notice.show({
message: alertIconAsText + "Failed to copy",
backgroundColor: notice.colors.RED,
textColor: "#141414"
});
})
that.aline(previousThat, "bottom", 4);
}
</script>
</head>
<body>
<!-- HTML content -->
</body>
</html>