Giter Club home page Giter Club logo

react-3d-gallery's Introduction

react-3d-gallery

a react 3d gallery component

Installation

npm install react-3d-gallery --save

Example

git clone https://github.com/lijinke666/react-3d-gallery.git
npm run demo
import React from "react"
import ReactDOM from "react-dom"
import Gallery3d from "react-3d-gallery"


const cover = (id) => ({
    href:"https://www.github.com",
    cover: "http://p1.music.126.net/PQsm4zVDlbCeNACgW1j3QA==/18831335650676452.jpg?param=400y400",
    mask: (
        <div className="photo-cover">
            <h4 key="photo-title" className="cover-title">title{id+1}</h4>
            <p key="photo-content" className="cover-content">content{id+1}</p>
        </div>
    ),

})
const categories = [...new Array(8)].map((item, i) => { item = cover(i); return item })

const options = {
    categories,
    width: 400,
    height: 400,
    speed:1000,     
    autoPlay: true,
    autoPlaySpeed: 4000,
    space: 20,
    arrow: true,
    backfaceVisibility: false
}

const Demo = () => (
    <Gallery3d {...options} style={{ "margin": "50px auto" }} />

)
ReactDOM.render(
    <Demo />,
    document.getElementById('root')
)

options


  • categories

    • type : Array
    • default : 300
    • explain : gallery categories object[]
      • options.href : type : String target href
      • options.cover : type : String gallary cover
      • options.mask : type : String | ReactNode gallary mask
  • width

    • type : Number
    • default : 300
    • explain : cover width (px)
  • height

    • type : Number
    • default : 300
    • explain : cover height (px)
  • space

    • type : Number
    • default : 30
    • explain : The time required to convert (ms)
  • autoPlay

    • type : Boolean
    • default : true
    • explain : Whether to scroll automatically
  • autoPlaySpeed

    • type : Number
    • default : 4000
    • explain : auto play speed (ms)
  • arrow

    • type : Boolean
    • default : true
    • explain : Whether to show the arrow of the gallery
  • backfaceVisibility

    • type : Boolean
    • default : true
    • explain : Whether to show backface visibility of the gallery

react-3d-gallery's People

Contributors

lijinke666 avatar

Stargazers

 avatar

Watchers

 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.