-
Notifications
You must be signed in to change notification settings - Fork 803
/
Copy pathindex.html
40 lines (40 loc) · 1.2 KB
/
index.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
38
39
40
<html>
<head>
<style media="screen" type="text/css">
img { display: none; }
body { overflow: hidden; }
#canvas { position: absolute; top: 0px; left: 0px; }
</style>
<script src="rainyday.js" type="text/javascript"></script>
<script type="text/javascript">
function demo() {
var hash = window.location.hash.substring(1);
if (hash == "demo1") {
var engine = new RainyDay('canvas','forest', window.innerWidth, window.innerHeight);
engine.trail = engine.TRAIL_DROPS;
engine.reflection = engine.REFLECTION_HQ;
engine.gravity = engine.GRAVITY_SIMPLE;
engine.rain([
engine.preset(0, 2, 0.88),
engine.preset(3, 3, 1)
], 10);
} else if (hash == "demo2") {
var engine = new RainyDay('canvas','city', window.innerWidth, window.innerHeight);
engine.trail = engine.TRAIL_DROPS;
engine.reflection = engine.REFLECTION_HQ;
engine.gravity = engine.GRAVITY_SIMPLE;
engine.rain([
engine.preset(3, 3, 1)
], 100);
}
}
</script>
</head>
<body onload="demo();">
<img id="forest" src="forest.jpg" />
<img id="city" src="city.jpg" />
<div id="cholder">
<canvas id="canvas"></canvas>
</div>
</body>
</html>