forked from sebmarkbage/art
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopacity.js
More file actions
53 lines (44 loc) · 899 Bytes
/
Copy pathopacity.js
File metadata and controls
53 lines (44 loc) · 899 Bytes
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
require('../mode');
var ART = require('../../index');
var art = ART.Surface(1000, 600);
var group = ART.Group()
.move(10,10)
.rotate(-10)
.blend(0.5)
.inject(art);
var green = ART.Rectangle(100, 100)
.move(10,10)
.fill('green')
.blend(0.5)
.rotate(20)
.indicate('pointer', 'Green square')
.inject(group);
var group2 = ART.Group()
.move(10,10)
.blend(0.5)
.rotate(5)
.indicate(null, 'Blue square')
.inject(group);
var blue = ART.Rectangle(100, 100)
.move(10,10)
.rotate(-5)
.fill('blue')
.blend(0.5)
.indicate('move')
.inject(group2);
setInterval(function(){
group2.rotate(1);
}, 1000 / 60);
blue.subscribe({
'mouseover': function(){
blue.blend(1);
},
'mouseout': function(){
blue.blend(0.5);
}
});
group2.subscribe('click', function(){
this.blend(1);
blue.indicate('wait');
});
art.inject(document.body);