blurify.js is a tiny(~2kb) library to blurred pictures, support graceful downgrade from css
mode to canvas
mode.
$ npm i blurify
blurify the images with given options
:
images
{ Element }, blurify target elements.blur
{ Int }, extent of blur, defaulting to6
.mode
{ String }, mode of blurify.css
: usefilter
property.(default
)canvas
: usecanvas
export base64.auto
: usecss
mode firstly, otherwise switch tocanvas
mode by automatically.
import blurify from 'blurify';
new blurify({
images: document.querySelectorAll('.blurify'),
blur: 6,
mode: 'css',
});
- fault-tolerance process
- fixed
toArray
bugs
- add
auto
mode
- add
css
mode
- fixed image cross origin issue
- fixed images reference error