js-cloudimage-360-view 3.0.0 → 3.0.3
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 +19 -4
- package/README.md +64 -39
- package/dist/ci360.service.js +6 -16
- package/dist/ci360.utils.js +1 -1
- package/dist/static/css/hotspots.css +21 -28
- package/dist/static/css/style.css +3 -3
- package/dist/utils/container-elements/create-360-view-circle-icon.js +1 -1
- package/dist/utils/image-src/generate-images-path.js +6 -4
- package/dist/utils/load-images/images-from-list/prepare-images-from-list.js +1 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,7 +14,7 @@ Types of changes:
|
|
|
14
14
|
|
|
15
15
|
> Date format: YYYY-MM-DD
|
|
16
16
|
|
|
17
|
-
> If we have some "Breaking changes" we can mark it in message by `**BREAKING**` preffix, like:
|
|
17
|
+
> If we have some "Breaking changes" we can mark it in message by `**BREAKING**` preffix, like:
|
|
18
18
|
> `- **BREAKING**: Some message`
|
|
19
19
|
|
|
20
20
|
-------------
|
|
@@ -25,11 +25,26 @@ Types of changes:
|
|
|
25
25
|
- ...
|
|
26
26
|
|
|
27
27
|
-------------
|
|
28
|
+
## 3.0.3 - 2022-05-04
|
|
29
|
+
### Fixed
|
|
30
|
+
- Error on loading original images from image list
|
|
31
|
+
|
|
32
|
+
## 3.0.2 - 2022-05-04
|
|
33
|
+
### Changed
|
|
34
|
+
- documentation
|
|
35
|
+
|
|
36
|
+
## 3.0.1 - 2022-03-28
|
|
37
|
+
### Changed
|
|
38
|
+
- hotspots icons
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
- loader is hidden if hide-360-logo is active
|
|
42
|
+
|
|
28
43
|
## 3.0.0 - 2022-03-25
|
|
29
44
|
### Added
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
45
|
+
- possibility to add makers or hotspots to each image
|
|
46
|
+
- possibility add views after init the plugin
|
|
47
|
+
- possibility to update views
|
|
33
48
|
### Fixed
|
|
34
49
|
- hide 360 logo after play once
|
|
35
50
|
|
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
[](https://github.com/scaleflex/js-cloudimage-360-view/releases)
|
|
2
|
+
[](https://img.shields.io/bundlephobia/min/js-cloudimage-360-view)
|
|
3
|
+
[](https://img.shields.io/npm/dt/js-cloudimage-360-view?logoColor=orange)
|
|
3
4
|
[](#contributing)
|
|
4
5
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](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)
|
|
6
|
+
[](https://www.scaleflex.com/en/home)
|
|
7
|
+
[](https://www.cloudimage.io/en/home)
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
10
|
<img
|
|
11
|
-
alt="
|
|
11
|
+
alt="cloudimage logo"
|
|
12
12
|
src="https://scaleflex.cloudimg.io/v7/cloudimage.io/LOGO+WITH+SCALEFLEX-01.png?vh=f6080d&w=350">
|
|
13
13
|
</p>
|
|
14
14
|
|
|
@@ -22,24 +22,20 @@
|
|
|
22
22
|
•
|
|
23
23
|
<a href="https://scaleflex.github.io/js-cloudimage-360-view/" target="_blank">Demo</a>
|
|
24
24
|
•
|
|
25
|
-
<a href="https://codesandbox.io/s/
|
|
25
|
+
<a href="https://codesandbox.io/s/js-cloudimage-360-view-examples-npne18" target="_blank">Code Sandbox</a>
|
|
26
26
|
•
|
|
27
27
|
<a href="https://youtu.be/zXUgrvZ7FMc" target="_blank">Video Tutorial</a>
|
|
28
28
|
•
|
|
29
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
30
|
</strong>
|
|
31
31
|
</p>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<p align="left">
|
|
32
|
+
<p align="center">A simple, interactive resource that can be used to provide a virtual tour of your product.</p>
|
|
33
|
+
<p align="center">
|
|
35
34
|
<img
|
|
36
35
|
alt="The Lounge"
|
|
37
|
-
src="https://scaleflex.cloudimg.io/v7/
|
|
36
|
+
src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/demos/assets/a2.gif">
|
|
38
37
|
</p>
|
|
39
38
|
|
|
40
|
-
powered by [Cloudimage](https://www.cloudimage.io/)
|
|
41
|
-
([Watch the video here](https://www.youtube.com/watch?v=tk4j_MpqvM8))
|
|
42
|
-
|
|
43
39
|
## <a name="table_of_contents"></a>Table of contents
|
|
44
40
|
|
|
45
41
|
* [Demo](#demo)
|
|
@@ -49,6 +45,7 @@ powered by [Cloudimage](https://www.cloudimage.io/)
|
|
|
49
45
|
* [Customize elements](#customize-elements)
|
|
50
46
|
* [Configuration](#configuration)
|
|
51
47
|
* [Controls](#controls)
|
|
48
|
+
* [Spin in X and Y axis](#spin_x_y)
|
|
52
49
|
* [Hotspots](#hotspots)
|
|
53
50
|
* [Cloudimage responsive integration](#cloudimage-responsive-integration)
|
|
54
51
|
* [Lazy loading integration](#lazy-loading)
|
|
@@ -69,7 +66,7 @@ To see the Cloudimage 360 view plugin in action, please check out the
|
|
|
69
66
|
Add script tag with CDN link to js-cloudimage-360-view lib after all content in body tag
|
|
70
67
|
|
|
71
68
|
```javascript
|
|
72
|
-
<script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/3.0.
|
|
69
|
+
<script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/3.0.3/js-cloudimage-360-view.min.js"></script>
|
|
73
70
|
```
|
|
74
71
|
|
|
75
72
|
## <a name="initialize"></a>Step 2: Initialize
|
|
@@ -87,7 +84,7 @@ After adding the js-cloudimage-360-view lib, simply initialize it with **class n
|
|
|
87
84
|
></div>
|
|
88
85
|
```
|
|
89
86
|
|
|
90
|
-
<a href="https://codesandbox.io/s/
|
|
87
|
+
<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>
|
|
91
88
|
|
|
92
89
|
## <a name="methods"></a> Methods
|
|
93
90
|
|
|
@@ -104,7 +101,7 @@ window.CI360.init();
|
|
|
104
101
|
> 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
|
|
105
102
|
> ```javascript
|
|
106
103
|
> <script>window.CI360 = { notInitOnLoad: true }</script>
|
|
107
|
-
> <script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/3.0
|
|
104
|
+
> <script src="https://cdn.scaleflex.it/plugins/js-cloudimage-360-view/3.0./js-cloudimage-360-view.min.js"></script>
|
|
108
105
|
> <script>window.CI360.init(); // initialize the plugin when you need</script>
|
|
109
106
|
> ```
|
|
110
107
|
|
|
@@ -120,6 +117,8 @@ lazy init cloudimage-360 view by id.
|
|
|
120
117
|
#### `idOftheView`: string
|
|
121
118
|
The id of the new view
|
|
122
119
|
|
|
120
|
+
<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>
|
|
121
|
+
|
|
123
122
|
### update
|
|
124
123
|
|
|
125
124
|
###### Type: **Function**
|
|
@@ -152,6 +151,8 @@ window.CI360.update('gurkha-suv');
|
|
|
152
151
|
window.CI360.update(null, true);
|
|
153
152
|
```
|
|
154
153
|
|
|
154
|
+
<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>
|
|
155
|
+
|
|
155
156
|
### destroy
|
|
156
157
|
|
|
157
158
|
###### Type: **Function**
|
|
@@ -161,7 +162,7 @@ Destroying a cloudimage 360 viewer instance will reset the HTML to its original
|
|
|
161
162
|
```javascript
|
|
162
163
|
window.CI360.destroy();
|
|
163
164
|
```
|
|
164
|
-
<a href="https://codesandbox.io/s/js-cloudimage-360-view-
|
|
165
|
+
<a href="https://codesandbox.io/s/js-cloudimage-360-view-examples-03pb2t">
|
|
165
166
|
<img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="edit in codesandbox"/></a>
|
|
166
167
|
|
|
167
168
|
### getActiveIndexByID
|
|
@@ -195,10 +196,10 @@ You can customize elements by adding the following classes:
|
|
|
195
196
|
bottom: 0;
|
|
196
197
|
}
|
|
197
198
|
.cloudimage-360-magnifier-icon {
|
|
198
|
-
background: url(https://scaleflex.
|
|
199
|
+
background: url(https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/loupe.svg) 50% 50% / cover no-repeat;
|
|
199
200
|
}
|
|
200
201
|
.cloudimage-360-close-fullscreen-icon {
|
|
201
|
-
background: url(https://scaleflex.
|
|
202
|
+
background: url(https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/cross.svg) 50% 50% / cover no-repeat;
|
|
202
203
|
}
|
|
203
204
|
.cloudimage-360-view-360-circle {
|
|
204
205
|
margin: auto;
|
|
@@ -207,7 +208,7 @@ You can customize elements by adding the following classes:
|
|
|
207
208
|
margin: auto;
|
|
208
209
|
}
|
|
209
210
|
.cloudimage-360-view-360-icon {
|
|
210
|
-
background: url(
|
|
211
|
+
background: url(https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/360_view.svg) 50% 50% / cover no-repeat;
|
|
211
212
|
}
|
|
212
213
|
.cloudimage-360-box-shadow {
|
|
213
214
|
top: 0;
|
|
@@ -257,12 +258,12 @@ The filename pattern for your 360 image. Must include {index}, which the library
|
|
|
257
258
|
###### Type: **String** | Default: **image-y-{index}.jpg** | _optional_
|
|
258
259
|
The same for [data-amount-x](#data-amount-x) but for images set in Y-axis.
|
|
259
260
|
|
|
260
|
-
###
|
|
261
|
+
### data-amount-x (or amount-x)
|
|
261
262
|
###### Type: **Number** | Default: **36** | _optional_
|
|
262
263
|
|
|
263
264
|
Amount of images to load in X-axis for 360 view .
|
|
264
265
|
|
|
265
|
-
###
|
|
266
|
+
### data-amount-y (or amount-y)
|
|
266
267
|
|
|
267
268
|
###### Type: **Number** | Default: **0** | _optional_
|
|
268
269
|
|
|
@@ -327,7 +328,7 @@ Setting the height relative to the container width according to the provided rat
|
|
|
327
328
|
data-ratio="2"
|
|
328
329
|
></div>
|
|
329
330
|
```
|
|
330
|
-
<a href="https://codesandbox.io/s/js-cloudimage-360-view-
|
|
331
|
+
<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>
|
|
331
332
|
#### `ratio`: JSON
|
|
332
333
|
Setting the height relative to the container width at any window size.
|
|
333
334
|
|
|
@@ -350,7 +351,7 @@ and 2.22 at window size less than or equal to 768px.
|
|
|
350
351
|
}'
|
|
351
352
|
></div>
|
|
352
353
|
```
|
|
353
|
-
<a href="https://codesandbox.io/s/js-cloudimage-360-view-
|
|
354
|
+
<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>
|
|
354
355
|
|
|
355
356
|
### data-autoplay-reverse (or autoplay-reverse)
|
|
356
357
|
|
|
@@ -432,12 +433,12 @@ Option to add list of images in x-oriantation instead of `folder` , `filename-x`
|
|
|
432
433
|
example:
|
|
433
434
|
|
|
434
435
|
```javascript
|
|
435
|
-
data-folder="https://scaleflex.
|
|
436
|
+
data-folder="https://scaleflex.cloudimg.io/v7/demo/360-car/"
|
|
436
437
|
data-image-list-x='[
|
|
437
438
|
"iris-1.jpeg",
|
|
438
439
|
"iris-4.jpeg",
|
|
439
|
-
"https://scaleflex.
|
|
440
|
-
"https://scaleflex.
|
|
440
|
+
"https://scaleflex.cloudimg.io/v7/demo/360-car/iris-12.jpeg",
|
|
441
|
+
"https://scaleflex.cloudimg.io/v7/demo/360-car/iris-15.jpeg"
|
|
441
442
|
]’
|
|
442
443
|
```
|
|
443
444
|
|
|
@@ -450,12 +451,12 @@ Option to add list of images in y-oriantation instead of `folder` , `filename-y`
|
|
|
450
451
|
example:
|
|
451
452
|
|
|
452
453
|
```javascript
|
|
453
|
-
data-folder="https://scaleflex.
|
|
454
|
+
data-folder="https://scaleflex.cloudimg.io/v7/demo/360-car/"
|
|
454
455
|
data-image-list-y='[
|
|
455
456
|
"iris-2-y.jpeg",
|
|
456
457
|
"iris-6-y.jpeg",
|
|
457
|
-
"https://scaleflex.
|
|
458
|
-
"https://scaleflex.
|
|
458
|
+
"https://scaleflex.cloudimg.io/v7/demo/360-car/iris-8-y.jpeg",
|
|
459
|
+
"https://scaleflex.cloudimg.io/v7/demo/360-car/iris-30-y.jpeg"
|
|
459
460
|
]’
|
|
460
461
|
```
|
|
461
462
|
### data-pointer-zoom (or pointer-zoom)
|
|
@@ -484,7 +485,7 @@ Helper class to apply lazy-loading depending on library you choose, see [Lazy lo
|
|
|
484
485
|
|
|
485
486
|
## <a name="controls"></a> Controls
|
|
486
487
|
|
|
487
|
-
You can add controls by adding elements with the following classes: **cloudimage-360-left**, **cloudimage-360-right**, **cloudimage-360-top**, **cloudimage-360-bottom
|
|
488
|
+
You can add controls by adding elements with the following classes: **cloudimage-360-left**, **cloudimage-360-right**, **cloudimage-360-top**, **cloudimage-360-bottom
|
|
488
489
|
|
|
489
490
|
### Example CSS
|
|
490
491
|
```css
|
|
@@ -533,7 +534,7 @@ You can add controls by adding elements with the following classes: **cloudimage
|
|
|
533
534
|
```html
|
|
534
535
|
<div
|
|
535
536
|
class="cloudimage-360"
|
|
536
|
-
data-folder="https://scaleflex.
|
|
537
|
+
data-folder="https://scaleflex.cloudimg.io/v7/demo/360-car/"
|
|
537
538
|
data-filename-x="{index}.jpeg"
|
|
538
539
|
>
|
|
539
540
|
<button class="cloudimage-360-left"></button>
|
|
@@ -543,7 +544,31 @@ You can add controls by adding elements with the following classes: **cloudimage
|
|
|
543
544
|
</div>
|
|
544
545
|
```
|
|
545
546
|
|
|
546
|
-
<a href="https://codesandbox.io/s/js-cloudimage-360-view-
|
|
547
|
+
<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>
|
|
548
|
+
|
|
549
|
+
## <a name="spin_x_y"/> Spin in X and Y axes
|
|
550
|
+
Allow the view to spin in both X, Y axes
|
|
551
|
+
### Requirements
|
|
552
|
+
We need to provide the `file-name` of the y-axis images using <a href="#data-filename-y-or-filename-y">data-filename-y</a>
|
|
553
|
+
|
|
554
|
+
Also 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>
|
|
555
|
+
so 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.
|
|
556
|
+
example:
|
|
557
|
+
|
|
558
|
+
```javascript
|
|
559
|
+
<div
|
|
560
|
+
class="cloudimage-360"
|
|
561
|
+
data-folder="https://scaleflex.cloudimg.io/v7/demo/360-nike/"
|
|
562
|
+
data-filename-x="nike-{index}.jpg"
|
|
563
|
+
data-filename-y="nike-y-{index}.jpg"
|
|
564
|
+
data-amount-x="35"
|
|
565
|
+
data-amount-y="36"
|
|
566
|
+
>
|
|
567
|
+
</div>
|
|
568
|
+
```
|
|
569
|
+
<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>
|
|
570
|
+
> Note: We can initilize the view in x, y axes without providing add `data-folder`, `data-amount-y`, `data-amount-y`.</br>
|
|
571
|
+
Just we need to provide the <a href="#data-amount-y-or-amount-y">data-amount-y</a>
|
|
547
572
|
## <a name="hotspots"/> Hotspots or Markers
|
|
548
573
|
Display information about the product on specific areas. Once a hotspot is created it can be used on more than one image.
|
|
549
574
|
### Requirements
|
|
@@ -688,7 +713,7 @@ example:
|
|
|
688
713
|
```js
|
|
689
714
|
window.CI360.addHotspots("gurkha-suv", HOTSPOTS_CONFIG);
|
|
690
715
|
```
|
|
691
|
-
<a href="https://codesandbox.io/s/competent-bogdan-49b0u6
|
|
716
|
+
<a href="https://codesandbox.io/s/competent-bogdan-49b0u6"><img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="edit in codesandbox"/></a>
|
|
692
717
|
|
|
693
718
|
### data-responsive (or responsive)
|
|
694
719
|
|
|
@@ -747,11 +772,11 @@ data-filters="bright:15,contrast:30"
|
|
|
747
772
|
|
|
748
773
|
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.
|
|
749
774
|
|
|
750
|
-
[Implementation example with lazysizes](https://codesandbox.io/s/
|
|
775
|
+
[Implementation example with lazysizes](https://codesandbox.io/s/js-cloudimage-360-view-examples-ux850x)
|
|
751
776
|
|
|
752
|
-
[Implementation example with yall.js](https://codesandbox.io/s/
|
|
777
|
+
[Implementation example with yall.js](https://codesandbox.io/s/js-cloudimage-360-view-xjpdg1)
|
|
753
778
|
|
|
754
|
-
[Implementation example with lozad.js](https://codesandbox.io/s/
|
|
779
|
+
[Implementation example with lozad.js](https://codesandbox.io/s/js-cloudimage-360-view-examples-8iukcn)
|
|
755
780
|
|
|
756
781
|
## <a name="best-practices"/> Best practices
|
|
757
782
|
|
|
@@ -778,4 +803,4 @@ Tested in all modern browsers and IE 11, 10, 9.
|
|
|
778
803
|
All contributions are super welcome!
|
|
779
804
|
|
|
780
805
|
## <a name="license"></a>License
|
|
781
|
-
JS Cloudimage 360 View is provided under the [MIT License](https://opensource.org/licenses/MIT)
|
|
806
|
+
JS Cloudimage 360 View is provided under the [MIT License](https://opensource.org/licenses/MIT)
|
package/dist/ci360.service.js
CHANGED
|
@@ -117,6 +117,10 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
117
117
|
if (isMouseOnHotspotElement) {
|
|
118
118
|
this.isClicked = false;
|
|
119
119
|
}
|
|
120
|
+
|
|
121
|
+
if (this.hotspotsConfigs) {
|
|
122
|
+
(0, _utils.updateHotspots)(this.container, this.hotspotsConfigs, this.activeImageX, this.activeImageY, this.movingDirection);
|
|
123
|
+
}
|
|
120
124
|
}
|
|
121
125
|
}, {
|
|
122
126
|
key: "mouseUp",
|
|
@@ -821,7 +825,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
821
825
|
}, {
|
|
822
826
|
key: "onFirstImageLoaded",
|
|
823
827
|
value: function onFirstImageLoaded(image) {
|
|
824
|
-
|
|
828
|
+
this.add360ViewIcon();
|
|
825
829
|
var ctx = this.canvas.getContext("2d");
|
|
826
830
|
ctx.scale(this.devicePixelRatio, this.devicePixelRatio);
|
|
827
831
|
this.updateContainerAndCanvasSize(image);
|
|
@@ -862,10 +866,6 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
862
866
|
if (this.fullscreen && !this.fullscreenView) {
|
|
863
867
|
this.addFullscreenIcon();
|
|
864
868
|
}
|
|
865
|
-
|
|
866
|
-
if (this.hotspotsConfigs && !this.autoplay) {
|
|
867
|
-
(0, _utils.updateHotspots)(this.container, this.hotspotsConfigs, this.activeImageX, this.activeImageY, this.movingDirection);
|
|
868
|
-
}
|
|
869
869
|
}
|
|
870
870
|
}, {
|
|
871
871
|
key: "onAllImagesLoaded",
|
|
@@ -890,16 +890,13 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
890
890
|
}
|
|
891
891
|
|
|
892
892
|
if (this.view360Icon) {
|
|
893
|
+
if (this.hide360Logo) return this.remove360ViewIcon();
|
|
893
894
|
this.view360Icon.innerText = ''; //TODO [deprecated]: remove setView360Icon in the upcoming versions
|
|
894
895
|
|
|
895
896
|
if (this.logoSrc) (0, _ci.setView360Icon)(this.view360Icon, this.logoSrc);
|
|
896
897
|
}
|
|
897
898
|
|
|
898
899
|
this.initControls();
|
|
899
|
-
|
|
900
|
-
if (this.hotspotsConfigs && !this.autoplay) {
|
|
901
|
-
(0, _utils.updateHotspots)(this.container, this.hotspotsConfigs, this.activeImageX, this.activeImageY, this.movingDirection);
|
|
902
|
-
}
|
|
903
900
|
}
|
|
904
901
|
}, {
|
|
905
902
|
key: "magnify",
|
|
@@ -968,13 +965,6 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
968
965
|
window.clearTimeout(_this4.loopTimeoutId);
|
|
969
966
|
_this4.autoplay = false;
|
|
970
967
|
|
|
971
|
-
if (!_this4.hide360Logo) {
|
|
972
|
-
_this4.add360ViewIcon();
|
|
973
|
-
|
|
974
|
-
_this4.view360Icon.innerText = '';
|
|
975
|
-
(0, _ci.setView360Icon)(_this4.view360Icon, _this4.logoSrc);
|
|
976
|
-
}
|
|
977
|
-
|
|
978
968
|
if (_this4.hotspotsConfigs) {
|
|
979
969
|
(0, _utils.updateHotspots)(_this4.container, _this4.hotspotsConfigs, _this4.activeImageX, _this4.activeImageY, _this4.movingDirection, _this4.isClicked);
|
|
980
970
|
}
|
package/dist/ci360.utils.js
CHANGED
|
@@ -45,7 +45,7 @@ var get360ViewProps = function get360ViewProps(image) {
|
|
|
45
45
|
controlReverse: isTrue(image, 'control-reverse'),
|
|
46
46
|
stopAtEdges: isTrue(image, 'stop-at-edges'),
|
|
47
47
|
hide360Logo: isTrue(image, 'hide-360-logo'),
|
|
48
|
-
logoSrc: attr(image, 'logo-src') || 'https://scaleflex.
|
|
48
|
+
logoSrc: attr(image, 'logo-src') || 'https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/360_view.svg',
|
|
49
49
|
ratio: attr(image, 'ratio') || attr(image, 'data-ratio'),
|
|
50
50
|
imageInfo: attr(image, 'info') || attr(image, 'data-info') || isTrue(image, 'info')
|
|
51
51
|
};
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
.cloudimage-360-hotspot-link-icon::before {
|
|
13
13
|
content: '';
|
|
14
14
|
position: absolute;
|
|
15
|
-
width:
|
|
16
|
-
height:
|
|
15
|
+
width: 16px;
|
|
16
|
+
height: 16px;
|
|
17
17
|
background-image: url('https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/link-hotspot.svg');
|
|
18
18
|
background-color: #0C6DC7;
|
|
19
19
|
background-repeat: no-repeat;
|
|
20
|
-
background-size:
|
|
20
|
+
background-size: 17px 7px;
|
|
21
21
|
background-position: center;
|
|
22
22
|
left: 50%;
|
|
23
23
|
top: 50%;
|
|
@@ -42,30 +42,19 @@
|
|
|
42
42
|
.cloudimage-360-hotspot-custom-icon::before {
|
|
43
43
|
content: '';
|
|
44
44
|
position: absolute;
|
|
45
|
-
width:
|
|
46
|
-
height:
|
|
47
|
-
|
|
48
|
-
top: 50%;
|
|
49
|
-
transform: translate(-50%, -50%);
|
|
50
|
-
box-sizing: border-box;
|
|
45
|
+
width: 16px;
|
|
46
|
+
height: 16px;
|
|
47
|
+
background-image: url('https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/plus.svg');
|
|
51
48
|
background-color: #76AD01;
|
|
52
49
|
background-repeat: no-repeat;
|
|
53
|
-
background-size:
|
|
50
|
+
background-size: 17px 7px;
|
|
54
51
|
background-position: center;
|
|
55
|
-
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.25);
|
|
56
|
-
border-radius: 50%;
|
|
57
|
-
animation: pulse 2s infinite;
|
|
58
|
-
cursor: auto;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.cloudimage-360-hotspot-custom-icon::after {
|
|
62
|
-
content: '+';
|
|
63
|
-
position: absolute;
|
|
64
52
|
left: 50%;
|
|
65
53
|
top: 50%;
|
|
66
|
-
color: #FFF;
|
|
67
|
-
font-weight: 400;
|
|
68
54
|
transform: translate(-50%, -50%);
|
|
55
|
+
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.25);
|
|
56
|
+
border-radius: 50%;
|
|
57
|
+
animation: pulse 2s infinite;
|
|
69
58
|
cursor: auto;
|
|
70
59
|
}
|
|
71
60
|
|
|
@@ -103,19 +92,23 @@
|
|
|
103
92
|
transform: rotate(45deg);
|
|
104
93
|
}
|
|
105
94
|
|
|
106
|
-
.cloudimage-360-hotspot-popup[data-popper-placement^='top']
|
|
95
|
+
.cloudimage-360-hotspot-popup[data-popper-placement^='top']
|
|
96
|
+
> .cloudimage-360-popup-arrow {
|
|
107
97
|
bottom: -4px;
|
|
108
98
|
}
|
|
109
99
|
|
|
110
|
-
.cloudimage-360-hotspot-popup[data-popper-placement^='bottom']
|
|
100
|
+
.cloudimage-360-hotspot-popup[data-popper-placement^='bottom']
|
|
101
|
+
> .cloudimage-360-popup-arrow {
|
|
111
102
|
top: -4px;
|
|
112
103
|
}
|
|
113
104
|
|
|
114
|
-
.cloudimage-360-hotspot-popup[data-popper-placement^='left']
|
|
105
|
+
.cloudimage-360-hotspot-popup[data-popper-placement^='left']
|
|
106
|
+
> .cloudimage-360-popup-arrow {
|
|
115
107
|
right: -4px;
|
|
116
108
|
}
|
|
117
109
|
|
|
118
|
-
.cloudimage-360-hotspot-popup[data-popper-placement^='right']
|
|
110
|
+
.cloudimage-360-hotspot-popup[data-popper-placement^='right']
|
|
111
|
+
> .cloudimage-360-popup-arrow {
|
|
119
112
|
left: -4px;
|
|
120
113
|
}
|
|
121
114
|
|
|
@@ -148,7 +141,7 @@
|
|
|
148
141
|
|
|
149
142
|
.cloudimage-360-carousel-dots {
|
|
150
143
|
display: flex;
|
|
151
|
-
column-gap:
|
|
144
|
+
column-gap: 6px;
|
|
152
145
|
justify-content: center;
|
|
153
146
|
flex-wrap: wrap;
|
|
154
147
|
margin: 5px auto;
|
|
@@ -158,8 +151,8 @@
|
|
|
158
151
|
}
|
|
159
152
|
|
|
160
153
|
.cloudimage-360-carousel-dot {
|
|
161
|
-
width:
|
|
162
|
-
height:
|
|
154
|
+
width: 6px;
|
|
155
|
+
height: 6px;
|
|
163
156
|
background-color: #C9D0DE;
|
|
164
157
|
border-radius: 50%;
|
|
165
158
|
cursor: pointer;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
height: 25px;
|
|
16
16
|
margin-bottom: 5px;
|
|
17
17
|
cursor: pointer;
|
|
18
|
-
background: url('https://scaleflex.
|
|
18
|
+
background: url('https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/loupe.svg') 50% 50% / cover no-repeat;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
.cloudimage-360-fullscreen-icon {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
height: 25px;
|
|
24
24
|
margin-bottom: 5px;
|
|
25
25
|
cursor: pointer;
|
|
26
|
-
background: url('https://scaleflex.
|
|
26
|
+
background: url('https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/full_screen.svg') 50% 50% / cover no-repeat;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
.cloudimage-360-reset-zoom-icon {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
width: 25px;
|
|
40
40
|
height: 25px;
|
|
41
41
|
cursor: pointer;
|
|
42
|
-
background: url('https://scaleflex.
|
|
42
|
+
background: url('https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/cross.svg') 50% 50% / cover no-repeat;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.cloudimage-360-loader {
|
|
@@ -7,7 +7,7 @@ exports.create360ViewCircleIcon = void 0;
|
|
|
7
7
|
|
|
8
8
|
var create360ViewCircleIcon = function create360ViewCircleIcon(circleOffset) {
|
|
9
9
|
var view360CircleIcon = new Image();
|
|
10
|
-
view360CircleIcon.src = 'https://scaleflex.
|
|
10
|
+
view360CircleIcon.src = 'https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/360.svg';
|
|
11
11
|
view360CircleIcon.style.bottom = "".concat(circleOffset, "%");
|
|
12
12
|
view360CircleIcon.className = 'cloudimage-360-view-360-circle';
|
|
13
13
|
return view360CircleIcon;
|
|
@@ -11,7 +11,7 @@ var _getResponsiveWidthOfContainer = require("../responsive/get-responsive-width
|
|
|
11
11
|
|
|
12
12
|
var _getSizeAccordingToPixelRatio = require("../responsive/get-size-according-to-pixel-ratio");
|
|
13
13
|
|
|
14
|
-
var generateImagesPath = function generateImagesPath(srcConfig) {
|
|
14
|
+
var generateImagesPath = function generateImagesPath(srcConfig, loadOriginalImages) {
|
|
15
15
|
var container = srcConfig.container,
|
|
16
16
|
folder = srcConfig.folder,
|
|
17
17
|
apiVersion = srcConfig.apiVersion,
|
|
@@ -28,10 +28,12 @@ var generateImagesPath = function generateImagesPath(srcConfig) {
|
|
|
28
28
|
|
|
29
29
|
if (ciToken) {
|
|
30
30
|
var imageOffsetWidth = container.offsetWidth;
|
|
31
|
-
var
|
|
32
|
-
var finalApiVersion =
|
|
31
|
+
var version = !(_falsyValues.FALSY_VALUES.indexOf(apiVersion) !== -1) ? apiVersion : null;
|
|
32
|
+
var finalApiVersion = version ? "".concat(version, "/") : '';
|
|
33
33
|
var ciSizeNext = (0, _getSizeAccordingToPixelRatio.getSizeAccordingToPixelRatio)((0, _getResponsiveWidthOfContainer.getResponsiveWidthOfContainer)(imageOffsetWidth));
|
|
34
|
-
|
|
34
|
+
var isCloudImageUrl = new URL(src).origin.indexOf('cloudimg') !== -1;
|
|
35
|
+
var cdn = isCloudImageUrl ? src : "https://".concat(ciToken, ".cloudimg.io/").concat(finalApiVersion).concat(src);
|
|
36
|
+
src = "".concat(cdn, "?").concat(ciTransformation || "".concat(!loadOriginalImages ? "width=".concat(ciSizeNext) : '', " ")).concat(ciFilters ? "&f=".concat(ciFilters) : '');
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
return src;
|
|
@@ -22,13 +22,7 @@ var prepareImagesFromList = function prepareImagesFromList(images, srcConfig, lo
|
|
|
22
22
|
|
|
23
23
|
nextSrcConfig.folder = /(http(s?)):\/\//gi.test(src) ? '' : folder;
|
|
24
24
|
nextSrcConfig.filename = src;
|
|
25
|
-
|
|
26
|
-
if (loadOriginalImages) {
|
|
27
|
-
var lastIndex = resultSrc.lastIndexOf('//');
|
|
28
|
-
return resultSrc.slice(lastIndex);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return (0, _generateImagesPath.generateImagesPath)(nextSrcConfig);
|
|
25
|
+
return (0, _generateImagesPath.generateImagesPath)(nextSrcConfig, loadOriginalImages);
|
|
32
26
|
});
|
|
33
27
|
};
|
|
34
28
|
|