js-cloudimage-360-view 2.7.2-beta.7 → 2.7.5
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 +27 -3
- package/LICENSE +13 -1
- package/README.md +154 -90
- package/dist/ci360.service.js +123 -88
- package/dist/ci360.utils.js +3 -4
- package/dist/constants/auto-play-behavior.js +13 -0
- package/dist/constants/falsy-values.js +8 -0
- package/dist/constants/image-src-props.js +8 -0
- package/dist/constants/index.js +43 -0
- package/dist/constants/orientations.js +12 -0
- package/dist/constants/regex.js +10 -0
- package/dist/index.js +28 -2
- package/dist/utils/auto-play/get-speed-factor.js +14 -0
- package/dist/utils/auto-play/is-completed-one-cycle.js +32 -0
- package/dist/utils/auto-play/loop.js +67 -0
- package/dist/utils/common/add-class.js +18 -0
- package/dist/utils/common/remove-class.js +16 -0
- package/dist/utils/container-elements/apply-styles-to-container.js +16 -0
- package/dist/utils/container-elements/create-360-view-circle-icon.js +16 -0
- package/dist/utils/container-elements/create-360-view-icon.js +15 -0
- package/dist/utils/container-elements/create-box-shadow.js +16 -0
- package/dist/utils/container-elements/create-canvas.js +16 -0
- package/dist/utils/container-elements/create-close-fullscreen-icon.js +14 -0
- package/dist/utils/container-elements/create-fullscreen-icon.js +14 -0
- package/dist/utils/container-elements/create-fullscreen-modal.js +20 -0
- package/dist/utils/container-elements/create-icons-container.js +15 -0
- package/dist/utils/container-elements/create-inner-box.js +15 -0
- package/dist/utils/container-elements/create-loader.js +15 -0
- package/dist/utils/container-elements/create-magnifier-icon.js +14 -0
- package/dist/utils/container-elements/index.js +101 -0
- package/dist/utils/controls/get-item-skipped.js +13 -0
- package/dist/utils/controls/init-controls.js +77 -0
- package/dist/utils/hotspot/attach-popup-events.js +63 -0
- package/dist/utils/hotspot/configs-error-handler.js +30 -0
- package/dist/utils/hotspot/create-popper-instace.js +32 -0
- package/dist/utils/hotspot/elements/create-carousel-dot.js +26 -0
- package/dist/utils/hotspot/elements/create-carousel-image.js +21 -0
- package/dist/utils/hotspot/elements/create-hotspot-icon.js +42 -0
- package/dist/utils/hotspot/elements/create-hotspot-popup-link.js +23 -0
- package/dist/utils/hotspot/elements/create-hotspots.js +20 -0
- package/dist/utils/hotspot/elements/create-images-carousel.js +27 -0
- package/dist/utils/hotspot/elements/create-modal-description.js +15 -0
- package/dist/utils/hotspot/elements/create-modal-title.js +15 -0
- package/dist/utils/hotspot/elements/create-model-elements.js +49 -0
- package/dist/utils/hotspot/elements/create-popup-arrow.js +16 -0
- package/dist/utils/hotspot/elements/create-popup.js +60 -0
- package/dist/utils/hotspot/fill-previous-coord-with-previous.js +26 -0
- package/dist/utils/hotspot/generate-hotspots-configs.js +41 -0
- package/dist/utils/hotspot/generate-popup-config.js +34 -0
- package/dist/utils/hotspot/get-hotspot-icon.js +14 -0
- package/dist/utils/hotspot/get-hotspot-orientation.js +21 -0
- package/dist/utils/hotspot/get-hotspot-popup-node.js +19 -0
- package/dist/utils/hotspot/get-hotspot-variant.js +20 -0
- package/dist/utils/hotspot/get-popup-node.js +14 -0
- package/dist/utils/hotspot/hide-hotspot-icon.js +13 -0
- package/dist/utils/hotspot/hide-hotspots-icons.js +18 -0
- package/dist/utils/hotspot/is-mouse-on-hotspot.js +14 -0
- package/dist/utils/hotspot/prepare-hotspots-positions.js +28 -0
- package/dist/utils/hotspot/set-current-slide.js +23 -0
- package/dist/utils/hotspot/update-hotspot-icon-position.js +21 -0
- package/dist/utils/hotspot/update-hotspots.js +60 -0
- package/dist/utils/image-src/generate-images-path.js +40 -0
- package/dist/utils/image-src/is-src-props-changed.js +23 -0
- package/dist/utils/index.js +237 -0
- package/dist/utils/load-images/images-from-folder/prepare-images-from-folder.js +36 -0
- package/dist/utils/load-images/images-from-list/prepare-images-from-list.js +37 -0
- package/dist/utils/load-images/load-image-as-promise.js +79 -0
- package/dist/utils/load-images/load-image.js +26 -0
- package/dist/utils/load-images/load-images-relative-to-container-size.js +58 -0
- package/dist/utils/load-images/load-original-images.js +58 -0
- package/dist/utils/load-images/pad.js +14 -0
- package/dist/utils/load-images/preload-images.js +38 -0
- package/dist/utils/load-images/preload-original-images.js +38 -0
- package/dist/utils/magnify/get-current-original-image.js +29 -0
- package/dist/utils/magnify/get-cursor-position.js +24 -0
- package/dist/utils/magnify/magnify.js +54 -0
- package/dist/utils/magnify/move-magnifier.js +47 -0
- package/dist/utils/responsive/contain.js +11 -0
- package/dist/utils/responsive/fit.js +33 -0
- package/dist/utils/responsive/get-container-responsive-height.js +20 -0
- package/dist/utils/responsive/get-container-responsive-width.js +20 -0
- package/dist/utils/responsive/get-responsive-width-of-container.js +14 -0
- package/dist/utils/responsive/get-size-according-to-pixel-ratio.js +17 -0
- package/dist/utils/responsive/get-size-limit.js +14 -0
- package/dist/utils/spin-y/get-moving-direction.js +21 -0
- package/dist/utils/zoom/generate-zoom-in-steps.js +20 -0
- package/dist/utils/zoom/generate-zoom-out-steps.js +20 -0
- package/package.json +4 -3
- package/.vscode/settings.json +0 -2
- package/dist/ci360.constants.js +0 -34
package/dist/ci360.service.js
CHANGED
|
@@ -15,11 +15,11 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
15
15
|
|
|
16
16
|
var _ci = require("./ci360.utils");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _constants = require("./constants/");
|
|
19
19
|
|
|
20
20
|
require("./static/css/style.css");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _utils = require("./utils");
|
|
23
23
|
|
|
24
24
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
25
|
|
|
@@ -34,7 +34,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
34
34
|
y: 0
|
|
35
35
|
};
|
|
36
36
|
this.isStartSpin = false;
|
|
37
|
-
this.movingDirection =
|
|
37
|
+
this.movingDirection = _constants.ORIENTATIONS.CENTER;
|
|
38
38
|
this.isClicked = false;
|
|
39
39
|
this.loadedImagesX = 0;
|
|
40
40
|
this.loadedImagesY = 0;
|
|
@@ -163,7 +163,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
163
163
|
};
|
|
164
164
|
this.container.style.cursor = 'grabbing';
|
|
165
165
|
this.isDragged = true;
|
|
166
|
-
this.movingDirection = (0,
|
|
166
|
+
this.movingDirection = (0, _utils.getMovingDirection)(this.isStartSpin, this.allowSpinY, this.intialPositions, nextPositions, this.movingDirection);
|
|
167
167
|
this.onMoveHandler(event);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
@@ -175,6 +175,10 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
175
175
|
if (this.pointerZoom && this.mouseTracked) {
|
|
176
176
|
this.togglePointerZoom();
|
|
177
177
|
}
|
|
178
|
+
|
|
179
|
+
if (this.isMagnifyOpen) {
|
|
180
|
+
this.closeMagnifier();
|
|
181
|
+
}
|
|
178
182
|
}
|
|
179
183
|
}, {
|
|
180
184
|
key: "togglePointerZoom",
|
|
@@ -187,7 +191,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
if (this.mouseTracked) {
|
|
190
|
-
var zoomSteps = (0,
|
|
194
|
+
var zoomSteps = (0, _utils.generateZoomOutSteps)(this.pointerZoom);
|
|
191
195
|
this.container.style.cursor = 'zoom-in';
|
|
192
196
|
zoomSteps.forEach(function (step, index) {
|
|
193
197
|
setTimeout(function () {
|
|
@@ -209,7 +213,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
209
213
|
} else {
|
|
210
214
|
if (this.bottomCircle) this.hide360ViewCircleIcon();
|
|
211
215
|
|
|
212
|
-
var _zoomSteps = (0,
|
|
216
|
+
var _zoomSteps = (0, _utils.generateZoomInSteps)(this.pointerZoom);
|
|
213
217
|
|
|
214
218
|
_zoomSteps.forEach(function (step) {
|
|
215
219
|
setTimeout(function () {
|
|
@@ -226,7 +230,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
226
230
|
}, {
|
|
227
231
|
key: "onOriginalImageLoad",
|
|
228
232
|
value: function onOriginalImageLoad(orientation, event, image, index) {
|
|
229
|
-
if (orientation ===
|
|
233
|
+
if (orientation === _constants.ORIENTATIONS.Y) {
|
|
230
234
|
this.originalImagesY[index] = image;
|
|
231
235
|
} else {
|
|
232
236
|
this.originalImagesX[index] = image;
|
|
@@ -254,15 +258,15 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
254
258
|
}, {
|
|
255
259
|
key: "prepareOriginalImages",
|
|
256
260
|
value: function prepareOriginalImages(event) {
|
|
257
|
-
var srcX = (0,
|
|
261
|
+
var srcX = (0, _utils.generateImagesPath)(this.srcXConfig);
|
|
258
262
|
this.isStartedLoadOriginalImages = true;
|
|
259
|
-
this.loader = (0,
|
|
263
|
+
this.loader = (0, _utils.createLoader)(this.innerBox);
|
|
260
264
|
this.container.style.cursor = 'wait';
|
|
261
|
-
(0,
|
|
265
|
+
(0, _utils.preloadOriginalImages)(this.srcXConfig, srcX, this.onOriginalImageLoad.bind(this, _constants.ORIENTATIONS.X, event));
|
|
262
266
|
|
|
263
267
|
if (this.allowSpinY) {
|
|
264
|
-
var srcY = (0,
|
|
265
|
-
(0,
|
|
268
|
+
var srcY = (0, _utils.generateImagesPath)(this.srcYConfig);
|
|
269
|
+
(0, _utils.preloadOriginalImages)(this.srcXConfig, srcY, this.onOriginalImageLoad.bind(this, _constants.ORIENTATIONS.Y, event));
|
|
266
270
|
}
|
|
267
271
|
}
|
|
268
272
|
}, {
|
|
@@ -302,11 +306,16 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
302
306
|
key: "touchMove",
|
|
303
307
|
value: function touchMove(event) {
|
|
304
308
|
if (!this.isClicked || !this.imagesLoaded) return;
|
|
309
|
+
|
|
310
|
+
if (event.cancelable) {
|
|
311
|
+
event.preventDefault();
|
|
312
|
+
}
|
|
313
|
+
|
|
305
314
|
var nextPositions = {
|
|
306
315
|
x: event.touches[0].clientX,
|
|
307
316
|
y: event.touches[0].clientY
|
|
308
317
|
};
|
|
309
|
-
this.movingDirection = (0,
|
|
318
|
+
this.movingDirection = (0, _utils.getMovingDirection)(this.isStartSpin, this.allowSpinY, this.intialPositions, nextPositions, this.movingDirection);
|
|
310
319
|
this.onMoveHandler(event);
|
|
311
320
|
}
|
|
312
321
|
}, {
|
|
@@ -433,12 +442,12 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
433
442
|
this.activeImageX = this.amountX;
|
|
434
443
|
|
|
435
444
|
if (isReverse ? this.leftElem : this.rightElem) {
|
|
436
|
-
(0,
|
|
445
|
+
(0, _utils.addClass)(isReverse ? this.leftElem : this.rightElem, 'not-active');
|
|
437
446
|
}
|
|
438
447
|
} else {
|
|
439
448
|
this.activeImageX += itemsSkipped;
|
|
440
|
-
if (this.rightElem) (0,
|
|
441
|
-
if (this.leftElem) (0,
|
|
449
|
+
if (this.rightElem) (0, _utils.removeClass)(this.rightElem, 'not-active');
|
|
450
|
+
if (this.leftElem) (0, _utils.removeClass)(this.leftElem, 'not-active');
|
|
442
451
|
}
|
|
443
452
|
} else {
|
|
444
453
|
this.activeImageX = (this.activeImageX + itemsSkipped) % this.amountX || this.amountX;
|
|
@@ -457,12 +466,12 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
457
466
|
this.activeImageX = 1;
|
|
458
467
|
|
|
459
468
|
if (isReverse ? this.rightElem : this.leftElem) {
|
|
460
|
-
(0,
|
|
469
|
+
(0, _utils.addClass)(isReverse ? this.rightElem : this.leftElem, 'not-active');
|
|
461
470
|
}
|
|
462
471
|
} else {
|
|
463
472
|
this.activeImageX -= itemsSkipped;
|
|
464
|
-
if (this.leftElem) (0,
|
|
465
|
-
if (this.rightElem) (0,
|
|
473
|
+
if (this.leftElem) (0, _utils.removeClass)(this.leftElem, 'not-active');
|
|
474
|
+
if (this.rightElem) (0, _utils.removeClass)(this.rightElem, 'not-active');
|
|
466
475
|
}
|
|
467
476
|
} else {
|
|
468
477
|
if (this.activeImageX - itemsSkipped < 1) {
|
|
@@ -485,12 +494,12 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
485
494
|
this.activeImageY = this.amountY;
|
|
486
495
|
|
|
487
496
|
if (isReverse ? this.bottomElem : this.topElem) {
|
|
488
|
-
(0,
|
|
497
|
+
(0, _utils.addClass)(isReverse ? this.bottomElem : this.topElem, 'not-active');
|
|
489
498
|
}
|
|
490
499
|
} else {
|
|
491
500
|
this.activeImageY += itemsSkipped;
|
|
492
|
-
if (this.topElem) (0,
|
|
493
|
-
if (this.bottomElem) (0,
|
|
501
|
+
if (this.topElem) (0, _utils.removeClass)(this.topElem, 'not-active');
|
|
502
|
+
if (this.bottomElem) (0, _utils.removeClass)(this.bottomElem, 'not-active');
|
|
494
503
|
}
|
|
495
504
|
} else {
|
|
496
505
|
this.activeImageY = (this.activeImageY + itemsSkipped) % this.amountY || this.amountY;
|
|
@@ -509,12 +518,12 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
509
518
|
this.activeImageY = 1;
|
|
510
519
|
|
|
511
520
|
if (isReverse ? this.topElem : this.bottomElem) {
|
|
512
|
-
(0,
|
|
521
|
+
(0, _utils.addClass)(isReverse ? this.topElem : this.bottomElem, 'not-active');
|
|
513
522
|
}
|
|
514
523
|
} else {
|
|
515
524
|
this.activeImageY -= itemsSkipped;
|
|
516
|
-
if (this.bottomElem) (0,
|
|
517
|
-
if (this.topElem) (0,
|
|
525
|
+
if (this.bottomElem) (0, _utils.removeClass)(this.bottomElem, 'not-active');
|
|
526
|
+
if (this.topElem) (0, _utils.removeClass)(this.topElem, 'not-active');
|
|
518
527
|
}
|
|
519
528
|
} else {
|
|
520
529
|
if (this.activeImageY - itemsSkipped < 1) {
|
|
@@ -528,7 +537,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
528
537
|
}, {
|
|
529
538
|
key: "moveRight",
|
|
530
539
|
value: function moveRight(currentPositionX) {
|
|
531
|
-
var itemsSkippedRight = (0,
|
|
540
|
+
var itemsSkippedRight = (0, _utils.getItemSkipped)(currentPositionX, this.movementStart.x, this.speedFactor);
|
|
532
541
|
this.spinReverse ? this.moveActiveIndexDown(itemsSkippedRight) : this.moveActiveIndexUp(itemsSkippedRight);
|
|
533
542
|
this.movementStart.x = currentPositionX;
|
|
534
543
|
this.activeImageY = 1;
|
|
@@ -537,7 +546,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
537
546
|
}, {
|
|
538
547
|
key: "moveLeft",
|
|
539
548
|
value: function moveLeft(currentPositionX) {
|
|
540
|
-
var itemsSkippedLeft = (0,
|
|
549
|
+
var itemsSkippedLeft = (0, _utils.getItemSkipped)(this.movementStart.x, currentPositionX, this.speedFactor);
|
|
541
550
|
this.spinReverse ? this.moveActiveIndexUp(itemsSkippedLeft) : this.moveActiveIndexDown(itemsSkippedLeft);
|
|
542
551
|
this.activeImageY = 1;
|
|
543
552
|
this.movementStart.x = currentPositionX;
|
|
@@ -546,7 +555,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
546
555
|
}, {
|
|
547
556
|
key: "moveTop",
|
|
548
557
|
value: function moveTop(currentPositionY) {
|
|
549
|
-
var itemsSkippedTop = (0,
|
|
558
|
+
var itemsSkippedTop = (0, _utils.getItemSkipped)(this.movementStart.y, currentPositionY, this.speedFactor);
|
|
550
559
|
this.spinReverse ? this.moveActiveYIndexUp(itemsSkippedTop) : this.moveActiveYIndexDown(itemsSkippedTop);
|
|
551
560
|
this.activeImageX = 1;
|
|
552
561
|
this.movementStart.y = currentPositionY;
|
|
@@ -555,7 +564,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
555
564
|
}, {
|
|
556
565
|
key: "moveBottom",
|
|
557
566
|
value: function moveBottom(currentPositionY) {
|
|
558
|
-
var itemsSkippedBottom = (0,
|
|
567
|
+
var itemsSkippedBottom = (0, _utils.getItemSkipped)(currentPositionY, this.movementStart.y, this.speedFactor);
|
|
559
568
|
this.spinReverse ? this.moveActiveYIndexDown(itemsSkippedBottom) : this.moveActiveYIndexUp(itemsSkippedBottom);
|
|
560
569
|
this.activeImageX = 1;
|
|
561
570
|
this.movementStart.y = currentPositionY;
|
|
@@ -572,16 +581,16 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
572
581
|
var isMoveBottom = currentPositionY - this.movementStart.y >= this.speedFactor;
|
|
573
582
|
if (this.bottomCircle) this.hide360ViewCircleIcon();
|
|
574
583
|
|
|
575
|
-
if (isMoveRight && this.movingDirection ===
|
|
584
|
+
if (isMoveRight && this.movingDirection === _constants.ORIENTATIONS.X) {
|
|
576
585
|
this.moveRight(currentPositionX);
|
|
577
586
|
this.isStartSpin = true;
|
|
578
|
-
} else if (isMoveLeft && this.movingDirection ===
|
|
587
|
+
} else if (isMoveLeft && this.movingDirection === _constants.ORIENTATIONS.X) {
|
|
579
588
|
this.moveLeft(currentPositionX);
|
|
580
589
|
this.isStartSpin = true;
|
|
581
|
-
} else if (isMoveTop && this.movingDirection ===
|
|
590
|
+
} else if (isMoveTop && this.movingDirection === _constants.ORIENTATIONS.Y) {
|
|
582
591
|
this.moveTop(currentPositionY);
|
|
583
592
|
this.isStartSpin = true;
|
|
584
|
-
} else if (isMoveBottom && this.movingDirection ===
|
|
593
|
+
} else if (isMoveBottom && this.movingDirection === _constants.ORIENTATIONS.Y) {
|
|
585
594
|
this.moveBottom(currentPositionY);
|
|
586
595
|
this.isStartSpin = true;
|
|
587
596
|
}
|
|
@@ -589,7 +598,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
589
598
|
}, {
|
|
590
599
|
key: "left",
|
|
591
600
|
value: function left() {
|
|
592
|
-
this.movingDirection =
|
|
601
|
+
this.movingDirection = _constants.ORIENTATIONS.X;
|
|
593
602
|
this.activeImageY = this.reversed ? this.amountY : 1;
|
|
594
603
|
this.moveActiveIndexDown(1);
|
|
595
604
|
this.update();
|
|
@@ -597,7 +606,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
597
606
|
}, {
|
|
598
607
|
key: "right",
|
|
599
608
|
value: function right() {
|
|
600
|
-
this.movingDirection =
|
|
609
|
+
this.movingDirection = _constants.ORIENTATIONS.X;
|
|
601
610
|
this.activeImageY = this.reversed ? this.amountY : 1;
|
|
602
611
|
this.moveActiveIndexUp(1);
|
|
603
612
|
this.update();
|
|
@@ -605,7 +614,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
605
614
|
}, {
|
|
606
615
|
key: "top",
|
|
607
616
|
value: function top() {
|
|
608
|
-
this.movingDirection =
|
|
617
|
+
this.movingDirection = _constants.ORIENTATIONS.Y;
|
|
609
618
|
this.activeImageX = this.reversed ? this.amountX : 1;
|
|
610
619
|
this.moveActiveYIndexUp(1);
|
|
611
620
|
this.update();
|
|
@@ -613,7 +622,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
613
622
|
}, {
|
|
614
623
|
key: "bottom",
|
|
615
624
|
value: function bottom() {
|
|
616
|
-
this.movingDirection =
|
|
625
|
+
this.movingDirection = _constants.ORIENTATIONS.Y;
|
|
617
626
|
this.activeImageX = this.reversed ? this.amountX : 1;
|
|
618
627
|
this.moveActiveYIndexDown(1);
|
|
619
628
|
this.update();
|
|
@@ -627,7 +636,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
627
636
|
top: this.top.bind(this),
|
|
628
637
|
bottom: this.bottom.bind(this)
|
|
629
638
|
};
|
|
630
|
-
(0,
|
|
639
|
+
(0, _utils.loop)(this.autoplayBehavior, this.spinY, reversed, loopTriggers);
|
|
631
640
|
}
|
|
632
641
|
}, {
|
|
633
642
|
key: "updateContainerSize",
|
|
@@ -635,8 +644,8 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
635
644
|
var parentEl = this.container.parentNode || {};
|
|
636
645
|
var imageAspectRatio = image.width / image.height;
|
|
637
646
|
var isProvidedHeightLessThanWidth = this.containerHeight < this.containerWidth;
|
|
638
|
-
var containerWidth = (0,
|
|
639
|
-
var containerHeight = (0,
|
|
647
|
+
var containerWidth = (0, _utils.getContainerResponsiveWidth)(parentEl, this.containerWidth);
|
|
648
|
+
var containerHeight = (0, _utils.getContainerResponsiveHeight)(this.container, containerWidth, this.containerHeight);
|
|
640
649
|
|
|
641
650
|
if (this.fullscreenView) {
|
|
642
651
|
this.container.width = window.innerWidth * this.devicePixelRatio;
|
|
@@ -669,7 +678,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
669
678
|
}, {
|
|
670
679
|
key: "onResizedImageLoad",
|
|
671
680
|
value: function onResizedImageLoad(orientation, image, index) {
|
|
672
|
-
if (orientation ===
|
|
681
|
+
if (orientation === _constants.ORIENTATIONS.Y) {
|
|
673
682
|
this.resizedImagesY[index] = image;
|
|
674
683
|
} else {
|
|
675
684
|
this.resizedImagesX[index] = image;
|
|
@@ -696,14 +705,14 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
696
705
|
var firstImage = this.imagesX[0];
|
|
697
706
|
this.updateContainerSize(firstImage);
|
|
698
707
|
this.update();
|
|
699
|
-
this.speedFactor = (0,
|
|
700
|
-
var srcX = (0,
|
|
708
|
+
this.speedFactor = (0, _utils.getSpeedFactor)(this.dragSpeed, this.amountX, this.container.offsetWidth);
|
|
709
|
+
var srcX = (0, _utils.generateImagesPath)(this.srcXConfig);
|
|
701
710
|
if (!responsive || this.container.offsetWidth < firstImage.width * 1.5) return;
|
|
702
|
-
(0,
|
|
711
|
+
(0, _utils.preloadImages)(this.srcXConfig, srcX, this.onResizedImageLoad.bind(this, _constants.ORIENTATIONS.X), true);
|
|
703
712
|
|
|
704
713
|
if (this.allowSpinY) {
|
|
705
|
-
var srcY = (0,
|
|
706
|
-
(0,
|
|
714
|
+
var srcY = (0, _utils.generateImagesPath)(this.srcYConfig);
|
|
715
|
+
(0, _utils.preloadImages)(this.srcYConfig, srcY, this.onResizedImageLoad.bind(this, _constants.ORIENTATIONS.Y), true);
|
|
707
716
|
}
|
|
708
717
|
}
|
|
709
718
|
}, {
|
|
@@ -711,7 +720,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
711
720
|
value: function update() {
|
|
712
721
|
var image = this.imagesX[this.activeImageX - 1];
|
|
713
722
|
|
|
714
|
-
if (this.movingDirection ===
|
|
723
|
+
if (this.movingDirection === _constants.ORIENTATIONS.Y) {
|
|
715
724
|
image = this.imagesY[this.activeImageY - 1];
|
|
716
725
|
}
|
|
717
726
|
|
|
@@ -723,7 +732,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
723
732
|
this.canvas.style.height = this.container.offsetHeight + 'px';
|
|
724
733
|
|
|
725
734
|
if (this.fullscreenView) {
|
|
726
|
-
var _contain = (0,
|
|
735
|
+
var _contain = (0, _utils.contain)(this.canvas.width, this.canvas.height, image.width, image.height),
|
|
727
736
|
width = _contain.width,
|
|
728
737
|
height = _contain.height,
|
|
729
738
|
offsetX = _contain.offsetX,
|
|
@@ -743,7 +752,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
743
752
|
value: function updateImageScale(ctx) {
|
|
744
753
|
var image = this.originalImagesX[this.activeImageX - 1];
|
|
745
754
|
|
|
746
|
-
if (this.movingDirection ===
|
|
755
|
+
if (this.movingDirection === _constants.ORIENTATIONS.Y) {
|
|
747
756
|
image = this.originalImagesY[this.activeImageY - 1];
|
|
748
757
|
}
|
|
749
758
|
|
|
@@ -779,7 +788,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
779
788
|
this.canvas.height = window.innerHeight * this.devicePixelRatio;
|
|
780
789
|
this.canvas.style.height = window.innerHeight + 'px';
|
|
781
790
|
|
|
782
|
-
var _contain2 = (0,
|
|
791
|
+
var _contain2 = (0, _utils.contain)(this.canvas.width, this.canvas.height, image.width, image.height),
|
|
783
792
|
offsetX = _contain2.offsetX,
|
|
784
793
|
offsetY = _contain2.offsetY,
|
|
785
794
|
width = _contain2.width,
|
|
@@ -807,7 +816,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
807
816
|
}
|
|
808
817
|
|
|
809
818
|
if (this.boxShadow && !this.fullscreenView) {
|
|
810
|
-
(0,
|
|
819
|
+
(0, _utils.createBoxShadow)(this.boxShadow, this.innerBox);
|
|
811
820
|
}
|
|
812
821
|
|
|
813
822
|
if (this.bottomCircle && !this.fullscreenView) {
|
|
@@ -830,7 +839,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
830
839
|
this.container.style.cursor = 'grab';
|
|
831
840
|
}
|
|
832
841
|
|
|
833
|
-
this.speedFactor = (0,
|
|
842
|
+
this.speedFactor = (0, _utils.getSpeedFactor)(this.dragSpeed, this.amountX, this.container.offsetWidth);
|
|
834
843
|
|
|
835
844
|
if (this.autoplay) {
|
|
836
845
|
this.play();
|
|
@@ -841,8 +850,9 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
841
850
|
}
|
|
842
851
|
|
|
843
852
|
if (this.view360Icon) {
|
|
844
|
-
this.view360Icon.innerText = '';
|
|
845
|
-
|
|
853
|
+
this.view360Icon.innerText = ''; //TODO [deprecated]: remove setView360Icon in the upcoming versions
|
|
854
|
+
|
|
855
|
+
if (this.logoSrc) (0, _ci.setView360Icon)(this.view360Icon, this.logoSrc);
|
|
846
856
|
}
|
|
847
857
|
|
|
848
858
|
this.initControls();
|
|
@@ -854,7 +864,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
854
864
|
|
|
855
865
|
event.stopPropagation();
|
|
856
866
|
if (this.mouseTracked) this.togglePointerZoom();
|
|
857
|
-
var currentOriginalImage = (0,
|
|
867
|
+
var currentOriginalImage = (0, _utils.getCurrentOriginalImage)(this.movingDirection, this.imagesX, this.imagesY, this.activeImageX, this.activeImageY);
|
|
858
868
|
this.isMagnifyOpen = true;
|
|
859
869
|
|
|
860
870
|
currentOriginalImage.onload = function () {
|
|
@@ -865,7 +875,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
865
875
|
|
|
866
876
|
this.glass = document.createElement('div');
|
|
867
877
|
this.container.style.overflow = 'hidden';
|
|
868
|
-
(0,
|
|
878
|
+
(0, _utils.magnify)(this.container, this.offset, currentOriginalImage, this.glass, this.magnifier || 3);
|
|
869
879
|
}
|
|
870
880
|
}, {
|
|
871
881
|
key: "closeMagnifier",
|
|
@@ -881,7 +891,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
881
891
|
value: function openFullscreenModal(event) {
|
|
882
892
|
event.stopPropagation();
|
|
883
893
|
if (this.mouseTracked) this.togglePointerZoom();
|
|
884
|
-
var fullscreenContainer = (0,
|
|
894
|
+
var fullscreenContainer = (0, _utils.createFullscreenModal)(this.container);
|
|
885
895
|
new CI360Viewer(fullscreenContainer, true);
|
|
886
896
|
}
|
|
887
897
|
}, {
|
|
@@ -908,7 +918,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
908
918
|
this.loopTimeoutId = window.setInterval(function () {
|
|
909
919
|
_this4.loop(_this4.reversed);
|
|
910
920
|
|
|
911
|
-
var isPlayedOnce = (0,
|
|
921
|
+
var isPlayedOnce = (0, _utils.isCompletedOneCycle)(_this4.autoplayBehavior, _this4.activeImageX, _this4.activeImageY, _this4.amountX, _this4.amountY, _this4.reversed);
|
|
912
922
|
|
|
913
923
|
if (_this4.playOnce && isPlayedOnce) {
|
|
914
924
|
window.clearTimeout(_this4.loopTimeoutId);
|
|
@@ -926,6 +936,21 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
926
936
|
if (this.bottomCircle) this.show360ViewCircleIcon();
|
|
927
937
|
window.clearTimeout(this.loopTimeoutId);
|
|
928
938
|
}
|
|
939
|
+
}, {
|
|
940
|
+
key: "updatePlugin",
|
|
941
|
+
value: function updatePlugin(forceUpdate) {
|
|
942
|
+
var container = this.container;
|
|
943
|
+
var imageProps = (0, _ci.get360ViewProps)(container);
|
|
944
|
+
var srcPropsChanged = (0, _utils.isSrcPropsChanged)(this, imageProps);
|
|
945
|
+
var reloadPlugin = srcPropsChanged || forceUpdate;
|
|
946
|
+
container.style.position = 'relative';
|
|
947
|
+
container.style.width = '100%';
|
|
948
|
+
container.style.cursor = 'default';
|
|
949
|
+
container.setAttribute('draggable', 'false');
|
|
950
|
+
if (reloadPlugin) container.innerHTML = '';
|
|
951
|
+
this.stop();
|
|
952
|
+
this.init(container, !reloadPlugin, reloadPlugin);
|
|
953
|
+
}
|
|
929
954
|
}, {
|
|
930
955
|
key: "destroy",
|
|
931
956
|
value: function destroy() {
|
|
@@ -945,7 +970,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
945
970
|
}, {
|
|
946
971
|
key: "addCloseFullscreenView",
|
|
947
972
|
value: function addCloseFullscreenView(event) {
|
|
948
|
-
var closeFullscreenIcon = (0,
|
|
973
|
+
var closeFullscreenIcon = (0, _utils.createCloseFullscreenIcon)();
|
|
949
974
|
closeFullscreenIcon.onclick = this.setFullscreenEvents.bind(this, event);
|
|
950
975
|
window.onkeyup = this.setFullscreenEvents.bind(this, event);
|
|
951
976
|
this.iconsContainer.appendChild(closeFullscreenIcon);
|
|
@@ -953,13 +978,13 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
953
978
|
}, {
|
|
954
979
|
key: "add360ViewIcon",
|
|
955
980
|
value: function add360ViewIcon() {
|
|
956
|
-
this.view360Icon = (0,
|
|
981
|
+
this.view360Icon = (0, _utils.create360ViewIcon)();
|
|
957
982
|
this.innerBox.appendChild(this.view360Icon);
|
|
958
983
|
}
|
|
959
984
|
}, {
|
|
960
985
|
key: "addFullscreenIcon",
|
|
961
986
|
value: function addFullscreenIcon() {
|
|
962
|
-
this.fullscreenIcon = (0,
|
|
987
|
+
this.fullscreenIcon = (0, _utils.createFullscreenIcon)();
|
|
963
988
|
this.fullscreenIcon.onclick = this.openFullscreenModal.bind(this);
|
|
964
989
|
this.iconsContainer.appendChild(this.fullscreenIcon);
|
|
965
990
|
}
|
|
@@ -980,7 +1005,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
980
1005
|
}, {
|
|
981
1006
|
key: "addMagnifier",
|
|
982
1007
|
value: function addMagnifier() {
|
|
983
|
-
this.magnifierIcon = (0,
|
|
1008
|
+
this.magnifierIcon = (0, _utils.createMagnifierIcon)();
|
|
984
1009
|
this.magnifierIcon.onclick = this.magnify.bind(this);
|
|
985
1010
|
this.iconsContainer.appendChild(this.magnifierIcon);
|
|
986
1011
|
}
|
|
@@ -1008,7 +1033,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1008
1033
|
}, {
|
|
1009
1034
|
key: "add360ViewCircleIcon",
|
|
1010
1035
|
value: function add360ViewCircleIcon() {
|
|
1011
|
-
this.view360CircleIcon = (0,
|
|
1036
|
+
this.view360CircleIcon = (0, _utils.create360ViewCircleIcon)(this.bottomCircleOffset);
|
|
1012
1037
|
this.innerBox.appendChild(this.view360CircleIcon);
|
|
1013
1038
|
}
|
|
1014
1039
|
}, {
|
|
@@ -1108,7 +1133,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1108
1133
|
onBottomStart: onBottomStart,
|
|
1109
1134
|
onEventEnd: onEventEnd
|
|
1110
1135
|
};
|
|
1111
|
-
var controlsElements = (0,
|
|
1136
|
+
var controlsElements = (0, _utils.initControls)(controlsConfig, controlsTriggers);
|
|
1112
1137
|
this.topElem = controlsElements.top || {};
|
|
1113
1138
|
this.bottomElem = controlsElements.bottom || {};
|
|
1114
1139
|
this.leftElem = controlsElements.left || {};
|
|
@@ -1132,9 +1157,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1132
1157
|
passive: true
|
|
1133
1158
|
});
|
|
1134
1159
|
this.container.addEventListener('touchend', this.touchEnd.bind(this));
|
|
1135
|
-
this.container.addEventListener('touchmove', this.touchMove.bind(this)
|
|
1136
|
-
passive: true
|
|
1137
|
-
});
|
|
1160
|
+
this.container.addEventListener('touchmove', this.touchMove.bind(this));
|
|
1138
1161
|
}
|
|
1139
1162
|
|
|
1140
1163
|
if (keys) {
|
|
@@ -1149,6 +1172,9 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1149
1172
|
value: function init(container) {
|
|
1150
1173
|
var _this6 = this;
|
|
1151
1174
|
|
|
1175
|
+
var update = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1176
|
+
var reload = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1177
|
+
|
|
1152
1178
|
var _get360ViewProps = (0, _ci.get360ViewProps)(container),
|
|
1153
1179
|
folder = _get360ViewProps.folder,
|
|
1154
1180
|
apiVersion = _get360ViewProps.apiVersion,
|
|
@@ -1159,7 +1185,6 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1159
1185
|
indexZeroBase = _get360ViewProps.indexZeroBase,
|
|
1160
1186
|
amountX = _get360ViewProps.amountX,
|
|
1161
1187
|
amountY = _get360ViewProps.amountY,
|
|
1162
|
-
imageOffset = _get360ViewProps.imageOffset,
|
|
1163
1188
|
_get360ViewProps$drag = _get360ViewProps.draggable,
|
|
1164
1189
|
draggable = _get360ViewProps$drag === void 0 ? true : _get360ViewProps$drag,
|
|
1165
1190
|
_get360ViewProps$swip = _get360ViewProps.swipeable,
|
|
@@ -1210,8 +1235,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1210
1235
|
this.allowSpinY = !!this.amountY;
|
|
1211
1236
|
this.activeImageX = autoplayReverse ? this.amountX : 1;
|
|
1212
1237
|
this.activeImageY = autoplayReverse ? this.amountY : 1;
|
|
1213
|
-
this.spinY = autoplayBehavior ===
|
|
1214
|
-
this.imageOffset = imageOffset;
|
|
1238
|
+
this.spinY = autoplayBehavior === _constants.AUTOPLAY_BEHAVIOR.SPIN_YX ? true : false;
|
|
1215
1239
|
this.bottomCircle = bottomCircle;
|
|
1216
1240
|
this.bottomCircleOffset = bottomCircleOffset;
|
|
1217
1241
|
this.boxShadow = boxShadow;
|
|
@@ -1222,13 +1246,13 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1222
1246
|
this.reversed = autoplayReverse;
|
|
1223
1247
|
this.disableDrag = disableDrag;
|
|
1224
1248
|
this.fullscreen = fullscreen;
|
|
1225
|
-
this.magnifier = !this.isMobile && magnifier ? magnifier :
|
|
1249
|
+
this.magnifier = !this.isMobile && magnifier > 1 ? Math.min(magnifier, 5) : 0;
|
|
1226
1250
|
this.lazyloadX = lazyload;
|
|
1227
1251
|
this.lazyloadY = lazyload;
|
|
1228
1252
|
this.lazySelector = lazySelector;
|
|
1229
1253
|
this.spinReverse = spinReverse;
|
|
1230
1254
|
this.controlReverse = controlReverse;
|
|
1231
|
-
this.dragSpeed =
|
|
1255
|
+
this.dragSpeed = Math.max(magnifier, 50);
|
|
1232
1256
|
this.autoplaySpeed = this.speed * 36 / this.amountX;
|
|
1233
1257
|
this.stopAtEdges = stopAtEdges;
|
|
1234
1258
|
this.hide360Logo = hide360Logo;
|
|
@@ -1237,13 +1261,24 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1237
1261
|
this.apiVersion = apiVersion;
|
|
1238
1262
|
this.containerWidth = containerWidth;
|
|
1239
1263
|
this.containerHeight = containerHeight;
|
|
1240
|
-
this.pointerZoom = Math.min(
|
|
1264
|
+
this.pointerZoom = pointerZoom > 1 ? Math.min(pointerZoom, 3) : 0;
|
|
1241
1265
|
this.keysReverse = keysReverse;
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1266
|
+
|
|
1267
|
+
if (reload) {
|
|
1268
|
+
new CI360Viewer(this.container);
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
if (update) {
|
|
1273
|
+
this.onAllImagesLoaded();
|
|
1274
|
+
return;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
this.innerBox = (0, _utils.createInnerBox)(this.container);
|
|
1278
|
+
this.iconsContainer = (0, _utils.createIconsContainer)(this.innerBox);
|
|
1279
|
+
this.canvas = (0, _utils.createCanvas)(this.innerBox);
|
|
1280
|
+
this.loader = (0, _utils.createLoader)(this.innerBox);
|
|
1281
|
+
(0, _utils.applyStylesToContainer)(this.container);
|
|
1247
1282
|
this.srcXConfig = {
|
|
1248
1283
|
folder: folder,
|
|
1249
1284
|
filename: filenameX,
|
|
@@ -1260,12 +1295,12 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1260
1295
|
};
|
|
1261
1296
|
this.srcYConfig = _objectSpread(_objectSpread({}, this.srcXConfig), {}, {
|
|
1262
1297
|
filename: filenameY,
|
|
1263
|
-
orientation:
|
|
1298
|
+
orientation: _constants.ORIENTATIONS.Y,
|
|
1264
1299
|
imageList: imageListY,
|
|
1265
1300
|
amount: this.amountY
|
|
1266
1301
|
});
|
|
1267
|
-
var srcX = (0,
|
|
1268
|
-
var srcY = (0,
|
|
1302
|
+
var srcX = (0, _utils.generateImagesPath)(this.srcXConfig);
|
|
1303
|
+
var srcY = (0, _utils.generateImagesPath)(this.srcYConfig);
|
|
1269
1304
|
|
|
1270
1305
|
var initLazyload = function initLazyload(image, orientation) {
|
|
1271
1306
|
var lazyloadXConfig = _objectSpread(_objectSpread({}, _this6.srcXConfig), {}, {
|
|
@@ -1276,18 +1311,18 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1276
1311
|
lazyload: false
|
|
1277
1312
|
});
|
|
1278
1313
|
|
|
1279
|
-
if (orientation ===
|
|
1314
|
+
if (orientation === _constants.ORIENTATIONS.Y) {
|
|
1280
1315
|
_this6.lazyloadY = false;
|
|
1281
|
-
(0,
|
|
1316
|
+
(0, _utils.preloadImages)(lazyloadXConfig, srcX, onImageLoad.bind(_this6, _constants.ORIENTATIONS.X));
|
|
1282
1317
|
} else {
|
|
1283
1318
|
_this6.lazyloadX = false;
|
|
1284
1319
|
_this6.lazyloadInitImageX = image;
|
|
1285
|
-
(0,
|
|
1320
|
+
(0, _utils.preloadImages)(lazyloadYConfig, srcY, onImageLoad.bind(_this6, _constants.ORIENTATIONS.Y));
|
|
1286
1321
|
}
|
|
1287
1322
|
};
|
|
1288
1323
|
|
|
1289
1324
|
var onImageLoad = function onImageLoad(orientation, image, index) {
|
|
1290
|
-
if (orientation !==
|
|
1325
|
+
if (orientation !== _constants.ORIENTATIONS.Y) {
|
|
1291
1326
|
_this6.imagesX[index] = image;
|
|
1292
1327
|
} else {
|
|
1293
1328
|
_this6.imagesY[index] = image;
|
|
@@ -1303,7 +1338,7 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1303
1338
|
|
|
1304
1339
|
var totalAmount = _this6.amountX + _this6.amountY;
|
|
1305
1340
|
var totalLoadedImages = _this6.imagesX.length + _this6.imagesY.length;
|
|
1306
|
-
var isFirstImageLoaded = index === 0 && orientation !==
|
|
1341
|
+
var isFirstImageLoaded = index === 0 && orientation !== _constants.ORIENTATIONS.Y;
|
|
1307
1342
|
var isAllImagesLoaded = loadedXImages.length + loadedYImages.length === _this6.amountX + _this6.amountY;
|
|
1308
1343
|
var percentage = Math.round(totalLoadedImages / totalAmount * 100);
|
|
1309
1344
|
|
|
@@ -1326,10 +1361,10 @@ var CI360Viewer = /*#__PURE__*/function () {
|
|
|
1326
1361
|
}
|
|
1327
1362
|
};
|
|
1328
1363
|
|
|
1329
|
-
(0,
|
|
1364
|
+
(0, _utils.preloadImages)(this.srcXConfig, srcX, onImageLoad.bind(this, _constants.ORIENTATIONS.X));
|
|
1330
1365
|
|
|
1331
1366
|
if (this.allowSpinY) {
|
|
1332
|
-
(0,
|
|
1367
|
+
(0, _utils.preloadImages)(this.srcYConfig, srcY, onImageLoad.bind(this, _constants.ORIENTATIONS.Y));
|
|
1333
1368
|
}
|
|
1334
1369
|
|
|
1335
1370
|
this.attachEvents(draggable, swipeable, keys);
|
package/dist/ci360.utils.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.setView360Icon = exports.get360ViewProps = exports.debounce = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _constants = require("./constants");
|
|
9
9
|
|
|
10
10
|
var _this = void 0;
|
|
11
11
|
|
|
@@ -21,21 +21,20 @@ var get360ViewProps = function get360ViewProps(image) {
|
|
|
21
21
|
indexZeroBase: parseInt(attr(image, 'index-zero-base') || attr(image, 'data-index-zero-base') || 0, 10),
|
|
22
22
|
amountX: parseInt(attr(image, 'amount') || attr(image, 'data-amount') || attr(image, 'amount-x') || attr(image, 'data-amount-x') || 36, 10),
|
|
23
23
|
amountY: parseInt(attr(image, 'amount-y') || attr(image, 'data-amount-y') || 0, 10),
|
|
24
|
-
imageOffset: parseInt(attr(image, 'image-offset') || attr(image, 'data-image-offset')),
|
|
25
24
|
speed: parseInt(attr(image, 'speed') || attr(image, 'data-speed') || 80, 10),
|
|
26
25
|
dragSpeed: parseInt(attr(image, 'drag-speed') || attr(image, 'data-drag-speed') || 150, 10),
|
|
27
26
|
keys: isTrue(image, 'keys'),
|
|
28
27
|
keysReverse: isTrue(image, 'keys-reverse'),
|
|
29
28
|
boxShadow: attr(image, 'box-shadow') || attr(image, 'data-box-shadow'),
|
|
30
29
|
autoplay: isTrue(image, 'autoplay'),
|
|
31
|
-
autoplayBehavior: attr(image, 'autoplay-behavior') || attr(image, 'data-autoplay-behavior') ||
|
|
30
|
+
autoplayBehavior: attr(image, 'autoplay-behavior') || attr(image, 'data-autoplay-behavior') || _constants.AUTOPLAY_BEHAVIOR.SPIN_X,
|
|
32
31
|
playOnce: isTrue(image, 'play-once'),
|
|
33
32
|
autoplayReverse: isTrue(image, 'autoplay-reverse'),
|
|
34
33
|
pointerZoom: parseFloat(attr(image, 'pointer-zoom') || attr(image, 'data-pointer-zoom') || 0, 10),
|
|
35
34
|
bottomCircle: isTrue(image, 'bottom-circle'),
|
|
36
35
|
disableDrag: isTrue(image, 'disable-drag'),
|
|
37
36
|
fullscreen: isTrue(image, 'fullscreen') || isTrue(image, 'full-screen'),
|
|
38
|
-
magnifier: (attr(image, 'magnifier') !== null || attr(image, 'data-magnifier') !== null) &&
|
|
37
|
+
magnifier: (attr(image, 'magnifier') !== null || attr(image, 'data-magnifier') !== null) && parseFloat(attr(image, 'magnifier') || attr(image, 'data-magnifier'), 10),
|
|
39
38
|
bottomCircleOffset: parseInt(attr(image, 'bottom-circle-offset') || attr(image, 'data-bottom-circle-offset') || 5, 10),
|
|
40
39
|
ciToken: attr(image, 'responsive') || attr(image, 'data-responsive'),
|
|
41
40
|
ciFilters: attr(image, 'filters') || attr(image, 'data-filters'),
|