2.0.8 • Published 3 years ago

react-threesixty v2.0.8

Weekly downloads
127
License
MIT
Repository
github
Last release
3 years ago

Install

ThreeSixty is available as NPM package

npm i react-threesixty

Example

<ThreeSixtyViewer
  image: 'images/example.jpg'
  count: 19
  perRow: 4
/>

Options

{
  // Source image url object with
  imageArr: [{
    'image_url' : 'images/example-1.jpeg'
  }, {
    'image_url' : 'images/example-2.jpeg'
  }, {
    'image_url' : 'images/example-3.jpeg'
  }
    ...
  ], // Also supports passing an array of images
  isMobile : false, // if it is mobile. Default : false
  imageKey : 'image_url', // imageArr key for imageUrl. Default : image_url
  zoomImageKey: 'zoom_image_url',
  // Width & Height
  width: 300,  // Image width. Default 300
  height: 300, // Image height. Default 300
  updateIndex: 0, // Update 360 Index. Default initialize to 0
  startIndex: 0, // Start Index. Default 0

  // Navigation
  prev: document.getElementById('prev'), // Previous button element. Default: null
  next: document.getElementById('next'), // Next button element. Default: null
  keys: true,         // Rotate image on arrow keys. Default: true
  draggable: true,    // Rotate image by dragging. Default: true
  swipeable: true,    // Rotate image by swiping on mobile screens. Default: true
  dragTolerance: 10,  // Rotation speed when dragging. Default: 10
  swipeTolerance: 10, // Rotation speed when swiping. Default: 10
  swipeTarget: document.getElementById('wrapper'), // Element which will listen for drag/swipe events. Default: Image container

  // Rotation settings
  speed: 100,     // Rotation speed during 'play' mode. Default: 10
  inverted: false, // Inverts rotation direction
  autoPlay: false, // Initial Autoplay. Default: false
  containerName: 'reactThreesixtyContainer' // Three sixty container name. Default: 'reactThreesixtyContainer'
  handleImageChange: null // Callback function to get image change. Default: null. Returns new image index
}

Array of images

As an alternative to sprite image, ThreeSixty also supports using array of images:

<ThreeSixtyViewer
  image: [{
    'imageUrl' : 'images/example-1.jpeg'
  }, {
    'imageUrl' : 'images/example-2.jpeg'
  }, {
    'imageUrl' : 'images/example-3.jpeg'
  }]
  imageKey : 'imageUrl'
  containerName: 'react-three-sixty' //Three sixty container name
/>

Licence

Licensed under the MIT license.

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.30

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago