Gathering detailed insights and metrics for mmc-js-cloudimage-360-view
Gathering detailed insights and metrics for mmc-js-cloudimage-360-view
Gathering detailed insights and metrics for mmc-js-cloudimage-360-view
Gathering detailed insights and metrics for mmc-js-cloudimage-360-view
npm install mmc-js-cloudimage-360-view
Typescript
Module System
Node Version
NPM Version
72.6
Supply Chain
99.4
Quality
75.5
Maintenance
100
Vulnerability
100
License
JavaScript (96.64%)
CSS (3.36%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
255 Commits
27 Branches
1 Contributors
Latest Version
1.1.2
Package Id
mmc-js-cloudimage-360-view@1.1.2
Unpacked Size
96.17 kB
Size
21.05 kB
File Count
9
NPM Version
6.14.15
Node Version
14.18.2
Cumulative downloads
Total Downloads
Last day
0%
0
Compared to previous day
Last week
0%
0
Compared to previous week
Last month
0%
0
Compared to previous month
Last year
0%
0
Compared to previous year
Docs • Demo • Code Sandbox • Video Tutorial • Why
A simple, interactive resource that can be used to provide a virtual tour of your product.
powered by Cloudimage (Watch the video here)
To see the Cloudimage 360 view plugin in action, please check out the Demo page.
Add script tag with CDN link to js-cloudimage-360-view lib after all content in body tag
1<script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/2.7.1/js-cloudimage-360-view.min.js"></script>
After adding the js-cloudimage-360-view lib, simply initialize it with class name "cloudimage-360", server folder path, file name and amount of images:
1<div 2 class="cloudimage-360" 3 data-folder="https://scaleflex.airstore.io/demo/360-car/" 4 data-filename="iris-{index}.jpeg" 5 data-amount="36" 6></div>
Initialization of js cloudimage 360 view plugin.
1window.CI360.init();
NOTE: initialization of the plugin runs on the script load. In case you need to postpone the initialization of the plugin you can disable it with notInitOnLoad param
1<script>window.CI360 = { notInitOnLoad: true }</script> 2<script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/2/js-cloudimage-360-view.min.js"></script> 3<script>window.CI360.init(); // initialize the plugin when you need</script>
Destroying a cloudimage 360 viewer instance will reset the HTML to its original state.
1window.CI360.destroy();
Get the {index} of the image that is being viewed.
1window.CI360.getActiveIndexByID('id_of_product');
You can customize the icons by adding the following classes:
1.cloudimage-360 .fullscreen-icon { 2 background: url(https://scaleflex.ultrafast.io/https://scaleflex.airstore.io/filerobot/js-cloudimage-360-view/full_screen.svg) 50% 50% / cover no-repeat; 3} 4.cloudimage-360 .magnify-icon { 5 background: url(https://scaleflex.ultrafast.io/https://scaleflex.airstore.io/filerobot/js-cloudimage-360-view/loupe.svg) 50% 50% / cover no-repeat; 6} 7.cloudimage-360 .close-fullscreen-icon { 8 background: url(https://scaleflex.ultrafast.io/https://scaleflex.airstore.io/filerobot/js-cloudimage-360-view/cross.svg) 50% 50% / cover no-repeat; 9} 10.cloudimage-360 .reset-zoom-icon { 11 background: url(https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/ic-resize.svg?vh=248986) 50% 50% / cover no-repeat; 12}
The selector for js-cloudimage-360-view lib.
Your images folder on server.
Allow to use a specific version of API.
1data-api-version="v7"
1data-api-version="null"
The filename pattern for your 360 image. Must include {index}, which the library will replace with a number between 1 and data-amount.
The filename pattern for Y-axis images. Must include {index}, which the library will replace with a number between 1 and data-amount-y.
Amount of images to load for 360 view.
Amount of images to load in Y-axis for 360 view.
Support for 360 spin by pressing arrow keys on keyboard.
Autoplay 360 spin view on load.
stops the autoplay after one complete cycle.
Changing autoplay behavior
Available behaviors (spin-x, spin-y, spin-xy, spin-yx)
Open 360 spin view in full screen modal.
Magnifier to zoom image.
enable magnifier in fullscreen modal.
Prevents page from jumping.
Autoplay 360 spin view on load.
disable mouse drag.
Speed of changing frames for autoplay in milliseconds.
Speed Factor of changing frames on drag event.
Spin direction, by default it uses counterclockwise (image indexes from 1 to data-amount).
Apply box shadow for container.
Display 360 view line at the bottom of container.
Hide 360 view icon.
URL of asset to use as the 360 view icon.
Spin direction using controls, by default it uses counterclockwise (image indexes from 1 to data-amount).
Blocks repeating images after reaching last image (or first image in opposite direction)
Bottom offset for 360 view line.
Left zero padding on filename. For example: index-zero-base="4" => image index will be "0004"
Option to add list of images instead of folder
& filename
.
example:
1data-folder="https://scaleflex.airstore.io/demo/360-car/" 2data-image-list='[ 3 "iris-1.jpeg", 4 "iris-4.jpeg", 5 "https://scaleflex.airstore.io/demo/360-car/iris-12.jpeg", 6 "https://scaleflex.airstore.io/demo/360-car/iris-15.jpeg" 7 ]’
Only 360 view images close to the client's viewport will be loaded, hence accelerating the page loading time. If set to true, an additional script must be included, see Lazy loading
Disable pointer zoom on desktop
Disable pinch zoom on mobile
Events to start pointer zoom
Available events (scroll, click)
Functions called after mouse leave the container
Available functions (resetZoom)
Multiple functions can be applied, separated by "," (comma)
Pointer zoom scaling factor
Pinch zoom scaling factor
Maximum scale that images can be resize to it with pointer or pinch zoom
Helper class to apply lazy-loading depending on library you choose, see Lazy loading
You can add controls by adding elements with the following classes: cloudimage-360-prev, cloudimage-360-next, cloudimage-360-top, cloudimage-360-bottom
1.cloudimage-360 .cloudimage-360-prev, .cloudimage-360 .cloudimage-360-next { 2 padding: 8px; 3 background: rgba(255, 255, 255, 0.5); 4 border: none; 5 border-radius: 4px; 6} 7.cloudimage-360 .cloudimage-360-prev:focus, .cloudimage-360 .cloudimage-360-next:focus { 8 outline: none; 9} 10.cloudimage-360 .cloudimage-360-prev { 11 display: none; 12 position: absolute; 13 z-index: 100; 14 top: calc(50% - 15px); 15 left: 20px; 16} 17.cloudimage-360 .cloudimage-360-next { 18 display: none; 19 position: absolute; 20 z-index: 100; 21 top: calc(50% - 15px); 22 right: 20px; 23} 24.cloudimage-360 .cloudimage-360-prev:before, .cloudimage-360 .cloudimage-360-next:before { 25 content: ''; 26 display: block; 27 width: 30px; 28 height: 30px; 29 background: 50% 50% / cover no-repeat; 30} 31.cloudimage-360 .cloudimage-360-prev:before { 32 background-image: url('https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/assets/img/arrow-left.svg'); 33} 34.cloudimage-360 .cloudimage-360-next:before { 35 background-image: url('https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/assets/img/arrow-right.svg'); 36} 37.cloudimage-360 .cloudimage-360-prev.not-active, .cloudimage-360 .cloudimage-360-next.not-active { 38 opacity: 0.4; 39 cursor: default; 40}
1<div 2 class="cloudimage-360" 3 data-folder="https://scaleflex.airstore.io/demo/indoor/" 4 data-filename="{index}.jpeg" 5> 6 <button class="cloudimage-360-prev"></button> 7 <button class="cloudimage-360-next"></button> 8 <button class="cloudimage-360-top"></button> 9 <button class="cloudimage-360-bottom"></button> 10</div>
See how it works (article on Medium)
To use the Cloudimage Responsive plugin, you will need a Cloudimage token to deliver your images over CDN. Don't worry, it only takes seconds to get one by registering here. Once your token is created, you can configure it as described below. This token allows you to use 25GB of image cache and 25GB of worldwide CDN traffic per month for free.
Enables cloudimage responsive plugin for 360 view.
Applies Cloudimage resize operations to your image, e.g. width, height, crop, face crop, rotate, prevent enlargement...
Multiple transformation operations can be applied to your image, separated by "&
" (Ampersand).
example:
1data-transformation="w=400&h=200&func=fit"
Applies Cloudimage filters to your image, e.g. brightness, contrast, greyscale, blur, Sharpen...
Multiple filters can be applied, separated by ",
" (comma).
example:
1data-filters="bright:15,contrast:30"
Lazy loading is not included into js-cloudimage-360-view by default. There are well thought libraries to achieve that. If you enable lazy loading in the configuration, you need to add an additional library like lazysizes, yall.js (Yet Another Lazy Loader), lozad.js to handle it.
Implementation example with lazysizes
Implementation example with yall.js
Implementation example with lozad.js
to save API calls you man want to use one of our cdn bundles:
CDN link to js-cloudimage-360-view 1.1.0 + lazysizes 4.1.7
1<script src="https://cdn.scaleflex.it/filerobot/js-cloudimage-360-view/v2.0.0.lazysizes.min.js"></script>
CDN link to js-cloudimage-360-view 1.1.0 + yall.js 3.1.1
1<script src="https://cdn.scaleflex.it/filerobot/js-cloudimage-360-view/v2.0.0.yall.min.js"></script>
CDN link to js-cloudimage-360-view 1.1.0 + lozad.js 1.9.0
1<script src="https://cdn.scaleflex.it/filerobot/js-cloudimage-360-view/v2.0.0.lozad.min.js"></script>
Tested in all modern browsers and IE 11, 10, 9.
All contributions are super welcome!
JS Cloudimage 360 View is provided under the MIT License
No vulnerabilities found.
No security vulnerabilities found.