├── .editorconfig ├── .eslintrc.json ├── .gitignore ├── demo ├── background-less.html ├── homepage.html ├── images │ ├── brush.png │ ├── brush.svg │ ├── default-blurred.jpg │ ├── default.jpg │ ├── github.svg │ ├── homepage-blurred.jpg │ ├── homepage.jpg │ ├── keep-cleared-blurred.jpg │ ├── keep-cleared.jpg │ ├── line-style-blurred.jpg │ ├── line-style.jpg │ └── separator.png ├── keep-cleared.html ├── line-style.html ├── partials │ ├── examples.html │ ├── footer.html │ └── header.html ├── scripts │ └── demo.js ├── sticky.html └── styles │ ├── common.scss │ └── demo.scss ├── dist ├── brusher.min.js ├── brusher.min.js.map └── demo │ ├── background-less.html │ ├── brusher-demo.min.css │ ├── brusher-demo.min.js │ ├── demo.html │ ├── images │ ├── brush.png │ ├── brush.svg │ ├── default-blurred.jpg │ ├── default.jpg │ ├── github.svg │ ├── homepage-blurred.jpg │ ├── homepage.jpg │ ├── keep-cleared-blurred.jpg │ ├── keep-cleared.jpg │ ├── line-style-blurred.jpg │ ├── line-style.jpg │ ├── non-sticky-blurred.jpg │ ├── non-sticky.jpg │ └── separator.png │ ├── index.html │ ├── keep-cleared.html │ ├── line-style.html │ ├── non-sticky.html │ └── sticky.html ├── license ├── package.json ├── readme.md ├── server.js ├── src └── index.js ├── webpack.config.demo.js ├── webpack.config.prod.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "airbnb-base", 3 | "env": { 4 | "browser": true 5 | }, 6 | "rules": { 7 | "no-console": "off", 8 | "no-underscore-dangle": "off", 9 | "no-plusplus": "off", 10 | "no-cond-assign": "off", 11 | "func-names": "off", 12 | "no-continue": "off", 13 | "no-bitwise": "off", 14 | "class-methods-use-this": "off", 15 | "prefer-destructuring": "off", 16 | "no-restricted-syntax": "off", 17 | "no-param-reassign": [ 18 | "off" 19 | ], 20 | "max-len": "off", 21 | "no-multi-spaces": "off" 22 | } 23 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | npm-debug.log 4 | .DS_Store 5 | .vscode 6 | package-lock.json 7 | yarn-error.log 8 | -------------------------------------------------------------------------------- /demo/background-less.html: -------------------------------------------------------------------------------- 1 | <%= require('html-loader!./partials/header.html') %> 2 |
3 |If you want to use it without the blurry background, all you have to do is not set the background on body and use it normally
11 |const brusher = new Brusher({
14 | image: 'path/to/image.png'
15 | });
16 |
17 | brusher.init();
18 |
19 |
20 | ← Back to Home
21 | A lightweight library to create interactive backgrounds
11 | 12 | Star 13 |Background of this page has been auto created by brusher. Move your mouse around to see it in action.
18 |All you need is an image. Below code shows how the current page has been initialized
19 |const brusher = new Brusher({
20 | image: 'abstract.png'
21 | });
22 |
23 | brusher.init();
24 |
25 |
26 | There are several options that you can use to modify the result. Have a look at the section below.
27 |Here is the list of options that you may use
32 |const brusher = new Brusher({
33 | image: 'abstract.png', // Path of the image to be used as a brush
34 | keepCleared: false, // Whether to keep cleared sections or blur them again
35 | stroke: 80, // Stroke size for the brush
36 | lineStyle: 'round', // Brush style (round, square, butt)
37 | autoBlur: false, // Brusher will use the provided image for the blurry background
38 | autoBlurValue: 15, // Blur strength in pixels
39 | });
40 |
41 | brusher.init();
42 |
43 |
44 | Have a look at the github page for further details.
45 |If you want brusher to preserve the cleared sections, set keepCleared
to true
const brusher = new Brusher({
14 | image: 'path/to/image.png',
15 | keepCleared: true,
16 | });
17 |
18 | brusher.init();
19 |
20 |
21 | ← Back to Home
22 | There are three different line styles that brusher understands i.e. round, square, butt
. If you don't provide it, it will use round
by default. Also, depending upon the image, the effect might not be quite visible in the background.
const brusher = new Brusher({
14 | image: 'path/to/image.png',
15 | lineStyle: 'butt',
16 | });
17 |
18 | brusher.init();
19 |
20 | ← Back to Home
21 | Find some of the examples demonstrating some of the options in use through the buttons below.
4 | 5 | Keep Cleared Sections 6 | Without Background Demo 7 | Sticky Blur Demo 8 | Different Line Style 9 | 10 | Github 11 | 12 | 13 |