-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathrealswipetest.html
More file actions
146 lines (105 loc) · 6.44 KB
/
realswipetest.html
File metadata and controls
146 lines (105 loc) · 6.44 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>DeepTissue.js - Swipe Dem/Reference</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="A JavaScript Library to Abstract MSPointer and WebKit Touch APIs" name="description">
<meta content="Chris Love" name="author">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="favicon.ico" rel="shortcut icon">
<link href="img/h/apple-touch-icon.png" rel="apple-touch-icon-precomposed" sizes="114x114">
<link href="img/m/apple-touch-icon.png" rel="apple-touch-icon-precomposed" sizes="72x72">
<link href="img/l/apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed">
<link href="img/l/apple-touch-icon.png" rel="shortcut icon">
<meta name="application-name" content="Deeptissue.js" />
<meta name="msapplication-TileColor" content="#0094ff" />
<meta name="msapplication-TileImage" content="msTouchIcon.png" />
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="google-site-verification" content="HfjA5xFE0XGLpBTctB2Vd6IglorXsjJpIImhE1H3yLU" />
<script>(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")</script>
<link href="img/l/splash.png" rel="apple-touch-startup-image">
<meta content="on" http-equiv="cleartype">
<link href="css/site.css?v=1" rel="stylesheet">
</head>
<body>
<header>
<a href="/" title="Deeptissue.js a Touch Library" class="no-decor">
<img src="img\m\apple-touch-icon.png" alt="deeptissue.js" class="site-logo" /><h1>Deeptissue.js</h1></a>
<h2>A Gesture Abstraction Library for both MSPointer and WebKit Touch APIs</h2>
<nav>
<a href="realtaptest.html">TAP</a>
<a href="realmovetest.html">MOVE</a>
<a href="realrotatetests.html">ROTATE</a>
<a href="realswipetest.html" class="active">SWIPE</a>
<a href="realscaletest.html">SCALE</a>
</nav>
</header>
<section class="touch-area center-item">SWIPE</section>
<script src="js/debug/mbp.js" type="text/javascript"></script>
<script src="js/dev/deeptissue.js" type="text/javascript"></script>
<script type="text/javascript">
var dt = deeptissue(document.querySelectorAll(".touch-area"), {
swipeRightThreshold: 50,
swipeLeftThreshold: -50,
swipeUpThreshold: -50,
swipeDownThreshold: 50
}),
el = document.querySelector(".touch-area"),
x = 0, y = 0;
dt.swipeRight(function (evt, m, translate) {
x = (evt.translationX !== undefined) ? evt.translationX : translate.translationX;
el.textContent = "swipe right " + x + "px " + el.textContent;
if (m !== null) {
el.style.transform = m.translate(75, 0, 0); // Apply Translation;
} else if (translate) {
el.style[dt.support.transform] =
"translate3D(" + 75 + "px, 0, 0)";
}
})
.swipeLeft(function (evt, m, translate) {
x = (evt.translationX !== undefined) ? evt.translationX : translate.translationX;
el.textContent = "swipe Left " + x + "px " + el.textContent;
if (m !== null) {
el.style.transform = m.translate(-75, 0, 0); // Apply Translation;
} else if (translate) {
el.style[dt.support.transform] =
"translate3D(" + -75 + "px, 0, 0)";
}
})
.swipeDown(function (evt, m, translate) {
y = (evt.translationY !== undefined) ? evt.translationY : translate.translationY;
el.textContent = "swipe down " +
(evt.translationY || translate.translationY) + "px " + el.textContent;
if (m !== null) {
el.style.transform = m.translate(0, evt.translationY, 0); // Apply Translation;
} else if (translate) {
el.style[dt.support.transform] =
"translate3D(0, " + translate.translationY + "px, 0)";
}
})
.swipeUp(function (evt, m, translate) {
y = (evt.translationY !== undefined) ? evt.translationY : translate.translationY;
el.textContent = "swipe up " +
(evt.translationY || translate.translationY) + "px " + el.textContent;
if (m !== null) {
el.style.transform = m.translate(0, evt.translationY, 0); // Apply Translation;
} else if (translate) {
el.style[dt.support.transform] =
"translate3D(0, " + translate.translationY + "px, 0)";
}
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-83556-6']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>