-
Notifications
You must be signed in to change notification settings - Fork 0
/
libcanvasdemo.html
33 lines (29 loc) · 945 Bytes
/
libcanvasdemo.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>LibCanvas :: Ui :: Rounded rectangle, ellipse</title>
<link href="http://libcanvas.github.com/files/styles.css" rel="stylesheet" />
<script src="http://libcanvas.github.com/files/js/atom.js"></script>
<script src="http://libcanvas.github.com/files/js/libcanvas.js"></script>
</head>
<body>
<p><a href="/">Return to index</a></p>
<script>
new function () {
LibCanvas.extract();
var helper = new App.Light([512, 256]);
[ new RoundedRectangle(50, 50, 150, 40).setRadius(15)
, new Ellipse(120, 130, 150, 60)
].forEach(function (shape, i) {
var vector = helper.createVector(shape, { zIndex: i })
.setStyle( { stroke: '#900', fill: '#300' })
.setStyle('hover' , { stroke: '#f00', fill: '#900' })
.setStyle('active', { stroke: '#0f0', fill: '#090' });
vector.clickable.start();
vector.draggable.start();
});
};
</script>
</body>
</html>