forked from adolfintel/warpspeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample2.html
66 lines (62 loc) · 2.15 KB
/
example2.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html>
<head>
<title>WarpSpeed.js</title>
<script type="text/javascript" src="warpspeed.min.js"></script>
<style type="text/css">
html,body{
margin:0;
padding:0;
border:0;
background-color:#EEEEEE;
}
body{
font-family:sans-serif;
}
div.separator{
height:10em;
}
</style>
</head>
<body>
<div style="position:relative; height:40vh;">
<div style="position:absolute; z-index:1 top:0; left:0; width:100%; height:100%;">
<canvas id="canvas" style="width:100%; height:100%;"></canvas>
<script>
new WarpSpeed("canvas");
</script>
</div>
<div style="position:absolute; z-index:2 top:0; left:0; width:100%; height:100%;">
<div style="font-size:3vw; color:#FFFFFF; font-weight:100; text-align:center; margin-top:5rem;">WarpSpeed</div>
</div>
</div>
<div class="separator"></div>
<div style="position:relative; height:40vh;">
<div style="position:absolute; z-index:1 top:0; left:0; width:100%; height:100%;">
<canvas id="canvas2" style="width:100%; height:100%;"></canvas>
<script>
new WarpSpeed("canvas2",
{density:2,backgroundColor:"#FFFFFF",starColor:"#000000",speed:1.2}
);
</script>
</div>
<div style="position:absolute; z-index:2 top:0; left:0; width:100%; height:100%;">
<div style="color:#000000; font-weight:100; text-align:center; margin-top:5rem;">As you can see, multiple instances of WarpSpeed with different settings can coexist</div>
</div>
</div>
<div class="separator"></div>
<div style="position:relative; height:40vh;">
<div style="position:absolute; z-index:1 top:0; left:0; width:100%; height:100%;">
<canvas id="canvas3" style="width:100%; height:100%;"></canvas>
<script>
new WarpSpeed("canvas3",
'{"speed":25,"speedAdjFactor":0.03,"density":0.7,"shape":"square","warpEffect":true,"warpEffectLength":5,"depthFade":false,"starSize":3,"backgroundColor":"#000000","starColor":"#FFFFFF"}'
);
</script>
</div>
<div style="position:absolute; z-index:2 top:0; left:0; width:100%; height:100%;">
<div style="color:#FFFFFF; font-weight:100; text-align:center; margin-top:5rem;">Settings can also be passed as a JSON string, like the ones generated by the editor</div>
</div>
</div>
</body>
</html>