belowjs 1.0.0 → 1.1.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/CHANGELOG.md +21 -1
- package/README.md +8 -5
- package/dist/belowjs.css +1 -1
- package/dist/belowjs.js +53 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,8 +5,28 @@ All notable changes to BelowJS will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.1.0] - 2025-09-03
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Screenshot capture button in the viewer UI
|
|
12
|
+
- `enableScreenshot` config option on `ModelViewer`
|
|
13
|
+
- `takeScreenshot()` method to programmatically save a PNG
|
|
14
|
+
- Styles for `.screenshot-button` and light/no-measurement variants
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Enable `preserveDrawingBuffer` on the renderer to support screenshots
|
|
18
|
+
- Examples updated to include `enableScreenshot: true`
|
|
19
|
+
|
|
8
20
|
## [1.0.0] - 2025-08-27 - Stable Release
|
|
9
21
|
|
|
22
|
+
## [1.0.1] - 2025-09-03
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- Cleaned the basic example (`examples/basic/index.html`):
|
|
26
|
+
- Remove legacy `#vrComfortButton` style rule
|
|
27
|
+
- Remove redundant manual dropdown listener (internal handler used)
|
|
28
|
+
- Disable `autoLoadFirst` and explicitly load initial model (`kxi`)
|
|
29
|
+
|
|
10
30
|
### Release Notes
|
|
11
31
|
- **Stable 1.0.0**: First stable release of the BelowJS library
|
|
12
32
|
- **Production ready**: Complete 3D model viewer with VR support
|
|
@@ -68,4 +88,4 @@ BelowJS 1.0.0 is now production-ready for underwater/dive model visualization wi
|
|
|
68
88
|
- Built on Three.js 0.179.1 with modern ES modules
|
|
69
89
|
- Modular architecture with clean separation of concerns
|
|
70
90
|
- Event-driven system for extensibility
|
|
71
|
-
- Production-ready with comprehensive error handling
|
|
91
|
+
- Production-ready with comprehensive error handling
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
📖 **[Full Documentation & Examples](https://patrick-morrison.github.io/belowjs/)**
|
|
8
8
|
|
|
9
|
-
> **Current Version:** `1.
|
|
9
|
+
> **Current Version:** `1.1.0` - Stable release with screenshot capture support.
|
|
10
10
|
|
|
11
11
|
**Dive Shipwrecks in Virtual Reality**
|
|
12
12
|
|
|
@@ -59,11 +59,11 @@ This gives you a complete VR-ready 3D viewer with dive lighting, measurement too
|
|
|
59
59
|
{
|
|
60
60
|
"imports": {
|
|
61
61
|
"three": "https://cdn.jsdelivr.net/npm/three@0.179.1/+esm",
|
|
62
|
-
"belowjs": "https://cdn.jsdelivr.net/npm/belowjs@1.
|
|
62
|
+
"belowjs": "https://cdn.jsdelivr.net/npm/belowjs@1.1.0/dist/belowjs.js"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
</script>
|
|
66
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/belowjs@1.
|
|
66
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/belowjs@1.1.0/dist/belowjs.css">
|
|
67
67
|
<style>
|
|
68
68
|
body, html { margin: 0; padding: 0; overflow: hidden; }
|
|
69
69
|
</style>
|
|
@@ -185,10 +185,13 @@ new ModelViewer(document.body, {
|
|
|
185
185
|
},
|
|
186
186
|
enableVR: true,
|
|
187
187
|
enableMeasurement: true,
|
|
188
|
-
enableDiveSystem: true
|
|
188
|
+
enableDiveSystem: true,
|
|
189
|
+
enableScreenshot: true
|
|
189
190
|
});
|
|
190
191
|
```
|
|
191
192
|
|
|
193
|
+
Enable `enableScreenshot` to add a button that captures the scene without UI overlays.
|
|
194
|
+
|
|
192
195
|
### URL Parameter Integration
|
|
193
196
|
The embed example supports URL parameters for dynamic configuration:
|
|
194
197
|
|
|
@@ -216,4 +219,4 @@ GPL-3.0-or-later — See [LICENSE](LICENSE) file.
|
|
|
216
219
|
|
|
217
220
|
Created by [Patrick Morrison](https://padmorrison.com).
|
|
218
221
|
|
|
219
|
-
Built for underwater archaeology. Models courtesy of [WreckSploration](https://wrecksploration.au).
|
|
222
|
+
Built for underwater archaeology. Models courtesy of [WreckSploration](https://wrecksploration.au).
|
package/dist/belowjs.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--below-bg-color: #0a0a0a;--below-text-color: #e8e8e8;--below-accent-color: #64B5F6;--below-panel-bg: rgba(255, 255, 255, .08);--below-panel-border: rgba(255, 255, 255, .12);--below-panel-backdrop: blur(20px);--below-panel-shadow: 0 8px 32px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);--below-font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--below-bg-color);color:var(--below-text-color);font-family:var(--below-font-family)}.below-viewer-container{width:100%;height:100%;position:relative}.below-viewer-container canvas{display:block;width:100%;height:100%}.below-panel{background:var(--below-panel-bg);-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);border:1px solid var(--below-panel-border);border-radius:16px;box-shadow:var(--below-panel-shadow)}.model-selector{position:absolute;top:20px;right:20px;z-index:50;background:var(--below-panel-bg);-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);border:1px solid var(--below-panel-border);border-radius:20px;padding:24px;display:flex;flex-direction:column;gap:20px;min-width:220px;box-shadow:var(--below-panel-shadow);transition:all .3s ease}.model-selector:hover{transform:translateY(-2px);box-shadow:0 12px 40px #0006,0 4px 12px #0000004d}.model-selector__dropdown{background:linear-gradient(145deg,#ffffff14,#ffffff0a);color:var(--below-text-color);border:1px solid rgba(255,255,255,.1);padding:16px 20px;font-size:23px;font-weight:500;font-family:inherit;cursor:pointer;outline:none;transition:all .3s ease;min-width:100%;border-radius:12px;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:inset 0 1px 3px #0000001a}.model-selector__dropdown:focus{border-color:var(--below-accent-color);box-shadow:0 0 0 2px #64b5f633,inset 0 1px 3px #0000001a}.model-selector__dropdown:hover{background:#ffffff1a;border-color:#fff3;transform:translateY(-1px);box-shadow:0 4px 12px #00000026}.model-selector__dropdown:disabled{cursor:not-allowed;opacity:.5}.model-selector__dropdown option{background:#1a1a1a;color:var(--below-text-color);padding:12px;font-size:14px}.loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1000;display:none;flex-direction:column;align-items:center;gap:20px;text-align:center}.loading-spinner{position:relative;display:flex;align-items:center;justify-content:center}.spinner-circle{position:relative;width:64px;height:64px}.spinner-path{position:absolute;top:0;left:0;width:100%;height:100%;border:3px solid rgba(255,255,255,.15);border-top:3px solid #ffffff;border-radius:50%;animation:spinner-rotate 1.5s ease-in-out infinite}.spinner-percentage{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:13px;font-weight:700;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.8);letter-spacing:-.5px}.loading-content{display:flex;flex-direction:column;gap:8px;align-items:center}.loading-model-name{font-size:18px;font-weight:500;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.8);letter-spacing:.3px}.loading-status{font-size:14px;font-weight:400;color:#ffffffd9;text-shadow:0 1px 2px rgba(0,0,0,.6)}@keyframes spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-indicator.light-theme .loading-model-name{color:#1a1a1a!important;text-shadow:0 1px 2px rgba(255,255,255,.8)!important}.loading-indicator.light-theme .loading-status{color:#1a1a1acc!important;text-shadow:0 1px 2px rgba(255,255,255,.6)!important}.loading-indicator.light-theme .spinner-percentage{color:#1a1a1a!important;text-shadow:0 1px 2px rgba(255,255,255,.8)!important}.loading-indicator.light-theme .spinner-path{border-color:#1a1a1a26!important;border-top-color:#1a1a1a!important}.status{position:absolute;bottom:20px;right:20px;background:#000000b3;padding:10px 15px;border-radius:8px;font-size:12px;z-index:10}.fullscreen-button{position:absolute;bottom:90px;right:20px;width:36px;height:36px;border-radius:50%;background:var(--below-panel-bg);border:1px solid var(--below-panel-border);color:var(--below-text-color);display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:120;-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);box-shadow:0 4px 16px #0003;-webkit-user-select:none;user-select:none;transition:transform .3s ease,box-shadow .3s ease}.fullscreen-button:hover{transform:translateY(-2px);box-shadow:0 8px 24px #0000004d}.fullscreen-button.light-theme{background:#000c!important;border:1px solid rgba(0,0,0,.2)!important;color:#fffffff2!important;box-shadow:0 2px 12px #00000040!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;top:20px!important;bottom:auto!important;right:20px!important}.fullscreen-button.light-theme:hover{background:#000000e6!important;border-color:#0000004d!important;color:#fff!important;transform:translateY(-2px) scale(1.02)!important;box-shadow:0 4px 20px #00000059!important}.fullscreen-button.no-measurement{bottom:20px!important}.info-panel{position:absolute;top:20px;left:20px;z-index:10;padding:20px 24px;max-width:340px;-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);background:var(--below-panel-bg);border:1px solid var(--below-panel-border);border-radius:16px;box-shadow:var(--below-panel-shadow);transition:all .3s ease}.info-panel:hover{transform:translateY(-1px);box-shadow:0 12px 40px #0006,0 4px 12px #0000004d}.info-panel__title{color:#fff;font-size:22px;font-weight:800;margin-bottom:12px;text-transform:uppercase;letter-spacing:1.2px;background:linear-gradient(135deg,#fff,#f5f5f5);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 0 8px rgba(255,255,255,.3))}.info-panel__controls{margin-top:8px;font-size:13px;line-height:1.5;color:#b0b0b0}.info-panel__controls strong{color:var(--below-text-color);font-weight:600}@media (max-width: 768px){.info-panel{top:10px;left:10px;padding:16px;max-width:280px}}.vr-button--glass,.vr-button-glass,[style*="position: absolute"][style*=bottom]{position:fixed!important;bottom:80px!important;left:50%!important;transform:translate(-50%)!important;z-index:100!important;padding:16px 32px!important;min-width:160px!important;height:56px!important;background:#ffffff1a!important;-webkit-backdrop-filter:blur(20px) saturate(140%)!important;backdrop-filter:blur(20px) saturate(140%)!important;border:1px solid rgba(255,255,255,.2)!important;border-radius:16px!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif!important;font-size:14px!important;font-weight:300!important;color:#fff!important;text-transform:uppercase!important;letter-spacing:.1em!important;white-space:nowrap!important;text-align:center!important;line-height:1.2!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;box-shadow:0 8px 32px #0000004d,0 2px 8px #4ec3ff0d,inset 0 1px #ffffff0d!important;cursor:pointer!important;transition:all .4s cubic-bezier(.4,0,.2,1)!important;outline:none!important;text-decoration:none!important;position:relative!important;overflow:hidden!important}.vr-button--glass:before,.vr-button-glass:before,.vr-button-available:before,[style*="position: absolute"][style*=bottom]:before{content:""!important;position:absolute!important;top:0!important;left:-100%!important;width:100%!important;height:100%!important;background:linear-gradient(90deg,transparent,rgba(255,255,255,.15),rgba(255,255,255,.3),rgba(255,255,255,.15),transparent)!important;animation:vrShimmerInviting 4s ease-in-out infinite!important;border-radius:16px!important;pointer-events:none!important}@keyframes vrShimmerInviting{0%,80%{left:-100%!important;opacity:0!important}85%{left:-50%!important;opacity:.5!important}90%{left:0!important;opacity:1!important}95%{left:50%!important;opacity:.5!important}to{left:100%!important;opacity:0!important}}.vr-button--glass:hover,.vr-button-glass:hover,.vr-button-available:hover{background:#ffffff26!important;border-color:#ffffff4d!important;transform:translate(-50%) translateY(-2px)!important;box-shadow:0 12px 40px #0006,0 4px 12px #4ec3ff1a,inset 0 1px #ffffff14!important}.vr-button--glass:hover:before,.vr-button-glass:hover:before,.vr-button-available:hover:before,[style*="position: absolute"][style*=bottom]:hover:before{animation:vrShimmer 1.5s ease-in-out infinite!important}.vr-button--glass:active,.vr-button-glass:active,.vr-button-available:active{transform:translate(-50%) translateY(-1px)!important;background:#fff3!important;box-shadow:0 6px 20px #0006,0 2px 6px #4ec3ff1a,inset 0 1px #ffffff1a!important;transition:all .1s ease!important}.vr-button-disabled,button.vr-button-disabled{background:#9ca3af1a!important;border:1px solid rgba(156,163,175,.3)!important;color:#9ca3af!important;cursor:not-allowed!important;opacity:.6!important;box-shadow:0 4px 16px #0003!important;pointer-events:none!important}.vr-button-disabled:before,button.vr-button-disabled:before{display:none!important}@keyframes vrShimmer{0%{left:-100%!important;opacity:0!important}50%{left:0!important;opacity:1!important}to{left:100%!important;opacity:0!important}}@media (max-width: 768px){.vr-button--glass,.vr-button-glass,[style*="position: absolute"][style*=bottom]{bottom:60px!important;padding:12px 24px!important;min-width:140px!important;height:48px!important;font-size:12px!important}.vr-icon{font-size:14px!important}.info-panel{display:none}}.vr-mode .info-panel{display:none!important}.vr-mode .model-selector{pointer-events:none;opacity:.5}.vr-controller{pointer-events:none}.vr-loading{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:#000c;color:#fff;padding:20px;border-radius:10px;font-size:18px;z-index:1000}.vr-measurement-panel{position:fixed;top:20px;right:20px;background:#000c;color:#fff;padding:15px;border-radius:10px;border:2px solid #87cefa;z-index:100;font-family:monospace}.vr-reticle{position:fixed;top:50%;left:50%;width:4px;height:4px;background:#fffc;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:999}.vr-teleport-indicator{position:absolute;width:2px;height:2px;background:#0f0;border-radius:50%;pointer-events:none;opacity:.8}.vr-hand-model{pointer-events:none}.vr-spotlight-indicator{position:fixed;bottom:80px;left:50%;transform:translate(-50%);color:#fffc;font-size:14px;text-align:center;pointer-events:none;z-index:90}@supports (-webkit-appearance: none){.vr-button--glass,.vr-button-glass,[style*="position: absolute"][style*=bottom]{backdrop-filter:blur(20px) saturate(140%)!important;-webkit-backdrop-filter:blur(20px) saturate(140%)!important}}.mode-toggle-container{display:flex;flex-direction:column;gap:20px}.semantic-toggle{position:relative;width:180px;height:60px;margin:0 auto;background:#ffffff0f;border-radius:30px;border:1px solid rgba(255,255,255,.1);overflow:hidden}.semantic-toggle input{position:absolute;opacity:0;width:0;height:0}.toggle-option{position:absolute;top:0;width:90px;height:60px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;transition:all .4s cubic-bezier(.4,0,.2,1);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.toggle-option.left{left:0}.toggle-option.right{right:0}.toggle-icon{font-size:20px;margin-bottom:4px;transition:all .3s ease}.toggle-text{color:#888;transition:all .3s ease;font-size:12px}.toggle-slider-bg{position:absolute;top:4px;left:4px;width:82px;height:52px;background:linear-gradient(135deg,#4caf50,#388e3c);border-radius:26px;transition:all .4s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 16px #4caf5066,0 2px 8px #0003}.semantic-toggle input:checked+.toggle-slider-bg{transform:translate(90px);background:linear-gradient(135deg,#64b5f6,#42a5f5);box-shadow:0 4px 16px #64b5f666,0 2px 8px #0003}.semantic-toggle input:not(:checked)~.toggle-option.left .toggle-icon{color:#fff;filter:drop-shadow(0 0 8px rgba(255,255,255,.5))}.semantic-toggle input:not(:checked)~.toggle-option.left .toggle-text{color:#fff;font-weight:700}.semantic-toggle input:checked~.toggle-option.right .toggle-icon{color:#fff;filter:drop-shadow(0 0 8px rgba(255,255,255,.5))}.semantic-toggle input:checked~.toggle-option.right .toggle-text{color:#fff;font-weight:700}.semantic-toggle:hover .toggle-slider-bg{box-shadow:0 6px 20px #4caf5080,0 2px 12px #0000004d}.semantic-toggle input:checked:hover+.toggle-slider-bg{box-shadow:0 6px 20px #64b5f680,0 2px 12px #0000004d}.dive-mode-indicator{position:absolute;top:20px;right:20px;z-index:15;background:#64b5f61a;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:1px solid rgba(100,181,246,.3);border-radius:12px;padding:8px 16px;font-size:12px;font-weight:600;color:#64b5f6;text-transform:uppercase;letter-spacing:.5px;opacity:0;transform:translateY(-10px);transition:all .3s ease}.dive-mode-indicator.active{opacity:1;transform:translateY(0)}.survey-mode-indicator{position:absolute;top:20px;right:20px;z-index:15;background:#4caf501a;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:1px solid rgba(76,175,80,.3);border-radius:12px;padding:8px 16px;font-size:12px;font-weight:600;color:#4caf50;text-transform:uppercase;letter-spacing:.5px;opacity:0;transform:translateY(-10px);transition:all .3s ease}.survey-mode-indicator.active{opacity:1;transform:translateY(0)}.dive-control-panel{position:absolute;top:20px;right:20px;z-index:10;background:#ffffff14;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.12);border-radius:20px;padding:24px;display:flex;flex-direction:column;gap:20px;min-width:220px;box-shadow:0 8px 32px #0000004d}.dive-control-title{color:#64b5f6;font-size:14px;font-weight:700;text-transform:uppercase;letter-spacing:1px;text-align:center;margin-bottom:8px}@keyframes diveTransition{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes surveyTransition{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.dive-mode-active .dive-control-panel{animation:diveTransition .3s ease-out}.survey-mode-active .dive-control-panel{animation:surveyTransition .3s ease-out}.measurement-panel{position:absolute;bottom:20px;right:20px;background:#ffffff0f;color:#ffffffe6;padding:12px 16px;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:500;z-index:100;cursor:pointer;border:1px solid rgba(255,255,255,.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:all .4s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none;min-width:100px;text-align:center;box-shadow:0 2px 8px #00000026}.measurement-panel:hover{background:#ffffff1a;border-color:#fff3;color:#fff;transform:scale(1.02);box-shadow:0 4px 16px #0003}.measurement-panel .disabled{color:#fff6;border-color:#ffffff0d;background:#ffffff05}.measurement-panel .active{color:#4ade80;border-color:#4ade804d;background:#4ade801a;box-shadow:0 0 20px #4ade801a}.measurement-panel .measured{color:#60a5fa;border-color:#60a5fa4d;background:#60a5fa1a;box-shadow:0 0 20px #60a5fa1a}.measurement-panel.light-theme{background:#000c;color:#fffffff2;border:1px solid rgba(0,0,0,.2);box-shadow:0 2px 12px #00000040}.measurement-panel.light-theme:hover{background:#000000e6;border-color:#0000004d;color:#fff;transform:scale(1.02);box-shadow:0 4px 20px #00000059}.measurement-panel.light-theme.disabled{color:#ffffff80;border-color:#0000001a;background:#0009}.measurement-panel.light-theme.active{color:#10b981;border-color:#10b98166;background:#000000d9;box-shadow:0 0 24px #10b98133}.measurement-panel.light-theme.measured{color:#3b82f6;border-color:#3b82f666;background:#000000d9;box-shadow:0 0 24px #3b82f633}.vr-comfort-glyph{position:absolute;width:40px;height:40px;border-radius:50%;background:#0009;border:2px solid #666;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .3s ease;font-size:20px;z-index:10000;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;touch-action:manipulation;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vr-comfort-glyph:hover{transform:scale(1.1);background:#000c}.vr-comfort-glyph:focus{outline:3px solid #4ade80;outline-offset:2px}.vr-comfort-glyph.comfort-off{color:#666;border-color:#666;background:#0009;box-shadow:none}.vr-comfort-glyph.comfort-on{color:#4ade80;border-color:#4ade80;background:#4ade801a;box-shadow:0 0 20px #4ade804d}.vr-comfort-glyph.position-bottom-right{bottom:var(--vr-comfort-offset-y, 70px);right:var(--vr-comfort-offset-x, 20px)}.vr-comfort-glyph.position-bottom-left{bottom:var(--vr-comfort-offset-y, 70px);left:var(--vr-comfort-offset-x, 20px)}.vr-comfort-glyph.position-top-right{top:var(--vr-comfort-offset-y, 20px);right:var(--vr-comfort-offset-x, 260px)}.vr-comfort-glyph.position-top-left{top:var(--vr-comfort-offset-y, 20px);left:var(--vr-comfort-offset-x, 20px)}.vr-mode *{box-sizing:border-box!important}.vr-mode body{background:#000!important;color:#fff!important;margin:0!important;padding:0!important}.vr-mode,.vr-mode *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif!important;line-height:1.5!important}.vr-mode input,.vr-mode select,.vr-mode button,.vr-mode textarea{font-size:18px!important;padding:12px 16px!important;border-radius:6px!important;border:2px solid #4a9eff!important;background:#101828f2!important;color:#fff!important;-webkit-backdrop-filter:blur(20px)!important;backdrop-filter:blur(20px)!important;transition:all .2s ease!important}.vr-mode input:focus,.vr-mode select:focus,.vr-mode button:focus,.vr-mode textarea:focus{outline:none!important;border-color:#60a5fa!important;box-shadow:0 0 0 3px #60a5fa4d!important;background:#101828!important}.vr-mode button:hover{background:#4a9eff33!important;border-color:#60a5fa!important}.vr-mode .vr-comfort-glyph{background:#000000e6!important;border-width:3px!important;-webkit-backdrop-filter:blur(15px)!important;backdrop-filter:blur(15px)!important;font-size:22px!important;width:44px!important;height:44px!important}.vr-mode .vr-comfort-glyph:hover{transform:scale(1.15)!important;background:#000000f2!important}.vr-button{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:none;border-radius:8px;padding:12px 20px;font-size:16px;font-weight:700;font-family:system-ui,-apple-system,sans-serif;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 15px #0003;-webkit-user-select:none;user-select:none;touch-action:manipulation}.vr-button:hover{transform:translateY(-2px);box-shadow:0 6px 20px #0000004d}.vr-button:focus{outline:3px solid #4ade80;outline-offset:2px}.vr-button:active{transform:translateY(0)}.vr-mode .vr-button{font-size:18px!important;padding:14px 24px!important;border-radius:10px!important}.vr-status{position:fixed;bottom:20px;right:20px;background:#000c;color:#fff;padding:8px 12px;border-radius:6px;font-size:14px;font-family:system-ui,-apple-system,sans-serif;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);z-index:9999;transition:all .3s ease}.vr-status.vr-active{background:#4ade8033;border:2px solid #4ade80;color:#4ade80}.vr-mode .vr-status{font-size:16px!important;padding:10px 16px!important;border-radius:8px!important}.vr-panel{background:#101828f2;border:2px solid #374151;border-radius:12px;padding:20px;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);color:#fff;font-family:system-ui,-apple-system,sans-serif;box-shadow:0 8px 32px #0006}.vr-mode .vr-panel{border-width:3px!important;padding:24px!important;border-radius:16px!important}.vr-panel h1,.vr-panel h2,.vr-panel h3{margin-top:0;color:#f9fafb}.vr-panel p{color:#d1d5db;line-height:1.6}@media (max-width: 768px){.vr-comfort-glyph{width:48px!important;height:48px!important;font-size:24px!important}.vr-comfort-glyph.position-bottom-right{bottom:var(--vr-comfort-offset-y-mobile, 80px);right:var(--vr-comfort-offset-x-mobile, 15px)}.vr-comfort-glyph.position-bottom-left{bottom:var(--vr-comfort-offset-y-mobile, 80px);left:var(--vr-comfort-offset-x-mobile, 15px)}.vr-button{font-size:18px!important;padding:14px 24px!important}.vr-status{font-size:16px!important;padding:10px 16px!important}.vr-panel{padding:16px!important;margin:10px!important}}@media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 192dpi){.vr-comfort-glyph{border-width:2.5px}.vr-mode .vr-comfort-glyph{border-width:3.5px!important}.vr-button{box-shadow:0 6px 20px #00000040}}.vr-mode-active{--vr-css-loaded: true;opacity:.999}.vr-hidden{display:none!important}.vr-visible{display:block!important}.vr-flex{display:flex!important}.vr-center{align-items:center!important;justify-content:center!important}.vr-text-center{text-align:center!important}.vr-text-white{color:#fff!important}.vr-bg-dark{background:#000c!important}.vr-rounded{border-radius:8px!important}.vr-shadow{box-shadow:0 4px 15px #0003!important}
|
|
1
|
+
:root{--below-bg-color: #0a0a0a;--below-text-color: #e8e8e8;--below-accent-color: #64B5F6;--below-panel-bg: rgba(255, 255, 255, .08);--below-panel-border: rgba(255, 255, 255, .12);--below-panel-backdrop: blur(20px);--below-panel-shadow: 0 8px 32px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);--below-font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--below-bg-color);color:var(--below-text-color);font-family:var(--below-font-family)}.below-viewer-container{width:100%;height:100%;position:relative}.below-viewer-container canvas{display:block;width:100%;height:100%}.below-panel{background:var(--below-panel-bg);-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);border:1px solid var(--below-panel-border);border-radius:16px;box-shadow:var(--below-panel-shadow)}.model-selector{position:absolute;top:20px;right:20px;z-index:50;background:var(--below-panel-bg);-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);border:1px solid var(--below-panel-border);border-radius:20px;padding:24px;display:flex;flex-direction:column;gap:20px;min-width:220px;box-shadow:var(--below-panel-shadow);transition:all .3s ease}.model-selector:hover{transform:translateY(-2px);box-shadow:0 12px 40px #0006,0 4px 12px #0000004d}.model-selector__dropdown{background:linear-gradient(145deg,#ffffff14,#ffffff0a);color:var(--below-text-color);border:1px solid rgba(255,255,255,.1);padding:16px 20px;font-size:23px;font-weight:500;font-family:inherit;cursor:pointer;outline:none;transition:all .3s ease;min-width:100%;border-radius:12px;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-shadow:inset 0 1px 3px #0000001a}.model-selector__dropdown:focus{border-color:var(--below-accent-color);box-shadow:0 0 0 2px #64b5f633,inset 0 1px 3px #0000001a}.model-selector__dropdown:hover{background:#ffffff1a;border-color:#fff3;transform:translateY(-1px);box-shadow:0 4px 12px #00000026}.model-selector__dropdown:disabled{cursor:not-allowed;opacity:.5}.model-selector__dropdown option{background:#1a1a1a;color:var(--below-text-color);padding:12px;font-size:14px}.loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:1000;display:none;flex-direction:column;align-items:center;gap:20px;text-align:center}.loading-spinner{position:relative;display:flex;align-items:center;justify-content:center}.spinner-circle{position:relative;width:64px;height:64px}.spinner-path{position:absolute;top:0;left:0;width:100%;height:100%;border:3px solid rgba(255,255,255,.15);border-top:3px solid #ffffff;border-radius:50%;animation:spinner-rotate 1.5s ease-in-out infinite}.spinner-percentage{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:13px;font-weight:700;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.8);letter-spacing:-.5px}.loading-content{display:flex;flex-direction:column;gap:8px;align-items:center}.loading-model-name{font-size:18px;font-weight:500;color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.8);letter-spacing:.3px}.loading-status{font-size:14px;font-weight:400;color:#ffffffd9;text-shadow:0 1px 2px rgba(0,0,0,.6)}@keyframes spinner-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.loading-indicator.light-theme .loading-model-name{color:#1a1a1a!important;text-shadow:0 1px 2px rgba(255,255,255,.8)!important}.loading-indicator.light-theme .loading-status{color:#1a1a1acc!important;text-shadow:0 1px 2px rgba(255,255,255,.6)!important}.loading-indicator.light-theme .spinner-percentage{color:#1a1a1a!important;text-shadow:0 1px 2px rgba(255,255,255,.8)!important}.loading-indicator.light-theme .spinner-path{border-color:#1a1a1a26!important;border-top-color:#1a1a1a!important}.status{position:absolute;bottom:20px;right:20px;background:#000000b3;padding:10px 15px;border-radius:8px;font-size:12px;z-index:10}.screenshot-button{position:absolute;bottom:140px;right:20px;width:36px;height:36px;border-radius:50%;background:var(--below-panel-bg);border:1px solid var(--below-panel-border);color:var(--below-text-color);display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:120;-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);box-shadow:0 4px 16px #0003;-webkit-user-select:none;user-select:none;transition:transform .3s ease,box-shadow .3s ease}.screenshot-button:hover{transform:translateY(-2px);box-shadow:0 8px 24px #0000004d}.screenshot-button svg{width:16px;height:16px;stroke-width:2.2}.screenshot-button.light-theme{background:#000c!important;border:1px solid rgba(0,0,0,.2)!important;color:#fffffff2!important;box-shadow:0 2px 12px #00000040!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;top:76px!important;bottom:auto!important;right:20px!important}.screenshot-button.light-theme:hover{background:#000000e6!important;border-color:#0000004d!important;color:#fff!important;transform:translateY(-2px) scale(1.02)!important;box-shadow:0 4px 20px #00000059!important}.screenshot-button.light-theme svg{stroke-width:2.2}.screenshot-button.no-measurement{bottom:70px!important}.fullscreen-button{position:absolute;bottom:90px;right:20px;width:36px;height:36px;border-radius:50%;background:var(--below-panel-bg);border:1px solid var(--below-panel-border);color:var(--below-text-color);display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:120;-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);box-shadow:0 4px 16px #0003;-webkit-user-select:none;user-select:none;transition:transform .3s ease,box-shadow .3s ease}.fullscreen-button:hover{transform:translateY(-2px);box-shadow:0 8px 24px #0000004d}.fullscreen-button.light-theme{background:#000c!important;border:1px solid rgba(0,0,0,.2)!important;color:#fffffff2!important;box-shadow:0 2px 12px #00000040!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;top:20px!important;bottom:auto!important;right:20px!important}.fullscreen-button.light-theme:hover{background:#000000e6!important;border-color:#0000004d!important;color:#fff!important;transform:translateY(-2px) scale(1.02)!important;box-shadow:0 4px 20px #00000059!important}.fullscreen-button.no-measurement{bottom:20px!important}.info-panel{position:absolute;top:20px;left:20px;z-index:10;padding:20px 24px;max-width:340px;-webkit-backdrop-filter:var(--below-panel-backdrop);backdrop-filter:var(--below-panel-backdrop);background:var(--below-panel-bg);border:1px solid var(--below-panel-border);border-radius:16px;box-shadow:var(--below-panel-shadow);transition:all .3s ease}.info-panel:hover{transform:translateY(-1px);box-shadow:0 12px 40px #0006,0 4px 12px #0000004d}.info-panel__title{color:#fff;font-size:22px;font-weight:800;margin-bottom:12px;text-transform:uppercase;letter-spacing:1.2px;background:linear-gradient(135deg,#fff,#f5f5f5);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 0 8px rgba(255,255,255,.3))}.info-panel__controls{margin-top:8px;font-size:13px;line-height:1.5;color:#b0b0b0}.info-panel__controls strong{color:var(--below-text-color);font-weight:600}@media (max-width: 768px){.info-panel{top:10px;left:10px;padding:16px;max-width:280px}}.vr-button--glass,.vr-button-glass,[style*="position: absolute"][style*=bottom]{position:fixed!important;bottom:80px!important;left:50%!important;transform:translate(-50%)!important;z-index:100!important;padding:16px 32px!important;min-width:160px!important;height:56px!important;background:#ffffff1a!important;-webkit-backdrop-filter:blur(20px) saturate(140%)!important;backdrop-filter:blur(20px) saturate(140%)!important;border:1px solid rgba(255,255,255,.2)!important;border-radius:16px!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif!important;font-size:14px!important;font-weight:300!important;color:#fff!important;text-transform:uppercase!important;letter-spacing:.1em!important;white-space:nowrap!important;text-align:center!important;line-height:1.2!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;box-shadow:0 8px 32px #0000004d,0 2px 8px #4ec3ff0d,inset 0 1px #ffffff0d!important;cursor:pointer!important;transition:all .4s cubic-bezier(.4,0,.2,1)!important;outline:none!important;text-decoration:none!important;position:relative!important;overflow:hidden!important}.vr-button--glass:before,.vr-button-glass:before,.vr-button-available:before,[style*="position: absolute"][style*=bottom]:before{content:""!important;position:absolute!important;top:0!important;left:-100%!important;width:100%!important;height:100%!important;background:linear-gradient(90deg,transparent,rgba(255,255,255,.15),rgba(255,255,255,.3),rgba(255,255,255,.15),transparent)!important;animation:vrShimmerInviting 4s ease-in-out infinite!important;border-radius:16px!important;pointer-events:none!important}@keyframes vrShimmerInviting{0%,80%{left:-100%!important;opacity:0!important}85%{left:-50%!important;opacity:.5!important}90%{left:0!important;opacity:1!important}95%{left:50%!important;opacity:.5!important}to{left:100%!important;opacity:0!important}}.vr-button--glass:hover,.vr-button-glass:hover,.vr-button-available:hover{background:#ffffff26!important;border-color:#ffffff4d!important;transform:translate(-50%) translateY(-2px)!important;box-shadow:0 12px 40px #0006,0 4px 12px #4ec3ff1a,inset 0 1px #ffffff14!important}.vr-button--glass:hover:before,.vr-button-glass:hover:before,.vr-button-available:hover:before,[style*="position: absolute"][style*=bottom]:hover:before{animation:vrShimmer 1.5s ease-in-out infinite!important}.vr-button--glass:active,.vr-button-glass:active,.vr-button-available:active{transform:translate(-50%) translateY(-1px)!important;background:#fff3!important;box-shadow:0 6px 20px #0006,0 2px 6px #4ec3ff1a,inset 0 1px #ffffff1a!important;transition:all .1s ease!important}.vr-button-disabled,button.vr-button-disabled{background:#9ca3af1a!important;border:1px solid rgba(156,163,175,.3)!important;color:#9ca3af!important;cursor:not-allowed!important;opacity:.6!important;box-shadow:0 4px 16px #0003!important;pointer-events:none!important}.vr-button-disabled:before,button.vr-button-disabled:before{display:none!important}@keyframes vrShimmer{0%{left:-100%!important;opacity:0!important}50%{left:0!important;opacity:1!important}to{left:100%!important;opacity:0!important}}@media (max-width: 768px){.vr-button--glass,.vr-button-glass,[style*="position: absolute"][style*=bottom]{bottom:60px!important;padding:12px 24px!important;min-width:140px!important;height:48px!important;font-size:12px!important}.vr-icon{font-size:14px!important}.info-panel{display:none}}.vr-mode .info-panel{display:none!important}.vr-mode .model-selector{pointer-events:none;opacity:.5}.vr-controller{pointer-events:none}.vr-loading{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:#000c;color:#fff;padding:20px;border-radius:10px;font-size:18px;z-index:1000}.vr-measurement-panel{position:fixed;top:20px;right:20px;background:#000c;color:#fff;padding:15px;border-radius:10px;border:2px solid #87cefa;z-index:100;font-family:monospace}.vr-reticle{position:fixed;top:50%;left:50%;width:4px;height:4px;background:#fffc;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:999}.vr-teleport-indicator{position:absolute;width:2px;height:2px;background:#0f0;border-radius:50%;pointer-events:none;opacity:.8}.vr-hand-model{pointer-events:none}.vr-spotlight-indicator{position:fixed;bottom:80px;left:50%;transform:translate(-50%);color:#fffc;font-size:14px;text-align:center;pointer-events:none;z-index:90}@supports (-webkit-appearance: none){.vr-button--glass,.vr-button-glass,[style*="position: absolute"][style*=bottom]{backdrop-filter:blur(20px) saturate(140%)!important;-webkit-backdrop-filter:blur(20px) saturate(140%)!important}}.mode-toggle-container{display:flex;flex-direction:column;gap:20px}.semantic-toggle{position:relative;width:180px;height:60px;margin:0 auto;background:#ffffff0f;border-radius:30px;border:1px solid rgba(255,255,255,.1);overflow:hidden}.semantic-toggle input{position:absolute;opacity:0;width:0;height:0}.toggle-option{position:absolute;top:0;width:90px;height:60px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;transition:all .4s cubic-bezier(.4,0,.2,1);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.toggle-option.left{left:0}.toggle-option.right{right:0}.toggle-icon{font-size:20px;margin-bottom:4px;transition:all .3s ease}.toggle-text{color:#888;transition:all .3s ease;font-size:12px}.toggle-slider-bg{position:absolute;top:4px;left:4px;width:82px;height:52px;background:linear-gradient(135deg,#4caf50,#388e3c);border-radius:26px;transition:all .4s cubic-bezier(.4,0,.2,1);box-shadow:0 4px 16px #4caf5066,0 2px 8px #0003}.semantic-toggle input:checked+.toggle-slider-bg{transform:translate(90px);background:linear-gradient(135deg,#64b5f6,#42a5f5);box-shadow:0 4px 16px #64b5f666,0 2px 8px #0003}.semantic-toggle input:not(:checked)~.toggle-option.left .toggle-icon{color:#fff;filter:drop-shadow(0 0 8px rgba(255,255,255,.5))}.semantic-toggle input:not(:checked)~.toggle-option.left .toggle-text{color:#fff;font-weight:700}.semantic-toggle input:checked~.toggle-option.right .toggle-icon{color:#fff;filter:drop-shadow(0 0 8px rgba(255,255,255,.5))}.semantic-toggle input:checked~.toggle-option.right .toggle-text{color:#fff;font-weight:700}.semantic-toggle:hover .toggle-slider-bg{box-shadow:0 6px 20px #4caf5080,0 2px 12px #0000004d}.semantic-toggle input:checked:hover+.toggle-slider-bg{box-shadow:0 6px 20px #64b5f680,0 2px 12px #0000004d}.dive-mode-indicator{position:absolute;top:20px;right:20px;z-index:15;background:#64b5f61a;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:1px solid rgba(100,181,246,.3);border-radius:12px;padding:8px 16px;font-size:12px;font-weight:600;color:#64b5f6;text-transform:uppercase;letter-spacing:.5px;opacity:0;transform:translateY(-10px);transition:all .3s ease}.dive-mode-indicator.active{opacity:1;transform:translateY(0)}.survey-mode-indicator{position:absolute;top:20px;right:20px;z-index:15;background:#4caf501a;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:1px solid rgba(76,175,80,.3);border-radius:12px;padding:8px 16px;font-size:12px;font-weight:600;color:#4caf50;text-transform:uppercase;letter-spacing:.5px;opacity:0;transform:translateY(-10px);transition:all .3s ease}.survey-mode-indicator.active{opacity:1;transform:translateY(0)}.dive-control-panel{position:absolute;top:20px;right:20px;z-index:10;background:#ffffff14;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.12);border-radius:20px;padding:24px;display:flex;flex-direction:column;gap:20px;min-width:220px;box-shadow:0 8px 32px #0000004d}.dive-control-title{color:#64b5f6;font-size:14px;font-weight:700;text-transform:uppercase;letter-spacing:1px;text-align:center;margin-bottom:8px}@keyframes diveTransition{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}@keyframes surveyTransition{0%{opacity:0;transform:scale(.9)}to{opacity:1;transform:scale(1)}}.dive-mode-active .dive-control-panel{animation:diveTransition .3s ease-out}.survey-mode-active .dive-control-panel{animation:surveyTransition .3s ease-out}.measurement-panel{position:absolute;bottom:20px;right:20px;background:#ffffff0f;color:#ffffffe6;padding:12px 16px;border-radius:12px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;font-weight:500;z-index:100;cursor:pointer;border:1px solid rgba(255,255,255,.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transition:all .4s cubic-bezier(.4,0,.2,1);-webkit-user-select:none;user-select:none;min-width:100px;text-align:center;box-shadow:0 2px 8px #00000026}.measurement-panel:hover{background:#ffffff1a;border-color:#fff3;color:#fff;transform:scale(1.02);box-shadow:0 4px 16px #0003}.measurement-panel .disabled{color:#fff6;border-color:#ffffff0d;background:#ffffff05}.measurement-panel .active{color:#4ade80;border-color:#4ade804d;background:#4ade801a;box-shadow:0 0 20px #4ade801a}.measurement-panel .measured{color:#60a5fa;border-color:#60a5fa4d;background:#60a5fa1a;box-shadow:0 0 20px #60a5fa1a}.measurement-panel.light-theme{background:#000c;color:#fffffff2;border:1px solid rgba(0,0,0,.2);box-shadow:0 2px 12px #00000040}.measurement-panel.light-theme:hover{background:#000000e6;border-color:#0000004d;color:#fff;transform:scale(1.02);box-shadow:0 4px 20px #00000059}.measurement-panel.light-theme.disabled{color:#ffffff80;border-color:#0000001a;background:#0009}.measurement-panel.light-theme.active{color:#10b981;border-color:#10b98166;background:#000000d9;box-shadow:0 0 24px #10b98133}.measurement-panel.light-theme.measured{color:#3b82f6;border-color:#3b82f666;background:#000000d9;box-shadow:0 0 24px #3b82f633}.vr-comfort-glyph{position:absolute;width:40px;height:40px;border-radius:50%;background:#0009;border:2px solid #666;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .3s ease;font-size:20px;z-index:10000;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;touch-action:manipulation;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.vr-comfort-glyph:hover{transform:scale(1.1);background:#000c}.vr-comfort-glyph:focus{outline:3px solid #4ade80;outline-offset:2px}.vr-comfort-glyph.comfort-off{color:#666;border-color:#666;background:#0009;box-shadow:none}.vr-comfort-glyph.comfort-on{color:#4ade80;border-color:#4ade80;background:#4ade801a;box-shadow:0 0 20px #4ade804d}.vr-comfort-glyph.position-bottom-right{bottom:var(--vr-comfort-offset-y, 70px);right:var(--vr-comfort-offset-x, 20px)}.vr-comfort-glyph.position-bottom-left{bottom:var(--vr-comfort-offset-y, 70px);left:var(--vr-comfort-offset-x, 20px)}.vr-comfort-glyph.position-top-right{top:var(--vr-comfort-offset-y, 20px);right:var(--vr-comfort-offset-x, 260px)}.vr-comfort-glyph.position-top-left{top:var(--vr-comfort-offset-y, 20px);left:var(--vr-comfort-offset-x, 20px)}.vr-mode *{box-sizing:border-box!important}.vr-mode body{background:#000!important;color:#fff!important;margin:0!important;padding:0!important}.vr-mode,.vr-mode *{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif!important;line-height:1.5!important}.vr-mode input,.vr-mode select,.vr-mode button,.vr-mode textarea{font-size:18px!important;padding:12px 16px!important;border-radius:6px!important;border:2px solid #4a9eff!important;background:#101828f2!important;color:#fff!important;-webkit-backdrop-filter:blur(20px)!important;backdrop-filter:blur(20px)!important;transition:all .2s ease!important}.vr-mode input:focus,.vr-mode select:focus,.vr-mode button:focus,.vr-mode textarea:focus{outline:none!important;border-color:#60a5fa!important;box-shadow:0 0 0 3px #60a5fa4d!important;background:#101828!important}.vr-mode button:hover{background:#4a9eff33!important;border-color:#60a5fa!important}.vr-mode .vr-comfort-glyph{background:#000000e6!important;border-width:3px!important;-webkit-backdrop-filter:blur(15px)!important;backdrop-filter:blur(15px)!important;font-size:22px!important;width:44px!important;height:44px!important}.vr-mode .vr-comfort-glyph:hover{transform:scale(1.15)!important;background:#000000f2!important}.vr-button{background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border:none;border-radius:8px;padding:12px 20px;font-size:16px;font-weight:700;font-family:system-ui,-apple-system,sans-serif;cursor:pointer;transition:all .3s ease;box-shadow:0 4px 15px #0003;-webkit-user-select:none;user-select:none;touch-action:manipulation}.vr-button:hover{transform:translateY(-2px);box-shadow:0 6px 20px #0000004d}.vr-button:focus{outline:3px solid #4ade80;outline-offset:2px}.vr-button:active{transform:translateY(0)}.vr-mode .vr-button{font-size:18px!important;padding:14px 24px!important;border-radius:10px!important}.vr-status{position:fixed;bottom:20px;right:20px;background:#000c;color:#fff;padding:8px 12px;border-radius:6px;font-size:14px;font-family:system-ui,-apple-system,sans-serif;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);z-index:9999;transition:all .3s ease}.vr-status.vr-active{background:#4ade8033;border:2px solid #4ade80;color:#4ade80}.vr-mode .vr-status{font-size:16px!important;padding:10px 16px!important;border-radius:8px!important}.vr-panel{background:#101828f2;border:2px solid #374151;border-radius:12px;padding:20px;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);color:#fff;font-family:system-ui,-apple-system,sans-serif;box-shadow:0 8px 32px #0006}.vr-mode .vr-panel{border-width:3px!important;padding:24px!important;border-radius:16px!important}.vr-panel h1,.vr-panel h2,.vr-panel h3{margin-top:0;color:#f9fafb}.vr-panel p{color:#d1d5db;line-height:1.6}@media (max-width: 768px){.vr-comfort-glyph{width:48px!important;height:48px!important;font-size:24px!important}.vr-comfort-glyph.position-bottom-right{bottom:var(--vr-comfort-offset-y-mobile, 80px);right:var(--vr-comfort-offset-x-mobile, 15px)}.vr-comfort-glyph.position-bottom-left{bottom:var(--vr-comfort-offset-y-mobile, 80px);left:var(--vr-comfort-offset-x-mobile, 15px)}.vr-button{font-size:18px!important;padding:14px 24px!important}.vr-status{font-size:16px!important;padding:10px 16px!important}.vr-panel{padding:16px!important;margin:10px!important}}@media (-webkit-min-device-pixel-ratio: 2),(min-resolution: 192dpi){.vr-comfort-glyph{border-width:2.5px}.vr-mode .vr-comfort-glyph{border-width:3.5px!important}.vr-button{box-shadow:0 6px 20px #00000040}}.vr-mode-active{--vr-css-loaded: true;opacity:.999}.vr-hidden{display:none!important}.vr-visible{display:block!important}.vr-flex{display:flex!important}.vr-center{align-items:center!important;justify-content:center!important}.vr-text-center{text-align:center!important}.vr-text-white{color:#fff!important}.vr-bg-dark{background:#000c!important}.vr-rounded{border-radius:8px!important}.vr-shadow{box-shadow:0 4px 15px #0003!important}
|
package/dist/belowjs.js
CHANGED
|
@@ -5375,7 +5375,8 @@ class In extends wt {
|
|
|
5375
5375
|
this.renderer = new u.WebGLRenderer({
|
|
5376
5376
|
antialias: this.config.renderer.antialias,
|
|
5377
5377
|
alpha: this.config.renderer.alpha,
|
|
5378
|
-
powerPreference: this.config.renderer.powerPreference
|
|
5378
|
+
powerPreference: this.config.renderer.powerPreference,
|
|
5379
|
+
preserveDrawingBuffer: !0
|
|
5379
5380
|
}), this.renderer.setSize(this.container.clientWidth, this.container.clientHeight), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.shadowMap.enabled = !0, this.renderer.shadowMap.type = u.PCFSoftShadowMap, this.renderer.outputColorSpace = u.SRGBColorSpace;
|
|
5380
5381
|
const e = {
|
|
5381
5382
|
none: u.NoToneMapping,
|
|
@@ -7904,6 +7905,7 @@ class Dn extends wt {
|
|
|
7904
7905
|
enableDiveSystem: { type: "boolean", default: !0 },
|
|
7905
7906
|
showDiveToggle: { type: "boolean", default: !0 },
|
|
7906
7907
|
enableFullscreen: { type: "boolean", default: !1 },
|
|
7908
|
+
enableScreenshot: { type: "boolean", default: !1 },
|
|
7907
7909
|
enableVRAudio: { type: "boolean", default: !1 },
|
|
7908
7910
|
audioPath: { type: "string", default: "./sound/" },
|
|
7909
7911
|
viewerConfig: {
|
|
@@ -7917,7 +7919,7 @@ class Dn extends wt {
|
|
|
7917
7919
|
initialModel: { type: "string", default: null },
|
|
7918
7920
|
initialPositions: { type: "object", default: null }
|
|
7919
7921
|
};
|
|
7920
|
-
this.config = new qe(i).validate(t), this.options = this.config, this.currentModelKey = null, this.belowViewer = null, this.ui = {}, this.measurementSystem = null, this.comfortGlyph = null, this.diveSystem = null, this.fullscreenButton = null, this.lastComfortMode = null, this.isLoading = !1, this.loadingMessage = "", this.loadingModelName = "", this.loadingPercentage = 0, this.vrUpdateLoop = null, typeof window < "u" && (window.modelViewer = this), this.init();
|
|
7922
|
+
this.config = new qe(i).validate(t), this.options = this.config, this.currentModelKey = null, this.belowViewer = null, this.ui = {}, this.measurementSystem = null, this.comfortGlyph = null, this.diveSystem = null, this.fullscreenButton = null, this.screenshotButton = null, this.lastComfortMode = null, this.isLoading = !1, this.loadingMessage = "", this.loadingModelName = "", this.loadingPercentage = 0, this.vrUpdateLoop = null, typeof window < "u" && (window.modelViewer = this), this.init();
|
|
7921
7923
|
}
|
|
7922
7924
|
init() {
|
|
7923
7925
|
const e = {
|
|
@@ -7927,8 +7929,8 @@ class Dn extends wt {
|
|
|
7927
7929
|
...typeof this.config.enableVRAudio < "u" && { enableVRAudio: this.config.enableVRAudio }
|
|
7928
7930
|
};
|
|
7929
7931
|
if (this.belowViewer = new In(this.container, e), this.setupEventForwarding(), this.belowViewer.on("initialized", () => {
|
|
7930
|
-
this.setupFocusInteraction(), this._maybeAttachMeasurementSystem(), this._maybeAttachVRComfortGlyph(), this._maybeAttachDiveSystem(), this._maybeAttachFullscreenButton();
|
|
7931
|
-
}), this.belowViewer.isInitialized && (this.setupFocusInteraction(), this._maybeAttachMeasurementSystem(), this._maybeAttachVRComfortGlyph(), this._maybeAttachDiveSystem(), this._maybeAttachFullscreenButton()), Object.keys(this.config.models).length > 0 && (this.createUI(), this.populateDropdown(), this.config.autoLoadFirst)) {
|
|
7932
|
+
this.setupFocusInteraction(), this._maybeAttachMeasurementSystem(), this._maybeAttachVRComfortGlyph(), this._maybeAttachDiveSystem(), this._maybeAttachScreenshotButton(), this._maybeAttachFullscreenButton();
|
|
7933
|
+
}), this.belowViewer.isInitialized && (this.setupFocusInteraction(), this._maybeAttachMeasurementSystem(), this._maybeAttachVRComfortGlyph(), this._maybeAttachDiveSystem(), this._maybeAttachScreenshotButton(), this._maybeAttachFullscreenButton()), Object.keys(this.config.models).length > 0 && (this.createUI(), this.populateDropdown(), this.config.autoLoadFirst)) {
|
|
7932
7934
|
const t = Object.keys(this.config.models)[0];
|
|
7933
7935
|
setTimeout(() => this.loadModel(t), 100);
|
|
7934
7936
|
}
|
|
@@ -7999,6 +8001,16 @@ class Dn extends wt {
|
|
|
7999
8001
|
this.diveSystem && t.model && this.diveSystem.updateParticleBounds(t.model);
|
|
8000
8002
|
}), typeof window < "u" && (window.diveSystem = this.diveSystem);
|
|
8001
8003
|
}
|
|
8004
|
+
_maybeAttachScreenshotButton() {
|
|
8005
|
+
if (!this.config.enableScreenshot || this.screenshotButton) return;
|
|
8006
|
+
const e = document.createElement("div");
|
|
8007
|
+
e.id = "screenshotButton", e.className = "screenshot-button", this.config.measurementTheme === "light" && e.classList.add("light-theme"), this.config.enableMeasurement || e.classList.add("no-measurement"), e.innerHTML = `<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
8008
|
+
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"></path>
|
|
8009
|
+
<circle cx="12" cy="13" r="4"></circle>
|
|
8010
|
+
</svg>`, e.tabIndex = 0, e.title = "Save Screenshot", e.setAttribute("aria-label", "Save Screenshot"), e.addEventListener("click", () => this.takeScreenshot()), e.addEventListener("keydown", (t) => {
|
|
8011
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.takeScreenshot());
|
|
8012
|
+
}), this.container.appendChild(e), this.screenshotButton = e, this.ui.screenshot = e;
|
|
8013
|
+
}
|
|
8002
8014
|
_maybeAttachFullscreenButton() {
|
|
8003
8015
|
if (!this.config.enableFullscreen || this.fullscreenButton) return;
|
|
8004
8016
|
const e = document.createElement("div");
|
|
@@ -8024,6 +8036,42 @@ class Dn extends wt {
|
|
|
8024
8036
|
const e = this.isFullscreen();
|
|
8025
8037
|
this.fullscreenButton.title = e ? "Exit Fullscreen" : "Enter Fullscreen", this.fullscreenButton.setAttribute("aria-label", e ? "Exit Fullscreen" : "Enter Fullscreen"), this.fullscreenButton.textContent = "⛶";
|
|
8026
8038
|
}
|
|
8039
|
+
/**
|
|
8040
|
+
* Captures a screenshot of the current 3D scene without UI overlays
|
|
8041
|
+
*
|
|
8042
|
+
* The method forces a render to ensure the canvas is up-to-date, validates
|
|
8043
|
+
* the resulting image data, and automatically downloads the screenshot as a PNG
|
|
8044
|
+
* file with a timestamp-based filename.
|
|
8045
|
+
*
|
|
8046
|
+
* @method takeScreenshot
|
|
8047
|
+
* @throws {Error} Will log errors if canvas is unavailable or screenshot capture fails
|
|
8048
|
+
* @returns {void}
|
|
8049
|
+
*
|
|
8050
|
+
* @example
|
|
8051
|
+
* // Programmatically capture a screenshot
|
|
8052
|
+
* viewer.takeScreenshot();
|
|
8053
|
+
*
|
|
8054
|
+
* @since 1.0.0
|
|
8055
|
+
*/
|
|
8056
|
+
takeScreenshot() {
|
|
8057
|
+
try {
|
|
8058
|
+
const e = this.belowViewer?.renderer?.domElement;
|
|
8059
|
+
if (!e) {
|
|
8060
|
+
console.error("[ModelViewer] No canvas available for screenshot");
|
|
8061
|
+
return;
|
|
8062
|
+
}
|
|
8063
|
+
this.belowViewer.renderer && this.belowViewer.sceneManager && this.belowViewer.cameraManager && this.belowViewer.renderer.render(this.belowViewer.sceneManager.scene, this.belowViewer.cameraManager.camera);
|
|
8064
|
+
const t = e.toDataURL("image/png");
|
|
8065
|
+
if (t === "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==") {
|
|
8066
|
+
console.error("[ModelViewer] Screenshot captured empty canvas");
|
|
8067
|
+
return;
|
|
8068
|
+
}
|
|
8069
|
+
const i = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "").slice(0, -5), o = `${this.currentModelKey ? this.config.models[this.currentModelKey]?.name?.replace(/[^a-zA-Z0-9\-_]/g, "-") || this.currentModelKey.replace(/[^a-zA-Z0-9\-_]/g, "-") : "unknown"}-belowjs-${i}.png`, n = document.createElement("a");
|
|
8070
|
+
n.href = t, n.download = o, document.body.appendChild(n), n.click(), document.body.removeChild(n), console.log(`[ModelViewer] Screenshot saved as ${o}`);
|
|
8071
|
+
} catch (e) {
|
|
8072
|
+
console.error("[ModelViewer] Failed to capture screenshot", e);
|
|
8073
|
+
}
|
|
8074
|
+
}
|
|
8027
8075
|
setupEventForwarding() {
|
|
8028
8076
|
this.belowViewer.on("initialized", (e) => this.emit("initialized", e)), this.belowViewer.on("model-load-start", (e) => this.emit("model-load-start", e)), this.belowViewer.on("model-load-progress", (e) => {
|
|
8029
8077
|
this.emit("model-load-progress", e), this.updateLoadingProgress(e);
|
|
@@ -8528,7 +8576,7 @@ class Dn extends wt {
|
|
|
8528
8576
|
const e = this.belowViewer.renderer.domElement;
|
|
8529
8577
|
e.removeEventListener("mousedown", this.focusEventHandlers.onMouseDown), e.removeEventListener("mousemove", this.focusEventHandlers.onMouseMove), e.removeEventListener("mouseup", this.focusEventHandlers.onMouseUp), e.removeEventListener("click", this.focusEventHandlers.onMouseClick), this.focusEventHandlers = null;
|
|
8530
8578
|
}
|
|
8531
|
-
this.measurementSystem && (this.measurementSystem.dispose(), this.measurementSystem = null), this.comfortGlyph && (this.comfortGlyph.dispose(), this.comfortGlyph = null), this.diveSystem && (this.diveSystem.dispose(), this.diveSystem = null, typeof window < "u" && window.diveSystem === this.diveSystem && (window.diveSystem = null)), this.fullscreenButton && (this.fullscreenButton.remove(), this.fullscreenButton = null, document.removeEventListener("fullscreenchange", this._onFullscreenChange)), this.belowViewer && this.belowViewer.dispose(), this.removeAllListeners();
|
|
8579
|
+
this.measurementSystem && (this.measurementSystem.dispose(), this.measurementSystem = null), this.comfortGlyph && (this.comfortGlyph.dispose(), this.comfortGlyph = null), this.diveSystem && (this.diveSystem.dispose(), this.diveSystem = null, typeof window < "u" && window.diveSystem === this.diveSystem && (window.diveSystem = null)), this.fullscreenButton && (this.fullscreenButton.remove(), this.fullscreenButton = null, document.removeEventListener("fullscreenchange", this._onFullscreenChange)), this.screenshotButton && (this.screenshotButton.remove(), this.screenshotButton = null), this.belowViewer && this.belowViewer.dispose(), this.removeAllListeners();
|
|
8532
8580
|
}
|
|
8533
8581
|
}
|
|
8534
8582
|
export {
|
package/package.json
CHANGED