js-cloudimage-360-view 4.8.0 → 4.9.2

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/README.md CHANGED
@@ -44,6 +44,7 @@
44
44
  - [Quick Start](#quick-start)
45
45
  - [Installation](#installation)
46
46
  - [Usage](#usage)
47
+ - [2D Grid Mode](#2d-grid-mode)
47
48
  - [React / Next.js](#react--nextjs)
48
49
  - [Configuration Options](#configuration-options)
49
50
  - [Event Callbacks](#event-callbacks)
@@ -79,6 +80,7 @@ JS Cloudimage 360 View enables you to create stunning, interactive 360-degree pr
79
80
  | Feature | Description |
80
81
  |---------|-------------|
81
82
  | **360° Rotation** | Smooth horizontal and vertical rotation with customizable speed |
83
+ | **2D Grid Mode** | True two-axis viewing for images organized as a horizontal/vertical matrix |
82
84
  | **Touch & Drag** | Intuitive mouse and touch controls with inertia/momentum |
83
85
  | **Pinch-to-Zoom** | Natural pinch gesture zooming on mobile devices |
84
86
  | **Autoplay** | Automatic rotation with configurable behavior and direction |
@@ -99,7 +101,7 @@ Add the library via CDN and create your first 360 viewer in seconds:
99
101
 
100
102
  ```html
101
103
  <!-- Add the library (CSS is auto-injected) -->
102
- <script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.8.0/js-cloudimage-360-view.min.js?vh=82962f&func=proxy"></script>
104
+ <script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.2/js-cloudimage-360-view.min.js?vh=d12bb5&func=proxy"></script>
103
105
 
104
106
  <!-- Create a container with data attributes -->
105
107
  <div
@@ -123,7 +125,7 @@ Add the library via CDN and create your first 360 viewer in seconds:
123
125
  ### Option 1: CDN (Recommended for Quick Setup)
124
126
 
125
127
  ```html
126
- <script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.8.0/js-cloudimage-360-view.min.js?vh=82962f&func=proxy"></script>
128
+ <script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.2/js-cloudimage-360-view.min.js?vh=d12bb5&func=proxy"></script>
127
129
  ```
128
130
 
129
131
  > **Note:** CSS is automatically injected by the script - no separate stylesheet needed.
@@ -217,6 +219,66 @@ const config = {
217
219
  };
218
220
  ```
219
221
 
222
+ ### 2D Grid Mode
223
+
224
+ For products photographed at multiple horizontal **and** vertical angles, grid mode provides true two-axis viewing. Instead of independent X/Y strips, the displayed image is determined by both axes simultaneously — dragging horizontally changes X, vertically changes Y, and diagonal drags update both.
225
+
226
+ Grid mode is auto-detected when `filenameGrid` or `imageListGrid` is provided.
227
+
228
+ **Using a filename pattern:**
229
+
230
+ ```javascript
231
+ CI360.init(document.getElementById('viewer'), {
232
+ folder: 'https://your-domain.com/images/',
233
+ filenameGrid: 'product_{indexY}_{indexX}.jpg',
234
+ amountX: 24, // horizontal angles
235
+ amountY: 4, // vertical angles
236
+ indexZeroBase: 3, // zero-pad to 3 digits: 001, 002, ...
237
+ stopAtEdgesY: true, // prevent Y from looping
238
+ });
239
+ ```
240
+
241
+ Placeholders `{indexX}` and `{indexY}` are replaced with 1-based indices (respecting `indexZeroBase` for zero-padding). Images are stored internally as a flat array with the formula `imagesGrid[y * amountX + x]`.
242
+
243
+ **Using an explicit image list:**
244
+
245
+ ```javascript
246
+ CI360.init(document.getElementById('viewer'), {
247
+ imageListGrid: [
248
+ // y=0 row (all X frames at first vertical angle)
249
+ 'img_001_001.jpg', 'img_001_002.jpg', /* ... */
250
+ // y=1 row
251
+ 'img_002_001.jpg', 'img_002_002.jpg', /* ... */
252
+ ],
253
+ amountX: 24,
254
+ amountY: 4,
255
+ });
256
+ ```
257
+
258
+ **Autoplay** works with all four behaviors: `spin-x` (horizontal only), `spin-y` (vertical only), `spin-xy` (row-scan: X advances each tick, Y advances when X wraps), and `spin-yx` (column-scan).
259
+
260
+ **Per-axis edge stopping** — use `stopAtEdgesX` and `stopAtEdgesY` to control looping independently. This is useful when one axis has full 360° coverage but the other has limited angles:
261
+
262
+ ```javascript
263
+ {
264
+ stopAtEdgesY: true, // Y has only 4 angles, don't loop
265
+ // X loops freely (default)
266
+ }
267
+ ```
268
+
269
+ **React:**
270
+
271
+ ```tsx
272
+ <CI360Viewer
273
+ folder="https://your-domain.com/images/"
274
+ filenameGrid="product_{indexY}_{indexX}.jpg"
275
+ amountX={24}
276
+ amountY={4}
277
+ indexZeroBase={3}
278
+ stopAtEdgesY
279
+ />
280
+ ```
281
+
220
282
  ---
221
283
 
222
284
  ## React / Next.js
@@ -401,6 +463,8 @@ All options can be set via JavaScript config or HTML data attributes.
401
463
  | `filenameY` | `data-filename-y` | `null` | Filename pattern for Y-axis images |
402
464
  | `imageListX` | `data-image-list-x` | `null` | Array of image URLs for X-axis (alternative to folder/filename) |
403
465
  | `imageListY` | `data-image-list-y` | `null` | Array of image URLs for Y-axis |
466
+ | `filenameGrid` | `data-filename-grid` | `null` | Filename pattern for 2D grid mode. Uses `{indexX}` and `{indexY}` placeholders |
467
+ | `imageListGrid` | `data-image-list-grid` | `null` | Array of image URLs for 2D grid (flat or 2D array, Y-outer X-inner order) |
404
468
  | `amountX` | `data-amount-x` | `0` | Total number of X-axis images |
405
469
  | `amountY` | `data-amount-y` | `0` | Total number of Y-axis images |
406
470
  | `indexZeroBase` | `data-index-zero-base` | `0` | Starting index for image filenames |
@@ -426,7 +490,9 @@ All options can be set via JavaScript config or HTML data attributes.
426
490
  | `dragReverse` | `data-drag-reverse` | `false` | Reverse drag direction |
427
491
  | `keys` | `data-keys` | `false` | Enable keyboard arrow navigation |
428
492
  | `keysReverse` | `data-keys-reverse` | `false` | Reverse keyboard direction |
429
- | `stopAtEdges` | `data-stop-at-edges` | `false` | Stop rotation at first/last frame |
493
+ | `stopAtEdges` | `data-stop-at-edges` | `false` | Stop rotation at first/last frame (both axes) |
494
+ | `stopAtEdgesX` | `data-stop-at-edges-x` | `null` | Stop X-axis at edges. Overrides `stopAtEdges` for X when set |
495
+ | `stopAtEdgesY` | `data-stop-at-edges-y` | `null` | Stop Y-axis at edges. Overrides `stopAtEdges` for Y when set |
430
496
  | `pinchZoom` | `data-pinch-zoom` | `true` | Enable pinch-to-zoom on touch devices |
431
497
 
432
498
  ### Display Options