js-cloudimage-360-view 4.9.3 → 4.9.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/README.md CHANGED
@@ -101,7 +101,7 @@ Add the library via CDN and create your first 360 viewer in seconds:
101
101
 
102
102
  ```html
103
103
  <!-- Add the library (CSS is auto-injected) -->
104
- <script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.3/js-cloudimage-360-view.min.js?vh=997be0&func=proxy"></script>
104
+ <script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.5/js-cloudimage-360-view.min.js?vh=32f739&func=proxy"></script>
105
105
 
106
106
  <!-- Create a container with data attributes -->
107
107
  <div
@@ -125,7 +125,7 @@ Add the library via CDN and create your first 360 viewer in seconds:
125
125
  ### Option 1: CDN (Recommended for Quick Setup)
126
126
 
127
127
  ```html
128
- <script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.3/js-cloudimage-360-view.min.js?vh=997be0&func=proxy"></script>
128
+ <script src="https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/4.9.5/js-cloudimage-360-view.min.js?vh=32f739&func=proxy"></script>
129
129
  ```
130
130
 
131
131
  > **Note:** CSS is automatically injected by the script - no separate stylesheet needed.
@@ -509,11 +509,14 @@ All options can be set via JavaScript config or HTML data attributes.
509
509
  | `bottomCircle` | `data-bottom-circle` | `false` | Show 360° progress indicator |
510
510
  | `bottomCircleOffset` | `data-bottom-circle-offset` | `5` | Progress indicator offset (px) |
511
511
  | `initialIconShown` | `data-initial-icon` | `true` | Show 360° icon on load |
512
+ | `initOnClick` | `data-init-on-click` | `false` | If true, images load only after the user clicks on the viewer. Shows a first-frame preview with a click overlay. Useful for grids with multiple 360 views |
512
513
  | `lazyload` | `data-lazyload` | `true` | Enable lazy loading |
513
514
  | `hints` | `data-hints` | `true` | Show interaction hints on load |
514
515
  | `theme` | `data-theme` | `null` | Color theme: `'light'` or `'dark'` |
515
516
  | `hotspotTrigger` | `data-hotspot-trigger` | `'hover'` | Hotspot trigger mode: `'hover'` or `'click'` |
516
517
  | `hotspotTimelineOnClick` | `data-hotspot-timeline-on-click` | `true` | Show hotspot popup when clicking timeline dot |
518
+ | `markerTheme` | `data-marker-theme` | `null` | Hotspot marker theme: `'default'`, `'inverted'`, or `'brand'` |
519
+ | `brandColor` | `data-brand-color` | `null` | Brand accent color for `'brand'` marker theme (e.g. `'#ff6600'`) |
517
520
 
518
521
  ### Cloudimage CDN Options
519
522
 
@@ -612,9 +615,14 @@ const config = {
612
615
  | `orientation` | Yes | `'x'` or `'y'` axis |
613
616
  | `containerSize` | Yes | `[width, height]` reference dimensions |
614
617
  | `positions` | Yes | Object mapping frame index to `{ x, y }` coordinates |
615
- | `content` | Yes | HTML content for the tooltip |
618
+ | `content` | No | HTML content for the tooltip |
616
619
  | `label` | No | Short label for the hotspot (used in timeline tooltips) |
617
620
  | `onClick` | No | Click handler function |
621
+ | `keepOpen` | No | If `true`, the popover stays open until explicitly closed |
622
+ | `className` | No | Custom CSS class(es) to add to the hotspot element |
623
+ | `markerTheme` | No | Per-hotspot theme override: `'default'`, `'inverted'`, or `'brand'` |
624
+ | `navigateTo` | No | Scene ID to navigate to on click (turns hotspot into a navigation pin) |
625
+ | `arrowDirection` | No | Rotation angle (degrees) for the navigation arrow icon. Only applies when `navigateTo` is set |
618
626
 
619
627
  ### Hotspot Timeline
620
628
 
@@ -710,6 +718,76 @@ Customize the timeline appearance with CSS variables:
710
718
  }
711
719
  ```
712
720
 
721
+ ### Marker Themes
722
+
723
+ Control the visual appearance of hotspot markers at the viewer level or per-hotspot.
724
+
725
+ **Viewer-level theme** applies to all hotspots:
726
+
727
+ ```javascript
728
+ const config = {
729
+ hotspots: [...],
730
+ markerTheme: 'inverted', // 'default', 'inverted', or 'brand'
731
+ brandColor: '#ff6600', // Used when markerTheme is 'brand'
732
+ };
733
+ ```
734
+
735
+ **Per-hotspot theme** overrides the viewer-level theme for individual markers:
736
+
737
+ ```javascript
738
+ const hotspots = [
739
+ {
740
+ id: 'highlight',
741
+ markerTheme: 'brand', // Override for this hotspot only
742
+ positions: { 0: { x: 500, y: 300 } },
743
+ content: '<div>Highlighted feature</div>',
744
+ // ...
745
+ },
746
+ {
747
+ id: 'subtle',
748
+ markerTheme: 'inverted', // Different override
749
+ positions: { 5: { x: 200, y: 150 } },
750
+ content: '<div>Subtle marker</div>',
751
+ // ...
752
+ },
753
+ ];
754
+ ```
755
+
756
+ | Theme | Description |
757
+ |-------|-------------|
758
+ | `'default'` | Light marker on light backgrounds (default) |
759
+ | `'inverted'` | Dark marker that blends with dark backgrounds |
760
+ | `'brand'` | Uses `brandColor` as the marker accent color |
761
+
762
+ All themes adapt automatically to the `theme: 'dark'` setting.
763
+
764
+ ### Navigation Hotspots
765
+
766
+ Hotspots with a `navigateTo` property become navigation pins that link between scenes:
767
+
768
+ ```javascript
769
+ const hotspots = [
770
+ {
771
+ id: 'go-to-interior',
772
+ navigateTo: 'interior-scene',
773
+ label: 'View Interior',
774
+ arrowDirection: 90, // Point downward (default is right)
775
+ positions: { 10: { x: 600, y: 400 } },
776
+ // ...
777
+ },
778
+ ];
779
+
780
+ const config = {
781
+ hotspots,
782
+ onNavigate: (sceneId) => {
783
+ // Handle scene transition
784
+ console.log(`Navigate to: ${sceneId}`);
785
+ },
786
+ };
787
+ ```
788
+
789
+ Navigation hotspots display a directional arrow icon. Use `arrowDirection` to rotate the arrow (in degrees, default `0` points right).
790
+
713
791
  ---
714
792
 
715
793
  ## Interaction Hints