forked from oncebot/pushbar.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
223 lines (165 loc) · 6.8 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pushbar.js demo</title>
<meta name="description" content="Pushbar.js is a tiny javascript plugin for creating sliding drawers in web apps">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:title" content="Pushbar.js"/>
<meta property="og:image" content="https://oncebot.github.io/pushbar.js/meta.png"/>
<meta property="og:site_name" content="Pushbar.js"/>
<meta property="og:description" content="Pushbar.js is a tiny javascript plugin for creating sliding drawers in web apps"/>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" href="//cdn.rawgit.com/necolas/normalize.css/master/normalize.css">
<link rel="stylesheet" href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
<link rel="stylesheet" type="text/css" href="pushbar/pushbar.css">
<link rel="stylesheet" type="text/css" href="demo.css">
</head>
<body>
<aside data-pushbar-id="left" class="pushbar from_left">
<div class="title"><span data-pushbar-close class="close push_right"></span> Left sidebar menu</div>
<ul class="menu">
<li>Home</li>
<li>Products</li>
<li>About</li>
<li>Contact</li>
<li>Github</li>
</ul>
</aside>
<aside data-pushbar-id="right" class="pushbar from_right">
<div class="title"><span data-pushbar-close class="close push_right"></span> Right</div>
</aside>
<aside data-pushbar-id="top" class="pushbar from_top">
<div class="title"><span data-pushbar-close class="close push_right"></span> Top</div>
</aside>
<aside data-pushbar-id="bottom" class="pushbar from_bottom">
<div class="title"><span data-pushbar-close class="close push_right"></span> Bottom</div>
</aside>
<main class="pushbar_main_content">
<div class="wrapper">
<div class="card">
<div class="card_title">
Pushbar.js
<div class="small" style="margin-top: 10px;">Pushbar.js is a tiny javascript plugin for creating sliding drawers in web apps</div>
<div class="small">It is fully customizable and dependency free.You can use it as sidebar menus or option drawers.</div>
<div><a href="https://github.com/oncebot/pushbar.js" target="_blank" class="button getBtn">Get it</a></div>
</div>
<div class="card_content">
<div><button data-pushbar-target="left">Left pushbar</button></div>
<div><button data-pushbar-target="right">Right pushbar</button></div>
<div><button data-pushbar-target="top">Top pushbar</button></div>
<div><button data-pushbar-target="bottom">Bottom pushbar</button></div>
<pre><code>
<strong>Installation</strong>
<br>
<br>
<ol>
<li>Add the pushbar.css file to the head of your html.</li>
<li>Add the pushbar.js file to the head of your html or right before the closing body tag.</li>
<li>Add this code after the pushbar.js script tag to initialize the plugin.<br>
<textarea disabled>
<script type="text/javascript">
  new Pushbar({
    blur:true,
    overlay:true,
  });
</script>
</textarea>
</li>
</ol>
</code></pre>
<pre><code>
<strong>Example html</strong>
<br>
<br>
<textarea disabled style="min-height: 550px;">
  <div data-pushbar-id="mypushbar1" class="pushbar from_left">
    Push bar content 1
    <button data-pushbar-close>Close</button>
  </div>
  <div data-pushbar-id="mypushbar2" class="pushbar from_bottom">
    Push bar content 2
    <button data-pushbar-close>Close</button>
  </div>
  <div class="pushbar_main_content">
    Main content of the page
    <button data-pushbar-target="mypushbar1">
    Open my pushbar 1
    </button>
    <button data-pushbar-target="mypushbar2">
    Open my pushbar 2
    </button>
  </div>
</textarea>
</code></pre>
<!-- <pre><code>
<strong>How to use</strong>
<br>
<br>
<p>Your pushbar must have the class .pushbar and any of the directional classes: .from_left, .from_right, .from_top, .from_bottom to set the opening direction.</p>
<p>Pushbar also must have an attribute : data-pushbar-id , which must have a unique value for that pushbar.</p>
<p>Your pushbar open button must have an attribute : data-pushbar-target, with the name of the pushbar as value (same value as data-pushbar-id).</p>
<p>data-pushbar-close attribute can be used on any element to make it a close button for all pushbars.</p>
<p>Your main content must have the class .pushbar_main_content.</p>
</code></pre> -->
<pre><code>
<strong>Options</strong>
<br>
<br>
<ol>
<li>blur : set it to true for blur effect on the main content (Default:false)</li>
<li>overlay : set it to true for dark overlay effect on the main content (Default:true)</li>
</li>
</ol>
</code></pre>
<pre><code>
<strong>API</strong>
<br>
<br>
Open and close pushbar with api
<textarea disabled style="min-height: 300px;">
<script type="text/javascript">
var pushbar =   new Pushbar({
    blur:true,
    overlay:true,
  });
//open a pushbar
pushbar.open('mypushbar1');
//close all pushbars
pushbar.close();
</script>
</textarea>
</code></pre>
<pre><code>
<strong>Emitted events</strong>
<br>
<br>
<p>'pushbar_opening': when a pushbar is opening, that pushbar element will emit this event.</p>
<p>'pushbar_closing': when a pushbar is closing, that pushbar element will emit this event.</p>
</code></pre>
<!--
<pre><code>
<strong>Important CSS classes for modification</strong>
<br>
<br>
<ol>
<li>.from_left, .from_right: change the width for your sidebars.</li>
<li>.from_top, .from_bottom: change the height for your top and bottom bars.</li>
<li>.pushbar_overlay: change the background and opacity for the overlay.</li>
</li>
</ol>
</code></pre> -->
</div>
</div>
<div style="text-align: center; font-size: 12px; margin-bottom: 15px;"><a href="https://oncebot.com" target="_blank">oncebot.com</a></div>
</div>
</main>
<script type="text/javascript" src="pushbar/pushbar.js"></script>
<script type="text/javascript">
var pushbar = new Pushbar({
blur:true,
overlay:true,
});
</script>
</body>
</html>