forked from ravan91/brick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sink.html
105 lines (102 loc) · 3.07 KB
/
sink.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
<!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>The Kitchen Sink</title>
<link rel="stylesheet" href="dist/brick.css">
<style>
body, html {
font-family: sans-serif;
height: 100%;
}
x-card p {
padding: 1em;
}
</style>
</head>
<body>
<x-layout>
<section>
<x-deck>
<x-card id="flip">
<x-flipbox>
<div>
<p>
This is the front
<button class="flip">Flip</button>
</p>
</div>
<div>
<p>
This is the front
<button class="flip">Flip</button>
</p>
</div>
</x-flipbox>
</x-card>
<x-card id="slide">
<x-slidebox>
<x-slides>
<x-slide>
<p>Slide 1 <button class="rand">Random</button></p>
</x-slide>
<x-slide>
<p>Slide 2 <button class="rand">Random</button></p>
</x-slide>
<x-slide>
<p>Slide 3 <button class="rand">Random</button></p>
</x-slide>
<x-slide>
<p>Slide 4 <button class="rand">Random</button></p>
</x-slide>
</x-slides>
</x-flipbox>
</x-card>
<x-card id="cal">
<p><x-datepicker></x-datepicker></p>
<p><x-calendar controls></x-calendar></p>
</x-card>
<x-card id="misc">
<p>
<x-slider></x-slider>
</p>
<p>
<x-toggle label="Yay"></x-toggle>
</p>
<p>
<button id="tip">Show Tooltip</button>
<x-tooltip target-selector="#tip">I'm the tooltip! Yayaaaaaaaas!</x-tooltip>
</p>
</x-card>
</x-deck>
</section>
<footer>
<x-tabbar>
<x-tabbar-tab target-selector="#flip">flip</x-tabbar-tab>
<x-tabbar-tab target-selector="#slide">slide</x-tabbar-tab>
<x-tabbar-tab target-selector="#cal">cal</x-tabbar-tab>
<x-tabbar-tab target-selector="#misc">misc</x-tabbar-tab>
</x-tabbar>
</x-footer>
</x-layout>
<script src="dist/brick.js"></script>
<script>
document.addEventListener('DOMComponentsLoaded', function(){
var slidebox = document.querySelector('x-slidebox');
var slides = document.querySelectorAll('x-slide');
var flipbox = document.querySelector('x-flipbox');
document.body.addEventListener('click', function (e) {
switch (e.target.className) {
case 'rand':
slidebox.slideTo(Math.random() * slides.length | 0);
break;
case 'flip':
flipbox.toggle();
break;
}
});
});
</script>
</body>
</html>