forked from msurguy/background-blur
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
597 lines (535 loc) · 27.3 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
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Background Blur - plugin by @msurguy</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.5/paper/bootstrap.min.css"/>
<!--[if gte IE 9]>
<style type="text/css">
.gradient {
filter: none;
}
</style>
<![endif]-->
<style>
/* Container that will contain blurred image and other content */
#preview-container {
overflow: hidden;
position: relative;
width:100%;
}
#preview {
height: 300px;
}
/* Plugin will add this class to blurred image, providing you with control over certain aspects */
.bg-blur {
z-index: -2;
opacity: 0;
position: absolute;
min-height: 100%;
height: auto;
display: block;
top: 0;
max-height: none;
/* Add this CSS to remove transparent border around the image */
left: -10%;
width: 120%;
}
/*
An element with this class is added by the plugin to provide an overlay above the blurred image
It could drastically improve the appearance of the blurred image for content readability
*/
.bg-blur-overlay {
z-index: -1;
position: absolute;
width: 100%;
height: 100%;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0.15+0,1+100 */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwLjE1Ii8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgba(0,0,0,0.15) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.15)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,0.15) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0,0,0,0.15) 0%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(0,0,0,0.15) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%,rgba(0,0,0,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#26000000', endColorstr='#000000',GradientType=0 ); /* IE6-8 */
}
/* Content */
#preview-container .content {
z-index: 1;
color: #FFF;
text-align: center;
}
.jumbotron {
background-color: inherit;
}
.jumbotron h1, .jumbotron h2 {
color: #FFF;
}
.avatar-holder {
overflow: hidden;
height: 200px;
text-align: center;
position: relative;
}
.avatar-container {
padding-top: 50px;
}
.avatar {
display: inline-block;
position: relative;
}
.avatar img {
width: 100px;
height: 100px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
border: 5px solid rgba(255,255,255,0.8);
transition: 0.3s;
cursor: pointer;
}
.avatar img:hover {
border: 5px solid rgba(90,96,200,0.8);
}
.avatar-blur {
z-index: -2;
position: absolute;
min-height: 100%;
height: auto;
display: block;
top: 0;
max-height: none;
/* Add this CSS to remove transparent border around the image */
left: -10%;
width: 120%;
}
.tinted-thumbnails img{
width: 25%;
float:left;
cursor: pointer;
}
#tinted-holder {
height: 300px;
overflow: hidden;
position: relative;
width:100%;
}
/* Plugin will add this class to blurred image, providing you with control over certain aspects */
.tinted-bg-blur {
z-index: -2;
opacity: 0;
position: absolute;
min-height: 100%;
height: auto;
display: block;
top: 0;
max-height: none;
/* Add this CSS to remove transparent border around the image */
left: -10%;
width: 120%;
}
/*
An element with this class is added by the plugin to provide an overlay above the blurred image
It could drastically improve the appearance of the blurred image for content readability
*/
.tinted-bg-overlay {
z-index: -1;
position: absolute;
width: 100%;
height: 100%;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#ba43a8+0,ea4fce+62,537bad+100&0.38+0,0.17+61,0.8+100 */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMTAwJSI+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjYmE0M2E4IiBzdG9wLW9wYWNpdHk9IjAuMzgiLz4KICAgIDxzdG9wIG9mZnNldD0iNjElIiBzdG9wLWNvbG9yPSIjZTk0ZmNkIiBzdG9wLW9wYWNpdHk9IjAuMTciLz4KICAgIDxzdG9wIG9mZnNldD0iNjIlIiBzdG9wLWNvbG9yPSIjZWE0ZmNlIiBzdG9wLW9wYWNpdHk9IjAuMTkiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzUzN2JhZCIgc3RvcC1vcGFjaXR5PSIwLjgiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
background: -moz-linear-gradient(-45deg, rgba(186,67,168,0.38) 0%, rgba(233,79,205,0.17) 61%, rgba(234,79,206,0.19) 62%, rgba(83,123,173,0.8) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(186,67,168,0.38)), color-stop(61%,rgba(233,79,205,0.17)), color-stop(62%,rgba(234,79,206,0.19)), color-stop(100%,rgba(83,123,173,0.8))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg, rgba(186,67,168,0.38) 0%,rgba(233,79,205,0.17) 61%,rgba(234,79,206,0.19) 62%,rgba(83,123,173,0.8) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, rgba(186,67,168,0.38) 0%,rgba(233,79,205,0.17) 61%,rgba(234,79,206,0.19) 62%,rgba(83,123,173,0.8) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, rgba(186,67,168,0.38) 0%,rgba(233,79,205,0.17) 61%,rgba(234,79,206,0.19) 62%,rgba(83,123,173,0.8) 100%); /* IE10+ */
background: linear-gradient(135deg, rgba(186,67,168,0.38) 0%,rgba(233,79,205,0.17) 61%,rgba(234,79,206,0.19) 62%,rgba(83,123,173,0.8) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#61ba43a8', endColorstr='#cc537bad',GradientType=1 ); /* IE6-8 fallback on horizontal gradient */
}
.video-bg-container {
overflow: hidden;
position: relative;
width:100%;
}
.video-thumbnails img {
width: 25%;
float:left;
cursor: pointer;
}
</style>
<link href="//vjs.zencdn.net/4.12/video-js.css" rel="stylesheet">
<script src="//vjs.zencdn.net/4.12/video.js"></script>
</head>
<body>
<a href="https://github.com/msurguy/background-blur"><img style="position: absolute; top: 0; right: 0; border: 0; z-index:1000" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
<div id="preview-container">
<div id="preview">
<div class="container jumbotron">
<div class="row">
<div class="col-md-12">
<div class="content">
<h1>Image Blur Plugin</h1>
<p>Ultra small plugin (4kb minified, 1.5kb gzipped) for Blurring images</p>
<a href="https://twitter.com/share" style="padding-top:10px;" class="twitter-share-button" data-via="msurguy" data-hashtags="webdesign">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h2>Switch Header Image:</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3 col-sm-6 col-xs-6">
<a href="#" class="preview-btn thumbnail">
<img class="img-responsive" src="https://ununsplash.imgix.net/photo-1429277096327-11ee3b761c93?q=75&fm=jpg&w=400&fit=max" alt=""/>
</a>
</div>
<div class="col-md-3 col-sm-6 col-xs-6">
<a href="#" class="preview-btn thumbnail">
<img class="img-responsive" src="https://unsplash.imgix.net/photo-1429042007245-890c9e2603af?fit=crop&fm=jpg&q=75&w=400" alt=""/>
</a>
</div>
<div class="col-md-3 col-sm-6 col-xs-6">
<a href="#" class="preview-btn thumbnail">
<img class="img-responsive" src="https://ununsplash.imgix.net/photo-1429030150151-548690082f0b?fit=crop&fm=jpg&q=75&w=400" alt=""/>
</a>
</div>
<div class="col-md-3 col-sm-6 col-xs-6">
<a href="#" class="preview-btn thumbnail">
<img class="img-responsive" src="https://unsplash.imgix.net/photo-1424746219973-8fe3bd07d8e3?fit=crop&fm=jpg&q=75&w=400" alt=""/>
</a>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h2>Usage: </h2>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>Install this plugin with Bower: </p>
<pre>bower install background-blur</pre>
<p>Or manually:</p>
<pre><script src="jquery.min.js"></script>
<script src="background-blur.min.js"></script></pre>
<p>Create a container which will contain the blurred image:</p>
<pre><div id='some-element'></div></pre>
<p>Then create a blurred image in that container:</p>
<pre>$('#some-element').backgroundBlur({
imageURL : 'http://URL-of-the-image',
blurAmount : 50,
imageClass : 'bg-blur'
});</pre>
<p>OR Create a blurred image and fade it in:</p>
<pre>$('#some-element').backgroundBlur({
imageURL : 'http://URL-of-the-image',
blurAmount : 50,
imageClass : 'bg-blur'
duration: 1000, // If the image needs to be faded in, how long that should take
endOpacity : 1 // Specify the final opacity that the image will have
});</pre>
<p>OR Create a blurred image, fade it in and switch to another image:</p>
<pre>// Initialize the blur
$('#some-element').backgroundBlur({
imageURL : 'http://URL-of-the-image',
blurAmount : 50,
imageClass : 'bg-blur'
duration: 1000, // If the image needs to be faded in, how long that should take
endOpacity : 1 // Specify the final opacity that the image will have
});
//Switch the image
$('#some-element').backgroundBlur('http://URL-of-another-image');</pre>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h2>More demos:</h2>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<p>Avatar-based backgrounds (click):</p>
<div class="avatar-holder">
<div class="avatar-container">
<div class="avatar">
<img src="//www.gravatar.com/avatar/54798cdd1ba8472c5011ae892bb06942?s=100" alt="@msurguy"/>
</div>
<div class="avatar">
<img src="//s3.amazonaws.com/uifaces/faces/twitter/gt/128.jpg" alt="@gt">
</div>
<div class="avatar">
<img src="//s3.amazonaws.com/uifaces/faces/twitter/mijustin/128.jpg" alt="@mijustin">
</div>
</div>
</div>
<br/>
<p>Code: </p>
<pre>
$avatarHolderEl.backgroundBlur({
imageURL : avatars[0],
blurAmount : 50,
imageClass : 'avatar-blur'
});
</pre>
</div>
<div class="col-md-6">
<p>Tinted overlays:</p>
<div id="tinted-holder"></div>
<div class="tinted-thumbnails">
<img src="https://ununsplash.imgix.net/photo-1429277096327-11ee3b761c93?q=75&fm=jpg&w=400&fit=max" alt=""/>
<img src="https://unsplash.imgix.net/photo-1424746219973-8fe3bd07d8e3?fit=crop&fm=jpg&q=75&w=400" alt=""/>
<img src="https://ununsplash.imgix.net/photo-1429030150151-548690082f0b?fit=crop&fm=jpg&q=75&w=400" alt=""/>
<img src="https://unsplash.imgix.net/photo-1429042007245-890c9e2603af?fit=crop&fm=jpg&q=75&w=400" alt=""/>
</div>
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#tinted-js" aria-controls="home" role="tab" data-toggle="tab">JS</a></li>
<li role="presentation"><a href="#tinted-css" aria-controls="css" role="tab" data-toggle="tab">CSS</a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="tinted-js">
<pre>$tintedHolderEl.backgroundBlur({
imageURL : 'url-of-the-image',
blurAmount : 10,
imageClass : 'tinted-bg-blur',
overlayClass : 'tinted-bg-overlay',
duration: 1000,
endOpacity : 1
});</pre>
</div>
<div role="tabpanel" class="tab-pane" id="tinted-css">
<pre>.tinted-bg-blur {
z-index: -2;
opacity: 0;
position: absolute;
min-height: 100%;
height: auto;
display: block;
top: 0;
max-height: none;
/* Add this CSS to remove transparent border around the image */
left: -10%;
width: 120%;
}
.tinted-bg-overlay {
z-index: -1;
position: absolute;
width: 100%;
height: 100%;
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMTAwJSI+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjZWE0ZmNlIiBzdG9wLW9wYWNpdHk9IjAuOTYiLz4KICAgIDxzdG9wIG9mZnNldD0iNjclIiBzdG9wLWNvbG9yPSIjNmE1ZmMyIiBzdG9wLW9wYWNpdHk9IjAuMTciLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzJiNjdiYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(-45deg, rgba(234,79,206,0.96) 0%, rgba(106,95,194,0.17) 67%, rgba(43,103,188,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(234,79,206,0.96)), color-stop(67%,rgba(106,95,194,0.17)), color-stop(100%,rgba(43,103,188,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(-45deg, rgba(234,79,206,0.96) 0%,rgba(106,95,194,0.17) 67%,rgba(43,103,188,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, rgba(234,79,206,0.96) 0%,rgba(106,95,194,0.17) 67%,rgba(43,103,188,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, rgba(234,79,206,0.96) 0%,rgba(106,95,194,0.17) 67%,rgba(43,103,188,1) 100%); /* IE10+ */
background: linear-gradient(135deg, rgba(234,79,206,0.96) 0%,rgba(106,95,194,0.17) 67%,rgba(43,103,188,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5ea4fce', endColorstr='#2b67bc',GradientType=1 ); /* IE6-8 fallback on horizontal gradient */
}
</pre>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p class="lead">Using video thubmbnail to create ambient background for a player (like on <a target="_blank" href="http://www.nbcnews.com/video">http://www.nbcnews.com/video</a>):</p>
</div>
</div>
</div>
<div class="video-bg-container">
<div id="video-bg">
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
<video id="video-element" class="video-js vjs-default-skin vjs-big-play-centered embed-responsive-item"
controls preload="auto" width="auto" height="auto"
poster="dist/video/lookup/lookup.jpg">
<source src="dist/video/lookup/lookup.mp4" type='video/mp4' />
<source src="dist/video/lookup/lookup.webm" type='video/webm' />
<p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
</div>
<div class="video-thumbnails">
<img data-mp4="dist/video/lookup/lookup.mp4" data-webm="dist/video/lookup/lookup.webm" src="dist/video/lookup/lookup.jpg" alt=""/>
<img data-mp4="dist/video/frankincense/frankincense.mp4" data-webm="dist/video/frankincense/frankincense.webm" src="dist/video/frankincense/frankincense.jpg" alt=""/>
<img data-mp4="dist/video/breathingbarcelona/breathingbarcelona.mp4" data-webm="dist/video/breathingbarcelona/breathingbarcelona.webm" src="dist/video/breathingbarcelona/barcelona.jpg" alt=""/>
<img data-mp4="dist/video/nightoflighthouse/nightoflighthouse.mp4" data-webm="dist/video/nightoflighthouse/nightoflighthouse.webm" src="dist/video/nightoflighthouse/night.jpg" alt=""/>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h2>Browser Support: </h2>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<ul>
<li>Chrome</li>
<li>Firefox</li>
<li>Safari and Safari Mobile (iOS)</li>
<li>IE6, IE7, IE8 - blur is supported without animation (need to omit "duration" property in those browsers to make this plugin work, the problem will get fixed when <a target="_blank" href="https://github.com/julianshapiro/velocity/issues/506">Velocity.js issue gets fixed</a>)</li>
<li>IE9, IE10, IE11</li>
<li>Android browsers</li>
<li>Possibly, more. Please let me know if some browser doesn't work</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h2>Under the hood: </h2>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>This plugin utilizes SVG filter to blur the image if SVG is supported by the browser (all except IE), otherwise the plugin creates an IMG tag and applies a special IE-only filter in CSS</p>
<p><strong>Q: </strong>Why not simply use CSS 3 blur filter? <br/><strong>A:</strong>The browser support for SVG blur filter is much wider when it comes to older browsers.</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h2><a href="https://julian.com/research/velocity/" target="_blank">Velocity.js support</a>: </h2>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>If you are using <a href="https://julian.com/research/velocity/" target="_blank">Velocity.js</a> animation library, the plugin will automatically detect its presence and make fade in/fade out animations more performant, especially on mobile. If Velocity is not present on the page, jQuery's "animate" is used</p>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h2>License: </h2>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>This plugin is released under MIT license, giving you permission to use for commercial and non-commercial projects</p>
</div>
</div>
</div>
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/velocity/1.2.2/velocity.min.js"></script>
<script src="dist/background-blur.min.js"></script>
<script>
// Scripts for demo page
$( document ).ready(function() {
var $previewEl = $('#preview');
var $avatarEl = $('.avatar');
var $avatarHolderEl = $('.avatar-holder');
var $tintedEl = $('.tinted-thumbnails img');
var $tintedHolderEl = $('#tinted-holder');
var $videoBGEl = $('#video-bg');
var $videoBgImages = $('.video-thumbnails img');
var $videoEl = document.getElementById('video-element');
var images = [];
var avatars = [];
// Simple slideshow
$('.preview-btn').each(function(){
var $el = $(this);
var img = $el.find('img').first().attr('src');
images.push(img);
$el.click(function(e){
e.preventDefault();
$previewEl.backgroundBlur(img);
});
});
$previewEl.backgroundBlur({
imageURL : images[0], // URL to the image that will be used for blurring
blurAmount : 10, // Amount of blur (higher amount degrades browser performance)
imageClass : 'bg-blur', // CSS class that will be applied to the image and to the SVG element,
overlayClass : 'bg-blur-overlay', // CSS class of an element that will overlay the blur background (useful for additional effects or putting a spinner)
duration: 1000, // If the image needs to be faded in, how long that should take
endOpacity : 1 // Specify the final opacity that the image will have
});
// Avatar - based backgrounds
$avatarEl.each(function(){
var $avatar = $(this);
var avatarImage = $avatar.find('img').first().attr('src');
avatars.push(avatarImage);
$avatar.click(function(e){
e.preventDefault();
$avatarHolderEl.backgroundBlur(avatarImage);
});
});
$avatarHolderEl.backgroundBlur({
imageURL : avatars[0], // URL to the image that will be used for blurring
blurAmount : 50, // Amount of blur (higher amount degrades browser performance)
imageClass : 'avatar-blur' // CSS class that will be applied to the image and to the SVG element,
});
// Avatar - based backgrounds
$tintedEl.each(function(){
var $el = $(this);
var avatarImage = $el.attr('src');
$el.click(function(e){
e.preventDefault();
$tintedHolderEl.backgroundBlur(avatarImage);
});
});
$tintedHolderEl.backgroundBlur({
imageURL : images[0], // URL to the image that will be used for blurring
blurAmount : 10, // Amount of blur (higher amount degrades browser performance)
imageClass : 'tinted-bg-blur', // CSS class that will be applied to the image and to the SVG element,
overlayClass : 'tinted-bg-overlay', // CSS class of an element that will overlay the blur background (useful for additional effects or putting a spinner)
duration: 1000, // If the image needs to be faded in, how long that should take
endOpacity : 1 // Specify the final opacity that the image will have
});
// Video background blur
var videoPlayer = videojs($videoEl);
$videoBGEl.backgroundBlur({
imageURL : 'dist/video/lookup/lookup.jpg', // URL to the image that will be used for blurring
blurAmount : 10, // Amount of blur (higher amount degrades browser performance)
imageClass : 'bg-blur', // CSS class that will be applied to the image and to the SVG element,
overlayClass : 'bg-blur-overlay', // CSS class of an element that will overlay the blur background (useful for additional effects or putting a spinner)
duration: 1000, // If the image needs to be faded in, how long that should take
endOpacity : 1 // Specify the final opacity that the image will have
});
$videoBgImages.each(function(){
var $el = $(this);
var avatarImage = $el.attr('src');
$el.click(function(e){
e.preventDefault();
videoPlayer.src ([
{ type: 'video/mp4', src: $el.data('mp4') },
{ type: 'video/webm', src: $el.data('webm') }
]);
videoPlayer.poster(avatarImage);
$videoBGEl.backgroundBlur(avatarImage);
});
});
});
</script>
</body>
</html>