js-cloudimage-360-view 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/LICENSE +21 -0
- package/README.md +547 -0
- package/dist/ci360.constants.js +31 -0
- package/dist/ci360.service.js +1637 -0
- package/dist/ci360.utils.js +250 -0
- package/dist/index.js +57 -0
- package/dist/static/css/style.css +121 -0
- package/package.json +59 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
3
|
+
|
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
Types of changes:
|
|
8
|
+
- `Added` for new features.
|
|
9
|
+
- `Changed` for changes in existing functionality.
|
|
10
|
+
- `Deprecated` for soon-to-be removed features.
|
|
11
|
+
- `Removed` for now removed features.
|
|
12
|
+
- `Fixed` for any bug fixes.
|
|
13
|
+
- `Security` in case of vulnerabilities.
|
|
14
|
+
|
|
15
|
+
> Date format: YYYY-MM-DD
|
|
16
|
+
|
|
17
|
+
> If we have some "Breaking changes" we can mark it in message by `**BREAKING**` preffix, like:
|
|
18
|
+
> `- **BREAKING**: Some message`
|
|
19
|
+
|
|
20
|
+
-------------
|
|
21
|
+
|
|
22
|
+
## TODOs
|
|
23
|
+
> Todo list for future
|
|
24
|
+
|
|
25
|
+
- ...
|
|
26
|
+
|
|
27
|
+
-------------
|
|
28
|
+
|
|
29
|
+
## 2.6.0 - 2020-09-03
|
|
30
|
+
|
|
31
|
+
### Feat
|
|
32
|
+
- add ability to specify custom 360 view logo
|
|
33
|
+
|
|
34
|
+
## 2.5.0 - 2020-07-05
|
|
35
|
+
|
|
36
|
+
### Feat
|
|
37
|
+
- possibility to hide 360 view icon
|
|
38
|
+
|
|
39
|
+
## 2.4.1 - 2020-04-11
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
- initialize first image using data-image-list #33
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## 2.4.0 - 2020-04-09
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
- problem with first preview image is random #28, #29
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 scaleflex
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,547 @@
|
|
|
1
|
+
[](https://github.com/scaleflex/js-cloudimage-360-view/releases)
|
|
2
|
+
[](#contributing)
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.scaleflex.it/en/home)
|
|
5
|
+
|
|
6
|
+
[](https://twitter.com/intent/tweet?text=Engage%20your%20customers%20with%20a%20stunning%20360%20viewvof%20your%20products&url=https://scaleflex.github.io/js-cloudimage-360-view/&via=cloudimage&hashtags=images,cloudimage)
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<img
|
|
10
|
+
height="175"
|
|
11
|
+
alt="The Lounge"
|
|
12
|
+
src="https://demo.cloudimg.io/v7/https://scaleflex.airstore.io/filerobot/filerobot-cloudimage.png?sanitize=true">
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<h1 align="center">
|
|
16
|
+
JS Cloudimage 360 View
|
|
17
|
+
</h1>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<strong>
|
|
21
|
+
<a href="#table_of_contents">Docs</a>
|
|
22
|
+
•
|
|
23
|
+
<a href="https://scaleflex.github.io/js-cloudimage-360-view/" target="_blank">Demo</a>
|
|
24
|
+
•
|
|
25
|
+
<a href="https://codesandbox.io/s/6479n17j73?fontsize=14&module=%2Findex.html" target="_blank">Code Sandbox</a>
|
|
26
|
+
•
|
|
27
|
+
<a href="https://youtu.be/zXUgrvZ7FMc" target="_blank">Video Tutorial</a>
|
|
28
|
+
•
|
|
29
|
+
<a href="https://medium.com/cloudimage/e-merchandising-how-can-a-360-view-of-your-products-boost-your-revenue-24b16eb9cd62" target="_blank">Why</a>
|
|
30
|
+
</strong>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
A simple, interactive resource that can be used to provide a virtual tour of your product.
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img
|
|
37
|
+
alt="The Lounge"
|
|
38
|
+
src="https://scaleflex.ultrafast.io/https://scaleflex.airstore.io/filerobot/js-cloudimage-360-view/demo-chair-500.gif?sanitize=true">
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
powered by [Cloudimage](https://www.cloudimage.io/)
|
|
42
|
+
([Watch the video here](https://www.youtube.com/watch?time_continue=2&v=JFZSE1vYb0k))
|
|
43
|
+
|
|
44
|
+
## <a name="table_of_contents"></a>Table of contents
|
|
45
|
+
|
|
46
|
+
* [Demo](#demo)
|
|
47
|
+
* [Step 1: Installation](#installation)
|
|
48
|
+
* [Step 2: Initialize](#initialize)
|
|
49
|
+
* [Methods](#methods)
|
|
50
|
+
* [Customize Icons](#customize-icons)
|
|
51
|
+
* [Configuration](#configuration)
|
|
52
|
+
* [Controls](#controls)
|
|
53
|
+
* [Cloudimage responsive integration](#cloudimage-responsive-integration)
|
|
54
|
+
* [Lazy loading integration](#lazy-loading)
|
|
55
|
+
* [Best practices](#best-practices)
|
|
56
|
+
* [Browser support](#browser_support)
|
|
57
|
+
* [Filerobot UI Family](#ui_family)
|
|
58
|
+
* [Contributing](#contributing)
|
|
59
|
+
* [License](#license)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## <a name="demo"></a> Demo
|
|
63
|
+
|
|
64
|
+
To see the Cloudimage 360 view plugin in action, please check out the
|
|
65
|
+
[Demo page](https://scaleflex.github.io/js-cloudimage-360-view/).
|
|
66
|
+
|
|
67
|
+
## <a name="installation"></a>Step 1: Installation
|
|
68
|
+
|
|
69
|
+
Add script tag with CDN link to js-cloudimage-360-view lib after all content in body tag
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
<script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/2.6.0/js-cloudimage-360-view.min.js"></script>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## <a name="initialize"></a>Step 2: Initialize
|
|
76
|
+
|
|
77
|
+
After adding the js-cloudimage-360-view lib, simply initialize it with **class name "cloudimage-360"**,
|
|
78
|
+
**server folder path**, **file name** and amount of images:
|
|
79
|
+
|
|
80
|
+
```html
|
|
81
|
+
<div
|
|
82
|
+
class="cloudimage-360"
|
|
83
|
+
data-folder="https://scaleflex.airstore.io/demo/360-car/"
|
|
84
|
+
data-filename="iris-{index}.jpeg"
|
|
85
|
+
data-amount="36"
|
|
86
|
+
></div>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
<a href="https://codesandbox.io/s/6479n17j73?fontsize=14&module=%2Findex.html"><img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="edit in codesandbox"/></a>
|
|
90
|
+
|
|
91
|
+
## <a name="methods"></a> Methods
|
|
92
|
+
|
|
93
|
+
### init
|
|
94
|
+
|
|
95
|
+
###### Type: **Function**
|
|
96
|
+
|
|
97
|
+
Initialization of js cloudimage 360 view plugin.
|
|
98
|
+
|
|
99
|
+
```javascript
|
|
100
|
+
window.CI360.init();
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
> 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
|
|
104
|
+
> ```javascript
|
|
105
|
+
> <script>window.CI360 = { notInitOnLoad: true }</script>
|
|
106
|
+
> <script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/2/js-cloudimage-360-view.min.js"></script>
|
|
107
|
+
> <script>window.CI360.init(); // initialize the plugin when you need</script>
|
|
108
|
+
> ```
|
|
109
|
+
|
|
110
|
+
### destroy
|
|
111
|
+
|
|
112
|
+
###### Type: **Function**
|
|
113
|
+
|
|
114
|
+
Destroying a cloudimage 360 viewer instance will reset the HTML to its original state.
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
window.CI360.destroy();
|
|
118
|
+
```
|
|
119
|
+
<a href="https://codesandbox.io/s/js-cloudimage-360-view-initdestroy-y1il9">
|
|
120
|
+
<img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="edit in codesandbox"/></a>
|
|
121
|
+
|
|
122
|
+
### getActiveIndexByID
|
|
123
|
+
|
|
124
|
+
###### Type: **Function**
|
|
125
|
+
|
|
126
|
+
Get the {index} of the image that is being viewed.
|
|
127
|
+
|
|
128
|
+
```javascript
|
|
129
|
+
window.CI360.getActiveIndexByID('id_of_product');
|
|
130
|
+
```
|
|
131
|
+
## <a name="customize-icons"></a> Customize icons
|
|
132
|
+
|
|
133
|
+
You can customize the icons by adding the following classes:
|
|
134
|
+
|
|
135
|
+
### Example CSS
|
|
136
|
+
```css
|
|
137
|
+
.cloudimage-360 .fullscreen-icon {
|
|
138
|
+
background: url(https://scaleflex.ultrafast.io/https://scaleflex.airstore.io/filerobot/js-cloudimage-360-view/full_screen.svg) 50% 50% / cover no-repeat;
|
|
139
|
+
}
|
|
140
|
+
.cloudimage-360 .magnify-icon {
|
|
141
|
+
background: url(https://scaleflex.ultrafast.io/https://scaleflex.airstore.io/filerobot/js-cloudimage-360-view/loupe.svg) 50% 50% / cover no-repeat;
|
|
142
|
+
}
|
|
143
|
+
.cloudimage-360 .close-fullscreen-icon {
|
|
144
|
+
background: url(https://scaleflex.ultrafast.io/https://scaleflex.airstore.io/filerobot/js-cloudimage-360-view/cross.svg) 50% 50% / cover no-repeat;
|
|
145
|
+
}
|
|
146
|
+
.cloudimage-360 .reset-zoom-icon {
|
|
147
|
+
background: url(https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/ic-resize.svg?vh=248986) 50% 50% / cover no-repeat;
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## <a name="configuration"></a> Config
|
|
152
|
+
|
|
153
|
+
### class
|
|
154
|
+
|
|
155
|
+
###### Type: **String** | Value: **"cloudimage-360"** | _required_
|
|
156
|
+
|
|
157
|
+
The selector for js-cloudimage-360-view lib.
|
|
158
|
+
|
|
159
|
+
### data-folder (or folder)
|
|
160
|
+
|
|
161
|
+
###### Type: **String(url)** | _required_
|
|
162
|
+
|
|
163
|
+
Your images folder on server.
|
|
164
|
+
|
|
165
|
+
### data-filename (or filename)
|
|
166
|
+
|
|
167
|
+
###### Type: **String** | Default: **image-{index}.jpg** | _optional_
|
|
168
|
+
|
|
169
|
+
The filename pattern for your 360 image. Must include {index}, which the library will replace with a number between 1 and [data-amount](#data-amount).
|
|
170
|
+
|
|
171
|
+
### data-filename-y (or filename-y)
|
|
172
|
+
|
|
173
|
+
###### Type: **String** | Default: **image-y-{index}.jpg** | _optional_
|
|
174
|
+
|
|
175
|
+
The filename pattern for Y-axis images. Must include {index}, which the library will replace with a number between 1 and [data-amount-y](#data-amount-y).
|
|
176
|
+
|
|
177
|
+
### <a name="data-amount"></a> data-amount (or amount)
|
|
178
|
+
|
|
179
|
+
###### Type: **Number** | Default: **36** | _optional_
|
|
180
|
+
|
|
181
|
+
Amount of images to load for 360 view.
|
|
182
|
+
|
|
183
|
+
### <a name="data-amount-y"></a> data-amount-y (or amount-y)
|
|
184
|
+
|
|
185
|
+
###### Type: **Number** | Default: **0** | _optional_
|
|
186
|
+
|
|
187
|
+
Amount of images to load in Y-axis for 360 view.
|
|
188
|
+
|
|
189
|
+
### data-keys (or keys)
|
|
190
|
+
|
|
191
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
192
|
+
|
|
193
|
+
Support for 360 spin by pressing arrow keys on keyboard.
|
|
194
|
+
|
|
195
|
+
### data-autoplay (or autoplay)
|
|
196
|
+
|
|
197
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
198
|
+
|
|
199
|
+
Autoplay 360 spin view on load.
|
|
200
|
+
|
|
201
|
+
### data-autoplay-behavior (or autoplay-behavior)
|
|
202
|
+
|
|
203
|
+
###### Type: **String** | Default: **spin-x** | _optional_
|
|
204
|
+
|
|
205
|
+
Changing autoplay behavior
|
|
206
|
+
|
|
207
|
+
Available behaviors (spin-x, spin-y, spin-xy, spin-yx)
|
|
208
|
+
|
|
209
|
+
### data-full-screen (or full-screen)
|
|
210
|
+
|
|
211
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
212
|
+
|
|
213
|
+
Open 360 spin view in full screen modal.
|
|
214
|
+
|
|
215
|
+
### data-magnifier (or magnifier)
|
|
216
|
+
|
|
217
|
+
###### Type: **Number** | Default: **none** | _optional_
|
|
218
|
+
|
|
219
|
+
Magnifier to zoom image.
|
|
220
|
+
|
|
221
|
+
### data-magnifier-in-fullscreen (or magnifier-in-fullscreen)
|
|
222
|
+
|
|
223
|
+
###### Type: **bool** | Default: **false** | _optional_
|
|
224
|
+
|
|
225
|
+
enable magnifier in fullscreen modal.
|
|
226
|
+
|
|
227
|
+
### data-ratio (or ratio)
|
|
228
|
+
|
|
229
|
+
###### Type: **Number** (height / width) | Default: **none** | _optional_
|
|
230
|
+
|
|
231
|
+
Prevents page from jumping.
|
|
232
|
+
|
|
233
|
+
### data-autoplay-reverse (or autoplay-reverse)
|
|
234
|
+
|
|
235
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
236
|
+
|
|
237
|
+
Autoplay 360 spin view on load.
|
|
238
|
+
|
|
239
|
+
### data-speed (or speed)
|
|
240
|
+
|
|
241
|
+
###### Type: **Number** | Default: **150** | _optional_
|
|
242
|
+
|
|
243
|
+
Speed of changing frames for autoplay in milliseconds.
|
|
244
|
+
|
|
245
|
+
### data-drag-speed (or drag-speed)
|
|
246
|
+
|
|
247
|
+
###### Type: **Number** | Default: **150** | _optional_
|
|
248
|
+
|
|
249
|
+
Speed Factor of changing frames on drag event.
|
|
250
|
+
|
|
251
|
+
### data-spin-reverse (or spin-reverse)
|
|
252
|
+
|
|
253
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
254
|
+
|
|
255
|
+
Spin direction, by default it uses counterclockwise (image indexes from 1 to data-amount).
|
|
256
|
+
|
|
257
|
+
### data-box-shadow (or box-shadow)
|
|
258
|
+
|
|
259
|
+
###### Type: **String** (e.g. data-box-shadow="inset 0 0 100px #222") | Default: **none** | _optional_
|
|
260
|
+
|
|
261
|
+
Apply box shadow for container.
|
|
262
|
+
|
|
263
|
+
### data-bottom-circle (or bottom-circle)
|
|
264
|
+
|
|
265
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
266
|
+
|
|
267
|
+
Display 360 view line at the bottom of container.
|
|
268
|
+
|
|
269
|
+
### data-hide-360-logo (or hide-360-logo)
|
|
270
|
+
|
|
271
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
272
|
+
|
|
273
|
+
Hide 360 view icon.
|
|
274
|
+
|
|
275
|
+
### data-logo-src (or logo-src)
|
|
276
|
+
|
|
277
|
+
###### Type: **String** | Default: **https://scaleflex.ultrafast.io/https://scaleflex.airstore.io/filerobot/js-cloudimage-360-view/360_view.svg** | _optional_
|
|
278
|
+
|
|
279
|
+
URL of asset to use as the 360 view icon.
|
|
280
|
+
|
|
281
|
+
### data-control-reverse (or control-reverse)
|
|
282
|
+
|
|
283
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
284
|
+
|
|
285
|
+
Spin direction using controls, by default it uses counterclockwise (image indexes from 1 to data-amount).
|
|
286
|
+
|
|
287
|
+
### data-stop-at-edges (or stop-at-edges)
|
|
288
|
+
|
|
289
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
290
|
+
|
|
291
|
+
Blocks repeating images after reaching last image (or first image in opposite direction)
|
|
292
|
+
|
|
293
|
+
### data-bottom-circle-offset (or bottom-circle-offset)
|
|
294
|
+
|
|
295
|
+
###### Type: **Number** | Default: **5** | _optional_
|
|
296
|
+
|
|
297
|
+
Bottom offset for 360 view line.
|
|
298
|
+
|
|
299
|
+
### data-index-zero-base (or index-zero-base)
|
|
300
|
+
|
|
301
|
+
###### Type: **Number** | _optional_
|
|
302
|
+
|
|
303
|
+
Left zero padding on filename. For example: index-zero-base="4" => image index will be "0004"
|
|
304
|
+
|
|
305
|
+
### data-image-list (or image-list)
|
|
306
|
+
|
|
307
|
+
###### Type: **Array** | _optional_
|
|
308
|
+
|
|
309
|
+
Option to add list of images instead of `folder` & `filename`.
|
|
310
|
+
|
|
311
|
+
example:
|
|
312
|
+
|
|
313
|
+
```javascript
|
|
314
|
+
data-folder="https://scaleflex.airstore.io/demo/360-car/"
|
|
315
|
+
data-image-list='[
|
|
316
|
+
"iris-1.jpeg",
|
|
317
|
+
"iris-4.jpeg",
|
|
318
|
+
"https://scaleflex.airstore.io/demo/360-car/iris-12.jpeg",
|
|
319
|
+
"https://scaleflex.airstore.io/demo/360-car/iris-15.jpeg"
|
|
320
|
+
]’
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
### data-lazyload (or lazyload)
|
|
324
|
+
|
|
325
|
+
###### Type: **Bool** | Default: **false** | _optional_
|
|
326
|
+
|
|
327
|
+
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](#lazy-loading)
|
|
328
|
+
### data-disable-pointer-zoom (or disable-pointer-zoom)
|
|
329
|
+
|
|
330
|
+
###### Type: **bool** | Default: **false** | _optional_
|
|
331
|
+
|
|
332
|
+
Disable pointer zoom on desktop
|
|
333
|
+
|
|
334
|
+
### data-disable-pinch-zoom (or disable-pinch-zoom)
|
|
335
|
+
|
|
336
|
+
###### Type: **bool** | Default: **false** | _optional_
|
|
337
|
+
|
|
338
|
+
Disable pinch zoom on mobile
|
|
339
|
+
### data-to-start-pointer-zoom (or to-start-pointer-zoom)
|
|
340
|
+
|
|
341
|
+
###### Type: **string** | Default: **scroll** | _optional_
|
|
342
|
+
|
|
343
|
+
Events to start pointer zoom
|
|
344
|
+
|
|
345
|
+
Available events (scroll, click)
|
|
346
|
+
|
|
347
|
+
### data-on-mouse-leave (or on-mouse-leave)
|
|
348
|
+
|
|
349
|
+
###### Type: **string** | Default: **none** | _optional_
|
|
350
|
+
|
|
351
|
+
Functions called after mouse leave the container
|
|
352
|
+
|
|
353
|
+
Available functions (resetZoom)
|
|
354
|
+
|
|
355
|
+
Multiple functions can be applied, separated by "," (comma)
|
|
356
|
+
|
|
357
|
+
### data-pointer-zoom-factor (or pointer-zoom-factor)
|
|
358
|
+
|
|
359
|
+
###### Type: **Number** | Default: **2** | _optional_
|
|
360
|
+
|
|
361
|
+
Pointer zoom scaling factor
|
|
362
|
+
### data-pinch-zoom-factor (or pinch-zoom-factor)
|
|
363
|
+
|
|
364
|
+
###### Type: **Number** | Default: **2** | _optional_
|
|
365
|
+
|
|
366
|
+
Pinch zoom scaling factor
|
|
367
|
+
|
|
368
|
+
### data-max-scale (or max-scale)
|
|
369
|
+
|
|
370
|
+
###### Type: **Number** | Default: **none** | _optional_
|
|
371
|
+
|
|
372
|
+
Maximum scale that images can be resize to it with pointer or pinch zoom
|
|
373
|
+
### data-lazyload-selector (or lazyload-selector)
|
|
374
|
+
|
|
375
|
+
###### Type: **String** | Default: **lazyload** | _optional_
|
|
376
|
+
|
|
377
|
+
Helper class to apply lazy-loading depending on library you choose, see [Lazy loading](#lazy-loading)
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
## <a name="controls"></a> Controls
|
|
381
|
+
|
|
382
|
+
You can add controls by adding elements with the following classes: **cloudimage-360-prev**, **cloudimage-360-next**, **cloudimage-360-top**, **cloudimage-360-bottom**
|
|
383
|
+
|
|
384
|
+
### Example CSS
|
|
385
|
+
```css
|
|
386
|
+
.cloudimage-360 .cloudimage-360-prev, .cloudimage-360 .cloudimage-360-next {
|
|
387
|
+
padding: 8px;
|
|
388
|
+
background: rgba(255, 255, 255, 0.5);
|
|
389
|
+
border: none;
|
|
390
|
+
border-radius: 4px;
|
|
391
|
+
}
|
|
392
|
+
.cloudimage-360 .cloudimage-360-prev:focus, .cloudimage-360 .cloudimage-360-next:focus {
|
|
393
|
+
outline: none;
|
|
394
|
+
}
|
|
395
|
+
.cloudimage-360 .cloudimage-360-prev {
|
|
396
|
+
display: none;
|
|
397
|
+
position: absolute;
|
|
398
|
+
z-index: 100;
|
|
399
|
+
top: calc(50% - 15px);
|
|
400
|
+
left: 20px;
|
|
401
|
+
}
|
|
402
|
+
.cloudimage-360 .cloudimage-360-next {
|
|
403
|
+
display: none;
|
|
404
|
+
position: absolute;
|
|
405
|
+
z-index: 100;
|
|
406
|
+
top: calc(50% - 15px);
|
|
407
|
+
right: 20px;
|
|
408
|
+
}
|
|
409
|
+
.cloudimage-360 .cloudimage-360-prev:before, .cloudimage-360 .cloudimage-360-next:before {
|
|
410
|
+
content: '';
|
|
411
|
+
display: block;
|
|
412
|
+
width: 30px;
|
|
413
|
+
height: 30px;
|
|
414
|
+
background: 50% 50% / cover no-repeat;
|
|
415
|
+
}
|
|
416
|
+
.cloudimage-360 .cloudimage-360-prev:before {
|
|
417
|
+
background-image: url('https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/assets/img/arrow-left.svg');
|
|
418
|
+
}
|
|
419
|
+
.cloudimage-360 .cloudimage-360-next:before {
|
|
420
|
+
background-image: url('https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/assets/img/arrow-right.svg');
|
|
421
|
+
}
|
|
422
|
+
.cloudimage-360 .cloudimage-360-prev.not-active, .cloudimage-360 .cloudimage-360-next.not-active {
|
|
423
|
+
opacity: 0.4;
|
|
424
|
+
cursor: default;
|
|
425
|
+
}
|
|
426
|
+
```
|
|
427
|
+
### Example HTML
|
|
428
|
+
```html
|
|
429
|
+
<div
|
|
430
|
+
class="cloudimage-360"
|
|
431
|
+
data-folder="https://scaleflex.airstore.io/demo/indoor/"
|
|
432
|
+
data-filename="{index}.jpeg"
|
|
433
|
+
>
|
|
434
|
+
<button class="cloudimage-360-prev"></button>
|
|
435
|
+
<button class="cloudimage-360-next"></button>
|
|
436
|
+
<button class="cloudimage-360-top"></button>
|
|
437
|
+
<button class="cloudimage-360-bottom"></button>
|
|
438
|
+
</div>
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
<a href="https://codesandbox.io/s/js-cloudimage-360-view-361eb?fontsize=14"><img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="edit in codesandbox"/></a>
|
|
442
|
+
|
|
443
|
+
## <a name="cloudimage-responsive-integration"/> Cloudimage Responsive Integration
|
|
444
|
+
|
|
445
|
+
[See how it works (article on Medium)](https://medium.com/cloudimage/responsive-images-in-2019-now-easier-than-ever-b76e5a43c074)
|
|
446
|
+
|
|
447
|
+
### Requirements
|
|
448
|
+
|
|
449
|
+
To use the Cloudimage Responsive plugin, you will need a
|
|
450
|
+
Cloudimage token to deliver your images over CDN. Don't worry, it only takes seconds to get one by
|
|
451
|
+
registering [here](https://www.cloudimage.io/en/register_page).
|
|
452
|
+
Once your token is created, you can configure it as described below.
|
|
453
|
+
This token allows you to use 25GB of image cache and 25GB of worldwide
|
|
454
|
+
CDN traffic per month for free.
|
|
455
|
+
|
|
456
|
+
### data-responsive (or responsive)
|
|
457
|
+
|
|
458
|
+
###### Type: **String** (Cloudimage token) | Default: **none** | _required for cloudimage responsive plugin_
|
|
459
|
+
|
|
460
|
+
Enables cloudimage responsive plugin for 360 view.
|
|
461
|
+
|
|
462
|
+
### data-transformation (or transformation)
|
|
463
|
+
|
|
464
|
+
###### Type: **String** | Default: **none** | _optional_
|
|
465
|
+
|
|
466
|
+
Applies Cloudimage resize operations to your image, e.g. width, height, crop, face crop, rotate, prevent enlargement...
|
|
467
|
+
Multiple transformation operations can be applied to your image, separated by "```&```" (Ampersand).
|
|
468
|
+
example:
|
|
469
|
+
|
|
470
|
+
```html
|
|
471
|
+
data-transformation="w=400&h=200&func=fit"
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
[Full documentation here.](https://docs.cloudimage.io/go/cloudimage-documentation-v7/en/image-resizing)
|
|
475
|
+
|
|
476
|
+
### data-filters (or filters)
|
|
477
|
+
|
|
478
|
+
###### Type: **String** | Default: **none** | _optional_
|
|
479
|
+
|
|
480
|
+
Applies Cloudimage filters to your image, e.g. brightness, contrast, greyscale, blur, Sharpen...
|
|
481
|
+
Multiple filters can be applied, separated by "```,```" (comma).
|
|
482
|
+
example:
|
|
483
|
+
|
|
484
|
+
```html
|
|
485
|
+
data-filters="bright:15,contrast:30"
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
[Full documentation here.](https://docs.cloudimage.io/go/cloudimage-documentation-v7/en/image-filters)
|
|
489
|
+
|
|
490
|
+
## <a name="lazy-loading"/> Lazy Loading
|
|
491
|
+
|
|
492
|
+
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](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.
|
|
493
|
+
|
|
494
|
+
[Implementation example with lazysizes](https://codesandbox.io/s/w7vx5w1ln7?fontsize=14)
|
|
495
|
+
|
|
496
|
+
[Implementation example with yall.js](https://codesandbox.io/s/ym2xrk87xv?fontsize=14)
|
|
497
|
+
|
|
498
|
+
[Implementation example with lozad.js](https://codesandbox.io/s/0185934m8p?fontsize=14)
|
|
499
|
+
|
|
500
|
+
to save API calls you man want to use one of our cdn bundles:
|
|
501
|
+
|
|
502
|
+
CDN link to js-cloudimage-360-view 1.1.0 + lazysizes 4.1.7
|
|
503
|
+
|
|
504
|
+
```javascript
|
|
505
|
+
<script src="https://cdn.scaleflex.it/filerobot/js-cloudimage-360-view/v2.0.0.lazysizes.min.js"></script>
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
CDN link to js-cloudimage-360-view 1.1.0 + yall.js 3.1.1
|
|
509
|
+
|
|
510
|
+
```javascript
|
|
511
|
+
<script src="https://cdn.scaleflex.it/filerobot/js-cloudimage-360-view/v2.0.0.yall.min.js"></script>
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
CDN link to js-cloudimage-360-view 1.1.0 + lozad.js 1.9.0
|
|
515
|
+
|
|
516
|
+
```javascript
|
|
517
|
+
<script src="https://cdn.scaleflex.it/filerobot/js-cloudimage-360-view/v2.0.0.lozad.min.js"></script>
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
## <a name="best-practices"/> Best practices
|
|
522
|
+
|
|
523
|
+
* In order to use cloudimage responsive with 360 view, your original (master) images should be stored on a server
|
|
524
|
+
or storage bucket (S3, Google Cloud, Azure Blob...) reachable over
|
|
525
|
+
HTTP or HTTPS by Cloudimage. If you want to upload your master images to
|
|
526
|
+
Cloudimage, contact us at
|
|
527
|
+
[hello@cloudimage.io](mailto:hello@cloudimage.io).
|
|
528
|
+
|
|
529
|
+
## <a name="browser_support"></a> Browser support
|
|
530
|
+
|
|
531
|
+
Tested in all modern browsers and IE 11, 10, 9.
|
|
532
|
+
|
|
533
|
+
## <a name="ui_family"></a>Filerobot UI Familiy
|
|
534
|
+
|
|
535
|
+
* [JS Cloudimage Responsive](https://github.com/scaleflex/js-cloudimage-responsive)
|
|
536
|
+
* [React Cloudimage Responsive](https://github.com/scaleflex/react-cloudimage-responsive)
|
|
537
|
+
* [Angular Cloudimage Responsive](https://github.com/scaleflex/ng-cloudimage-responsive)
|
|
538
|
+
* [Image Editor](https://github.com/scaleflex/filerobot-image-editor)
|
|
539
|
+
* [Uploader](https://github.com/scaleflex/filerobot-uploader)
|
|
540
|
+
|
|
541
|
+
## <a name="contributing"></a>Contributing!
|
|
542
|
+
|
|
543
|
+
All contributions are super welcome!
|
|
544
|
+
|
|
545
|
+
## <a name="license"></a>License
|
|
546
|
+
JS Cloudimage 360 View is provided under the [MIT License](https://opensource.org/licenses/MIT)
|
|
547
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var TO_START_POINTER_ZOOM = {
|
|
7
|
+
SCROLL_TO_START: 'scroll',
|
|
8
|
+
CLICK_TO_START: 'click'
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
var MOUSE_LEAVE_ACTIONS = {
|
|
12
|
+
RESET_ZOOM: 'resetZoom'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var ORIENTATIONS = {
|
|
16
|
+
X: 'x-axis',
|
|
17
|
+
Y: 'y-axis',
|
|
18
|
+
CENTER: 'center'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var AUTOPLAY_BEHAVIOR = {
|
|
22
|
+
SPIN_X: 'spin-x',
|
|
23
|
+
SPIN_Y: 'spin-y',
|
|
24
|
+
SPIN_XY: 'spin-xy',
|
|
25
|
+
SPIN_YX: 'spin-yx'
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.TO_START_POINTER_ZOOM = TO_START_POINTER_ZOOM;
|
|
29
|
+
exports.MOUSE_LEAVE_ACTIONS = MOUSE_LEAVE_ACTIONS;
|
|
30
|
+
exports.ORIENTATIONS = ORIENTATIONS;
|
|
31
|
+
exports.AUTOPLAY_BEHAVIOR = AUTOPLAY_BEHAVIOR;
|