GithubHelp home page GithubHelp logo

xiaxiangfeng / react-carousel3d Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 2.0 4.45 MB

A 3D perspective carousel 3D效果的走马灯

Home Page: https://xiaxiangfeng.github.io/react-carousel3d/#/carousel

TypeScript 99.25% JavaScript 0.75%
carousel carousel3d react-carousel react-carousel3d

react-carousel3d's Introduction

react-carousel3d

A 3D perspective carousel。预览地址:https://xiaxiangfeng.github.io/react-carousel3d/#/carousel

Image text

从 NPM 下载包

npm i react-carousel3

Basic usage

Demo:

import React from 'react';
import { Carousel } from 'react-carousel3';

const style = {
  width: 297,
  height: 296,
};

export default () => (
  <div
    style={{
      display: 'flex',
      justifyContent: 'center',
      background: 'linear-gradient(to bottom, #16235e 0%, #020223 100%)',
    }}
  >
    <Carousel height={460} width={980} yOrigin={42} yRadius={48} autoPlay={true}>
      <div key={1} style={style}>
        <img alt="" src="/image/1.png" />
      </div>
      <div key={2} style={style}>
        <img alt="" src="/image/2.png" />
      </div>
      <div key={3} style={style}>
        <img alt="" src="/image/3.png" />
      </div>
      <div key={4} style={style}>
        <img alt="" src="/image/4.png" />
      </div>
      <div key={5} style={style}>
        <img alt="" src="/image/5.png" />
      </div>
      <div key={6} style={style}>
        <img alt="" src="/image/6.png" />
      </div>
    </Carousel>
  </div>
);

Carousel options

You may pass these options to the carousel constructor. Some of these properties may be changed during runtime via the data handle.

Option Description Default
height container height
width container width
xOrigin Center of the carousel (x coordinate) (container width / 2)
yOrigin Center of the carousel (y coordinate) (container height / 10)
xRadius Half the width of the carousel (container width / 2.3)
yRadius Half the height of the carousel (container height / 6)
autoPlay auto play false

Getting Started

Install dependencies,

$ npm i

Start the dev server,

$ npm start

Build documentation,

$ npm run docs:build

Run test,

$ npm test

Build library via father,

$ npm run build

react-carousel3d's People

Contributors

ninichuuh avatar xiaxiangfeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.