npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-360-product-viewer

v0.2.6

Published

Showcase your products in this 360 viewer component.

Downloads

3,595

Readme

Storybook Contributors Forks Stargazers Issues MIT License LinkedIn

About React 360 Product Viewer

There are a few javascript product viewers out there but none could deliver what I needed. A React component written in Typescript and free! With a lot of customization you can quickly setup this component. All you need is a set of images that represents an animation you would like your users to explore. Either through user-interaction or setting it to autoplay! Point the component to your image folder, set the name, count and image type and you are ready!

It can be controlled either using mouse or touch!

Main features:

  • React component
  • Uses Typescript
  • Free
  • Simple

Built With

Getting Started

WARNING: This project is not yet available for download using NPM , the following test is merely a stub. Will be updated when the component is ready to be used.

Prerequisites

React In order to use the component you need a React project. This was built and tested with 17.0.2 but other versions should work.

Installation

Make sure you have a react project - otherwise use: .

  npx create-react-app my-app --template typescript
  1. Download through npm
 npm add react-360-product-viewer
  1. Add the component to your page, change the properties to fit your need. For all options see storybook
<React360Viewer
  imagesBaseUrl="./imageSeries/"
  imagesCount={YOUR_IMAGE_SERIES_COUNT_HERE}
  imagesFiletype="png"
  mouseDragSpeed={20}
/>

Usage

TODO: Add descriptions of all parameters For more example and a playground please refer to storybook

API

| Parameter | Type | Default | Description | Example | | ------------------------- | ---------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | | imagesCount | number | none | Set the number of images in your sequence | 35 | | imageBaseUrl | string | none | Set URL from the base of your homepage | | imageIndexSeparator | string | none | Set URL from the base of your homepage | ./imageSeries/ | | imagesFileTyp | string | none | Image type (anything that can be rendered in an img tag) | png | | imageFilenamePrefix | string | none | Add a prefix before the image number | shoe (if entire image filename is shoe2.png) | | imageInitialIndex | number | 0 | Which imagenumber to show on component load | 10 | | mouseDragSPeed | number | 20 | How fast to change images when pointer moves | 20 | | autoplaySpeed | number | 10 | How fast to change images when autoplay is active | 10 | | reverse | boolean | false | Reverse the order of images displayed. Applicable for both pointer as well as autoplay | false | | autoplay | boolean | false | Should the images automatically change on component load | false | | autoplayTarget | number | none | The autoplay will stop on given image index | 15 | | width | number | 150 | With of the image | 150 | | height | number | 150 | Height of the image | 150 | | zeroPad | ZeroPadRange (number 0 to 9) | 0 | Num zeros to prepend to your image number (if you set 1, your image numbers will be 01, 02..., 09, 10, 11) | 1 | | showRotationIconOnStartup | boolean | false | If true, a small icon representing a rotation which should inform the user that the component can be rotated. | false | | customRotationIcon | function returning SVG icon | | Set rotation icon that renders on startup | () => SOME JSX or SVG | | shouldNotifyEvents | boolean | false | If true the component will notify on some events. This can be a lot of event so use with caution. | false | | notifyOnPointerDown | function | not set | Pass your own function that takes x, y as arguments. Will be called when mouse or touch is pressed. | - | | notifyOnPointerUp | function | not set | Pass your own function that takes x, y as arguments . Will be called when mouse or touch is released. | - | | notifyOnPointerMoved | function | not set | Pass your own function that takes x, y as arguments . Will be called any time the mouse or touch is moved if being pressed down. | |

Roadmap

  • [x] Add rotate icon
  • [x] Start image index
  • [ ] Set autoplay to look x number of times
  • [x] Release for NPM
  • [x] Document API
  • [x] Allow for external URI:s as imagesources
  • [ ] Example on how to layout images
  • [ ] Add inertia
  • [ ] Supply events
    • [ ] Autoplay finished
    • [ ] Image changed
    • [x] User key Down
    • [x] User key release
    • [x] User movement

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.