brusher

Create beautiful webpage backgrounds

  • 所有者: kamranahmedse/brusher
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Little vanilla JS library to add interactive backgrounds to your webpages - View Demo

Installation

Install it using yarn or npm

yarn add brusher

Or you may use unpkg

http://unpkg.com/brusher/dist/brusher.min.js

Usage

For the basic usage, all you need to do is create an instance of Brusher and provide an image

import Brusher from 'brusher';

const brusher = new Brusher({
  image: 'abstract.png'
});

brusher.init();

Available Options

Here is the list of options that you may use

const brusher = new Brusher({
  image: 'abstract.png', // Path of the image to be used as a brush
  keepCleared: true,     // Put the blur back after user has cleared it
  stroke: 80,            // Stroke size for the brush
  lineStyle: 'round',    // Brush style (round, square, butt)
  autoBlur: false,       // Brusher will use the provided image for the blurry background
  autoBlurValue: 15,     // Blur strength in pixels
});

brusher.init();

A note on blurry background: although brusher is capable of generating blurry background by itself, it is recommended that you blur the image yourself and apply it to the body for improved performance. Brusher relies on CSS blur for the background. And rendering performance for the pre-provided blurred image would be of-course much better than that applied using CSS. Here is the sample CSS that you may use for the background

body {
  background-size: cover;
  background-position: 0 0;
  background-attachment: fixed;
  background-image: url(path/to/blurred/image.jpg);
}

License

MIT © Kamran Ahmed

主要指标

概览
名称与所有者kamranahmedse/brusher
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2018-05-06 19:44:30
推送于2020-03-04 08:30:13
最后一次提交2020-03-04 12:30:02
发布数5
最新版本名称0.1.4 (发布于 )
第一版名称0.0.1 (发布于 )
用户参与
星数758
关注者数16
派生数47
提交数61
已启用问题?
问题数5
打开的问题数4
拉请求数5
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?