This repository has been archived by the owner on May 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
executable file
·250 lines (232 loc) · 9.68 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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<!DOCTYPE html>
<html>
<head>
<!-- Meta setup -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Rocket Button Module</title>
<link href="node_modules/rocket-demo/css/demo.min.css" rel="stylesheet" type="text/css">
<link href="css/button.min.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="rocket-demo-message">
You need to run "npm install" and include the neccessary demo files in order to view this file.
</div>
<div id="rocket-demo" style="display:none;">
<div class="heading">
<div class="container"><h2>Rocket Button Module</h2></div>
</div>
<div class="container">
<h4>Getting Started</h4>
<p>Install via NPM.</p>
<pre class="prettyprint linenums">
npm install rocket-button
</pre>
<p class="note">Note that this module has a dependency <a href="https://github.com/chrishumboldt/Rocket-Tools" class="link" target="_blank">Rocket Tools (28kb)</a> which will automatically be installed as well.</p>
<h4>CSS Implementation</h4>
<p>Start by including the necessary files.</p>
<pre class="prettyprint linenums">
<head>
<link href="node_modules/rocket-button/css/button.min.css" rel="stylesheet" type="text/css">
</head>
</pre>
<p>Now class your button with modifiers to gain the desired effect. For example:</p>
<pre class="prettyprint linenums">
<button class="mod-button _mod-style-line-red _mod-size-large">Example Button</button>
</pre>
<br>
<h4>SASS Implementation</h4>
<p>Instead of including the CSS file above, you can import the SASS file and create your own button styles. See an example below:</p>
<pre class="prettyprint linenums">
@import "node_modules/rocket-button/build/sass/import";
.btn-primary,
.btn-secondary {
@include mod-button-setup;
@include mod-button-shape(rounded);
@include mod-button-size(normal);
}
.btn-primary {
@include mod-button-style(line, black);
@include mod-button-size(large);
}
.btn-secondary {
@include mod-button-style(flat, white);
}
</pre>
<br>
<h4>Button Loaders</h4>
<p>If you want to enable a button loader then you will need to execute the following Javascript. Start by including the necessary files.</p>
<pre class="prettyprint linenums">
<body>
<button id="button-loader" class="mod-button _mod-style-flat-blue">Button Loader</button>
// Include the scripts
<script src="node_modules/rocket-tools/js/tools.min.js"></script>
<script src="node_modules/rocket-button/js/button.min.js"></script>
<script>
Rocket.event.add('#button-loader', 'click', (event) => {
Rocket.button.loader({
element: event.currentTarget,
parseEvent: event
});
});
</script>
</body>
</pre>
<br>
<h4>Drop Down Buttons</h4>
<p>If you want to enable button drop downs then you will need to execute the following Javascript. Start by including the necessary files.</p>
<pre class="prettyprint linenums">
<body>
<div id="btn-primary" class="mod-button _mod-style-flat-blue">
Drop-Down Default<div class="mod-button-arrow"></div>
<ul>
<li><a href>Link 1</a></li>
<li><a href>Link 2</a></li>
<li class="mod-button-line-top"><a href>Link 3</a></li>
</ul>
</div>
// Include the scripts
<script src="node_modules/rocket-tools/js/tools.min.js"></script>
<script src="node_modules/rocket-button/js/button.min.js"></script>
<script>
Rocket.button.dropdown({
target: '#btn-primary'
});
</script>
</body>
</pre>
<br>
<h4>Working Examples</h4>
<p>Flat Buttons</p>
<a href class="mod-button _mod-style-flat-white">White</a>
<a href class="mod-button _mod-style-flat-grey">Grey</a>
<a href class="mod-button _mod-style-flat-black">Black</a>
<a href class="mod-button _mod-style-flat-aqua">Aqua</a>
<a href class="mod-button _mod-style-flat-blue">Blue</a>
<a href class="mod-button _mod-style-flat-green">Green</a>
<a href class="mod-button _mod-style-flat-orange">Orange</a>
<a href class="mod-button _mod-style-flat-pink">Pink</a>
<a href class="mod-button _mod-style-flat-purple">Purple</a>
<a href class="mod-button _mod-style-flat-red">Red</a>
<a href class="mod-button _mod-style-flat-yellow">Yellow</a>
<br><br>
<p>Gradient Buttons</p>
<a href class="mod-button _mod-style-gradient-white">White</a>
<a href class="mod-button _mod-style-gradient-grey">Grey</a>
<a href class="mod-button _mod-style-gradient-black">Black</a>
<a href class="mod-button _mod-style-gradient-aqua">Aqua</a>
<a href class="mod-button _mod-style-gradient-blue">Blue</a>
<a href class="mod-button _mod-style-gradient-green">Green</a>
<a href class="mod-button _mod-style-gradient-orange">Orange</a>
<a href class="mod-button _mod-style-gradient-pink">Pink</a>
<a href class="mod-button _mod-style-gradient-purple">Purple</a>
<a href class="mod-button _mod-style-gradient-red">Red</a>
<a href class="mod-button _mod-style-gradient-yellow">Yellow</a>
<br><br>
<p>Line Buttons</p>
<a href class="mod-button _mod-style-line-white">White</a>
<a href class="mod-button _mod-style-line-grey">Grey</a>
<a href class="mod-button _mod-style-line-black">Black</a>
<a href class="mod-button _mod-style-line-aqua">Aqua</a>
<a href class="mod-button _mod-style-line-blue">Blue</a>
<a href class="mod-button _mod-style-line-green">Green</a>
<a href class="mod-button _mod-style-line-orange">Orange</a>
<a href class="mod-button _mod-style-line-pink">Pink</a>
<a href class="mod-button _mod-style-line-purple">Purple</a>
<a href class="mod-button _mod-style-line-red">Red</a>
<a href class="mod-button _mod-style-line-yellow">Yellow</a>
<br><br>
<h5>Button Sizes</h5>
<a href class="mod-button _mod-size-small">Small</a>
<a href class="mod-button">Normal</a>
<a href class="mod-button _mod-size-large">Large</a>
<a href class="mod-button _mod-size-x-large">Extra Large</a>
<br><br>
<h5>Button Shapes</h5>
<a href class="mod-button _mod-style-flat-red">Rounded (default)</a>
<a href class="mod-button _mod-style-flat-red _mod-shape-pill">Pill Button</a>
<a href class="mod-button _mod-style-flat-red _mod-shape-square">Squared Button</a>
<br><br>
<h5>Button Loaders</h5>
<a href class="mod-button _mod-style-flat-blue _mod-size-small" id="loader-example-1">Loader Example</a>
<a href class="mod-button _mod-style-flat-blue" id="loader-example-2">Loader Example</a>
<a href class="mod-button _mod-style-flat-blue _mod-size-large" id="loader-example-3">Loader Example</a>
<a href class="mod-button _mod-style-flat-blue _mod-size-x-large" id="loader-example-4">Loader Example</a>
<br><br>
<h5>Drop Down Button</h5>
<div class="button-dropdowns mod-button _mod-size-large">
Drop Down Default<div class="mod-button-arrow"></div>
<ul>
<li><a href>Link 1</a></li>
<li><a href>Link 2</a></li>
<li class="mod-button-line-top"><a href>Link 3</a></li>
</ul>
</div>
<div class="button-dropdowns mod-button _mod-style-flat-blue">
Drop Down Blue<div class="mod-button-arrow"></div>
<ul>
<li><a href>Link 1</a></li>
<li><a href>Link 2</a></li>
<li><a href>Link 3</a></li>
<li><a href>Link 4</a></li>
<li class="mod-button-line-top"><a href>Link 5</a></li>
</ul>
</div>
<br><br><br>
<h4>Detailed Documentation</h4>
<p>For a more detailed look into the available options, you can read the documentation at <a target="_blank" href="https://github.com/chrishumboldt/Rocket-Button" class="link">https://github.com/chrishumboldt/Rocket-Button</a></p>
</div>
<footer><div class="container"><div class="col-double">
<div class="left">
Made by <a href="http://chrishumboldt.com" target="_blank">Chris Humboldt</a>
</div>
<!-- <div class="right">
A <a href="http://getwebplate.com" target="_blank">Webplate Project</a>
Want updates? <a href="http://twitter.com/webplatetweets" target="_blank">@webplatetweets</a>
</div> -->
</div></div></footer>
</div>
<!-- Scripts -->
<script src="node_modules/rocket-tools/js/tools.min.js"></script>
<script src="node_modules/rocket-demo/js/demo.min.js"></script>
<script src="build/js/button.js"></script>
<script>
Rocket.button.dropdown({
target: '.button-dropdowns'
});
// Stop all button events
const buttons = document.querySelectorAll('a.mod-button');
for (let i = buttons.length - 1; i >= 0; i--) {
buttons[i].onclick = (event) => {
event.preventDefault();
};
}
// Loader example
Rocket.defaults.button.loader.timeout = 4;
Rocket.event.add('#loader-example-1', 'click', (event) => {
Rocket.button.loader({
element: event.currentTarget,
parseEvent: event
});
});
Rocket.event.add('#loader-example-2', 'click', (event) => {
Rocket.button.loader({
element: event.currentTarget,
parseEvent: event
});
});
Rocket.event.add('#loader-example-3', 'click', (event) => {
Rocket.button.loader({
element: event.currentTarget,
parseEvent: event
});
});
Rocket.event.add('#loader-example-4', 'click', (event) => {
Rocket.button.loader({
element: event.currentTarget,
parseEvent: event
});
});
</script>
</body>
</html>