-
Notifications
You must be signed in to change notification settings - Fork 541
/
index.html
72 lines (69 loc) · 2.25 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<style>
.ribbon {
top: 3.2em;
right: -4.7em;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
color:#fff;
display: block;
padding: .6em 3.5em;
position: fixed;
text-align: center;
text-decoration: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: green;
z-index: 10000;
}
</style>
</head>
<body>
<a href="https://github.com/AlloyTeam/AlloyFinger" class="ribbon">Fork me on Github</a>
<script src="../../asset/transform.js"></script>
<script src="../../alloy_finger.js"></script>
<img src="../../asset/test.png" id="testImg" alt="" />
<script>
var el = document.getElementById("testImg");
Transform(el);
var initScale = 1;
var gesture = new AlloyFinger(el, {
rotate: function (evt) {
el.rotateZ += evt.angle;
},
pinchStart: function () {
initScale = el.scaleX;
},
pinch: function (evt) {
el.scaleX = el.scaleY = initScale * evt.zoom;
},
pressMove: function (evt) {
el.translateX += evt.deltaX;
el.translateY += evt.deltaY;
},
tap: function (evt) {
//console.log(el.scaleX + "_" + el.scaleY + "_" + el.rotateZ + "_" + el.translateX + "_" + el.translateY);
//console.log("tap");
},
doubleTap: function (evt) {
//console.log("doubleTap");
},
longTap: function (evt) {
//console.log("longTap");
},
swipe: function (evt) {
//console.log("swipe" + evt.direction);
}
});
</script>
</body>
</html>