-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (48 loc) · 1.28 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<script src="js/jquery-2.1.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<meta charset="UTF-8">
<title>The Experiment - Design and Technology Studio</title>
</head>
<body>
<div class="someDiv">
<canvas id="someCanvas"></canvas>
</div>
<div>Click on the box.</div>
<script type="text/javascript" src="js/ParticleMachine.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="libs/gs/TweenMax.min.js"></script>
<script type="text/javascript">
$(function() {
var inited = false;
var p0Machine = new ParticleMachine('data/logo_sm.json',
'.someDiv', '#someCanvas');
var anim;
var twObj;
TweenLite.defaultEase = Bounce.easeIn;
$(".someDiv").click(function() {
if (!inited) {
inited = true;
p0Machine.init();
}
beginAnimation();
});
/*
Using this tween to push the particles.
In our usage we used the scroll position
to update.
*/
function beginAnimation() {
twObj = {val:0};
anim = TweenLite.fromTo(twObj, 2, {val:0}, {val:1});
anim.eventCallback("onUpdate", tweenUpdate);
}
function tweenUpdate() {
p0Machine.setPosition(twObj.val);
}
});
</script>
</body>
</html>