-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathui-scrolling-text.htm
More file actions
81 lines (58 loc) · 2.62 KB
/
ui-scrolling-text.htm
File metadata and controls
81 lines (58 loc) · 2.62 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
<!DOCTYPE html>
<html>
<head>
<title>UI Scrolling Text</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-scrolling-text.js" type="text/javascript" charset="utf-8"></script>
<style>
@keyframes scrolling-item {
20% { -webkit-transform: translateX(calc(0px)); }
55% { -webkit-transform: translateX(calc(-100% + 200px)); }
65% { -webkit-transform: translateX(calc(-100% + 200px)); }
}
</style>
<script>
var start = function() {
// TODO: Make ui component.
page.color = "white";
// BOX: Button container.
const box = createBox(0, 0, 220, 50);
that.color = "white";
that.round = 8;
that.border = 1;
that.borderColor = "rgba(0, 0, 0, 0.1)";
that.center();
// BOX: Scrolling text.
box.boxScrollingText = createBox(10, 11, 200, 26);
box.add(that);
that.color = "transparent";
// LABEL: Vegetables are healthy text.
createLabel(0, 0, "auto", 26);
box.boxScrollingText.add(that);
that.text = "Start. Vegetables are healthy. End.";
that.color = "transparent";
that.spaceX = 10;
that.element.style.whiteSpace = "nowrap";
that.element.style.animation = "scrolling-item 15s linear 0s infinite";
// BOX: Right mask for box.boxScrollingText.
box.boxRightMask = createBox(0, 0, 10, box.boxScrollingText.height);
box.add(that);
that.element.style.background = "linear-gradient(to right, #FFFFFF00, white, white)";
that.aline(box.boxScrollingText, "right", -9);
that.border = 0;
// BOX: Top left for box.boxScrollingText.
box.boxLeftMask = createBox(0, 0, 10, box.boxScrollingText.height);
box.add(that);
that.element.style.background = "linear-gradient(to left, #FFFFFF00, white, white)";
that.aline(box.boxScrollingText, "left", -9);
that.border = 0;
}
</script>
</head>
<body>
<!-- HTML content -->
</body>
</html>