-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.html
56 lines (51 loc) · 1.4 KB
/
demo.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
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>swipe-able Demo</title>
<script src="../platform/platform.js"></script>
<link rel="import" href="swipe-able.html">
<style>
body {
background: #eee;
font-family: sans-serif;
}
#cards {
max-width: 400px; margin: 15px auto;
}
#cards swipe-able {
padding: 30px 15px;
text-align: center;
border: 1px solid #ccc;
border-top: 0;
border-left: 0;
border-radius: 2px;
margin-bottom: 10px;
background: white;
}
#message { text-align: center; }
</style>
</head>
<body unresolved>
<section id="cards">
<swipe-able>
Swipe left dismiss, right rubberband
</swipe-able>
<swipe-able left="rubberband" right="dismiss">
Swipe left to rubberband, right dismiss
</swipe-able>
<swipe-able left="rubberband" right="rubberband">
Rubberbands in both directions
</swipe-able>
<swipe-able left="dismiss" right="grow">
Dismiss left, grow right
</swipe-able>
</section>
<p id="message"></p>
<script>
document.addEventListener('swipe', function(e) {
document.getElementById('message').innerHTML = "Swiped <b>" + e.detail.direction +"</b> with <b>" + e.detail.effect + "</b> effect.";
});
</script>
</body>
</html>