js-cloudimage-360-view 4.2.0 → 4.3.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/README.md +62 -0
- package/dist/js-cloudimage-360-view.min.js +7 -7
- package/dist/react/{ci360-CILBSFAa.mjs → ci360-85fPJbOD.mjs} +1063 -801
- package/dist/react/ci360-85fPJbOD.mjs.map +1 -0
- package/dist/react/ci360-lO9vxGoH.js +35 -0
- package/dist/react/ci360-lO9vxGoH.js.map +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.js +1 -1
- package/dist/react/style.css +1 -1
- package/package.json +1 -1
- package/src/react/types.d.ts +6 -0
- package/src/types/ci360.d.ts +1 -0
- package/dist/react/ci360-CILBSFAa.mjs.map +0 -1
- package/dist/react/ci360-TSs45Yhc.js +0 -35
- package/dist/react/ci360-TSs45Yhc.js.map +0 -1
package/README.md
CHANGED
|
@@ -443,6 +443,7 @@ All options can be set via JavaScript config or HTML data attributes.
|
|
|
443
443
|
| `lazyload` | `data-lazyload` | `true` | Enable lazy loading |
|
|
444
444
|
| `hints` | `data-hints` | `true` | Show interaction hints on load |
|
|
445
445
|
| `theme` | `data-theme` | `null` | Color theme: `'light'` or `'dark'` |
|
|
446
|
+
| `hotspotTrigger` | `data-hotspot-trigger` | `'hover'` | Hotspot trigger mode: `'hover'` or `'click'` |
|
|
446
447
|
| `hotspotTimelineOnClick` | `data-hotspot-timeline-on-click` | `true` | Show hotspot popup when clicking timeline dot |
|
|
447
448
|
|
|
448
449
|
### Cloudimage CDN Options
|
|
@@ -914,6 +915,67 @@ const config = {
|
|
|
914
915
|
|
|
915
916
|
---
|
|
916
917
|
|
|
918
|
+
## Mobile Considerations
|
|
919
|
+
|
|
920
|
+
### Memory Limitations
|
|
921
|
+
|
|
922
|
+
Mobile browsers (especially Safari) have strict memory limits that can cause tab crashes when loading many high-resolution images. The library includes built-in optimizations for mobile that are **automatically enabled**:
|
|
923
|
+
|
|
924
|
+
- **Sequential image loading** (3 concurrent on mobile vs 6 on desktop)
|
|
925
|
+
- **Main-thread canvas rendering** (avoids OffscreenCanvas memory issues on Safari)
|
|
926
|
+
- **Reduced touch event rate** (30fps vs 100fps on desktop)
|
|
927
|
+
- **Capped device pixel ratio** (max 2x on mobile)
|
|
928
|
+
- **Automatic memory management** (releases off-screen viewers, frees memory when page backgrounded)
|
|
929
|
+
|
|
930
|
+
### Recommended Settings for Mobile
|
|
931
|
+
|
|
932
|
+
| Setting | Desktop | Mobile | Notes |
|
|
933
|
+
|---------|---------|--------|-------|
|
|
934
|
+
| `amountX` | 60-100+ | 30-40 max | Each image uses ~4MB GPU memory |
|
|
935
|
+
| `pointerZoom` | ✅ | ❌ | Loads higher-res images |
|
|
936
|
+
| `magnifier` | ✅ | ❌ | Loads higher-res images |
|
|
937
|
+
|
|
938
|
+
### Detecting Mobile Devices
|
|
939
|
+
|
|
940
|
+
The library automatically detects mobile devices, but you can also adjust your configuration:
|
|
941
|
+
|
|
942
|
+
```javascript
|
|
943
|
+
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
944
|
+
navigator.userAgent
|
|
945
|
+
);
|
|
946
|
+
|
|
947
|
+
const viewer = new CI360();
|
|
948
|
+
viewer.init(container, {
|
|
949
|
+
folder: 'https://example.com/images/',
|
|
950
|
+
filenameX: '{index}.jpg',
|
|
951
|
+
amountX: isMobile ? 36 : 72, // Fewer images on mobile
|
|
952
|
+
pointerZoom: isMobile ? false : 2, // Disable zoom on mobile
|
|
953
|
+
magnifier: isMobile ? false : 3, // Disable magnifier on mobile
|
|
954
|
+
});
|
|
955
|
+
```
|
|
956
|
+
|
|
957
|
+
### Memory Management API
|
|
958
|
+
|
|
959
|
+
Memory management is **automatically enabled on mobile**. For desktop or manual control:
|
|
960
|
+
|
|
961
|
+
```javascript
|
|
962
|
+
const viewer = new CI360();
|
|
963
|
+
viewer.initAll();
|
|
964
|
+
|
|
965
|
+
// Manually enable (already auto-enabled on mobile)
|
|
966
|
+
viewer.enableMemoryManagement();
|
|
967
|
+
|
|
968
|
+
// Disable if needed
|
|
969
|
+
viewer.disableMemoryManagement();
|
|
970
|
+
```
|
|
971
|
+
|
|
972
|
+
This uses IntersectionObserver to:
|
|
973
|
+
- Release memory when viewers scroll off-screen
|
|
974
|
+
- Reload images when viewers become visible again
|
|
975
|
+
- Release all viewer memory when the page is backgrounded
|
|
976
|
+
|
|
977
|
+
---
|
|
978
|
+
|
|
917
979
|
## Migration Guide (v3 → v4)
|
|
918
980
|
|
|
919
981
|
Version 4 introduces significant improvements in performance, customization, and developer experience. This guide helps you upgrade from v3.
|