@canvas3/nuxt 0.1.9 → 0.1.11
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/dist/module.json +1 -1
- package/dist/runtime/constants/studio783Log.js +1 -1
- package/dist/runtime/utils/canvas3/canvas3.d.ts +1 -0
- package/dist/runtime/utils/canvas3/canvas3.js +9 -5
- package/dist/runtime/utils/exports.d.ts +4 -3
- package/dist/runtime/utils/exports.js +4 -9
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const studio783log = () => {
|
|
2
2
|
console.log(`
|
|
3
|
-
|
|
3
|
+
Nuxt module Canvas3 developed by
|
|
4
4
|
|
|
5
5
|
\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588 \u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588
|
|
6
6
|
\u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588
|
|
@@ -47,6 +47,7 @@ declare class Canvas3Class {
|
|
|
47
47
|
removeScrollActiveElement(elNode: HTMLElement): void;
|
|
48
48
|
removeMesh(id: string): void;
|
|
49
49
|
addAnimationToRender(callBackName: string, callBackFunction: AnimationCallback): void;
|
|
50
|
+
removeAnimationFromRender(callBackName: string): void;
|
|
50
51
|
addImageAsMesh(imgHtmlEl: HTMLImageElement, shaderName: string | null, meshId: string, meshUniforms: MeshMaterialUniform, activateMeshUniforms: MeshMaterialUniform): Promise<void>;
|
|
51
52
|
composerPass(): void;
|
|
52
53
|
setSize(): void;
|
|
@@ -240,6 +240,9 @@ class Canvas3Class {
|
|
|
240
240
|
addAnimationToRender(callBackName, callBackFunction) {
|
|
241
241
|
this.animations.set(callBackName, callBackFunction);
|
|
242
242
|
}
|
|
243
|
+
removeAnimationFromRender(callBackName) {
|
|
244
|
+
this.animations.delete(callBackName);
|
|
245
|
+
}
|
|
243
246
|
// addTextAsMSDF(shaderName: string, meshId: string, htmlEl: HTMLElement, textContent: string, theme: string, meshUniforms: MeshMaterialUniform, activateMeshUniforms: MeshMaterialUniform) {
|
|
244
247
|
// this.activateMeshUniformMap.set(meshId, activateMeshUniforms)
|
|
245
248
|
//
|
|
@@ -481,12 +484,13 @@ class Canvas3Class {
|
|
|
481
484
|
this.mouse.movementY
|
|
482
485
|
);
|
|
483
486
|
}
|
|
484
|
-
if (this.composer)
|
|
485
|
-
this.composer.render();
|
|
486
487
|
for (const [_key, callback] of this.animations.entries()) {
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
488
|
+
callback?.();
|
|
489
|
+
}
|
|
490
|
+
if (this.composer) {
|
|
491
|
+
this.composer.render();
|
|
492
|
+
} else if (this.renderer && this.camera) {
|
|
493
|
+
this.renderer.render(this.scene, this.camera);
|
|
490
494
|
}
|
|
491
495
|
try {
|
|
492
496
|
requestAnimationFrame(this.render.bind(this));
|
|
@@ -4,6 +4,7 @@ export declare const Canvas3: {
|
|
|
4
4
|
addMeshToScene: (mesh: Mesh) => void;
|
|
5
5
|
getMeshFromSceneByName: (meshName: string) => import("three").Object3D<import("three").Object3DEventMap> | undefined;
|
|
6
6
|
addAnimationToRender: (callBackName: string, callBackFunction: import("../types/types.js").AnimationCallback) => void;
|
|
7
|
+
removeAnimationFromRender: (callBackName: string) => void;
|
|
7
8
|
addImageAsMesh: (imgHtmlEl: HTMLImageElement, shaderName: string | null, meshId: string, meshUniforms: import("../types/types.js").MeshMaterialUniform, activateMeshUniforms: import("../types/types.js").MeshMaterialUniform) => Promise<void>;
|
|
8
9
|
getShaderMaterial: typeof getShaderMaterial;
|
|
9
10
|
removeMesh: (imgHtmlEl: HTMLImageElement, shaderName: string | null, meshId: string, meshUniforms: import("../types/types.js").MeshMaterialUniform, activateMeshUniforms: import("../types/types.js").MeshMaterialUniform) => Promise<void>;
|
|
@@ -12,7 +13,7 @@ export declare const Canvas3: {
|
|
|
12
13
|
setMeshPositionsUpdate: (state: boolean) => void;
|
|
13
14
|
scrollToTop: (delay?: number) => void;
|
|
14
15
|
getScrollSpeed: () => number | null;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
getCamera: () => import("three").PerspectiveCamera | null;
|
|
17
|
+
getRenderer: () => import("three").WebGLRenderer | null;
|
|
18
|
+
getScene: () => import("three").Scene;
|
|
18
19
|
};
|
|
@@ -8,6 +8,7 @@ export const Canvas3 = {
|
|
|
8
8
|
return mainClass.scene.getObjectByName(meshName);
|
|
9
9
|
},
|
|
10
10
|
addAnimationToRender: mainClass.addAnimationToRender.bind(mainClass),
|
|
11
|
+
removeAnimationFromRender: mainClass.removeAnimationFromRender.bind(mainClass),
|
|
11
12
|
addImageAsMesh: mainClass.addImageAsMesh.bind(mainClass),
|
|
12
13
|
getShaderMaterial,
|
|
13
14
|
removeMesh: mainClass.addImageAsMesh.bind(mainClass),
|
|
@@ -18,13 +19,7 @@ export const Canvas3 = {
|
|
|
18
19
|
getScrollSpeed: () => {
|
|
19
20
|
return mainClass.scroll?.speed ?? null;
|
|
20
21
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
get scene() {
|
|
25
|
-
return mainClass.scene;
|
|
26
|
-
},
|
|
27
|
-
get camera() {
|
|
28
|
-
return mainClass.camera;
|
|
29
|
-
}
|
|
22
|
+
getCamera: () => mainClass.camera,
|
|
23
|
+
getRenderer: () => mainClass.renderer,
|
|
24
|
+
getScene: () => mainClass.scene
|
|
30
25
|
};
|