1.0.2 • Published 5 years ago

react-fluid-gallery v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-fluid-gallery (demo)

Fluid media gallery for React powered by WebGL.

NPM JavaScript Style Guide

Demo

Inspired by Tao Tajima. Use the scroll wheel or swipe to transition fluidly between background images in the gallery.

Install

npm install --save react-fluid-gallery

Usage

Check out the demo.

import React, { Component } from 'react'

import FluidGallery from 'react-fluid-gallery'

import image1 from './1.jpg'
import image2 from './2.jpg'
import video from './video.mp4'

export default class App extends Component {
  render () {
    return (
      <FluidGallery
        style={{ width: '100vw', height: '100vh' }}
        slides={[ image1, image2, video ]}
      />
    )
  }
}

Props

PropertyTypeDefaultDescription
slidesArray<string>requiredArray of image / video URLs to use for the gallery slides.
startAtnumberrandomDefault slide to show.
onChangefunction(index: number)undefinedOptional callback when the active slide is changed.
......undefinedAny other props are applied to the root canvas element.

Credits

The original version of this awesome gallery technique was published on the personal website of Tao Tajima.

License

MIT © Travis Fischer