{"_id":"@aneeven/js-cloudimage-360-view","_rev":"1-44757f91bf3bd4d726ed895ca6e4853d","name":"@aneeven/js-cloudimage-360-view","description":"[![Release](https://img.shields.io/github/v/release/scaleflex/js-cloudimage-360-view)](https://github.com/scaleflex/js-cloudimage-360-view/releases) [![Size](https://img.shields.io/bundlephobia/min/js-cloudimage-360-view)](https://img.shields.io/bundlepho","dist-tags":{"latest":"3.2.1"},"versions":{"3.2.0":{"name":"@aneeven/js-cloudimage-360-view","version":"3.2.0","keywords":["image","images","cloudimage","360","photo","product","view","viewer","360 product view"],"author":{"name":"scaleflex"},"license":"MIT","_id":"@aneeven/js-cloudimage-360-view@3.2.0","homepage":"http://#readme","bugs":{"url":"https://github.com/scaleflex/js-cloudimage-360-view/issues"},"dist":{"shasum":"ef9576e1090fd875065a9a921456faf9fdfa5bfb","tarball":"https://registry.npmjs.org/@aneeven/js-cloudimage-360-view/-/js-cloudimage-360-view-3.2.0.tgz","fileCount":4,"integrity":"sha512-2x2lMpy+U5Lnu7lRbyYA7grZfM8bY+NTGwEQNkYUU9AnggaABSgr5MLNj9jXX/Xidz7E3PTIWqbH5L49kIQeQQ==","signatures":[{"sig":"MEYCIQDpxmhT3cLP+teZ4kguIJBMuCpWuk4HvnyUQm//RRzYUwIhALw8zZhQeYZSunKsHmuCKgUYZkDnRQI5/GdA3j6/8ePC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33720},"main":"dist/index.js","gitHead":"39469ed58823ebe45388a5a885d880e288c99366","private":false,"scripts":{"dist":"npm run clean:dist && babel src -d dist --copy-files","build:demo":"npm run clean:demo && webpack --mode production  --config config/webpack-demo.config.js","clean:demo":"rm -rf examples/dist","clean:dist":"rm -rf dist","start-demo":"webpack-dev-server --mode development --config config/webpack-demo.config.js","clean:build":"rm -rf build","deploy:demo":"gh-pages -d examples/dist","build:bundle":"npm run clean:build && webpack --mode production --config config/webpack-build.config.js","publish:demo":"npm run build:demo && npm run deploy:demo","deploy:bundle":"npm run build:bundle && node bin/deploy-bundle"},"_npmUser":{"name":"aneeven","email":"andreas.neeven@gmail.com"},"repository":{"url":"git+https://github.com/scaleflex/js-cloudimage-360-view.git","type":"git"},"_npmVersion":"10.7.0","description":"[![Release](https://img.shields.io/github/v/release/scaleflex/js-cloudimage-360-view)](https://github.com/scaleflex/js-cloudimage-360-view/releases) [![Size](https://img.shields.io/bundlephobia/min/js-cloudimage-360-view)](https://img.shields.io/bundlepho","directories":{},"_nodeVersion":"20.14.0","dependencies":{"core-js":"^3.0.0","@babel/runtime":"^7.17.0","@popperjs/core":"^2.11.2"},"_hasShrinkwrap":false,"devDependencies":{"fs":"^0.0.1-security","dotenv":"^16.0.3","webpack":"^5.79.0","gh-pages":"^2.0.1","form-data":"^4.0.0","@babel/cli":"^7.16.7","css-loader":"^2.1.1","@babel/core":"^7.16.7","webpack-cli":"^5.0.1","babel-loader":"^8.2.3","highlight.js":"^10.4.1","style-loader":"^3.3.2","mobile-detect":"^1.4.3","babel-preset-env":"^1.7.0","isomorphic-fetch":"^3.0.0","@babel/preset-env":"^7.16.5","webpack-dev-server":"^4.13.3","babel-preset-es2015":"^6.24.1","babel-preset-minify":"^0.5.0","html-webpack-plugin":"^5.5.1","babel-preset-stage-0":"^6.24.1","mini-css-extract-plugin":"^0.9.0","babel-plugin-array-includes":"^2.0.3","@babel/plugin-transform-runtime":"^7.16.5"},"_npmOperationalInternal":{"tmp":"tmp/js-cloudimage-360-view_3.2.0_1718970545897_0.9820422545083904","host":"s3://npm-registry-packages"}},"3.2.1":{"name":"@aneeven/js-cloudimage-360-view","version":"3.2.1","main":"dist/index.js","private":false,"description":"[![Release](https://img.shields.io/github/v/release/scaleflex/js-cloudimage-360-view)](https://github.com/scaleflex/js-cloudimage-360-view/releases) [![Size](https://img.shields.io/bundlephobia/min/js-cloudimage-360-view)](https://img.shields.io/bundlepho","author":{"name":"scaleflex"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/scaleflex/js-cloudimage-360-view.git"},"homepage":"http://#readme","keywords":["image","images","cloudimage","360","photo","product","view","viewer","360 product view"],"scripts":{"start-demo":"webpack-dev-server --mode development --config config/webpack-demo.config.js","clean:build":"rm -rf build","build:bundle":"npm run clean:build && webpack --mode production --config config/webpack-build.config.js","deploy:bundle":"npm run build:bundle && node bin/deploy-bundle","clean:dist":"rm -rf dist","dist":"npm run clean:dist && babel src -d dist --copy-files","clean:demo":"rm -rf examples/dist","build:demo":"npm run clean:demo && webpack --mode production  --config config/webpack-demo.config.js","deploy:demo":"gh-pages -d examples/dist","publish:demo":"npm run build:demo && npm run deploy:demo"},"dependencies":{"@babel/runtime":"^7.17.0","@popperjs/core":"^2.11.2","core-js":"^3.0.0"},"devDependencies":{"@babel/cli":"^7.16.7","@babel/core":"^7.16.7","@babel/plugin-transform-runtime":"^7.16.5","@babel/preset-env":"^7.16.5","babel-loader":"^8.2.3","babel-plugin-array-includes":"^2.0.3","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-minify":"^0.5.0","babel-preset-stage-0":"^6.24.1","css-loader":"^2.1.1","dotenv":"^16.0.3","form-data":"^4.0.0","fs":"^0.0.1-security","gh-pages":"^2.0.1","highlight.js":"^10.4.1","html-webpack-plugin":"^5.5.1","isomorphic-fetch":"^3.0.0","mini-css-extract-plugin":"^0.9.0","mobile-detect":"^1.4.3","style-loader":"^3.3.2","webpack":"^5.79.0","webpack-cli":"^5.0.1","webpack-dev-server":"^4.13.3"},"_id":"@aneeven/js-cloudimage-360-view@3.2.1","gitHead":"e823348eea6406d94c4fee863efd3f7a86101c53","bugs":{"url":"https://github.com/scaleflex/js-cloudimage-360-view/issues"},"_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-73+BOYzUPuzcvNl1jCGEElfPhEAvWmK+chWNbiEmVOnYKKwzn2a60nShC9acjHcHQg7En4uUeTehoLXMxGN5yw==","shasum":"02b5c0661e09062e0dbe4bd961ba2683c3dd0dad","tarball":"https://registry.npmjs.org/@aneeven/js-cloudimage-360-view/-/js-cloudimage-360-view-3.2.1.tgz","fileCount":94,"unpackedSize":175024,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRv0jJChMFrqV++s78y5ZRt9SuFwAzhEiDCmODXwwaZQIgLDtZZpNwolcFBi1umoDVIS0+MXi9btx6wcSGdKhITrs="}]},"_npmUser":{"name":"aneeven","email":"andreas.neeven@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-cloudimage-360-view_3.2.1_1718971730050_0.37172296748226485"},"_hasShrinkwrap":false}},"time":{"created":"2024-06-21T11:49:05.797Z","modified":"2024-06-21T12:08:50.416Z","3.2.0":"2024-06-21T11:49:06.099Z","3.2.1":"2024-06-21T12:08:50.224Z"},"maintainers":[{"name":"aneeven","email":"andreas.neeven@gmail.com"}],"author":{"name":"scaleflex"},"repository":{"type":"git","url":"git+https://github.com/scaleflex/js-cloudimage-360-view.git"},"keywords":["image","images","cloudimage","360","photo","product","view","viewer","360 product view"],"license":"MIT","homepage":"http://#readme","bugs":{"url":"https://github.com/scaleflex/js-cloudimage-360-view/issues"},"readme":"[![Release](https://img.shields.io/github/v/release/scaleflex/js-cloudimage-360-view)](https://github.com/scaleflex/js-cloudimage-360-view/releases)\n[![Size](https://img.shields.io/bundlephobia/min/js-cloudimage-360-view)](https://img.shields.io/bundlephobia/min/js-cloudimage-360-view)\n[![Download](https://img.shields.io/npm/dt/js-cloudimage-360-view?logoColor=orange)](https://img.shields.io/npm/dt/js-cloudimage-360-view?logoColor=orange)\n[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg)](#contributing)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Scaleflex team](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20-Scaleflex%20team-6986fa.svg)](https://www.scaleflex.com/en/home)\n[![Cloudimage](https://img.shields.io/badge/Powered%20by-cloudimage-blue)](https://www.cloudimage.io/en/home)\n\n<p align=\"center\">\n\t<a href=\"https://www.cloudimage.io/#gh-light-mode-only\">\n\t\t<img\n\t\t\talt=\"cloudimage logo\"\n\t\t\tsrc=\"https://scaleflex.cloudimg.io/v7/cloudimage.io/LOGO+WITH+SCALEFLEX-01.png?vh=f6080d&w=350\">\n\t</a>\n\t\t<a href=\"https://www.cloudimage.io/#gh-dark-mode-only\">\n\t\t<img\n\t\t\talt=\"cloudimage logo\"\n\t\t\tsrc=\"https://scaleflex.cloudimg.io/v7/cloudimage.io/cloudimage-logo-light.png?vh=b798ab&w=350\">\n\t</a>\n</p>\n\n<h1 align=\"center\">\n   JS Cloudimage 360 View\n</h1>\n\n<p align=\"center\">\n\t<strong>\n\t\t<a href=\"#table_of_contents\">Docs</a>\n\t\t•\n\t\t<a href=\"https://scaleflex.github.io/js-cloudimage-360-view/\" target=\"_blank\">Demo</a>\n\t\t•\n\t\t<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-examples-npne18\" target=\"_blank\">Code Sandbox</a>\n\t\t•\n\t\t<a href=\"https://youtu.be/zXUgrvZ7FMc\" target=\"_blank\">Video Tutorial</a>\n\t\t•\n\t\t<a href=\"https://medium.com/cloudimage/e-merchandising-how-can-a-360-view-of-your-products-boost-your-revenue-24b16eb9cd62\" target=\"_blank\">Why</a>\n\t</strong>\n</p>\n<p align=\"center\">A simple, interactive resource that can be used to provide a virtual tour of your product.</p>\n<p align=\"center\">\n\t<img\n\t\talt=\"The Lounge\"\n\t\tsrc=\"https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/demos/assets/a2.gif\">\n</p>\n\n## <a name=\"table_of_contents\"></a>Table of contents\n\n* [Demo](#demo)\n* [Step 1: Installation](#installation)\n* [Step 2: Initialize](#initialize)\n* [Methods](#methods)\n* [Customize elements](#customize-elements)\n* [Configuration](#configuration)\n* [Controls](#controls)\n* [Spin in X and Y axis](#spin_x_y)\n* [Hotspots or Markers](#hotspots)\n* [Cloudimage responsive integration](#cloudimage-responsive-integration)\n* [Lazy loading integration](#lazy-loading)\n* [Best practices](#best-practices)\n* [Browser support](#browser_support)\n* [Filerobot UI Family](#ui_family)\n* [Contributing](#contributing)\n* [License](#license)\n\n\n## <a name=\"demo\"></a> Demo\n\nTo see the Cloudimage 360 view plugin in action, please check out the\n[Demo page](https://scaleflex.github.io/js-cloudimage-360-view/).\n\n## <a name=\"installation\"></a>Step 1: Installation\n\nAdd script tag with CDN link to js-cloudimage-360-view lib after all content in body tag\n\n```javascript\n<script src=\"https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/latest/js-cloudimage-360-view.min.js?func=proxy\"></script>\n```\n\n## <a name=\"initialize\"></a>Step 2: Initialize\n\nAfter adding the js-cloudimage-360-view lib, simply initialize it with **class name \"cloudimage-360\"**,\n**server folder path**, **file name** and amount of images:\n\n```html\n<div\n   class=\"cloudimage-360\"\n   id=\"gurkha-suv\"\n   data-folder=\"https://scaleflex.cloudimg.io/v7/demo/suv-orange-car-360/\"\n   data-filename-x=\"orange-{index}.jpg\"\n   data-amount-x=\"73\"\n></div>\n```\n\n<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-example-l7ce4h\"><img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a>\n\n## <a name=\"methods\"></a> Methods\n\n### init\n\n###### Type: **Function**\n\nInitialization of js cloudimage 360 view plugin.\n\n```javascript\nwindow.CI360.init();\n```\n\n> 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\n> ```javascript\n> <script>window.CI360 = { notInitOnLoad: true }</script>\n> <script src=\"https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/3.0./js-cloudimage-360-view.min.js\"></script>\n> <script>window.CI360.init(); // initialize the plugin when you need</script>\n> ```\n\n### add\n\n###### Type: **Function**\n\n```javascript\nwindow.CI360.add(idOftheView: string);\n```\nlazy init cloudimage-360 view by id.\n###### arguments\n`idOftheView`: string\nThe id of the new view\n\n<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-examples-vxlmoi\"><img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a>\n\n### update\n\n###### Type: **Function**\n```javascript\nwindow.CI360.update(idOftheView, forceUpdate);\n```\nUpdate cloudimage 360 viewer instance.<br/>\nFor any update in source attributes after plugin initialization (e.g. `data-folder`, `data-filename-x`, `data-amount-y`),\nthe plugin will re-init.\n###### arguments\n`idOftheView`: string\nThe id of the new view\n\n`forceUpdate`: bool\nForce the view to reinitialize.\n\n```html\n<div\n   class=\"cloudimage-360\"\n   id=\"gurkha-suv\"\n   data-folder=\"https://scaleflex.cloudimg.io/v7/demo/suv-orange-car-360/\"\n   data-filename-x=\"orange-{index}.jpg\"\n   data-amount-x=\"73\"\n></div>\n```\n```javascript\nwindow.CI360.update('gurkha-suv');\n```\n\n```javascript\nwindow.CI360.update(null, true);\n```\n\n<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-examples-n7m04e\"><img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a>\n\n### destroy\n\n###### Type: **Function**\n\nDestroying a cloudimage 360 viewer instance will reset the HTML to its original state.\n\n```javascript\nwindow.CI360.destroy();\n```\n<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-examples-03pb2t\">\n\t<img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a>\n\n### getActiveIndexByID\n\n###### Type: **Function**\n\nGet the {index} of the image that is being viewed.\n\n```javascript\nwindow.CI360.getActiveIndexByID(idOfInstance: string, oriantation: string);\n```\n###### arguments\n`idOfInstance`: string\nThe id of the instance\n\n`oriantation`: string\nThe oriantation of the active index\n\n## <a name=\"customize-elements\"></a> Customize elements\n\nYou can customize elements by adding the following classes:\n\n### Example CSS\n```css\n.cloudimage-360-icons-container {\n\ttop: 5px;\n  \tright: 5px;\n}\n.cloudimage-360-fullscreen-modal {\n\ttop: 0;\n  \tbottom: 0;\n}\n.cloudimage-360-magnifier-icon {\n\tbackground: url(https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/loupe.svg) 50% 50% / cover no-repeat;\n}\n.cloudimage-360-close-fullscreen-icon {\n\tbackground: url(https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/cross.svg) 50% 50% / cover no-repeat;\n}\n.cloudimage-360-view-360-circle {\n  \tmargin: auto;\n}\n.cloudimage-360-loader {\n\tmargin: auto;\n}\n.cloudimage-360-view-360-icon {\n\tbackground: url(https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/360_view.svg) 50% 50% / cover no-repeat;\n}\n.cloudimage-360-box-shadow {\n\ttop: 0;\n  \tleft: 0;\n}\n.cloudimage-360-img-magnifier-glass {\n\tborder: 3px solid #000;\n  \tborder-radius: 50%;\n}\n```\n\n## <a name=\"configuration\"></a> Config\n\n### class\n\n###### Type: **String** | Value: **\"cloudimage-360\"** | _required_\n\nThe selector for js-cloudimage-360-view lib.\n\n### data-folder (or folder)\n\n###### Type: **String(url)** | _required_\n\nYour images folder on server.\n### data-api-version (or api-version)\n\n###### Type: **String** |Default: **'v7'** | _optional_\n\nAllow to use a specific version of API.\n\n- set a specific version of API\n```javascript\ndata-api-version=\"v7\"\n```\n- disable API version\n```javascript\ndata-api-version=\"null\"\n```\n### data-filename-x (or filename-x)\n\n###### Type: **String** | Default: **image-{index}.jpg** | _optional_\n\nThe filename pattern for your 360 image. Must include {index}, which the library will replace with a number between 1 and [data-amount-x](#data-amount-x).\n\n### data-filename-y (or filename-y)\n\n###### Type: **String** | Default: **image-y-{index}.jpg** | _optional_\nThe same for [data-amount-x](#data-amount-x) but for images set in Y-axis.\n\n### data-amount-x (or amount-x)\n###### Type: **Number** | Default: **36** | _optional_\n\nAmount of images to load in X-axis for 360 view .\n\n### data-amount-y (or amount-y)\n\n###### Type: **Number** | Default: **0** | _optional_\n\nAmount of images to load in Y-axis for 360 view.\n\n### data-keys (or keys)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nSupport for 360 spin by pressing arrow keys on keyboard.\n\n### data-keys-reverse (or keys-reverse)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\ninvert arrow keys on keyboard.\n\n### data-autoplay (or autoplay)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nAutoplay 360 spin view on load.\n\n### data-play-once (or autoplay)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nstops the autoplay after one complete cycle.\n\n### data-autoplay-behavior (or autoplay-behavior)\n\n###### Type: **String** | Default: **spin-x** | _optional_\n\nChanging autoplay behavior\n\nAvailable behaviors (spin-x, spin-y, spin-xy, spin-yx)\n\n### data-fullscreen (or fullscreen)\n###### Type: **Bool** | Default: **false** | _optional_\n\nOpen 360 spin view in full screen modal.\n\n### data-magnifier (or magnifier)\n\n###### Type: **Number** | Default: **none** | _optional_\n\nMagnifier to zoom image.\n\n### data-ratio (or ratio)\n###### Type: **Number** (width / height) or JSON object | Default: **none** | _optional_\n#### `ratio`: string\n\nSetting the height relative to the container width according to the provided ratio</br>\n\n```html\n<div\n   class=\"cloudimage-360\"\n   id=\"gurkha-suv\"\n   data-folder=\"https://scaleflex.cloudimg.io/v7/demo/suv-orange-car-360/\"\n   data-filename-x=\"orange-{index}.jpg\"\n   data-amount-x=\"73\"\n   data-ratio=\"2\"\n></div>\n```\n<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-examples-865iz5\"><img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a>\n#### `ratio`: JSON\nSetting the height relative to the container width at any window size.\n\nIn the following example, the height should be 1.3 the container width at window size less than or equal to 567px\nand 2.22 at window size less than or equal to 768px.\n\n```html\n<div\n   class=\"cloudimage-360\"\n   id=\"gurkha-suv\"\n   data-folder=\"https://scaleflex.cloudimg.io/v7/demo/suv-orange-car-360/\"\n   data-filename-x=\"orange-{index}.jpg\"\n   data-amount-x=\"73\"\n   data-ratio='{\n      \"576\": \"1.3\",\n      \"768\": \"2.22\",\n      \"992\": \"2.23\",\n      \"1200\": \"3\",\n      \"2400\": \"3.2\"\n   }'\n></div>\n```\n<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-examples-xzx8no\"><img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a>\n\n### data-autoplay-reverse (or autoplay-reverse)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nAutoplay 360 spin view on load.\n\n### data-disable-drag (or disable-drag)\n\n###### Type: **bool** | Default: **false** | _optional_\n\ndisable mouse drag.\n\n### data-speed (or speed)\n\n###### Type: **Number** | Default: **150** | _optional_\n\nSpeed of changing frames for autoplay in milliseconds.\n\n### data-drag-speed (or drag-speed)\n\n###### Type: **Number** | Default: **150** | _optional_\n\nSpeed Factor of changing frames on drag event.\n\n### data-spin-reverse (or spin-reverse)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nSpin direction, by default it uses counterclockwise (image indexes from 1 to data-amount-x).\n\n### data-box-shadow (or box-shadow)\n\n###### Type: **String** (e.g. data-box-shadow=\"inset 0 0 100px #222\") | Default: **none** | _optional_\n\nApply box shadow for container.\n\n### data-bottom-circle (or bottom-circle)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nDisplay 360 view line at the bottom of container.\n\n### data-hide-360-logo (or hide-360-logo)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nHide 360 view icon.\n\n### data-control-reverse (or control-reverse)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nSpin direction using controls, by default it uses counterclockwise (image indexes from 1 to data-amount-x).\n\n### data-stop-at-edges (or stop-at-edges)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nBlocks repeating images after reaching last image (or first image in opposite direction)\n\n### data-bottom-circle-offset (or bottom-circle-offset)\n\n###### Type: **Number** | Default: **5** | _optional_\n\nBottom offset for 360 view line.\n\n### data-index-zero-base (or index-zero-base)\n\n###### Type: **Number** | _optional_\n\nLeft zero padding on filename. For example: index-zero-base=\"4\" => image index will be \"0004\"\n\n### data-image-list-x (or data-image-list-x)\n###### Type: **Array** | _optional_\n\nOption to add list of images in x-oriantation instead of `folder` , `filename-x` & `amount-x`.\n\nexample:\n\n```javascript\ndata-folder=\"https://scaleflex.cloudimg.io/v7/demo/360-car/\"\ndata-image-list-x='[\n   \"iris-1.jpeg\",\n   \"iris-4.jpeg\",\n   \"https://scaleflex.cloudimg.io/v7/demo/360-car/iris-12.jpeg\",\n   \"https://scaleflex.cloudimg.io/v7/demo/360-car/iris-15.jpeg\"\n   ]’\n```\n\n### data-image-list-y (or data-image-list-y)\n\n###### Type: **Array** | _optional_\n\nOption to add list of images in y-oriantation instead of `folder` , `filename-y` & `amount-y`.\n\nexample:\n\n```javascript\ndata-folder=\"https://scaleflex.cloudimg.io/v7/demo/360-car/\"\ndata-image-list-y='[\n   \"iris-2-y.jpeg\",\n   \"iris-6-y.jpeg\",\n   \"https://scaleflex.cloudimg.io/v7/demo/360-car/iris-8-y.jpeg\",\n   \"https://scaleflex.cloudimg.io/v7/demo/360-car/iris-30-y.jpeg\"\n   ]’\n```\n### data-pointer-zoom (or pointer-zoom)\n\n###### Type: **Number** | Default: **none** | _optional_\n\nOption to scale images on click on it to provided value.\n\nexample:\n\n```javascript\ndata-pointer-zoom=\"3\"\n```\n\n### data-lazyload (or lazyload)\n\n###### Type: **Bool** | Default: **false** | _optional_\n\nOnly 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](#lazy-loading)\n### data-lazyload-selector (or lazyload-selector)\n\n###### Type: **String** | Default: **lazyload** | _optional_\n\nHelper class to apply lazy-loading depending on library you choose, see [Lazy loading](#lazy-loading)\n\n\n## <a name=\"controls\"></a> Controls\n\nYou can add controls by adding elements with the following classes: **cloudimage-360-left**, **cloudimage-360-right**, **cloudimage-360-top**, **cloudimage-360-bottom\n\n### Example CSS\n```css\n.cloudimage-360 .cloudimage-360-left, .cloudimage-360 .cloudimage-360-right {\n\tpadding: 8px;\n\tbackground: rgba(255, 255, 255, 0.5);\n\tborder: none;\n\tborder-radius: 4px;\n}\n.cloudimage-360 .cloudimage-360-left:focus, .cloudimage-360 .cloudimage-360-right:focus {\n\toutline: none;\n}\n.cloudimage-360 .cloudimage-360-left {\n\tdisplay: none;\n\tposition: absolute;\n\tz-index: 100;\n\ttop: calc(50% - 15px);\n\tleft: 20px;\n}\n.cloudimage-360 .cloudimage-360-right {\n\tdisplay: none;\n\tposition: absolute;\n\tz-index: 100;\n\ttop: calc(50% - 15px);\n\tright: 20px;\n}\n.cloudimage-360 .cloudimage-360-left:before, .cloudimage-360 .cloudimage-360-right:before {\n\tcontent: '';\n\tdisplay: block;\n\twidth: 30px;\n\theight: 30px;\n\tbackground: 50% 50% / cover no-repeat;\n}\n.cloudimage-360 .cloudimage-360-left:before {\n\tbackground-image: url('https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/assets/img/arrow-left.svg');\n}\n.cloudimage-360 .cloudimage-360-right:before {\n\tbackground-image: url('https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/assets/img/arrow-right.svg');\n}\n.cloudimage-360 .cloudimage-360-left.not-active, .cloudimage-360 .cloudimage-360-right.not-active {\n\topacity: 0.4;\n\tcursor: default;\n}\n```\n### Example HTML\n```html\n<div\n\tclass=\"cloudimage-360\"\n\tdata-folder=\"https://scaleflex.cloudimg.io/v7/demo/360-car/\"\n\tdata-filename-x=\"{index}.jpeg\"\n>\n\t<button class=\"cloudimage-360-left\"></button>\n\t<button class=\"cloudimage-360-right\"></button>\n\t<button class=\"cloudimage-360-top\"></button>\n\t<button class=\"cloudimage-360-bottom\"></button>\n</div>\n```\n\n<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-examples-npne18\"><img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a>\n\n## <a name=\"spin_x_y\"/> Spin in X and Y axes\nAllow the view to spin in both X, Y axes\n### Requirements\nWe need to provide the `file-name` of the y-axis images using <a href=\"#data-filename-y-or-filename-y\">data-filename-y</a>\n\nAlso as we did for the x-axis if we are intializing the view using <a href=\"#data-folder-or-folder\">data-folder</a> and <a href=\"#data-filename-y-or-filename-y\">data-filename-y</a>\nso we need to provide <a href=\"#data-amount-y-or-amount-y\">data-amount-y</a> which indicates the number of images on the y-axis.\nexample:\n\n```javascript\n<div\n   class=\"cloudimage-360\"\n   data-folder=\"https://scaleflex.cloudimg.io/v7/demo/360-nike/\"\n   data-filename-x=\"nike-{index}.jpg\"\n   data-filename-y=\"nike-y-{index}.jpg\"\n   data-amount-x=\"35\"\n   data-amount-y=\"36\"\n>\n</div>\n```\n<a href=\"https://codesandbox.io/s/js-cloudimage-360-view-wc9j12?file=/index.html\"><img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a></br>\n> Note: We can initilize the view in x, y axes without providing add `data-folder`, `data-amount-y`, `data-amount-y`.</br>\nJust we need to provide the <a href=\"#data-amount-y-or-amount-y\">data-amount-y</a>\n## <a name=\"hotspots\"/> Hotspots or Markers\nDisplay information about the product on specific areas. Once a hotspot is created it can be used on more than one image.\n### Requirements\nFirst, we need to set `data-hotspots` attribute to the view we want to add hotspots or markers on it, to prevent the plugin to init the view without hotspots config.\nAlso we need to set an `id` attribute, we will need it to link the view with the hotspots config.\n\n### Create hotspots configuration\nThe hotspots config should be an array of objects, each object in the array indicates a single hotspot config.\nFor each item in the array, we need to set the positions (X-coord and Y-coord) of the hotspot at every image index we need to show the hotspot on it. <br>hint: To know the current image index we will need to set `data-info=\"white || black\"` attribute.\n\nexample:\n\n```js\nconst HOTSPOTS_CONFIG = [\n {\n  positions: [\n   { imageIndex: 0, xCoord: 527, yCoord: 319 },\n   { imageIndex: 1, xCoord: 524 },\n   { imageIndex: 2, xCoord: 520 },\n   { imageIndex: 3, xCoord: 498 },\n   { imageIndex: 4, xCoord: 470 },\n   { imageIndex: 5, xCoord: 441 },\n  ]\n }\n]\n```\nIn the previous example, we have only set the Ycoord a single time at the image index 0.\nSo if the coord didn't change there's no need to reset it, it will already take the previous value.\n\nNow we need to set the hotspot variant, we have three types of hotspots (link, popup, and custom), as it will be explained below.\n## Variant\n### Link\nwe need to provide the URL of the link and the link title.\n\nexample:\n\n```js\nconst HOTSPOTS_CONFIG = [\n {\n  positions,\n  variant: {\n  title: 'New Gurkha Technical Specifications',\n  url: 'https://www.forcegurkha.co.in/specifications/',\n  newTab: true\n  }\n }\n]\n```\n---\n### Popup\nOnly the property inserted will displayed.\n| Property  |Type | Default | Description |\n| ------------- | ------------- | ------------- |------------- |\n| images  | Array| [] | To display a carousel of images we need an array of objects, each object should include the src and the alt of each image  |\n| title  |String| null | Display title underneath the images  |\n| description| String | null | Display description underneath the title  |\n| moreDetailsUrl | String | null | Display a button underneath the description to navigate to a provided URL |\n| moreDetailsTitle  | String | null| Set the title of the more details button  |\n\n   example:\n```js\nconst HOTSPOTS_CONFIG = [\n {\n  positions,\n  variant: {\n   images: [\n    { src: 'https://scaleflex.cloudimg.io/v7/demo/360-assets/AIR_SNORKEL_FINAL_JPG.png?vh=88bccb', alt: 'air snorkel' }\n   ], // optional\n   title: 'Air Intake Snorkel', // optional\n   description: 'The snorkel gives the Gurkha an unmatched water-wading ability and ensures ample supply of fresh air for combustion.', // optional\n   moreDetailsUrl: 'https://forcegurkha.co.in', // optional\n   moreDetailsTitle: 'Read more' // optional\n  }\n }\n]\n```\n---\n### Custom\nDisplay any element in the DOM in a popup and link it with the hotspot.</br>\nWe will need to set the variant property value to the id of the element.\n\nexample:\n```js\nconst HOTSPOTS_CONFIG = [\n {\n  positions,\n  variant: 'gurkha-suv'\n }\n]\n```\n## PopupProps\nOptions to customize the hotspot popup.\n### Properties\n| Property  | Type | Defaullt |Description |\n| ------------- | ------------- | ------------- | ------------- |\n| popupSelector |String| null |Set className to the popup wrapper  |\n| open |Boolean | false |Open the popup  |\n| arrow |Boolean| true |Dipslay an arrow that points toward the hotspot element|\n| offset|Array | [0, 0] |Set a distance between the hotspot element and the popup  |\n| placement|String| Auto|- we can adjust the position of the hotspot popup relative to the hotspot element. (top - bottom - left - right)|\n\n\nexample:\n```js\nconst HOTSPOTS_CONFIG = [\n {\n  positions,\n  variant,\n  popupProps: {\n   popupSelector: 'air-intake-popup', // optional\n   offset: [20, 5], // optional\n   arrow: false, // optional\n   placement: 'bottom' // optional\n  },\n  indicatorSelector: 'first-hotspot-icon' // optional\n }\n]\n```\n## Responsive hotspots\nNow we need to make our hotspots responsive to have an accurate positioning in different screens.\nwe have to set `initialDimensions` property to every hotspot config. which indicates the dimension of the cloudimage-360 view.<br/>\nhint: `data-info` can be used to get view size.\n\nexample:\n```js\nconst HOTSPOTS_CONFIG = [\n {\n   positions,\n   variant,\n   popupProps,\n   indicatorSelector,\n   initialDimensions: [ 1170, 662 ]\n }\n]\n```\n## Add Hotspots\nwe need this function to link the created config with the 360-view.\n```js\nwindow.CI360.addHotspots(idOftheView, hotspotsConfig);\n```\nexample:\n```js\nwindow.CI360.addHotspots(\"gurkha-suv\", HOTSPOTS_CONFIG);\n```\n<a href=\"https://codesandbox.io/s/competent-bogdan-49b0u6\"><img src=\"https://codesandbox.io/static/img/play-codesandbox.svg\" alt=\"edit in codesandbox\"/></a>\n\n### data-responsive (or responsive)\n\n###### Type: **String** (Cloudimage token) | Default: **none** | _required for cloudimage responsive plugin_\n\nEnables cloudimage responsive plugin for 360 view.\n\n## <a name=\"cloudimage-responsive-integration\"/> Cloudimage Responsive Integration\n\n[See how it works (article on Medium)](https://medium.com/cloudimage/responsive-images-in-2019-now-easier-than-ever-b76e5a43c074)\n\n### Requirements\n\nTo use the Cloudimage Responsive plugin, you will need a\nCloudimage token to deliver your images over CDN. Don't worry, it only takes seconds to get one by\nregistering [here](https://www.cloudimage.io/en/register_page).\nOnce your token is created, you can configure it as described below.\nThis token allows you to use 25GB of image cache and 25GB of worldwide\nCDN traffic per month for free.\n\n### data-responsive (or responsive)\n\n###### Type: **String** (Cloudimage token) | Default: **none** | _required for cloudimage responsive plugin_\n\nEnables cloudimage responsive plugin for 360 view.\n\n### data-request-responsive-images (or request-responsive-images)\n\n###### Type: **Bool** | Default: **false**\n\nRequest new images on resize, based on the container width.\n\n### data-transformation (or transformation)\n\n###### Type: **String** | Default: **none** | _optional_\n\nApplies Cloudimage resize operations to your image, e.g. width, height, crop, face crop, rotate, prevent enlargement...\nMultiple transformation operations can be applied to your image, separated by \"```&```\" (Ampersand).\nexample:\n\n```html\ndata-transformation=\"w=400&h=200&func=fit\"\n```\n\n[Full documentation here.](https://docs.cloudimage.io/go/cloudimage-documentation-v7/en/image-resizing)\n\n### data-filters (or filters)\n\n###### Type: **String** | Default: **none** | _optional_\n\nApplies Cloudimage filters to your image, e.g. brightness, contrast, greyscale, blur, Sharpen...\nMultiple filters can be applied, separated by \"```,```\" (comma).\nexample:\n\n```html\ndata-filters=\"bright:15,contrast:30\"\n```\n\n[Full documentation here.](https://docs.cloudimage.io/go/cloudimage-documentation-v7/en/image-filters)\n\n## <a name=\"lazy-loading\"/> Lazy Loading\n\nLazy 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](https://github.com/aFarkas/lazysizes), [yall.js (Yet Another Lazy Loader)](https://github.com/malchata/yall.js), [lozad.js](https://github.com/ApoorvSaxena/lozad.js) to handle it.\n\n[Implementation example with lazysizes](https://codesandbox.io/s/js-cloudimage-360-view-examples-ux850x)\n\n[Implementation example with yall.js](https://codesandbox.io/s/js-cloudimage-360-view-xjpdg1)\n\n[Implementation example with lozad.js](https://codesandbox.io/s/js-cloudimage-360-view-examples-8iukcn)\n\n## <a name=\"best-practices\"/> Best practices\n\n* In order to use cloudimage responsive with 360 view, your original (master) images should be stored on a server\nor storage bucket (S3, Google Cloud, Azure Blob...) reachable over\nHTTP or HTTPS by Cloudimage. If you want to upload your master images to\nCloudimage, contact us at\n[hello@cloudimage.io](mailto:hello@cloudimage.io).\n\n## <a name=\"browser_support\"></a> Browser support\n\nTested in all modern browsers and IE 11, 10, 9.\n\n## <a name=\"ui_family\"></a>Filerobot UI Familiy\n\n* [JS Cloudimage Responsive](https://github.com/scaleflex/js-cloudimage-responsive)\n* [React Cloudimage Responsive](https://github.com/scaleflex/react-cloudimage-responsive)\n* [Angular Cloudimage Responsive](https://github.com/scaleflex/ng-cloudimage-responsive)\n* [Image Editor](https://github.com/scaleflex/filerobot-image-editor)\n* [Uploader](https://github.com/scaleflex/filerobot-uploader)\n\n## <a name=\"contributing\"></a>Contributing!\n\nAll contributions are super welcome!\n\n## <a name=\"license\"></a>License\nJS Cloudimage 360 View is provided under the [MIT License](https://opensource.org/licenses/MIT)\n","readmeFilename":"README.md"}