@vib3code/sdk 2.0.1
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 +118 -0
- package/DOCS/BLUEPRINT_EXECUTION_PLAN_2026-01-07.md +34 -0
- package/DOCS/CI_TESTING.md +38 -0
- package/DOCS/CLI_ONBOARDING.md +75 -0
- package/DOCS/CONTROL_REFERENCE.md +64 -0
- package/DOCS/DEV_TRACK_ANALYSIS.md +77 -0
- package/DOCS/DEV_TRACK_PLAN_2026-01-07.md +42 -0
- package/DOCS/DEV_TRACK_SESSION_2026-01-31.md +220 -0
- package/DOCS/ENV_SETUP.md +189 -0
- package/DOCS/EXPORT_FORMATS.md +417 -0
- package/DOCS/GPU_DISPOSAL_GUIDE.md +21 -0
- package/DOCS/LICENSING_TIERS.md +275 -0
- package/DOCS/MASTER_PLAN_2026-01-31.md +570 -0
- package/DOCS/OBS_SETUP_GUIDE.md +98 -0
- package/DOCS/PROJECT_SETUP.md +66 -0
- package/DOCS/RENDERER_LIFECYCLE.md +40 -0
- package/DOCS/REPO_MANIFEST.md +121 -0
- package/DOCS/SESSION_014_PLAN.md +195 -0
- package/DOCS/SESSION_LOG_2026-01-07.md +56 -0
- package/DOCS/STRATEGIC_BLUEPRINT_2026-01-07.md +72 -0
- package/DOCS/SYSTEM_AUDIT_2026-01-30.md +738 -0
- package/DOCS/SYSTEM_INVENTORY.md +520 -0
- package/DOCS/TELEMETRY_EXPORTS.md +34 -0
- package/DOCS/WEBGPU_STATUS.md +38 -0
- package/DOCS/XR_BENCHMARKS.md +608 -0
- package/LICENSE +21 -0
- package/README.md +426 -0
- package/docs/.nojekyll +0 -0
- package/docs/01-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/02-hyperspatial_ego_death.html +346 -0
- package/docs/03-post_cartesian_sublime.html +346 -0
- package/docs/04-crystalline_void_meditation.html +346 -0
- package/docs/05-quantum_decoherence_ballet.html +346 -0
- package/docs/06-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/07-hyperspatial_ego_death.html +346 -0
- package/docs/08-post_cartesian_sublime.html +346 -0
- package/docs/09-crystalline_void_meditation.html +346 -0
- package/docs/10-quantum_decoherence_ballet.html +346 -0
- package/docs/11-dissolution_of_euclidean_hegemony.html +346 -0
- package/docs/12-hyperspatial_ego_death.html +346 -0
- package/docs/13-post_cartesian_sublime.html +346 -0
- package/docs/index.html +794 -0
- package/docs/test-hub.html +441 -0
- package/docs/url-state.js +102 -0
- package/docs/vib3-exports/01-quantum-quantum-tetrahedron-lattice.html +489 -0
- package/docs/vib3-exports/02-quantum-quantum-hypersphere-matrix.html +489 -0
- package/docs/vib3-exports/03-quantum-quantum-hypertetra-fractal.html +489 -0
- package/docs/vib3-exports/04-faceted-faceted-crystal-structure.html +407 -0
- package/docs/vib3-exports/05-faceted-faceted-klein-bottle.html +407 -0
- package/docs/vib3-exports/06-faceted-faceted-hypertetra-torus.html +407 -0
- package/docs/vib3-exports/07-holographic-holographic-wave-field.html +457 -0
- package/docs/vib3-exports/08-holographic-holographic-hypersphere-sphere.html +457 -0
- package/docs/vib3-exports/09-holographic-holographic-hypertetra-crystal.html +457 -0
- package/docs/vib3-exports/index.html +238 -0
- package/docs/webgpu-live.html +702 -0
- package/package.json +367 -0
- package/src/advanced/AIPresetGenerator.js +777 -0
- package/src/advanced/MIDIController.js +703 -0
- package/src/advanced/OffscreenWorker.js +1051 -0
- package/src/advanced/WebGPUCompute.js +1051 -0
- package/src/advanced/WebXRRenderer.js +680 -0
- package/src/agent/cli/AgentCLI.js +615 -0
- package/src/agent/cli/index.js +14 -0
- package/src/agent/index.js +73 -0
- package/src/agent/mcp/MCPServer.js +950 -0
- package/src/agent/mcp/index.js +9 -0
- package/src/agent/mcp/tools.js +548 -0
- package/src/agent/telemetry/EventStream.js +669 -0
- package/src/agent/telemetry/Instrumentation.js +618 -0
- package/src/agent/telemetry/TelemetryExporters.js +427 -0
- package/src/agent/telemetry/TelemetryService.js +464 -0
- package/src/agent/telemetry/index.js +52 -0
- package/src/benchmarks/BenchmarkRunner.js +381 -0
- package/src/benchmarks/MetricsCollector.js +299 -0
- package/src/benchmarks/index.js +9 -0
- package/src/benchmarks/scenes.js +259 -0
- package/src/cli/index.js +675 -0
- package/src/config/ApiConfig.js +88 -0
- package/src/core/CanvasManager.js +217 -0
- package/src/core/ErrorReporter.js +117 -0
- package/src/core/ParameterMapper.js +333 -0
- package/src/core/Parameters.js +396 -0
- package/src/core/RendererContracts.js +200 -0
- package/src/core/UnifiedResourceManager.js +370 -0
- package/src/core/VIB3Engine.js +636 -0
- package/src/core/renderers/FacetedRendererAdapter.js +32 -0
- package/src/core/renderers/HolographicRendererAdapter.js +29 -0
- package/src/core/renderers/QuantumRendererAdapter.js +29 -0
- package/src/core/renderers/RendererLifecycleManager.js +63 -0
- package/src/creative/ColorPresetsSystem.js +980 -0
- package/src/creative/ParameterTimeline.js +1061 -0
- package/src/creative/PostProcessingPipeline.js +1113 -0
- package/src/creative/TransitionAnimator.js +683 -0
- package/src/export/CSSExporter.js +226 -0
- package/src/export/CardGeneratorBase.js +279 -0
- package/src/export/ExportManager.js +580 -0
- package/src/export/FacetedCardGenerator.js +279 -0
- package/src/export/HolographicCardGenerator.js +543 -0
- package/src/export/LottieExporter.js +552 -0
- package/src/export/QuantumCardGenerator.js +315 -0
- package/src/export/SVGExporter.js +519 -0
- package/src/export/ShaderExporter.js +903 -0
- package/src/export/TradingCardGenerator.js +3055 -0
- package/src/export/TradingCardManager.js +181 -0
- package/src/export/VIB3PackageExporter.js +559 -0
- package/src/export/index.js +14 -0
- package/src/export/systems/TradingCardSystemFaceted.js +494 -0
- package/src/export/systems/TradingCardSystemHolographic.js +452 -0
- package/src/export/systems/TradingCardSystemQuantum.js +411 -0
- package/src/faceted/FacetedSystem.js +963 -0
- package/src/features/CollectionManager.js +433 -0
- package/src/gallery/CollectionManager.js +240 -0
- package/src/gallery/GallerySystem.js +485 -0
- package/src/geometry/GeometryFactory.js +314 -0
- package/src/geometry/GeometryLibrary.js +72 -0
- package/src/geometry/buffers/BufferBuilder.js +338 -0
- package/src/geometry/buffers/index.js +18 -0
- package/src/geometry/generators/Crystal.js +420 -0
- package/src/geometry/generators/Fractal.js +298 -0
- package/src/geometry/generators/KleinBottle.js +197 -0
- package/src/geometry/generators/Sphere.js +192 -0
- package/src/geometry/generators/Tesseract.js +160 -0
- package/src/geometry/generators/Tetrahedron.js +225 -0
- package/src/geometry/generators/Torus.js +304 -0
- package/src/geometry/generators/Wave.js +341 -0
- package/src/geometry/index.js +142 -0
- package/src/geometry/warp/HypersphereCore.js +211 -0
- package/src/geometry/warp/HypertetraCore.js +386 -0
- package/src/geometry/warp/index.js +57 -0
- package/src/holograms/HolographicVisualizer.js +1073 -0
- package/src/holograms/RealHolographicSystem.js +966 -0
- package/src/holograms/variantRegistry.js +69 -0
- package/src/integrations/FigmaPlugin.js +854 -0
- package/src/integrations/OBSMode.js +754 -0
- package/src/integrations/ThreeJsPackage.js +660 -0
- package/src/integrations/TouchDesignerExport.js +552 -0
- package/src/integrations/frameworks/Vib3React.js +591 -0
- package/src/integrations/frameworks/Vib3Svelte.js +654 -0
- package/src/integrations/frameworks/Vib3Vue.js +628 -0
- package/src/llm/LLMParameterInterface.js +240 -0
- package/src/llm/LLMParameterUI.js +577 -0
- package/src/math/Mat4x4.js +708 -0
- package/src/math/Projection.js +341 -0
- package/src/math/Rotor4D.js +637 -0
- package/src/math/Vec4.js +476 -0
- package/src/math/constants.js +164 -0
- package/src/math/index.js +68 -0
- package/src/math/projections.js +54 -0
- package/src/math/rotations.js +196 -0
- package/src/quantum/QuantumEngine.js +906 -0
- package/src/quantum/QuantumVisualizer.js +1103 -0
- package/src/reactivity/ReactivityConfig.js +499 -0
- package/src/reactivity/ReactivityManager.js +586 -0
- package/src/reactivity/SpatialInputSystem.js +1783 -0
- package/src/reactivity/index.js +93 -0
- package/src/render/CommandBuffer.js +465 -0
- package/src/render/MultiCanvasBridge.js +340 -0
- package/src/render/RenderCommand.js +514 -0
- package/src/render/RenderResourceRegistry.js +523 -0
- package/src/render/RenderState.js +552 -0
- package/src/render/RenderTarget.js +512 -0
- package/src/render/ShaderLoader.js +253 -0
- package/src/render/ShaderProgram.js +599 -0
- package/src/render/UnifiedRenderBridge.js +496 -0
- package/src/render/backends/WebGLBackend.js +1108 -0
- package/src/render/backends/WebGPUBackend.js +1409 -0
- package/src/render/commands/CommandBufferExecutor.js +607 -0
- package/src/render/commands/RenderCommandBuffer.js +661 -0
- package/src/render/commands/index.js +17 -0
- package/src/render/index.js +367 -0
- package/src/scene/Disposable.js +498 -0
- package/src/scene/MemoryPool.js +618 -0
- package/src/scene/Node4D.js +697 -0
- package/src/scene/ResourceManager.js +599 -0
- package/src/scene/Scene4D.js +540 -0
- package/src/scene/index.js +98 -0
- package/src/schemas/error.schema.json +84 -0
- package/src/schemas/extension.schema.json +88 -0
- package/src/schemas/index.js +214 -0
- package/src/schemas/parameters.schema.json +142 -0
- package/src/schemas/tool-pack.schema.json +44 -0
- package/src/schemas/tool-response.schema.json +127 -0
- package/src/shaders/common/fullscreen.vert.glsl +5 -0
- package/src/shaders/common/fullscreen.vert.wgsl +17 -0
- package/src/shaders/common/geometry24.glsl +65 -0
- package/src/shaders/common/geometry24.wgsl +54 -0
- package/src/shaders/common/rotation4d.glsl +85 -0
- package/src/shaders/common/rotation4d.wgsl +86 -0
- package/src/shaders/common/uniforms.glsl +44 -0
- package/src/shaders/common/uniforms.wgsl +48 -0
- package/src/shaders/faceted/faceted.frag.glsl +129 -0
- package/src/shaders/faceted/faceted.frag.wgsl +164 -0
- package/src/shaders/holographic/holographic.frag.glsl +406 -0
- package/src/shaders/holographic/holographic.frag.wgsl +185 -0
- package/src/shaders/quantum/quantum.frag.glsl +513 -0
- package/src/shaders/quantum/quantum.frag.wgsl +361 -0
- package/src/testing/ParallelTestFramework.js +519 -0
- package/src/testing/__snapshots__/exportFormats.test.js.snap +24 -0
- package/src/testing/exportFormats.test.js +8 -0
- package/src/testing/projections.test.js +14 -0
- package/src/testing/rotations.test.js +37 -0
- package/src/ui/InteractivityMenu.js +516 -0
- package/src/ui/StatusManager.js +96 -0
- package/src/ui/adaptive/renderers/webgpu/BufferLayout.ts +252 -0
- package/src/ui/adaptive/renderers/webgpu/PolytopeInstanceBuffer.ts +144 -0
- package/src/ui/adaptive/renderers/webgpu/TripleBufferedUniform.ts +170 -0
- package/src/ui/adaptive/renderers/webgpu/WebGPURenderer.ts +735 -0
- package/src/ui/adaptive/renderers/webgpu/index.ts +112 -0
- package/src/variations/VariationManager.js +431 -0
- package/src/viewer/AudioReactivity.js +505 -0
- package/src/viewer/CardBending.js +481 -0
- package/src/viewer/GalleryUI.js +832 -0
- package/src/viewer/ReactivityManager.js +590 -0
- package/src/viewer/TradingCardExporter.js +600 -0
- package/src/viewer/ViewerPortal.js +374 -0
- package/src/viewer/index.js +12 -0
- package/src/wasm/WasmLoader.js +296 -0
- package/src/wasm/index.js +132 -0
- package/tools/agentic/mcpTools.js +88 -0
- package/tools/cli/agent-cli.js +92 -0
- package/tools/export/formats.js +24 -0
- package/tools/math/rotation-baseline.mjs +64 -0
- package/tools/shader-sync-verify.js +937 -0
- package/tools/telemetry/manifestPipeline.js +141 -0
- package/tools/telemetry/telemetryEvents.js +35 -0
- package/types/adaptive-sdk.d.ts +185 -0
- package/types/advanced/AIPresetGenerator.d.ts +81 -0
- package/types/advanced/MIDIController.d.ts +100 -0
- package/types/advanced/OffscreenWorker.d.ts +82 -0
- package/types/advanced/WebGPUCompute.d.ts +52 -0
- package/types/advanced/WebXRRenderer.d.ts +77 -0
- package/types/advanced/index.d.ts +46 -0
- package/types/core/ErrorReporter.d.ts +50 -0
- package/types/core/VIB3Engine.d.ts +204 -0
- package/types/creative/ColorPresetsSystem.d.ts +91 -0
- package/types/creative/ParameterTimeline.d.ts +74 -0
- package/types/creative/PostProcessingPipeline.d.ts +109 -0
- package/types/creative/TransitionAnimator.d.ts +71 -0
- package/types/creative/index.d.ts +35 -0
- package/types/integrations/FigmaPlugin.d.ts +46 -0
- package/types/integrations/OBSMode.d.ts +74 -0
- package/types/integrations/ThreeJsPackage.d.ts +62 -0
- package/types/integrations/TouchDesignerExport.d.ts +36 -0
- package/types/integrations/Vib3React.d.ts +74 -0
- package/types/integrations/Vib3Svelte.d.ts +63 -0
- package/types/integrations/Vib3Vue.d.ts +55 -0
- package/types/integrations/index.d.ts +52 -0
- package/types/reactivity/SpatialInputSystem.d.ts +173 -0
- package/types/reactivity/index.d.ts +394 -0
- package/types/render/CommandBuffer.d.ts +169 -0
- package/types/render/RenderCommand.d.ts +312 -0
- package/types/render/RenderState.d.ts +279 -0
- package/types/render/RenderTarget.d.ts +254 -0
- package/types/render/ShaderProgram.d.ts +277 -0
- package/types/render/UnifiedRenderBridge.d.ts +143 -0
- package/types/render/WebGLBackend.d.ts +168 -0
- package/types/render/WebGPUBackend.d.ts +186 -0
- package/types/render/index.d.ts +141 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactivity Menu System
|
|
3
|
+
* Visual interface for Universal Interactivity Engine
|
|
4
|
+
* Shows real-time input data and parameter mappings
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export class InteractivityMenu {
|
|
8
|
+
constructor(interactivityEngine) {
|
|
9
|
+
this.engine = interactivityEngine;
|
|
10
|
+
this.isVisible = false;
|
|
11
|
+
this.menuContainer = null;
|
|
12
|
+
this.updateInterval = null;
|
|
13
|
+
|
|
14
|
+
this.createMenu();
|
|
15
|
+
this.bindEvents();
|
|
16
|
+
|
|
17
|
+
console.log('๐๏ธ Interactivity Menu initialized');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Create the interactivity menu UI
|
|
22
|
+
*/
|
|
23
|
+
createMenu() {
|
|
24
|
+
// Create menu container
|
|
25
|
+
this.menuContainer = document.createElement('div');
|
|
26
|
+
this.menuContainer.id = 'interactivity-menu';
|
|
27
|
+
this.menuContainer.innerHTML = `
|
|
28
|
+
<style>
|
|
29
|
+
#interactivity-menu {
|
|
30
|
+
position: fixed;
|
|
31
|
+
top: 50px;
|
|
32
|
+
right: 20px;
|
|
33
|
+
width: 350px;
|
|
34
|
+
background: rgba(0, 0, 0, 0.9);
|
|
35
|
+
border: 2px solid #00ffff;
|
|
36
|
+
border-radius: 10px;
|
|
37
|
+
padding: 20px;
|
|
38
|
+
font-family: 'Orbitron', monospace;
|
|
39
|
+
font-size: 0.8rem;
|
|
40
|
+
color: #00ffff;
|
|
41
|
+
z-index: 2000;
|
|
42
|
+
display: none;
|
|
43
|
+
backdrop-filter: blur(10px);
|
|
44
|
+
box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.interactivity-header {
|
|
48
|
+
text-align: center;
|
|
49
|
+
margin-bottom: 20px;
|
|
50
|
+
font-size: 1rem;
|
|
51
|
+
color: #ff00ff;
|
|
52
|
+
text-shadow: 0 0 10px #ff00ff;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.input-source {
|
|
56
|
+
background: rgba(0, 255, 255, 0.1);
|
|
57
|
+
border: 1px solid rgba(0, 255, 255, 0.3);
|
|
58
|
+
border-radius: 5px;
|
|
59
|
+
padding: 10px;
|
|
60
|
+
margin-bottom: 10px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.source-header {
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
align-items: center;
|
|
67
|
+
margin-bottom: 5px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.source-name {
|
|
71
|
+
font-weight: bold;
|
|
72
|
+
color: #00ff00;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.source-status {
|
|
76
|
+
padding: 2px 6px;
|
|
77
|
+
border-radius: 3px;
|
|
78
|
+
font-size: 0.7rem;
|
|
79
|
+
font-weight: bold;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.status-active {
|
|
83
|
+
background: #00ff00;
|
|
84
|
+
color: #000;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.status-inactive {
|
|
88
|
+
background: #ff6600;
|
|
89
|
+
color: #fff;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.reactive-bands {
|
|
93
|
+
display: grid;
|
|
94
|
+
grid-template-columns: 1fr 1fr;
|
|
95
|
+
gap: 5px;
|
|
96
|
+
margin-top: 5px;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.reactive-band {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
font-size: 0.7rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.band-label {
|
|
106
|
+
color: #ffff00;
|
|
107
|
+
margin-bottom: 2px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.band-bar {
|
|
111
|
+
height: 6px;
|
|
112
|
+
background: rgba(255, 255, 255, 0.2);
|
|
113
|
+
border-radius: 3px;
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.band-fill {
|
|
118
|
+
height: 100%;
|
|
119
|
+
background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
|
|
120
|
+
width: 0%;
|
|
121
|
+
transition: width 0.1s ease;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.parameter-mappings {
|
|
125
|
+
margin-top: 15px;
|
|
126
|
+
padding-top: 15px;
|
|
127
|
+
border-top: 1px solid rgba(0, 255, 255, 0.3);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.mapping-header {
|
|
131
|
+
color: #ff00ff;
|
|
132
|
+
font-weight: bold;
|
|
133
|
+
margin-bottom: 10px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.parameter-mapping {
|
|
137
|
+
display: flex;
|
|
138
|
+
justify-content: space-between;
|
|
139
|
+
align-items: center;
|
|
140
|
+
padding: 3px 0;
|
|
141
|
+
font-size: 0.7rem;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.param-name {
|
|
145
|
+
color: #ffff00;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.param-value {
|
|
149
|
+
color: #00ff00;
|
|
150
|
+
font-family: 'Courier New', monospace;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.performance-stats {
|
|
154
|
+
margin-top: 15px;
|
|
155
|
+
padding-top: 15px;
|
|
156
|
+
border-top: 1px solid rgba(0, 255, 255, 0.3);
|
|
157
|
+
font-size: 0.7rem;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.perf-stat {
|
|
161
|
+
display: flex;
|
|
162
|
+
justify-content: space-between;
|
|
163
|
+
margin-bottom: 3px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.toggle-btn {
|
|
167
|
+
background: rgba(255, 0, 255, 0.2);
|
|
168
|
+
border: 1px solid #ff00ff;
|
|
169
|
+
color: #ff00ff;
|
|
170
|
+
padding: 5px 10px;
|
|
171
|
+
border-radius: 3px;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
font-size: 0.7rem;
|
|
174
|
+
transition: all 0.3s;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.toggle-btn:hover {
|
|
178
|
+
background: rgba(255, 0, 255, 0.4);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.toggle-btn.active {
|
|
182
|
+
background: #ff00ff;
|
|
183
|
+
color: #000;
|
|
184
|
+
}
|
|
185
|
+
</style>
|
|
186
|
+
|
|
187
|
+
<div class="interactivity-header">
|
|
188
|
+
๐๏ธ UNIVERSAL INTERACTIVITY ENGINE
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
<div id="input-sources">
|
|
192
|
+
<!-- Input sources will be dynamically populated -->
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<div class="parameter-mappings">
|
|
196
|
+
<div class="mapping-header">๐ PARAMETER MAPPINGS</div>
|
|
197
|
+
<div id="parameter-values">
|
|
198
|
+
<!-- Parameter values will be dynamically updated -->
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div class="performance-stats">
|
|
203
|
+
<div class="mapping-header">โก PERFORMANCE</div>
|
|
204
|
+
<div id="performance-data">
|
|
205
|
+
<!-- Performance stats will be updated -->
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
`;
|
|
209
|
+
|
|
210
|
+
document.body.appendChild(this.menuContainer);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Show the interactivity menu
|
|
215
|
+
*/
|
|
216
|
+
show() {
|
|
217
|
+
this.isVisible = true;
|
|
218
|
+
this.menuContainer.style.display = 'block';
|
|
219
|
+
this.startUpdates();
|
|
220
|
+
console.log('๐๏ธ Interactivity Menu shown');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Hide the interactivity menu
|
|
225
|
+
*/
|
|
226
|
+
hide() {
|
|
227
|
+
this.isVisible = false;
|
|
228
|
+
this.menuContainer.style.display = 'none';
|
|
229
|
+
this.stopUpdates();
|
|
230
|
+
console.log('๐๏ธ Interactivity Menu hidden');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Toggle menu visibility
|
|
235
|
+
*/
|
|
236
|
+
toggle() {
|
|
237
|
+
if (this.isVisible) {
|
|
238
|
+
this.hide();
|
|
239
|
+
} else {
|
|
240
|
+
this.show();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Bind keyboard events
|
|
246
|
+
*/
|
|
247
|
+
bindEvents() {
|
|
248
|
+
document.addEventListener('keydown', (e) => {
|
|
249
|
+
// Toggle with I key (when not typing in inputs)
|
|
250
|
+
if (e.key === 'i' || e.key === 'I') {
|
|
251
|
+
if (!['INPUT', 'TEXTAREA'].includes(e.target.tagName)) {
|
|
252
|
+
e.preventDefault();
|
|
253
|
+
this.toggle();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Start real-time updates
|
|
261
|
+
*/
|
|
262
|
+
startUpdates() {
|
|
263
|
+
if (this.updateInterval) return;
|
|
264
|
+
|
|
265
|
+
this.updateInterval = setInterval(() => {
|
|
266
|
+
this.updateInputSources();
|
|
267
|
+
this.updateParameterMappings();
|
|
268
|
+
this.updatePerformanceStats();
|
|
269
|
+
}, 100); // Update 10 times per second
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Stop real-time updates
|
|
274
|
+
*/
|
|
275
|
+
stopUpdates() {
|
|
276
|
+
if (this.updateInterval) {
|
|
277
|
+
clearInterval(this.updateInterval);
|
|
278
|
+
this.updateInterval = null;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Update input sources display
|
|
284
|
+
*/
|
|
285
|
+
updateInputSources() {
|
|
286
|
+
const sourcesContainer = document.getElementById('input-sources');
|
|
287
|
+
const reactiveBands = this.engine.getReactiveBands();
|
|
288
|
+
const activeInputs = this.engine.activeInputs;
|
|
289
|
+
|
|
290
|
+
let sourcesHTML = '';
|
|
291
|
+
|
|
292
|
+
// Audio sources
|
|
293
|
+
if (activeInputs.has('audio')) {
|
|
294
|
+
sourcesHTML += this.createSourceHTML('audio', '๐ต Audio Input', true, {
|
|
295
|
+
'Bass': reactiveBands.audio.bass,
|
|
296
|
+
'Mid': reactiveBands.audio.mid,
|
|
297
|
+
'High': reactiveBands.audio.high,
|
|
298
|
+
'Energy': reactiveBands.audio.energy
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Mouse/Touch sources
|
|
303
|
+
if (activeInputs.has('mouse/touch')) {
|
|
304
|
+
sourcesHTML += this.createSourceHTML('mouseTouch', '๐ฑ๏ธ Mouse/Touch', true, {
|
|
305
|
+
'Movement': reactiveBands.movement.smoothed,
|
|
306
|
+
'Velocity': reactiveBands.velocity.smoothed,
|
|
307
|
+
'Precision': reactiveBands.precision.smoothed
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// Keyboard sources
|
|
312
|
+
if (activeInputs.has('keyboard')) {
|
|
313
|
+
sourcesHTML += this.createSourceHTML('keyboard', 'โจ๏ธ Keyboard', true, {
|
|
314
|
+
'Typing Rate': reactiveBands.ui.typing.velocity || 0,
|
|
315
|
+
'Rhythm': reactiveBands.ui.typing.rhythm || 0
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// Gamepad sources
|
|
320
|
+
if (activeInputs.has('gamepad')) {
|
|
321
|
+
sourcesHTML += this.createSourceHTML('gamepad', '๐ฎ Gamepad', true, {
|
|
322
|
+
'Pressure': reactiveBands.gamepad.pressure,
|
|
323
|
+
'Left X': Math.abs(reactiveBands.gamepad.axes[0] || 0),
|
|
324
|
+
'Left Y': Math.abs(reactiveBands.gamepad.axes[1] || 0),
|
|
325
|
+
'Right X': Math.abs(reactiveBands.gamepad.axes[2] || 0)
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// Device orientation
|
|
330
|
+
if (activeInputs.has('device-orientation')) {
|
|
331
|
+
sourcesHTML += this.createSourceHTML('wearable', 'โ Device Sensors', true, {
|
|
332
|
+
'Tilt X': Math.abs(reactiveBands.wearable.tilt.x),
|
|
333
|
+
'Tilt Y': Math.abs(reactiveBands.wearable.tilt.y),
|
|
334
|
+
'Motion': reactiveBands.wearable.motion
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// UI interactions
|
|
339
|
+
if (activeInputs.has('ui')) {
|
|
340
|
+
sourcesHTML += this.createSourceHTML('ui', '๐ฅ๏ธ UI Interactions', true, {
|
|
341
|
+
'Scroll': reactiveBands.ui.scroll || 0,
|
|
342
|
+
'Click': reactiveBands.ui.click || 0,
|
|
343
|
+
'Hover': reactiveBands.ui.hover || 0
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
sourcesContainer.innerHTML = sourcesHTML;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Create HTML for an input source
|
|
352
|
+
*/
|
|
353
|
+
createSourceHTML(sourceId, sourceName, isActive, bands) {
|
|
354
|
+
const statusClass = isActive ? 'status-active' : 'status-inactive';
|
|
355
|
+
const statusText = isActive ? 'ACTIVE' : 'INACTIVE';
|
|
356
|
+
|
|
357
|
+
let bandsHTML = '';
|
|
358
|
+
for (const [name, value] of Object.entries(bands)) {
|
|
359
|
+
const percentage = Math.min(100, Math.max(0, value * 100));
|
|
360
|
+
bandsHTML += `
|
|
361
|
+
<div class="reactive-band">
|
|
362
|
+
<div class="band-label">${name}</div>
|
|
363
|
+
<div class="band-bar">
|
|
364
|
+
<div class="band-fill" style="width: ${percentage}%"></div>
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
`;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return `
|
|
371
|
+
<div class="input-source">
|
|
372
|
+
<div class="source-header">
|
|
373
|
+
<span class="source-name">${sourceName}</span>
|
|
374
|
+
<span class="source-status ${statusClass}">${statusText}</span>
|
|
375
|
+
</div>
|
|
376
|
+
<div class="reactive-bands">
|
|
377
|
+
${bandsHTML}
|
|
378
|
+
</div>
|
|
379
|
+
</div>
|
|
380
|
+
`;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Update parameter mappings display
|
|
385
|
+
*/
|
|
386
|
+
updateParameterMappings() {
|
|
387
|
+
const parametersContainer = document.getElementById('parameter-values');
|
|
388
|
+
|
|
389
|
+
const parameters = [
|
|
390
|
+
'rot4dXW', 'rot4dYW', 'rot4dZW',
|
|
391
|
+
'speed', 'hue', 'gridDensity',
|
|
392
|
+
'morphFactor', 'chaos'
|
|
393
|
+
];
|
|
394
|
+
|
|
395
|
+
let parametersHTML = '';
|
|
396
|
+
for (const param of parameters) {
|
|
397
|
+
const value = this.engine.getParameterValue(param);
|
|
398
|
+
if (value !== null) {
|
|
399
|
+
parametersHTML += `
|
|
400
|
+
<div class="parameter-mapping">
|
|
401
|
+
<span class="param-name">${param}</span>
|
|
402
|
+
<span class="param-value">${value.toFixed(2)}</span>
|
|
403
|
+
</div>
|
|
404
|
+
`;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
parametersContainer.innerHTML = parametersHTML;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Update performance statistics display
|
|
413
|
+
*/
|
|
414
|
+
updatePerformanceStats() {
|
|
415
|
+
const performanceContainer = document.getElementById('performance-data');
|
|
416
|
+
const stats = this.engine.getPerformanceStats();
|
|
417
|
+
|
|
418
|
+
const performanceHTML = `
|
|
419
|
+
<div class="perf-stat">
|
|
420
|
+
<span>Update Rate:</span>
|
|
421
|
+
<span>${stats.updateRate.toFixed(1)} Hz</span>
|
|
422
|
+
</div>
|
|
423
|
+
<div class="perf-stat">
|
|
424
|
+
<span>Processing Time:</span>
|
|
425
|
+
<span>${stats.processingTime.toFixed(2)} ms</span>
|
|
426
|
+
</div>
|
|
427
|
+
<div class="perf-stat">
|
|
428
|
+
<span>Active Sources:</span>
|
|
429
|
+
<span>${stats.totalSources}</span>
|
|
430
|
+
</div>
|
|
431
|
+
<div class="perf-stat">
|
|
432
|
+
<span>Input Latency:</span>
|
|
433
|
+
<span>${stats.inputLatency.toFixed(1)} ms</span>
|
|
434
|
+
</div>
|
|
435
|
+
`;
|
|
436
|
+
|
|
437
|
+
performanceContainer.innerHTML = performanceHTML;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Add custom parameter mapping
|
|
442
|
+
*/
|
|
443
|
+
addCustomMapping(parameterName, sourcePath, range = [0, 1], smoothing = 0.5) {
|
|
444
|
+
this.engine.parameterMappings[parameterName] = {
|
|
445
|
+
sources: [sourcePath],
|
|
446
|
+
range: range,
|
|
447
|
+
smoothing: smoothing
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
console.log(`๐๏ธ Added custom mapping: ${parameterName} <- ${sourcePath}`);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Remove parameter mapping
|
|
455
|
+
*/
|
|
456
|
+
removeMapping(parameterName) {
|
|
457
|
+
delete this.engine.parameterMappings[parameterName];
|
|
458
|
+
console.log(`๐๏ธ Removed mapping: ${parameterName}`);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Export current configuration
|
|
463
|
+
*/
|
|
464
|
+
exportConfiguration() {
|
|
465
|
+
const config = {
|
|
466
|
+
parameterMappings: this.engine.parameterMappings,
|
|
467
|
+
activeInputs: Array.from(this.engine.activeInputs),
|
|
468
|
+
timestamp: new Date().toISOString()
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
const blob = new Blob([JSON.stringify(config, null, 2)], {
|
|
472
|
+
type: 'application/json'
|
|
473
|
+
});
|
|
474
|
+
|
|
475
|
+
const url = URL.createObjectURL(blob);
|
|
476
|
+
const a = document.createElement('a');
|
|
477
|
+
a.href = url;
|
|
478
|
+
a.download = 'vib34d-interactivity-config.json';
|
|
479
|
+
a.click();
|
|
480
|
+
URL.revokeObjectURL(url);
|
|
481
|
+
|
|
482
|
+
console.log('๐๏ธ Configuration exported');
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Import configuration
|
|
487
|
+
*/
|
|
488
|
+
async importConfiguration(file) {
|
|
489
|
+
try {
|
|
490
|
+
const text = await file.text();
|
|
491
|
+
const config = JSON.parse(text);
|
|
492
|
+
|
|
493
|
+
if (config.parameterMappings) {
|
|
494
|
+
this.engine.parameterMappings = config.parameterMappings;
|
|
495
|
+
console.log('๐๏ธ Configuration imported successfully');
|
|
496
|
+
return true;
|
|
497
|
+
}
|
|
498
|
+
} catch (error) {
|
|
499
|
+
console.error('๐๏ธ Failed to import configuration:', error);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Destroy the menu
|
|
507
|
+
*/
|
|
508
|
+
destroy() {
|
|
509
|
+
this.stopUpdates();
|
|
510
|
+
if (this.menuContainer) {
|
|
511
|
+
this.menuContainer.remove();
|
|
512
|
+
this.menuContainer = null;
|
|
513
|
+
}
|
|
514
|
+
console.log('๐งน Interactivity Menu destroyed');
|
|
515
|
+
}
|
|
516
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIB34D Status Management System
|
|
3
|
+
* Handles UI feedback and status messaging
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export class StatusManager {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.statusElement = null;
|
|
9
|
+
this.timeout = null;
|
|
10
|
+
this.init();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Initialize status system
|
|
15
|
+
*/
|
|
16
|
+
init() {
|
|
17
|
+
this.statusElement = document.getElementById('status');
|
|
18
|
+
// Silent handling - status element is optional
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Set status message with type and auto-clear
|
|
23
|
+
*/
|
|
24
|
+
setStatus(message, type = 'info', duration = 3000) {
|
|
25
|
+
if (!this.statusElement) return;
|
|
26
|
+
|
|
27
|
+
this.statusElement.textContent = message;
|
|
28
|
+
this.statusElement.className = `status ${type}`;
|
|
29
|
+
|
|
30
|
+
// Clear previous timeout
|
|
31
|
+
if (this.timeout) {
|
|
32
|
+
clearTimeout(this.timeout);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Auto-clear after duration (unless it's an error)
|
|
36
|
+
if (type !== 'error' && duration > 0) {
|
|
37
|
+
this.timeout = setTimeout(() => {
|
|
38
|
+
this.clearStatus();
|
|
39
|
+
}, duration);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Log to console as well
|
|
43
|
+
const logMethod = type === 'error' ? 'error' : type === 'warning' ? 'warn' : 'log';
|
|
44
|
+
console[logMethod](`[${type.toUpperCase()}] ${message}`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Clear status message
|
|
49
|
+
*/
|
|
50
|
+
clearStatus() {
|
|
51
|
+
if (this.statusElement) {
|
|
52
|
+
this.statusElement.textContent = '';
|
|
53
|
+
this.statusElement.className = 'status';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (this.timeout) {
|
|
57
|
+
clearTimeout(this.timeout);
|
|
58
|
+
this.timeout = null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Show success message
|
|
64
|
+
*/
|
|
65
|
+
success(message, duration = 3000) {
|
|
66
|
+
this.setStatus(message, 'success', duration);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Show error message (persists until cleared)
|
|
71
|
+
*/
|
|
72
|
+
error(message) {
|
|
73
|
+
this.setStatus(message, 'error', 0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Show warning message
|
|
78
|
+
*/
|
|
79
|
+
warning(message, duration = 4000) {
|
|
80
|
+
this.setStatus(message, 'warning', duration);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Show info message
|
|
85
|
+
*/
|
|
86
|
+
info(message, duration = 3000) {
|
|
87
|
+
this.setStatus(message, 'info', duration);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Show loading message
|
|
92
|
+
*/
|
|
93
|
+
loading(message) {
|
|
94
|
+
this.setStatus(message, 'loading', 0);
|
|
95
|
+
}
|
|
96
|
+
}
|