forked from konstantinos-tsatsarounos/rainyday.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo3.html
37 lines (36 loc) · 771 Bytes
/
demo3.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
35
36
37
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>rainyday.js demo #3</title>
<style media="screen">
body {
overflow: hidden;
height: 100%;
margin: 0;
padding: 0;
}
img {
width: 100%;
height: 100%;
}
</style>
<script src="rainyday.js"></script>
<script>
function run() {
var image = document.getElementById('background');
image.onload = function() {
var engine = new RainyDay({
image: this
});
engine.rain([ [0, 2, 200], [3, 3, 1] ], 100);
};
image.crossOrigin = 'anonymous';
image.src = 'http://i.imgur.com/OVQkDRE.jpg';
}
</script>
</head>
<body onload="run();">
<img id="background" alt="background" src="" />
</body>
</html>