forked from mozbrick/brick-tabbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
110 lines (94 loc) · 2.79 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
<!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-tabbar</title>
<!-- Importing Polyfill -->
<script src="bower_components/platform/platform.js"></script>
<!-- Importing Custom Elemenent -->
<link rel="import" href="src/brick-tabbar.html">
<!-- Importing brick-deck, just for the demo -->
<link rel="import" href="bower_components/brick-deck/src/brick-deck.html">
<style type="text/css">
/** Defining custom styles:
Besides applying custom styles to the brick-deck and brick-cards
themselves, you can define styles for the following selectors to
determine how the widget appears during animations
brick-card[leaving] => defines how a card looks when in the middle
of transitioning out of frame
brick-card[selected] => defines how the currently selected card looks
**/
html, body{
width: 100%;
height: 100%;
overflow: auto;
}
#demo-controls{
text-align: center;
}
#demo-box{
margin: 0 auto;
width: 320px;
height: 480px;
background-color: #333;
}
#demo-box brick-card{
text-align:center;
font-size: 5em;
line-height: 1em;
padding: 50% 0;
}
#demo-box brick-card[transition-override]:after{
content: "transition-override = " attr(transition-override);
font-size: .25em;
line-height: 1em;
display: block;
}
#demo-box brick-card[leaving]:before{
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.3);
}
#demo-box brick-card[selected]{
color: white;
text-shadow: 1px 1px 10px black;
}
#a {
background-color: red;
}
#b {
background-color: orange;
}
#c {
background-color: yellow;
}
#demo-bar {
margin: 0 auto;
width: 320px;
}
#demo-bar brick-tabbar-tab {
border: 1px solid grey;
padding: 5px;
cursor: pointer;
}
</style>
</head>
<body>
<brick-deck id="demo-box" selected-index="0">
<brick-card id="a" selected>0</brick-card>
<brick-card id="b">1</brick-card>
<brick-card id="c">2</brick-card>
</brick-deck>
<!-- Using Custom Element -->
<brick-tabbar id="demo-bar">
<brick-tabbar-tab target="a" selected>0</brick-tabbar-tab>
<brick-tabbar-tab target="b">1</brick-tabbar-tab>
<brick-tabbar-tab target="c">2</brick-tabbar-tab>
</brick-tabbar>
</body>
</html>