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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?