-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.html
318 lines (318 loc) · 19.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
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta charset="utf-8" />
<title>ClassyLoader jQuery plugin | vox.SPACE</title>
<link rel="stylesheet" href="css/documentation.css" />
<script src="js/jquery.min.js"></script>
<script src="js/jquery.classyloader.min.js"></script>
</head>
<body>
<div id="page-container">
<div id="main-container">
<div id="page-content">
<div class="content-header">
<div class="header-section">
<h1>ClassyLoader<br><small>Beautiful loaders? Hell yea!</small></h1>
</div>
</div>
<ul class="breadcrumb breadcrumb-top">
<li><a href="https://vox.space/"><i class="fa fa-home"></i> vox.SPACE</a></li>
<li><a href="https://vox.space/?section=4">jQuery plugins</a></li>
<li>ClassyLoader</li>
</ul>
<div class="row">
<div class="col-md-6">
<div class="block">
<div class="block-title">
<h2>Introduction</h2>
</div>
<div class="clearfix">
<p>ClassyLoader is a <a href="http://www.jquery.com">jQuery</a> plugin written by <a href="https://vox.space">Marius Stanciu - Sergiu</a>, a plugin that lets your add beautiful and animated loaders to your website.</p>
<ul>
<li>Beautifully animated</li>
<li>Cross-browser compatible</li>
<li>Lightweight & ultra customisable</li>
<li>Minimal coding required – simply include the Javascript file</li>
<li>Easy to customize</li>
</ul>
<p>
<a href="/files/jquery-classyloader.zip" class="btn btn-primary">
<i class="fa fa-folder-open"></i> Download it
</a>
</p>
<div class="alert alert-info">
<h4><i class="fa fa-info-circle"></i> License</h4>
This jQuery plugin is distributed under the <a href="https://vox.space/LICENSE-MIT">MIT license</a>. Enjoy!
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="block">
<div class="block-title">
<h2>Demo</h2>
</div>
<div class="clearfix">
<canvas class="loader"></canvas>
<script>
$(document).ready(function() {
$('.loader').ClassyLoader({
currentValue: 16,
maxValue: 20,
speed: 20,
fontSize: '50px',
diameter: 80,
lineColor: 'rgba(155,155,155,1)',
remainingLineColor: 'rgba(200,200,200,0.4)',
lineWidth: 10
});
});
</script>
<br />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="block">
<div class="block-title">
<h2>Setup</h2>
</div>
<div class="clearfix">
<p>First you need to include the jQuery library, since ClassyLoader is a plugin. You can download it from the jQuery website or link it directly from the Google CDN.</p>
<pre><script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script></pre>
<p>Secondly, you need to include the jQuery ClassyLoader javascript, which you can do it by adding the code below to your page.</p>
<pre><script src="js/jquery.classyloader.min.js"></script></pre>
<p>Next, you create the canvas element on which you want to trigger the plugin.</p>
<pre><canvas class="loader"></canvas></pre>
<p>As the last step, you trigger the plugin on the element you just created. In this case, we trigger it on the element with the class loader.</p>
<pre>$('.loader').ClassyLoader();</pre>
<p>If you want to manually trigger the loader, you can do it like this:</p>
<pre><canvas class="loader"></canvas></pre>
<pre>var loader = $('.loader').ClassyLoader({
animate: false,
percentage: 0
});</pre>
<p>This will show the loader at 0%, but not animate it. You can animate the loader by using the <em>draw()</em> method and specify the percent to draw. For example:</p>
<pre>$('.customtrigger').on('click', function() {
loader.setPercent(100).draw();
});
</pre>
<p>You can also use this shortened version:</p>
<pre>$('.customtrigger').on('click', function() {
loader.draw(100);
});
</pre>
</div>
</div>
</div>
<div class="col-md-6">
<div class="block">
<div class="block-title">
<h2>Options</h2>
</div>
<div class="clearfix">
<ul class="fa-ul">
<li>
<h3>Parameters</h3>
<hr />
</li>
<li>
<span class="label label-danger">width</span> - width of the loader in pixels, default is <span class="label label-primary">200</span>
</li>
<li>
<span class="label label-danger">height</span> - height of the loader in pixels, default is <span class="label label-primary">200</span>
</li>
<li>
<span class="label label-danger">animate</span> - whether to animate the loader or not, default is <span class="label label-primary">true</span>
</li>
<li>
<span class="label label-danger">percentage</span> - percent of the value, between 0 and 100, default is <span class="label label-primary">100</span>
</li>
<li>
<span class="label label-danger">speed</span> - miliseconds between animation cycles, lower value is faster, default is <span class="label label-primary">1</span>
</li>
<li>
<span class="label label-danger">showRemaining</span> - show the remaining percentage (100% - percentage), default is <span class="label label-primary">true</span>
</li>
<li>
<span class="label label-danger">start</span> - start angle of the loader, default is <span class="label label-primary">left</span>, can be <span class="label label-success">left</span>, <span class="label label-success">right</span>, <span class="label label-success">top</span>, <span class="label label-success">bottom</span>
</li>
<li>
<span class="label label-danger">fontFamily</span> - name of the font for the percentage, default is <span class="label label-primary">Helvetica</span>
</li>
<li>
<span class="label label-danger">showText</span> - whether to display the percentage text, default is <span class="label label-primary">true</span>
</li>
<li>
<span class="label label-danger">fontSize</span> - size of the percentage font, in pixels, default is <span class="label label-primary">50px</span>
</li>
<li>
<span class="label label-danger">roundedLine</span> - whether the line is rounded, in pixels, default is <span class="label label-primary">false</span>
</li>
<li>
<span class="label label-danger">diameter</span> - diameter of the circle, in pixels, default is <span class="label label-primary">80</span>
</li>
<li>
<span class="label label-danger">fontColor</span> - color of the font in the center of the loader, any CSS color would work, hex, rgb, rgba, hsl, hsla, default is <span class="label label-primary">rgba(25, 25, 25, 0.6)</span>
</li>
<li>
<span class="label label-danger">lineColor</span> - line color of the main circle, default is <span class="label label-primary">rgba(55, 55, 55, 1)</span>
</li>
<li>
<span class="label label-danger">remainingLineColor</span> - line color of the remaining percentage (if showRemaining is true), default is <span class="label label-primary">rgba(55, 55, 55, 0.4)</span>
</li>
<li>
<span class="label label-danger">lineWidth</span> - the width of the circle line in pixels, default is <span class="label label-primary">5</span>
</li>
<li>
<h3>Methods</h3>
<hr />
</li>
<li>
<span class="label label-danger">show()</span> - method that displays the initial loader but does not animate it. For ex. you can use the <em>show()</em> method to display the loader at 0% and animate it by using the <em>draw()</em> method after you set the percent to load
</li>
<li>
<span class="label label-danger">draw()</span> - animate the loader to the specified percentage
</li>
<li>
<span class="label label-danger">setPercent()</span> - sets the percentage value of the loader, so you can use the <em>draw()</em> method afterwards to animate the loader
</li>
<li>
<span class="label label-danger">getPercent()</span> - returns the percentage value of the loader
</li>
</ul>
</div>
</div>
<div class="block">
<div class="block-title">
<h2>Example</h2>
</div>
<div class="clearfix">
<canvas class="loader2"></canvas>
<canvas class="loader3"></canvas>
<canvas class="loader4"></canvas>
<canvas class="loader5"></canvas>
<script>
$(document).ready(function() {
$('.loader2').ClassyLoader({
percentage: 60,
speed: 8,
diameter: 50,
fontSize: '20px',
showText: false,
roundedLine: true,
fontColor: 'rgba(73, 125, 164, 0.3)',
lineColor: 'rgba(73, 125, 164, 1)',
remainingLineColor: 'rgba(73, 125, 164, 0.1)',
lineWidth: 40
});
$('.loader3').ClassyLoader({
speed: 40,
fontSize: '36px',
fontFamily: 'Georgia',
fontColor: 'rgba(0,0,0,0.4)',
lineColor: 'rgba(255,0,0,0.4)',
lineWidth: 1,
remainingLineColor: 'rgba(0,0,0,0.1)'
});
$('.loader4').ClassyLoader({
speed: 20,
diameter: 30,
fontSize: '20px',
fontFamily: 'Georgia',
fontColor: 'rgba(0,0,0,0.4)',
lineColor: 'rgba(0,0,0,0.4)',
percentage: 34,
remainingLineColor: 'rgba(0,0,0,0.1)'
});
$('.loader5').ClassyLoader({
speed: 100,
diameter: 80,
fontSize: '30px',
fontFamily: 'Courier',
fontColor: 'rgba(0,0,0,0.4)',
lineColor: 'rgba(255,175,255,0.7)',
percentage: 80,
lineWidth: 20,
start: 'top',
remainingLineColor: 'rgba(200,200,200,0.1)'
});
});
</script>
<pre>$('.loader2').ClassyLoader({
percentage: 60,
speed: 8,
diameter: 70,
showText: false,
fontSize: '20px',
roundedLine: true,
fontColor: 'rgba(73, 125, 164, 0.3)',
lineColor: 'rgba(73, 125, 164, 1)',
remainingLineColor: 'rgba(73, 125, 164, 0.1)',
lineWidth: 40
});</pre>
<pre>$('.loader3').ClassyLoader({
speed: 40,
fontFamily: 'Georgia',
fontColor: 'rgba(0,0,0,0.4)',
lineColor: 'rgba(255,0,0,0.4)',
lineWidth: 1,
remainingLineColor: 'rgba(0,0,0,0.1)'
});</pre>
<pre>$('.loader4').ClassyLoader({
speed: 20,
diameter: 30,
fontSize: '20px',
fontFamily: 'Georgia',
fontColor: 'rgba(0,0,0,0.4)',
lineColor: 'rgba(0,0,0,0.4)',
percentage: 34,
remainingLineColor: 'rgba(0,0,0,0.1)'
});</pre>
<pre>$('.loader5').ClassyLoader({
speed: 100,
diameter: 80,
fontSize: '30px',
fontFamily: 'Courier',
fontColor: 'rgba(0,0,0,0.4)',
lineColor: 'rgba(0,0,0,0.7)',
percentage: 80,
lineWidth: 20,
start: 'top',
remainingLineColor: 'rgba(200,200,200,0.1)'
});</pre>
</div>
</div>
</div>
</div>
</div>
<footer class="clearfix">
<div class="pull-right">
<span>2005 - 2015</span> © <a href="https://vox.space" target="_blank">vox.SPACE</a>
</div>
</footer>
</div>
</div>
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u = "https://www.picozu.com/x/";
_paq.push(['setTrackerUrl', u + 'piwik.php']);
_paq.push(['setSiteId', 2]);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.defer = true;
g.src = u + 'piwik.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<noscript><p><img src="https://www.picozu.com/x/piwik.php?idsite=2" style="border:0;" alt="" /></p></noscript>
</body>
</html>