Blurify Save

blurify.js is a tiny(~2kb) library to blurred pictures, support graceful downgrade from `css` mode to `canvas` mode.

Project README

blurify

npmsize

blurify.js is a tiny(~2kb) library to blur pictures, with graceful downgrade support from css mode to canvas mode.

Installation

$ npm i blurify

DEMO

Demo

Usage

blurify(options)

blurify the images with given options:

  • images { Element }, blurify target elements.
  • blur { Int }, extent of blur, defaulting to 6.
  • mode { String }, mode of blurify.
    • css: use filter property.(default)
    • canvas: use canvas export base64.
    • auto: use css mode firstly, otherwise switch to canvas mode by automatically.
import blurify from 'blurify';

new blurify({
    images: document.querySelectorAll('.blurify'),
    blur: 6,
    mode: 'css',
});

// or in shorthand

blurify(6, document.querySelectorAll('.blurify'));

License

Licensed under the MIT License

Open Source Agenda is not affiliated with "Blurify" Project. README Source: dabanlee/blurify
Stars
685
Open Issues
4
Last Commit
1 year ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating