-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathindex.html
197 lines (180 loc) · 7.32 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
<!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="src/pushbar.css">
<link rel="stylesheet" type="text/css" href="demo.css">
</head>
<body>
<aside data-pushbar-id="left" data-pushbar-direction="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" data-pushbar-direction="right">
<div class="title"><span data-pushbar-close class="close push_right"></span> Right</div>
</aside>
<aside data-pushbar-id="top" data-pushbar-direction="top">
<div class="title"><span data-pushbar-close class="close push_right"></span> Top</div>
</aside>
<aside data-pushbar-id="bottom" data-pushbar-direction="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">
<div style="display: flex; align-items: center;">
<span style="flex:1;">Pushbar.js</span>
<a href="https://www.buymeacoffee.com/oncebot" style="color:white;" target="_blank">☕️ Buy Me A
Cofee</a>
</div>
<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>New! [ IMPORTANT: USES HAS SLIGNT CHANGE, SEE BELOW ]</strong>
<br>
<br>
<ol>
<li>It's now even smaller and more effitient.</li>
<li>Code is now beautified.</li>
<li>Added to NPM.</li>
<li>Added to CDN.</li>
</ol>
</code></pre>
<pre><code>
<strong>Installation</strong>
<br>
<br>
<ol>
<li>Add the pushbar.css file to the head of your html. [CDN: https://cdn.jsdelivr.net/npm/[email protected]/src/pushbar.min.css]</li>
<li>Add the pushbar.js file to the head of your html or right before the closing body tag. [CDN: https://cdn.jsdelivr.net/npm/[email protected]/src/pushbar.min.js]</li>
<li>Add this code after the pushbar.js script tag to initialize the plugin.<br>
<textarea disabled>
<script type="text/javascript">
& nbsp new Pushbar({
& nbsp & nbsp blur: true,
& nbsp & nbsp overlay: true,
& nbsp });
</script>
</textarea>
</li>
</ol>
</code></pre>
<pre><code>
<strong>Example html</strong>
<br>
<br>
<textarea disabled style="min-height: 550px;">
//CHANGE: Older version of pushbar used class="pushbar from_left"
  <div data-pushbar-id="mypushbar1" data-pushbar-direction="left">
    Push bar content 1
    <button data-pushbar-close>Close</button>
  </div>
//CHANGE: Older version of pushbar used class="pushbar from_bottom"
  <div data-pushbar-id="mypushbar2" data-pushbar-direction="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>Direction attributes [NEW]</strong>
<br>
<br>
You can use 4 directional attributes in pushbar elements
<ol>
<li>data-pushbar-direction="left" So that the pushbar opens from left</li>
<li>data-pushbar-direction="right" So that the pushbar opens from right</li>
<li>data-pushbar-direction="top" So that the pushbar opens from top</li>
<li>data-pushbar-direction="bottom" So that the pushbar opens from bottom</li>
</ol>
</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">
const pushbar = & nbsp new Pushbar({
& nbsp & nbsp blur: true,
& nbsp & nbsp overlay: true,
& nbsp });
//open a pushbar
pushbar.open('mypushbar1');
//close all pushbars
pushbar.close();
</script>
</textarea>
</code></pre>
<pre><code>
<strong>Events</strong>
<br>
<br>
<p>'pushbar_opening': when a pushbar is opening, it will emit 'pushbar_opening' event with an object { element, id }, Where element will be the current pushbar element and the id is the current pushbar id.</p>
<p>'pushbar_closing': when a pushbar is closing, it will emit 'pushbar_closing' event with an object { element, id }, Where element will be the current pushbar element and the id is the current pushbar id.</p>
</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="src/pushbar.js"></script>
<script type="text/javascript">
const pushbar = new Pushbar({
blur: true,
overlay: true,
});
</script>
</body>
</html>