-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.html
154 lines (146 loc) · 4.41 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
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
147
148
149
150
151
152
153
154
<!doctype html>
<html lang="en">
<head>
<title>TinyGesture.js</title>
<meta charset="utf-8" />
<meta
name="description"
content="Very small gesture recognizer for JavaScript. Swipe, pan, tap, doubletap, longpress, pinch, and rotate."
/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<script type="module">
// Check out these files for an example of how to use TinyGesture.js.
import Pannable from './DemoPannable.js';
import Swipeable from './DemoSwipeable.js';
import Tappable from './DemoTappable.js';
import Pinchable from './DemoPinchable.js';
import Rotatable from './DemoRotatable.js';
document.addEventListener('DOMContentLoaded', () => {
const target = document.getElementById('target');
Pannable(target);
Swipeable(target);
Tappable(target, {
bgColor: '#666688',
color: '#fff',
});
Pinchable(target);
Rotatable(target);
});
</script>
<!-- Open Graph -->
<meta property="og:site_name" content="TinyGesture.js" />
<meta property="og:title" content="TinyGesture.js" />
<meta property="og:url" content="https://sciactive.github.io/tiny-gesture" />
<meta
property="og:description"
content="Very small gesture recognizer for JavaScript. Swipe, pan, tap, doubletap, longpress, pinch, and rotate."
/>
<!-- Bundled Styles -->
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO"
crossorigin="anonymous"
/>
<style type="text/css">
html,
body {
top: 0;
left: 0;
height: 100%;
width: 100%;
}
#target {
width: 200px;
height: 200px;
transform: translate3d(0, 0, 0);
z-index: 0;
background-color: #006688;
color: #fff;
font-size: 20px;
}
#forkongithub a {
display: block;
background: #000;
color: #fff;
text-decoration: none;
font-family: arial, sans-serif;
text-align: center;
font-weight: bold;
padding: 5px 40px;
font-size: 1rem;
line-height: 2rem;
position: relative;
transition: 0.5s;
}
#forkongithub a:hover {
background: #c11;
color: #fff;
}
#forkongithub a::before,
#forkongithub a::after {
content: '';
width: 100%;
display: block;
position: absolute;
top: 1px;
left: 0;
height: 1px;
background: #fff;
}
#forkongithub a::after {
bottom: 1px;
top: auto;
}
@media screen and (min-width: 800px) {
#forkongithub {
position: fixed;
display: block;
top: 0;
right: 0;
width: 400px;
overflow: hidden;
height: 400px;
z-index: 9999;
}
#forkongithub a {
width: 400px;
position: absolute;
top: 60px;
right: -120px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.8);
}
}
</style>
</head>
<body>
<span id="forkongithub"><a href="https://github.com/sciactive/tinygesture">Fork me on GitHub</a></span>
<div class="container d-flex flex-column" style="height: 100%">
<div>
<h1 class="display-4">TinyGesture.js</h1>
<p class="lead">
Very small gesture recognizer for JavaScript. Swipe, pan, tap, doubletap, longpress, pinch, and rotate.
</p>
</div>
<div
class="flex-grow-1 d-flex justify-content-center align-items-center position-relative border border-info m-3"
style="overflow: hidden"
>
<div class="d-flex justify-content-center align-items-center rounded position-relative text-center" id="target">
<span style="user-select: none">
Swipe me.<br />
Tap me.<br />
Press me.<br />
Pinch me.<br />
Rotate me.
</span>
</div>
</div>
</div>
</body>
</html>