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

virtual360-react

v1.2.0

Published

Virtual360 is an amazing pure React component which stitches together set of images into a smooth 360-degree image. This component is perfect for developers who want to provide ultimate and immersive user experience.

Downloads

23

Readme

Getting Started with Virtual360 for React

Overview

Virtual360 is an amazing pure React component which stitches together set of images into a smooth 360-degree image. This component is perfect for developers who want to provide ultimate and immersive user experience.

Installation

npm install virtual360-react

or

yarn add virtual360-react

Key Features

  • Spin in any direction (360 Viewer)
  • Support any number of images
  • Responsive design - Images scale up/down to fit any screen size
  • Pre-loads images - Improves performance
  • Works flawlessly on every computer and mobile devices
  • No jQuery
  • More coming soon!

Quick Start Guide

Make sure the images have sequential naming and must always use 2 or more digits i.e. 01, 02, 03. For example:

example-01.jpg
example-02.jpg
example-03.jpg
example-04.jpg
example-05.jpg
...

The images will be referenced using {col}. For example the src of the above images could look like this:

src = "/example-{col}.jpg";

Please Note: If a specific image is not successfully loaded (e.g gives a 404 error), it will be ignored and 360 viewer will still load unless all images could not be loaded.

Import the Component

import Virtual360 from "virtual360-react/dist/Virtual360";

Usage

import Virtual360 from "virtual360-react/dist/Virtual360";

function Main() {
  return (
    <div>
      <Virtual360
        sensitivity={1}
        numOfImagesPerColumn={32}
        defaultImagePosition={30}
        imageSrc="/example-{col}.jpg"
      ></Virtual360>
    </div>
  );
}

export default Main;

The Virtual360 component takes the following props:

| Prop Name | Default Values | Description | | ------------------------------------- | :-----------------------------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | sensitivity | 1 | The rotation speed on drag. (1 = fast). | | numOfImagesPerColumn - Required | | Number of images. Starts from 1. | | defaultImagePosition | 1 | The start position (angle) of the 360 viewer. Please Note: If defaultImagePosition > total number of successful images loaded, then default image position will reset to 1. | | reverseRotation | false | Reverse the direction of the 360 drag/spin. | | imageSrc - Required | e.g imageSrc="/example-{col}.jpg" | The image src referenced using {col}. Could be remote location of the image using {col} e.g. https://example.com/example-{col}.jpg | | width | auto | Sets the width of the component. | | height | auto | Sets the height of the component. | | border | | Sets the border of the component. |