/
demo.html
34 lines (32 loc) · 1.1 KB
/
demo.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
34
<!DOCTYPE html>
<html>
<head>
<title>image processing library</title>
</head>
<body>
<img id="image" src="test.jpg" />
<img id="image" src="test.jpg" />
<pre id="text"></pre>
<script type="text/javascript" src="core.js"></script>
<script type="text/javascript" src="filters.js"></script>
<script type="text/javascript">
window.onload = function() {
var image = ube(document.images[1], function() {
/* ~~~~~ */ var startDate = new Date();
this.darken(50).rgba(20).apply()
.monochrome(4).applyRect(490, 290, 100, 100)
.draw(function() {
this.strokeStyle = 'red',
this.strokeRect(10, 10, 100, 100);
})
.invert().applyCustom(function() {
this.font = '150px sans-serif';
this.fillText('yay text!', 25, 250);
});
/* ~~~~~ */ document.getElementById('text').innerHTML += '<b>Total execution time: ' + (new Date() - startDate) + 'ms (Refresh)</b>';
});
};
</script>
</body>
</html>
<!-- please excuse my sloppy html -->