Giter VIP home page Giter VIP logo

rc-camera's Introduction

rc-camera


React Camera Component.

Base on Camera.

NPM version node version npm download

Feature

  • support ie8,ie8+,chrome,firefox,safari(basic usage)

  • support edge,chrome,firefox,safari,opera(some transform animations)

install

rc-camera

Usage

import Camera from "rc-camera";
import "rc-camera/assets/index.css"

const imgList = [{ img: "", content: "" }];

ReactDOM.render(<Camera imgList={imgList} />, mountNode);

API

props

name type default description
width String 100% Camera container width
aspectRatio Number 0.5 The ratio of height / width. You can fit width and height.
prefixCls String rc-camera PrefixCls of css
imgList Array [{}] Set imgs of Camera.
current Number 0 Set the current img of Camera.
slideOn String random The slide target of the animation: random prev next.
animateType String random The animation type.
duration Number 1000 Animation duration(ms).
easing String cubic-bezier(0.77, 0, 0.175, 1) Animation easing.
contentBar (content) => React.ReactNode ContentBar of Camera. You will get each img content when sliding.
contentBarWrapStyle Obejct {} ContentBarWrap style. You can change wrapper background.
prevBtn ReactNode The prev Button of Camera.
nextBtn ReactNode The next Button of Camera.
pagination Boolean true Pagination of Camera.
autoPlay Boolean false Whether to auto play the Camera.
autoPlayTime Number 5000 The interval time of autoPlay
showThumbnail Boolean true Whether to show thumbnail when hover the pagination.
onChange Function(current, nextIndex, isAuto) Callback executed when slide to next img.
onAnimationOver Function(current) Callback executed when the animation is over.

Development

npm install
npm start

Example

http://localhost:8007/examples/default.html

online example: https://yhspehy.github.io/rc-camera/examples/

License

rc-camera is released under the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.