react-progressive-bg-image

? Medium style progressive background image.

Github星跟踪图

react-progressive-bg-image

Medium style progressive background image for React based on Styled-components.

Travis
Codecov Status
npm package
npm downloads

Dependency Status
devDependency Status
peerDependency Status

prettier
license

Demo

DEMO

Further Reading:

Installation

$ yarn add react-progressive-bg-image styled-components

Requirements

  • node >= 9.4.0

  • yarn >= 1.3.2

  • react ^16.0.0,

  • styled-components ^3

Usage

Case 1: Inline-style

Remind: May need to setup autoprefixer in your project.

import ProgressiveImage from 'react-progressive-bg-image';

<ProgressiveImage
  src={image1}
  placeholder={image1X60}
  style={{
    height: 600,
    backgroundSize: 'contain',
    backgroundPosition: 'center center',
  }}
/>;

Case 2: With Styled-components

import styled from 'styled-components';
import ProgressiveImage from 'react-progressive-bg-image';

const StyledProgressiveImage = styled(ProgressiveImage)`
  height: 600px;
  background-size: contain;
  background-position: center center;
`;

<StyledProgressiveImage
  src={IMAGE}
  placeholder={IMAGEX60}
  transition="all 1s linear"
/>;

Property, Prop, Type, Required, Description, -------------, --------, ------------, -----------------------------------, src, string, yes, Origin image, placeholder, string, yes, Small image (Suggest inline base64), opacity, number, default: 0.5, blur, number, default: 20, scale, number, default: 1, transition, string, default: 'opacity 0.3s linear', component, string, default: 'div', ## Test

$ yarn run format
$ yarn run eslint
$ yarn run test:watch

Github release / NPM release

$ npm version patch
$ git push

Inspiration

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests ($ yarn run test).

CHANGELOG

LICENSE

MIT: http://michaelhsu.mit-license.org

主要指标

概览
名称与所有者evenchange4/react-progressive-bg-image
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2017-05-02 06:34:50
推送于2024-12-08 18:18:36
最后一次提交2018-02-09 10:04:35
发布数21
最新版本名称v3.0.0 (发布于 2018-01-30 22:06:25)
第一版名称v1.0.1 (发布于 2017-05-02 17:12:14)
用户参与
星数227
关注者数2
派生数15
提交数91
已启用问题?
问题数17
打开的问题数10
拉请求数40
打开的拉请求数15
关闭的拉请求数55
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?