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

@motork/product-viewer-360

v1.1.6

Published

A simple interactive resource used to show a virtual tour of the product.

Downloads

527

Readme

Product Viewer 360

npm version npm npm

A simple interactive resource used to show a virtual tour of the product.

This project uses Vue CLI 3 for serving and building files. In order to be able to work and release a new distribution folder, make sure to install globally the following dependencies in your machine:

How to use

Include ProductViewer360 component and styles.

import ProductViewer360 from '@motork/product-viewer-360';
import '~@motork/product-viewer-360/dist/product-viewer-360.min.css';

export default {
  name: 'Component',
  components: {
    ProductViewer360,
  },
};

Use the component in a template

<product-viewer-360
  :interior="https://your-interior-image.jpg"
  :images="[]"
  :images-open="[]"
  :start="14"
  disclaimer-text="Copyright © 2019 MotorK Italia s.r.l. All Rights Reserved."
  hint-text="Clicca e trascina per ruotare"
  @ready="onProductViewerReady"
  @on-viewer-event="onProductViewerEvent"
/>

Component Reference

Properties

| Name | Required | Type | Default | Description | | ------------------- | -------- | --------------- | ---------------------------- | ------------------------------------------------------------------------------------ | | interior | false | String | null | Panorama image link | | images | false | Array<Object> | [] | Closed doors images. Example data in tests/fixtures/submodel folder | | images-open | false | Array<Object> | [] | Open doors images. Example data in tests/fixtures/submodel folder | | start | false | Number | 0 | Image start position | | disclaimer-text | false | String | '' | Disclaimer text | | hint-text | false | String | '' | Hint text | | container-max-width | false | Number | 1440 | Max width for the control's container | | locale | false | String | 'en' | Language localisation code. Available values: en, it, es, fr, de. | | messages | false | Object | { en: { ... } } | Localisation messages. Example data in tests/fixtures/translations/messages folder | | translations | false | Object | this.messages[this.locale] | Translations object provided directly |

Events

| Name | Arguments | Description | | --------------- | ----------------------- | ---------------------- | | ready | undefined | Fired when it's ready | | on-viewer-event | Action name as String | Fired when interacting |

Development

The development phase takes place through vue-cli-service which points to src/main.js file.

You have to options to start the development environment:

1 - Use your machine and install the dependencies

2 - Use of Docker

  • Make sure that docker is installed in your machine
  • Run npm run docker:serve

When docker is running you can stop and remove the container with the following command

docker rm -f product-viewer-360-dev

npm-link

Sometimes you need to work on application code and @motork/product-viewer-360 dependency at the same time. In this case you should use npm-link.

Package linking is a two-step process:

  1. Create a global symlink for a dependency with npm link. A symlink, short for symbolic link, is a shortcut that points to another directory or file on your system.
  2. Tell the application to use the global symlink with npm link @motork/product-viewer-360.

For example:

# step 1
cd ~/projects/product-viewer-360
npm link # add global symlink

# step 2
cd ~/wp-content/themes/drivek
npm link @motork/product-viewer-360

Back to Normal

How do you switch back to normal dependencies? When you don’t want to use the local version of @motork/product-viewer-360 anymore, delete the symlink.

# in the dependency local version
cd ~/projects/product-viewer-360
npm uninstall # delete global symlink

# in the application code
cd ~/wp-content/themes/drivek
npm uninstall --no-save @motork/product-viewer-360 && npm i

Build

Building process is handled by Rollup which points to src/entry.js file.

Why should I use Rollup over Webpack?

Rollup offers optimizations like tree shaking that make it ideal for building shared libraries. This plugin also prioritizes defaults that are ideal for most Vue plugins and UI component libraries.

The base conpect of this project it's coming from vue-sfc-rollup tool.

# if chosen the first option mentioned above
npm run build
# if using docker
npm run docker:build

Release a new version

A new version can be released by triggering a Jenkins job wich will use the jenkins/Jenkinsfile.groovy file.

Troubleshooting

When using docker the node_modules folder will be binded to the docker OS environment and not to the local machine.

Remove the folder (rm -rf node_modules) and install again npm i.