@c4h/chuci 0.2.2 → 0.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4h/chuci",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Standalone multimedia swiper and viewer web components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -74,7 +74,7 @@ export class CcViewer3DModel extends CcViewerBase {
74
74
  `
75
75
  ${this.isLoading ? '<div class="loading">Loading...</div>' : ''}
76
76
  ${!this.isLoading && this.debugMode ? `
77
- <div class="debug-info" style="z-index: 1005;">
77
+ <div class="debug-info" style="z-index: calc(var(--cc-viewer-z-index-each, 1000) + 5);">
78
78
  Camera Position: ${this.getCameraDebugInfo()}<br>
79
79
  Camera Target: ${this.getTargetDebugInfo()}<br>
80
80
  Controls: Rotate (drag), Zoom (scroll), Pan (right-drag)
@@ -150,7 +150,7 @@ export class CcViewer3DModel extends CcViewerBase {
150
150
  font-size: 12px;
151
151
  border-radius: 4px;
152
152
  pointer-events: none;
153
- z-index: 1010;
153
+ z-index: calc(var(--cc-viewer-z-index-each, 1000) + 10);
154
154
  }
155
155
 
156
156
  .texture-toggle {
@@ -164,7 +164,7 @@ export class CcViewer3DModel extends CcViewerBase {
164
164
  cursor: pointer;
165
165
  border-radius: 4px;
166
166
  transition: background 0.3s;
167
- z-index: 1010;
167
+ z-index: calc(var(--cc-viewer-z-index-each, 1000) + 10);
168
168
  pointer-events: auto;
169
169
  }
170
170
 
@@ -325,7 +325,11 @@ export class CcViewer3DModel extends CcViewerBase {
325
325
  canvas.style.width = `${rect.width}px`
326
326
  canvas.style.height = `${rect.height}px`
327
327
  canvas.style.pointerEvents = 'auto'
328
- canvas.style.zIndex = 'calc(var(--cc-viewer-z-index-each, 1000) + 1)'
328
+ // Get z-index from host style
329
+ const hostStyle = window.getComputedStyle(this)
330
+ const zIndexVar = hostStyle.getPropertyValue('--cc-viewer-z-index-each').trim()
331
+ const baseZIndex = zIndexVar ? parseInt(zIndexVar, 10) : 1000
332
+ canvas.style.zIndex = `${baseZIndex + 1}`
329
333
  document.body.appendChild(canvas)
330
334
 
331
335
  // Store canvas reference for cleanup
@@ -75,7 +75,7 @@ export class CcViewerGaussian extends CcViewerBase {
75
75
  width: 100%;
76
76
  height: 100%;
77
77
  background-color: rgba(0, 0, 0, 0.9);
78
- z-index: 1000;
78
+ z-index: var(--cc-viewer-z-index-each, 1000);
79
79
  }
80
80
 
81
81
  .viewer {
@@ -142,7 +142,7 @@ export class CcViewerGaussian extends CcViewerBase {
142
142
  pointer-events: none;
143
143
  white-space: pre-line;
144
144
  min-width: 200px;
145
- z-index: 1003;
145
+ z-index: calc(var(--cc-viewer-z-index-each, 1000) + 3);
146
146
  }
147
147
 
148
148
  ${this.getNavigationStyles()}
@@ -276,7 +276,11 @@ ${this.getTargetDebugInfo()}
276
276
  normalCanvas.style.left = `${rect.left}px`
277
277
  normalCanvas.style.width = `${rect.width}px`
278
278
  normalCanvas.style.height = `${rect.height}px`
279
- normalCanvas.style.zIndex = 'calc(var(--cc-viewer-z-index-each, 1000) + 1)' // Above backdrop but below buttons
279
+ // Get z-index from host style
280
+ const hostStyle = window.getComputedStyle(this)
281
+ const zIndexVar = hostStyle.getPropertyValue('--cc-viewer-z-index-each').trim()
282
+ const baseZIndex = zIndexVar ? parseInt(zIndexVar, 10) : 1000
283
+ normalCanvas.style.zIndex = `${baseZIndex + 1}` // Above backdrop but below buttons
280
284
  normalCanvas.style.pointerEvents = 'auto' // Keep mouse events for 3D controls
281
285
  normalCanvas.style.display = 'block'
282
286
  normalCanvas.style.background = 'transparent'