-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathopacity-seagull.js
40 lines (29 loc) · 927 Bytes
/
opacity-seagull.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
const { Button, ui, ImageView} = require('tabris');
// example of images side by side - Matt.
const IMAGE_PATH = 'https://mrmccormack.github.io/imd-learning-tabris/images/';
const DICE_OFFSET = 0;
let btnOpacity = new Button({ centerX: 0, top: 40, text: 'Sharpen' })
.on('select', () => {
blurPhoto.visible = false
sharpPhoto.opacity = 1.0
}).appendTo(ui.contentView)
let sharpPhoto = new ImageView({
centerY: 0,
width: 200,
centerX: -DICE_OFFSET,
image: IMAGE_PATH + 'seagull-1900657_640.jpg'
}).appendTo(ui.contentView);
let blurPhoto = new ImageView({
centerY: 0,
width: 200,
opacity: 1.0,
centerX: DICE_OFFSET,
image: IMAGE_PATH + 'seagull-1900657_640-blur.jpg'
}).appendTo(ui.contentView);
let blurBackground = new ImageView({
centerY: 0,
centerX: 0,
opacity: 0.4,
scaleMode: 'fill',
image: IMAGE_PATH + 'seagull-1900657_640-blur.jpg'
}).appendTo(ui.contentView);