forked from AlloyTeam/PhyTouch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathas_tool.html
69 lines (63 loc) · 2.3 KB
/
as_tool.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
67
68
69
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<img src="../asset/alloy.png" id="test" style="display: block; width: 210px;height: 210px;position: absolute;left: 50%;margin-left: -105px;margin-top: -105px;top:50%;">
<a href="https://github.com/AlloyTeam/AlloyTouch/tree/master/transformjs" target="_blank" style="position: absolute; right: 0; top: 0;">
<img src="//alloyteam.github.io/github.png" alt="" />
</a>
<script src="../transform.js" ></script>
<script src="../asset/to.js"></script>
<script src="../asset/alloy_flow.js"></script>
<script>
var element = document.querySelector("#test"),
obj = {};
Transform(obj);
obj.originY = 100;
obj.skewX = -20;
function sineInOut(a) {
return 0.5 * (1 - Math.cos(Math.PI * a));
}
var setting = {
onChange: function () {
element.style.transform = element.style.msTransform = element.style.OTransform = element.style.MozTransform = element.style.webkitTransform = obj.transform;
}
};
var alloyFlow = new AlloyFlow({
workflow: [
{
work: function () {
To.go(obj, "scaleY", .8, 450, sineInOut, setting);
To.go(obj, "skewX", 20, 900, sineInOut, setting)
},
start: 0
}, {
work: function () {
To.go(obj, "scaleY", 1, 450, sineInOut, setting)
},
start: 450
}, {
work: function () {
To.go(obj, "scaleY", .8, 450, sineInOut, setting);
To.go(obj, "skewX", -20, 900, sineInOut, setting)
},
start: 900
}, {
work: function () {
To.go(obj, "scaleY", 1, 450, sineInOut, setting);
},
start: 1350
}, {
work: function () {
this.start();
},
start: 1800
}
]
}).start();
</script>
</body>
</html>