@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,580 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VIB34D Export/Import Management System
|
|
3
|
+
* Handles all export and import functionality for configurations and media
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export class ExportManager {
|
|
7
|
+
constructor(engine) {
|
|
8
|
+
this.engine = engine;
|
|
9
|
+
this.setupFileInputs();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Set up file input handlers
|
|
14
|
+
*/
|
|
15
|
+
setupFileInputs() {
|
|
16
|
+
// Create hidden file inputs
|
|
17
|
+
const jsonInput = document.createElement('input');
|
|
18
|
+
jsonInput.type = 'file';
|
|
19
|
+
jsonInput.id = 'jsonFileInput';
|
|
20
|
+
jsonInput.accept = '.json';
|
|
21
|
+
jsonInput.style.display = 'none';
|
|
22
|
+
jsonInput.addEventListener('change', (e) => this.handleJSONImport(e));
|
|
23
|
+
document.body.appendChild(jsonInput);
|
|
24
|
+
|
|
25
|
+
const folderInput = document.createElement('input');
|
|
26
|
+
folderInput.type = 'file';
|
|
27
|
+
folderInput.id = 'folderInput';
|
|
28
|
+
folderInput.webkitdirectory = true;
|
|
29
|
+
folderInput.multiple = true;
|
|
30
|
+
folderInput.style.display = 'none';
|
|
31
|
+
folderInput.addEventListener('change', (e) => this.handleFolderImport(e));
|
|
32
|
+
document.body.appendChild(folderInput);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Export current configuration as JSON
|
|
37
|
+
*/
|
|
38
|
+
exportJSON() {
|
|
39
|
+
const config = {
|
|
40
|
+
version: "2.0",
|
|
41
|
+
type: "vib34d-integrated-config",
|
|
42
|
+
name: `${this.engine.variationManager.getVariationName(this.engine.currentVariation)} - ${new Date().toLocaleDateString()}`,
|
|
43
|
+
variation: this.engine.currentVariation,
|
|
44
|
+
parameters: this.engine.parameterManager.getAllParameters(),
|
|
45
|
+
timestamp: Date.now(),
|
|
46
|
+
metadata: {
|
|
47
|
+
engine: "VIB34D Integrated",
|
|
48
|
+
features: ["5-layer holographic", "100 variations", "4D mathematics", "agent-ready"],
|
|
49
|
+
author: "Paul Phillips (domusgpt)",
|
|
50
|
+
email: "phillips.paul.email@gmail.com"
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const json = JSON.stringify(config, null, 2);
|
|
55
|
+
this.downloadFile(json, 'vib34d-config.json', 'application/json');
|
|
56
|
+
this.engine.statusManager.success('Configuration exported as JSON');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Save to Gallery - Creates properly formatted collection for gallery system
|
|
61
|
+
*/
|
|
62
|
+
saveToGallery(customName = null) {
|
|
63
|
+
// Get current state
|
|
64
|
+
const params = this.engine.parameterManager.getAllParameters();
|
|
65
|
+
const variationName = customName || this.engine.variationManager.getVariationName(this.engine.currentVariation);
|
|
66
|
+
const timestamp = new Date().toISOString();
|
|
67
|
+
|
|
68
|
+
// Format as holographic-collection (gallery format)
|
|
69
|
+
const collection = {
|
|
70
|
+
name: `Custom Gallery Collection - ${new Date().toLocaleDateString()}`,
|
|
71
|
+
description: `User-saved variation: ${variationName}`,
|
|
72
|
+
version: "1.0",
|
|
73
|
+
type: "holographic-collection", // Required by gallery system
|
|
74
|
+
profileName: "VIB34D System",
|
|
75
|
+
totalVariations: 1,
|
|
76
|
+
created: timestamp,
|
|
77
|
+
variations: [{
|
|
78
|
+
id: 0,
|
|
79
|
+
name: variationName,
|
|
80
|
+
isCustom: true,
|
|
81
|
+
globalId: Date.now(), // Unique identifier
|
|
82
|
+
system: "faceted", // System type for gallery
|
|
83
|
+
parameters: {
|
|
84
|
+
// Map VIB34D parameters to gallery format
|
|
85
|
+
geometryType: params.geometry || 0,
|
|
86
|
+
density: params.gridDensity || 10,
|
|
87
|
+
speed: params.speed || 1.0,
|
|
88
|
+
chaos: params.chaos || 0.0,
|
|
89
|
+
morph: params.morphFactor || 0.0,
|
|
90
|
+
hue: params.hue || 200,
|
|
91
|
+
saturation: 0.8,
|
|
92
|
+
intensity: 0.5,
|
|
93
|
+
// Include 4D parameters
|
|
94
|
+
rot4dXW: params.rot4dXW || 0,
|
|
95
|
+
rot4dYW: params.rot4dYW || 0,
|
|
96
|
+
rot4dZW: params.rot4dZW || 0,
|
|
97
|
+
dimension: params.dimension || 3.8
|
|
98
|
+
}
|
|
99
|
+
}]
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const json = JSON.stringify(collection, null, 2);
|
|
103
|
+
const filename = `custom-${Date.now()}.json`;
|
|
104
|
+
|
|
105
|
+
// Download with instructions
|
|
106
|
+
this.downloadFile(json, filename, 'application/json');
|
|
107
|
+
|
|
108
|
+
// Show detailed instructions
|
|
109
|
+
this.engine.statusManager.success(
|
|
110
|
+
`🎯 Saved for Gallery!<br><br>` +
|
|
111
|
+
`<strong>File:</strong> ${filename}<br>` +
|
|
112
|
+
`<strong>Next Steps:</strong><br>` +
|
|
113
|
+
`1. Find downloaded file in your Downloads folder<br>` +
|
|
114
|
+
`2. Move it to the <code>collections/</code> folder in your VIB34D directory<br>` +
|
|
115
|
+
`3. Refresh gallery to see your variation<br><br>` +
|
|
116
|
+
`<small>The gallery only shows collections from the collections/ folder</small>`
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
console.log('🎯 Gallery collection saved:', filename);
|
|
120
|
+
return filename;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Export current configuration as CSS theme
|
|
125
|
+
*/
|
|
126
|
+
exportCSS() {
|
|
127
|
+
const params = this.engine.parameterManager.getAllParameters();
|
|
128
|
+
const cssContent = `/* VIB34D Integrated Holographic CSS Theme */
|
|
129
|
+
/* Generated: ${new Date().toISOString()} */
|
|
130
|
+
/* Variation: ${this.engine.currentVariation + 1} - ${this.engine.variationManager.getVariationName(this.engine.currentVariation)} */
|
|
131
|
+
|
|
132
|
+
:root {
|
|
133
|
+
/* VIB34D Parameters */
|
|
134
|
+
--vib34d-variation: ${this.engine.currentVariation};
|
|
135
|
+
--vib34d-geometry: ${params.geometry};
|
|
136
|
+
--vib34d-grid-density: ${params.gridDensity};
|
|
137
|
+
--vib34d-morph-factor: ${params.morphFactor};
|
|
138
|
+
--vib34d-chaos: ${params.chaos};
|
|
139
|
+
--vib34d-speed: ${params.speed};
|
|
140
|
+
--vib34d-hue: ${params.hue}deg;
|
|
141
|
+
--vib34d-rot-4d-xw: ${params.rot4dXW};
|
|
142
|
+
--vib34d-rot-4d-yw: ${params.rot4dYW};
|
|
143
|
+
--vib34d-rot-4d-zw: ${params.rot4dZW};
|
|
144
|
+
--vib34d-dimension: ${params.dimension};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.vib34d-holographic {
|
|
148
|
+
/* Base holographic background */
|
|
149
|
+
background: linear-gradient(45deg,
|
|
150
|
+
hsl(${params.hue}, 70%, 30%) 0%,
|
|
151
|
+
hsl(${(params.hue + 60) % 360}, 70%, 20%) 25%,
|
|
152
|
+
hsl(${(params.hue + 120) % 360}, 70%, 25%) 50%,
|
|
153
|
+
hsl(${(params.hue + 180) % 360}, 70%, 20%) 75%,
|
|
154
|
+
hsl(${(params.hue + 240) % 360}, 70%, 30%) 100%);
|
|
155
|
+
|
|
156
|
+
/* Animation based on parameters */
|
|
157
|
+
animation: vib34d-holographic-pulse ${3 / params.speed}s infinite;
|
|
158
|
+
|
|
159
|
+
/* 4D transformation simulation */
|
|
160
|
+
transform: perspective(1000px)
|
|
161
|
+
rotateX(${params.rot4dXW * 5}deg)
|
|
162
|
+
rotateY(${params.rot4dYW * 5}deg)
|
|
163
|
+
rotateZ(${params.rot4dZW * 5}deg);
|
|
164
|
+
|
|
165
|
+
/* Layer effects */
|
|
166
|
+
position: relative;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.vib34d-holographic::before {
|
|
171
|
+
content: '';
|
|
172
|
+
position: absolute;
|
|
173
|
+
top: 0;
|
|
174
|
+
left: 0;
|
|
175
|
+
right: 0;
|
|
176
|
+
bottom: 0;
|
|
177
|
+
background: radial-gradient(circle at 50% 50%,
|
|
178
|
+
hsla(${(params.hue + 30) % 360}, 80%, 50%, 0.3) 0%,
|
|
179
|
+
hsla(${(params.hue + 90) % 360}, 70%, 40%, 0.2) 30%,
|
|
180
|
+
transparent 60%);
|
|
181
|
+
mix-blend-mode: screen;
|
|
182
|
+
animation: vib34d-overlay-rotate ${6 / params.speed}s linear infinite;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.vib34d-holographic::after {
|
|
186
|
+
content: '';
|
|
187
|
+
position: absolute;
|
|
188
|
+
top: 0;
|
|
189
|
+
left: 0;
|
|
190
|
+
right: 0;
|
|
191
|
+
bottom: 0;
|
|
192
|
+
background: repeating-linear-gradient(
|
|
193
|
+
${params.rot4dXW * 90}deg,
|
|
194
|
+
transparent 0px,
|
|
195
|
+
hsla(${params.hue}, 60%, 60%, ${0.1 + params.chaos * 0.2}) ${2 + params.gridDensity * 0.5}px,
|
|
196
|
+
transparent ${4 + params.gridDensity}px
|
|
197
|
+
);
|
|
198
|
+
mix-blend-mode: overlay;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@keyframes vib34d-holographic-pulse {
|
|
202
|
+
0% {
|
|
203
|
+
filter: hue-rotate(0deg) saturate(1) brightness(1);
|
|
204
|
+
transform: perspective(1000px)
|
|
205
|
+
rotateX(${params.rot4dXW * 5}deg)
|
|
206
|
+
rotateY(${params.rot4dYW * 5}deg)
|
|
207
|
+
rotateZ(${params.rot4dZW * 5}deg)
|
|
208
|
+
scale(1);
|
|
209
|
+
}
|
|
210
|
+
50% {
|
|
211
|
+
filter: hue-rotate(${params.chaos * 180}deg)
|
|
212
|
+
saturate(${1 + params.morphFactor})
|
|
213
|
+
brightness(${1.1 + params.morphFactor * 0.3});
|
|
214
|
+
transform: perspective(1000px)
|
|
215
|
+
rotateX(${params.rot4dXW * 5 + 2}deg)
|
|
216
|
+
rotateY(${params.rot4dYW * 5 + 2}deg)
|
|
217
|
+
rotateZ(${params.rot4dZW * 5 + 2}deg)
|
|
218
|
+
scale(${1 + params.morphFactor * 0.1});
|
|
219
|
+
}
|
|
220
|
+
100% {
|
|
221
|
+
filter: hue-rotate(360deg) saturate(1) brightness(1);
|
|
222
|
+
transform: perspective(1000px)
|
|
223
|
+
rotateX(${params.rot4dXW * 5}deg)
|
|
224
|
+
rotateY(${params.rot4dYW * 5}deg)
|
|
225
|
+
rotateZ(${params.rot4dZW * 5}deg)
|
|
226
|
+
scale(1);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
@keyframes vib34d-overlay-rotate {
|
|
231
|
+
from { transform: rotate(0deg); }
|
|
232
|
+
to { transform: rotate(360deg); }
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* Interactive effects */
|
|
236
|
+
.vib34d-holographic:hover {
|
|
237
|
+
animation-duration: ${1.5 / params.speed}s;
|
|
238
|
+
filter: saturate(${1.2 + params.morphFactor * 0.3}) brightness(${1.1 + params.chaos * 0.2});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.vib34d-holographic:active {
|
|
242
|
+
transform: perspective(1000px)
|
|
243
|
+
rotateX(${params.rot4dXW * 5 + 5}deg)
|
|
244
|
+
rotateY(${params.rot4dYW * 5 + 5}deg)
|
|
245
|
+
rotateZ(${params.rot4dZW * 5 + 3}deg)
|
|
246
|
+
scale(${0.95 + params.morphFactor * 0.05});
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* Configuration comment for reference */
|
|
250
|
+
/* VIB34D Configuration: ${JSON.stringify(params, null, 2)} */`;
|
|
251
|
+
|
|
252
|
+
this.downloadFile(cssContent, 'vib34d-holographic.css', 'text/css');
|
|
253
|
+
this.engine.statusManager.success('CSS theme exported');
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Export complete HTML page with current visualization
|
|
258
|
+
*/
|
|
259
|
+
exportHTML() {
|
|
260
|
+
const params = this.engine.parameterManager.getAllParameters();
|
|
261
|
+
const htmlContent = `<!DOCTYPE html>
|
|
262
|
+
<html lang="en">
|
|
263
|
+
<head>
|
|
264
|
+
<meta charset="UTF-8">
|
|
265
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
266
|
+
<title>VIB34D Holographic Export - Variation ${this.engine.currentVariation + 1}</title>
|
|
267
|
+
<style>
|
|
268
|
+
body {
|
|
269
|
+
margin: 0;
|
|
270
|
+
padding: 0;
|
|
271
|
+
background: #000;
|
|
272
|
+
font-family: 'Orbitron', 'Courier New', monospace;
|
|
273
|
+
overflow: hidden;
|
|
274
|
+
}
|
|
275
|
+
#holographic-canvas {
|
|
276
|
+
width: 100vw;
|
|
277
|
+
height: 100vh;
|
|
278
|
+
display: block;
|
|
279
|
+
}
|
|
280
|
+
.info-overlay {
|
|
281
|
+
position: fixed;
|
|
282
|
+
top: 20px;
|
|
283
|
+
left: 20px;
|
|
284
|
+
color: #fff;
|
|
285
|
+
background: rgba(0,0,0,0.7);
|
|
286
|
+
padding: 15px;
|
|
287
|
+
border-radius: 8px;
|
|
288
|
+
font-size: 12px;
|
|
289
|
+
z-index: 1000;
|
|
290
|
+
max-width: 300px;
|
|
291
|
+
}
|
|
292
|
+
.info-overlay h3 {
|
|
293
|
+
margin: 0 0 10px 0;
|
|
294
|
+
color: hsl(${params.hue}, 70%, 70%);
|
|
295
|
+
}
|
|
296
|
+
</style>
|
|
297
|
+
</head>
|
|
298
|
+
<body>
|
|
299
|
+
<canvas id="holographic-canvas"></canvas>
|
|
300
|
+
|
|
301
|
+
<div class="info-overlay">
|
|
302
|
+
<h3>VIB34D Holographic Export</h3>
|
|
303
|
+
<div>Variation: ${this.engine.currentVariation + 1} - ${this.engine.variationManager.getVariationName(this.engine.currentVariation)}</div>
|
|
304
|
+
<div>Geometry: ${this.getGeometryName(params.geometry)}</div>
|
|
305
|
+
<div>Generated: ${new Date().toLocaleString()}</div>
|
|
306
|
+
<div style="margin-top: 10px; font-size: 10px; opacity: 0.7;">
|
|
307
|
+
Click to interact • Double-click to randomize
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
|
|
311
|
+
<script>
|
|
312
|
+
// VIB34D Configuration
|
|
313
|
+
const vib34dConfig = ${JSON.stringify(params, null, 4)};
|
|
314
|
+
|
|
315
|
+
// Simplified renderer for exported HTML
|
|
316
|
+
class ExportedHolographicRenderer {
|
|
317
|
+
constructor(canvas) {
|
|
318
|
+
this.canvas = canvas;
|
|
319
|
+
this.ctx = canvas.getContext('2d');
|
|
320
|
+
this.config = vib34dConfig;
|
|
321
|
+
this.time = 0;
|
|
322
|
+
this.mouseX = 0.5;
|
|
323
|
+
this.mouseY = 0.5;
|
|
324
|
+
this.mouseIntensity = 0;
|
|
325
|
+
this.clickIntensity = 0;
|
|
326
|
+
|
|
327
|
+
this.setupInteraction();
|
|
328
|
+
this.render();
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
setupInteraction() {
|
|
332
|
+
this.canvas.addEventListener('mousemove', (e) => {
|
|
333
|
+
const rect = this.canvas.getBoundingClientRect();
|
|
334
|
+
this.mouseX = (e.clientX - rect.left) / rect.width;
|
|
335
|
+
this.mouseY = (e.clientY - rect.top) / rect.height;
|
|
336
|
+
this.mouseIntensity = 0.5;
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
this.canvas.addEventListener('click', () => {
|
|
340
|
+
this.clickIntensity = 1.0;
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
this.canvas.addEventListener('dblclick', () => {
|
|
344
|
+
this.randomizeConfig();
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
randomizeConfig() {
|
|
349
|
+
this.config.hue = Math.random() * 360;
|
|
350
|
+
this.config.gridDensity = 4 + Math.random() * 26;
|
|
351
|
+
this.config.morphFactor = Math.random() * 2;
|
|
352
|
+
this.config.chaos = Math.random();
|
|
353
|
+
this.config.speed = 0.1 + Math.random() * 2.9;
|
|
354
|
+
this.clickIntensity = 1.5;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
render() {
|
|
358
|
+
this.canvas.width = window.innerWidth;
|
|
359
|
+
this.canvas.height = window.innerHeight;
|
|
360
|
+
|
|
361
|
+
const ctx = this.ctx;
|
|
362
|
+
ctx.fillStyle = '#000';
|
|
363
|
+
ctx.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
364
|
+
|
|
365
|
+
// Generate holographic pattern based on config
|
|
366
|
+
const centerX = this.canvas.width / 2;
|
|
367
|
+
const centerY = this.canvas.height / 2;
|
|
368
|
+
const interactionX = centerX + (this.mouseX - 0.5) * this.canvas.width * 0.3;
|
|
369
|
+
const interactionY = centerY + (this.mouseY - 0.5) * this.canvas.height * 0.3;
|
|
370
|
+
|
|
371
|
+
// Multiple layers for depth
|
|
372
|
+
const layers = [
|
|
373
|
+
{ alpha: 0.2, size: 1, offset: 0 },
|
|
374
|
+
{ alpha: 0.3, size: 1.5, offset: 0.3 },
|
|
375
|
+
{ alpha: 0.4, size: 2, offset: 0.6 },
|
|
376
|
+
{ alpha: 0.3, size: 1.2, offset: 0.9 },
|
|
377
|
+
{ alpha: 0.5, size: 2.5, offset: 1.2 }
|
|
378
|
+
];
|
|
379
|
+
|
|
380
|
+
layers.forEach((layer, layerIndex) => {
|
|
381
|
+
for (let i = 0; i < this.config.gridDensity * 8; i++) {
|
|
382
|
+
const angle = (i / (this.config.gridDensity * 8)) * Math.PI * 2;
|
|
383
|
+
const radius = Math.sin(this.time * 0.001 * this.config.speed + angle * this.config.morphFactor + layer.offset) *
|
|
384
|
+
(100 + layerIndex * 30) * (1 + this.mouseIntensity * 0.5);
|
|
385
|
+
|
|
386
|
+
const x = interactionX + Math.cos(angle) * radius;
|
|
387
|
+
const y = interactionY + Math.sin(angle) * radius;
|
|
388
|
+
|
|
389
|
+
const hue = (this.config.hue + angle * 57.2958 + this.time * 0.1 + layerIndex * 20) % 360;
|
|
390
|
+
const alpha = (layer.alpha + Math.sin(this.time * 0.002 + angle) * 0.2) *
|
|
391
|
+
(1 + this.clickIntensity * 0.5);
|
|
392
|
+
|
|
393
|
+
ctx.fillStyle = \`hsla(\${hue}, 70%, \${50 + layerIndex * 10}%, \${alpha})\`;
|
|
394
|
+
ctx.beginPath();
|
|
395
|
+
ctx.arc(x, y, (2 + this.config.chaos * 3) * layer.size, 0, Math.PI * 2);
|
|
396
|
+
ctx.fill();
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// Decay intensities
|
|
401
|
+
this.mouseIntensity *= 0.95;
|
|
402
|
+
this.clickIntensity *= 0.92;
|
|
403
|
+
|
|
404
|
+
this.time += 16;
|
|
405
|
+
requestAnimationFrame(() => this.render());
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
// Initialize when page loads
|
|
410
|
+
window.addEventListener('load', () => {
|
|
411
|
+
new ExportedHolographicRenderer(document.getElementById('holographic-canvas'));
|
|
412
|
+
});
|
|
413
|
+
</script>
|
|
414
|
+
</body>
|
|
415
|
+
</html>`;
|
|
416
|
+
|
|
417
|
+
this.downloadFile(htmlContent, 'vib34d-holographic.html', 'text/html');
|
|
418
|
+
this.engine.statusManager.success('HTML file exported');
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Export current visualization as PNG
|
|
423
|
+
*/
|
|
424
|
+
exportPNG() {
|
|
425
|
+
try {
|
|
426
|
+
const canvas = document.getElementById('content-canvas');
|
|
427
|
+
if (!canvas) {
|
|
428
|
+
throw new Error('Content canvas not found');
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const link = document.createElement('a');
|
|
432
|
+
link.download = `vib34d-variation-${this.engine.currentVariation + 1}.png`;
|
|
433
|
+
link.href = canvas.toDataURL('image/png');
|
|
434
|
+
link.click();
|
|
435
|
+
|
|
436
|
+
this.engine.statusManager.success('PNG image exported');
|
|
437
|
+
} catch (error) {
|
|
438
|
+
this.engine.statusManager.error('PNG export failed: ' + error.message);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Trigger JSON import file dialog
|
|
444
|
+
*/
|
|
445
|
+
importJSON() {
|
|
446
|
+
document.getElementById('jsonFileInput').click();
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Trigger folder import dialog
|
|
451
|
+
*/
|
|
452
|
+
importFolder() {
|
|
453
|
+
document.getElementById('folderInput').click();
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Handle JSON file import
|
|
458
|
+
*/
|
|
459
|
+
async handleJSONImport(event) {
|
|
460
|
+
const file = event.target.files[0];
|
|
461
|
+
if (!file) return;
|
|
462
|
+
|
|
463
|
+
try {
|
|
464
|
+
const text = await file.text();
|
|
465
|
+
const config = JSON.parse(text);
|
|
466
|
+
|
|
467
|
+
if (this.validateConfiguration(config)) {
|
|
468
|
+
this.loadConfiguration(config);
|
|
469
|
+
this.engine.statusManager.success(`Configuration imported: ${config.name || 'Unnamed'}`);
|
|
470
|
+
} else {
|
|
471
|
+
this.engine.statusManager.error('Invalid configuration file');
|
|
472
|
+
}
|
|
473
|
+
} catch (error) {
|
|
474
|
+
this.engine.statusManager.error('Failed to import configuration: ' + error.message);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// Reset input
|
|
478
|
+
event.target.value = '';
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Handle folder import
|
|
483
|
+
*/
|
|
484
|
+
async handleFolderImport(event) {
|
|
485
|
+
const files = Array.from(event.target.files);
|
|
486
|
+
const jsonFiles = files.filter(file =>
|
|
487
|
+
file.name.toLowerCase().endsWith('.json') &&
|
|
488
|
+
file.type === 'application/json'
|
|
489
|
+
);
|
|
490
|
+
|
|
491
|
+
if (jsonFiles.length === 0) {
|
|
492
|
+
this.engine.statusManager.warning('No JSON files found in folder');
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
let loadedCount = 0;
|
|
497
|
+
|
|
498
|
+
for (const file of jsonFiles) {
|
|
499
|
+
try {
|
|
500
|
+
const text = await file.text();
|
|
501
|
+
const config = JSON.parse(text);
|
|
502
|
+
|
|
503
|
+
if (this.validateConfiguration(config)) {
|
|
504
|
+
// For folder import, save as custom variation
|
|
505
|
+
this.saveAsCustomVariation(config);
|
|
506
|
+
loadedCount++;
|
|
507
|
+
}
|
|
508
|
+
} catch (error) {
|
|
509
|
+
console.warn(`Failed to load ${file.name}:`, error);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
if (loadedCount > 0) {
|
|
514
|
+
this.engine.statusManager.success(`Imported ${loadedCount} configurations from folder`);
|
|
515
|
+
this.engine.variationManager.populateGrid();
|
|
516
|
+
} else {
|
|
517
|
+
this.engine.statusManager.error('No valid configurations found in folder');
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// Reset input
|
|
521
|
+
event.target.value = '';
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Validate configuration file
|
|
526
|
+
*/
|
|
527
|
+
validateConfiguration(config) {
|
|
528
|
+
return config &&
|
|
529
|
+
config.type === 'vib34d-integrated-config' &&
|
|
530
|
+
config.parameters &&
|
|
531
|
+
typeof config.parameters === 'object';
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Load configuration into engine
|
|
536
|
+
*/
|
|
537
|
+
loadConfiguration(config) {
|
|
538
|
+
if (config.parameters) {
|
|
539
|
+
this.engine.parameterManager.setParameters(config.parameters);
|
|
540
|
+
|
|
541
|
+
if (typeof config.variation === 'number') {
|
|
542
|
+
this.engine.setVariation(config.variation);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
this.engine.updateDisplayValues();
|
|
546
|
+
this.engine.updateVisualizers();
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Save imported config as custom variation
|
|
552
|
+
*/
|
|
553
|
+
saveAsCustomVariation(config) {
|
|
554
|
+
const customIndex = this.engine.variationManager.saveCurrentAsCustom();
|
|
555
|
+
return customIndex;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/**
|
|
559
|
+
* Download file helper
|
|
560
|
+
*/
|
|
561
|
+
downloadFile(content, filename, mimeType) {
|
|
562
|
+
const blob = new Blob([content], { type: mimeType });
|
|
563
|
+
const url = URL.createObjectURL(blob);
|
|
564
|
+
|
|
565
|
+
const link = document.createElement('a');
|
|
566
|
+
link.href = url;
|
|
567
|
+
link.download = filename;
|
|
568
|
+
link.click();
|
|
569
|
+
|
|
570
|
+
URL.revokeObjectURL(url);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Get geometry name helper
|
|
575
|
+
*/
|
|
576
|
+
getGeometryName(index) {
|
|
577
|
+
const names = ['Tetrahedron', 'Hypercube', 'Sphere', 'Torus', 'Klein Bottle', 'Fractal', 'Wave', 'Crystal'];
|
|
578
|
+
return names[index] || 'Unknown';
|
|
579
|
+
}
|
|
580
|
+
}
|