-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
60 lines (52 loc) · 1.57 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<title>brick-flipbox</title>
<!-- Importing Polyfill -->
<script src="bower_components/platform/platform.js"></script>
<!-- Importing Custom Elemenent -->
<link rel="import" href="dist/brick-flipbox.local.html">
<!-- Demo styles -->
<style>
.demo {
border: 1px solid black;
width: 320px;
height: 480px;
}
.demo > div:first-child {
background: red;
}
.demo > div:last-child {
background: blue;
}
</style>
</head>
<body>
<brick-flipbox class="demo">
<div>front</div>
<div>back</div>
</brick-flipbox>
<select name="direction" id="direction">
<option value="right" selected="selected">Right</option>
<option value="left">Left</option>
<option value="up">Up</option>
<option value="down">Down</option>
</select>
<button id="toggleButton">Toggle</button>
<script>
window.addEventListener('WebComponentsReady',function(){
var toggleButton = document.getElementById('toggleButton');
var direction = document.getElementById('direction');
var flipbox = document.querySelector('brick-flipbox');
toggleButton.addEventListener('click', function() {
flipbox.toggle();
});
direction.addEventListener('change', function(e) {
flipbox.direction = e.currentTarget.value;
});
});
</script>
</body>
</html>