-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
57 lines (50 loc) · 983 Bytes
/
example.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
<html>
<head>
<title>Flipbox</title>
<link rel="stylesheet" type="text/css" href="build/build.css">
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
padding: 150px;
}
#card {
width: 100px;
height: 100px;
}
.back,
.front {
width: 100px;
height: 100px;
border-radius: 5px;
border: 1px solid #ddd;
background: #eee;
text-align: center;
padding-top: 40px;
}
.back {
background: #fff;
}
</style>
</head>
<body>
<script src="build/build.js"></script>
<div id="card">
<div>
<div class="front">front</div>
<div class="back">back</div>
</div>
</div>
<script>
var card = document.querySelector('#card');
var Flipbox = require('flipbox');
var box = new Flipbox(card);
box.el.onclick = function(){
box.flip();
};
</script>
</body>
</html>