-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbutton-view-on-github.js
75 lines (54 loc) · 1.74 KB
/
button-view-on-github.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
/*
Using classes and id's
@version:2.4
Snippet url:
- https://github.com/mrmccormack/imd-learning-tabris/blob/master/button-view-on-github.md
References:
- https://tabrisjs.com/documentation/latest/selector.html
*/
const {ImageView, Button,app, ui, TextView, ProgressBar} = require('tabris');
const GITHUB_URL = 'https://github.com/mrmccormack/imd-learning-tabris/blob/master/button-view-on-github.md';
const TABRIS_URL = 'https://tabrisjs.com/documentation/latest/';
let imgTabrisIcon = new ImageView({
left: 10, top: 20, width:48, height:50,
image: 'https://raw.githubusercontent.com/mrmccormack/imd-learning-tabris/master/images/tabris-icon.png'
}).on({
tap: () => app.launch(TABRIS_URL)
.catch((e) => textView.text = e)
}).appendTo(ui.contentView);
let imgGithubLink = new ImageView({
right: 10, top: 20,
image: 'https://cdn3.iconfinder.com/data/icons/free-social-icons/67/github_circle_black-48.png'
}).on({
tap: () => app.launch(GITHUB_URL)
.catch((e) => textView.text = e)
}).appendTo(ui.contentView);
let txtDescription = new TextView({
left: 10, top: 20, right: 10,
text: 'Description \n goes here...',
alignment: 'center',
font: '12px'
}).appendTo(ui.contentView);
let progressBar = new ProgressBar({
left: 15, right: 15, top: 80,
maximum: 300,
selection: 1
}).appendTo(ui.contentView);
let progress = 10 ;
for (i = 0; i < 40; i++) {
//text += "The number is " + i + "<br>";
progress = i * 10;
setTimeout(setProgress, 20);
// console.log (text);
}
txtDescription.animate({
opacity: 0.5,
transform: {
scaleX: 1.3,
scaleY: 1.3,
}
})
function setProgress() {
// txtDescription.text = 'Thank you!' + progress.toString();
progressBar.selection = progress;
}