forked from tgomilar/paroller.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
554 lines (516 loc) · 23.5 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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="lightweight jQuery plugin that enables parallax scrolling effect on elements">
<meta name="keywords"
content="paroller.js,jquery plugin,parallax,scrolling,parallax effect,jQuery,paroller,scroller,scrolling,paroller js,paroller jquery, paroller plugin">
<meta name="google-site-verification" content="TWTDG5sHkQOekIFUa5uWVmi7yO3pJTU7AGMaIPajIHc"/>
<title>paroller.js</title>
<script src="https://use.fontawesome.com/9576790a31.js"></script>
<link rel="stylesheet" href="assets/style.css">
</head>
<body class="is-loading">
<!-- GitHub link -->
<a class="github" href="https://github.com/tgomilar/paroller.js/" target="_blank">
<i class="fa fa-github fa-2x" aria-hidden="true"></i>
</a>
<!-- Sidebar -->
<section id="sidebar">
<div class="inner">
<nav>
<ul>
<li><a href="#download" class="active">Download</a></li>
<li><a href="#install">Install</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#demo">Demo</a></li>
</ul>
</nav>
</div>
</section>
<!-- Wrapper -->
<div id="wrapper">
<!-- Download -->
<section id="download" class="wrapper fullscreen fade-up">
<div class="inner">
<h1 class="title-gradient">paroller.js</h1>
<p>paroller.js is a lightweight jQuery plugin that enables parallax scrolling effect on selected
elements.</p>
<ul>
<li>You can use it on elements with background property or on any other element.</li>
<li>While scrolling elements can move: vertical, horizontal.</li>
<li>Manipulated through html <i>data-*</i> attributes or jQuery options.</li>
<li>Mobile ready.</li>
<li>Easy to use.</li>
</ul>
<ul class="actions">
<li>
<a href="https://github.com/tgomilar/paroller.js/" target="_blank"
class="button">
<i class="fa fa-github" aria-hidden="true"></i> GitHub
</a>
</li>
<li>
<a href="https://github.com/tgomilar/paroller.js/archive/master.zip" target="_blank"
class="button">
<i class="fa fa-download" aria-hidden="true"></i> Download
</a>
</li>
<li>|</li>
<li>
<a href="https://github.com/tgomilar/paroller.js/releases/" target="_blank">
Previous versions
</a>
</li>
</ul>
</div>
</section>
<!-- Install -->
<section id="install" class="wrapper fade-up">
<div class="inner">
<h2 class="major">Install</h2>
<div class="text-left col-xs-12 col-sm-12 col-md-9 offset-md-2">
<p>Before closing <samp><code></body></code></samp> element include <a
href="http://jquery.com/download/" target="_blank">jQuery</a> and <a
href="https://github.com/tgomilar/paroller.js/blob/master/dist/" target="_blank">paroller.js</a>.
</p>
<h3>1. jQuery library</h3>
<code><script src="jquery-3.1.1.min.js"></script></code>
<h3>2. jquery.paroller.js</h3>
<code><script src="jquery.paroller.min.js"></script></code>
<h3>3. Use</h3>
<h5>// define element</h5>
<table>
<tr>
<td>a)</td>
<td><div class="block">
<code>
<div class="my-paroller" data-paroller-factor="0.3" data-paroller-type="foreground"
data-paroller-direction="horizontal"></div>
</code>
</div>
</td>
</tr>
<tr>
<td>b)</td>
<td><div class="block">
<code> <div id="my-element"></div></code>
</div>
</td>
</tr>
</table>
<h5>// initialize paroller.js</h5>
<table>
<tr>
<td>a)</td>
<td><code>$('.my-paroller').paroller();</code></td>
</tr>
<tr>
<td>b)</td>
<td><code> $("#my-element").paroller({ factor: 0.5, factorXs: 0.2, type: 'foreground', direction: 'horizontal' });</code></td>
</tr>
</table>
<h3>npm</h3>
<code>$ npm install paroller.js</code><br>
<code>require('paroller.js');</code>
<h3>Yarn</h3>
<code>$ yarn add paroller.js</code>
<h3>Bower</h3>
<code>$ bower install paroller.js</code>
</div>
</div>
</section>
<!-- Usage -->
<section id="usage" class="wrapper fade-up">
<div class="inner">
<h2>Usage</h2>
<div class="container">
<p>
To enable parallax scrolling effect you can use <b>data-paroller-*</b>
attributes on selected elements or <b>set values via jQuery</b>.<br>
<b>'factor'</b> sets speed and distance of element's parallax effect on scroll.
</p>
<p class="alert">
<b class="fa fa-exclamation-circle"></b> Since <b>'factor'</b> is multiplier it <b>must be set for paroller.js to have parallax effect</b>.
</p>
<pre>
<div class="paroller">Awesome element with parallax effect</div>
// initialize paroller.js and set attributes for selected elements
$(".paroller, [data-paroller-factor]").paroller({
factor: 0.3, // multiplier for scrolling speed and offset
factorXs: 0.1, // multiplier for scrolling speed and offset
type: 'foreground', // background, foreground
direction: 'horizontal' // vertical, horizontal
transition: 'transform 0.2s ease-in' // CSS transition
});
</pre>
<pre>
<div data-paroller-factor="-0.1"
data-paroller-factor-xs="0.1"
data-paroller-type="foreground"
data-paroller-direction="vertical">
Awesome element with parallax effect
</div>
// initialize paroller.js
$("[data-paroller-factor]").paroller();
</pre>
<hr>
<h3>Via data attributes</h3>
<table>
<tr>
<td>data-paroller-factor</td>
<td>Sets offset and speed. It can be positive (0.3)
or negative (-0.3).
Less means slower. <br>
<code><div data-paroller-factor="0.3"></div></code>
</td>
</tr>
<tr>
<td>data-paroller-type</td>
<td>This attribute has two values <i>background</i> and <i>foreground</i>.<br>
If not set the default value is <i>background</i>. <br>
<code><div data-paroller-factor="0.3"
data-paroller-type="foreground"></div></code>
</td>
</tr>
<tr>
<td>data-paroller-direction</td>
<td>This attribute hsd two values: <i>vertical</i>, <i>horizontal</i>.<br>
If not used the default value is set to: <i>vertical</i>. <br>
<code><div data-paroller-factor="0.3" data-paroller-direction="horizontal"></div></code>
</td>
</tr>
<tr>
<td>data-paroller-transition</td>
<td>Sets CSS transition on elements with paroller <b>type</b> set to <b>foreground</b>.<br>
If not used the default value is set to: <i>translate 0.1s ease</i>. <br>
<code><div data-paroller-type="foreground" data-paroller-transition="all 0.2s ease-in"></div></code>
</td>
</tr>
</table>
</div>
<hr>
<h3>Via JavaScript</h3>
<pre>
// initialize paroller.js and set attributes for selected elements
$(".paroller, [data-paroller-factor]").paroller({
factor: 0.3, // multiplier for scrolling speed and offset
factorXs: 0.1, // multiplier for scrolling speed and offset if window width is <576px
factorSm: 0.2, // multiplier for scrolling speed and offset if window width is <=768px
factorMd: 0.2, // multiplier for scrolling speed and offset if window width is <=1024px
factorLg: 0.3, // multiplier for scrolling speed and offset if window width is <=1200px
type: 'foreground', // background, foreground
direction: 'horizontal' // vertical, horizontal
transition: 'transform 0.1s ease' // CSS transition, added on elements where type:'foreground'
});
</pre>
</div>
</section>
<!-- Demo -->
<section id="demo" class="wrapper fade-up">
<div class="inner">
<h2>Demo</h2>
<h6 class="mega my-element"
data-paroller-factor="0.5"
data-paroller-factor-lg="0.4"
data-paroller-factor-md="0.3"
data-paroller-factor-sm="-0.2"
data-paroller-factor-xs="-0.1"
data-paroller-type="foreground"
data-paroller-direction="horizontal"
data-paroller-transition="transform .2s linear"
>
👋 Heola! こんにちは! Ahoj! Merhaba! Olá!
</h6>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="mega my-element"<br>
data-paroller-factor="0.5"<br>
data-paroller-factor-lg="0.4"<br>
data-paroller-factor-md="0.3"<br>
data-paroller-factor-sm="-0.2"<br>
data-paroller-factor-xs="-0.1"<br>
data-paroller-type="foreground"<br>
data-paroller-direction="horizontal"<br>
data-paroller-transition="transform .2s linear"
</div>
<div>
<h5>js</h5>
$('.my-element').paroller();
</div>
</div>
</div>
<h6 class="mega align-right paroller-example">
გამარჯობა! Hello! Zdravo! Привет! 你好! Ciao! !مرحبا Hallå! Χαίρετε! ¡Hola! 👋
</h6>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="paroller-example"
</div>
<div>
<h5>js</h5>
$('.paroller-example').paroller({<br>
factorXs: 0.1,<br>
factorSm: 0.1,<br>
factorMd: -0.4,<br>
factorLg: -0.5,<br>
factorXl: -0.6,<br>
factor: -0.4,<br>
type: 'foreground',<br>
direction: 'horizontal'<br>
});
</div>
</div>
</div>
<div class="jumbotron"
style="background: url('https://unsplash.it/1920/800?image=950') no-repeat center; background-size: cover;"
data-paroller-factor="0.5"
data-paroller-factor-xs="0.2"
>
</div>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="jumbotron"
style="background: url('https://unsplash.it/1920/800?image=950') no-repeat center;<br>
background-size: cover;"<br>
data-paroller-factor="0.5"<br>
data-paroller-factor-xs="0.2"
</div>
<div>
<h5>js</h5>
$('.jumbotron').paroller();
</div>
</div>
</div>
<div class="jumbotron text-center my-5"
style="background: url('https://unsplash.it/1920/800?image=152') repeat center; background-size: cover;"
data-paroller-factor="-0.5"
data-paroller-factor-sm="-0.2"
data-paroller-factor-xs="-0.1"
>
</div>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="jumbotron"
style="background: url('https://unsplash.it/1920/800?image=152') repeat center; background-size:
cover;"<br>
data-paroller-factor="-0.5"<br>
data-paroller-factor-sm="-0.2"<br>
data-paroller-factor-xs="-0.1"
</div>
<div>
<h5>js</h5>
$('.jumbotron').paroller();
</div>
</div>
</div>
<div class="jumbotron text-center my-5"
style="background: url('https://unsplash.it/1920/500?image=974') no-repeat center; background-size: cover;"
data-paroller-factor="-0.2">
</div>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="jumbotron"
style="background: url('https://unsplash.it/1920/500?image=974') no-repeat center;
background-size: cover;"<br>
data-paroller-factor="-0.2"
</div>
<div>
<h5>js</h5>
$('.jumbotron').paroller();
</div>
</div>
</div>
<div class="d-flex">
<div class="image"
style="background: url('https://unsplash.it/400/800?image=889') no-repeat center; background-size: cover;"
data-paroller-factor="0.5"
data-paroller-factor-md="0.3"
data-paroller-factor-sm="0.2"
data-paroller-factor-xs="0.1"
>
</div>
<div class="image"
style="background: url('https://unsplash.it/400/800?image=889') repeat center; background-size: cover;"
data-paroller-factor="-0.4">
</div>
<div class="image"
style="background: url('https://unsplash.it/400/800?image=889') no-repeat center; background-size: cover;"
data-paroller-factor="-0.1">
</div>
</div>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="image"
style="background: url('https://unsplash.it/400/800?image=889') repeat center; background-size:
cover;"<br>
data-paroller-factor="0.5"<br>
data-paroller-factor-md="0.3"<br>
data-paroller-factor-sm="0.2"<br>
data-paroller-factor-xs="0.1"
<hr>
class="image"
style="background: url('https://unsplash.it/400/800?image=889') repeat center; background-size:
cover;"<br>
data-paroller-factor="-0.4"
<hr>
class="image"
style="background: url('https://unsplash.it/400/800?image=889') repeat center; background-size:
cover;"<br>
data-paroller-factor="-0.1"
</div>
<div>
<h5>js</h5>
$('.image').paroller();
<hr>
$('.image').paroller();
<hr>
$('.image').paroller();
</div>
</div>
</div>
<div class="jumbotron text-center my-5"
style="background: url('https://unsplash.it/1920/500?image=867') no-repeat center; background-size: cover;"
data-paroller-factor="-0.15" data-paroller-direction="horizontal">
</div>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="jumbotron"
style="background: url('https://unsplash.it/1920/500?image=867') no-repeat center;
background-size: cover;"<br>
data-paroller-factor="-0.15"<br>
data-paroller-direction="horizontal"
</div>
<div>
<h5>js</h5>
$('.jumbotron').paroller();
</div>
</div>
</div>
<div class="jumbotron text-center my-5"
style="background: url('https://unsplash.it/1920/1200?image=249') repeat bottom; background-size: cover;"
data-paroller-factor="0.3" data-paroller-direction="horizontal">
</div>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="jumbotron"
style="background: url('https://unsplash.it/1920/1200?image=249') repeat bottom;
background-size: cover;"<br>
data-paroller-factor="0.3"<br>
data-paroller-direction="horizontal"
</div>
<div>
<h5>js</h5>
$('.jumbotron').paroller();
</div>
</div>
</div>
<div class="jumbotron text-center my-5"
style="background: url('https://unsplash.it/1920/900?image=888') no-repeat center; background-size: cover;"
data-paroller-factor="-0.5" data-paroller-direction="horizontal">
</div>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="jumbotron"
style="background: url('https://unsplash.it/1920/900?image=888') no-repeat center;
background-size: cover;"<br>
data-paroller-factor="-0.5"<br>
data-paroller-direction="horizontal"
</div>
<div>
<h5>js</h5>
$('.jumbotron').paroller();
</div>
</div>
</div>
<h6 class="mega align-center" data-paroller-factor="0.1"
data-paroller-factor-xs="0.05"
data-paroller-factor-sm="-0.05"
data-paroller-factor-md="0.05"
data-paroller-type="foreground">
Scrolling is fun ✌️
</h6>
<div class="show-more"><i class="fa fa-code"></i></div>
<div class="popover">
<div class="popover-inner">
<div>
<h5>html</h5>
class="mega align-center" data-paroller-factor="0.1" data-paroller-type="foreground"
</div>
<div>
<h5>js</h5>
$('.mega').paroller();
</div>
</div>
</div>
</div>
</section>
</div>
<!-- Footer -->
<footer id="footer" class="wrapper style1-alt">
<div class="inner">
<p>Happy scrolling!</p>
<div class="signature">
<script>document.write(new Date().getFullYear())</script>
@ Copyrights <a href="https://github.com/tgomilar/paroller.js/blob/master/LICENCE.md"
target="_blank">MIT</a> | Made with <i class="fa fa-heart"></i> by <a
href="https://github.com/tgomilar" target="_blank">@tgomilar</a>
</div>
</div>
</footer>
<!-- Scripts -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
<!--paroller.js-->
<script src="dist/jquery.paroller.js"></script>
<script src="assets/main.js"></script>
<script>
$(document)
.ready(function () {
//initialize paroller.js
$('[data-paroller-factor]').paroller();
//initialize paroller.js and set options for elements with .paroller class
$('.paroller-example').paroller({
factorXs: 0.1,
factorSm: 0.1,
factorMd: -0.4,
factorLg: -0.5,
factorXl: -0.6,
factor: -0.4,
type: 'foreground',
direction: 'horizontal',
transition: 'transform .3s ease-out'
});
});
</script>
</body>
</html>