@canvas3/nuxt 0.1.24 → 0.1.25

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "canvas-nuxt-layout",
3
3
  "configKey": "canvas3Layout",
4
- "version": "0.1.24",
4
+ "version": "0.1.25",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.0"
@@ -7,6 +7,7 @@ import Scroll from '#canvas3-nuxt/utils/canvas3/scroll';
7
7
  import type { AnimationCallbacks, Canvas3OptionsType, ScrollActionBinding, MeshMaterialUniform, MeshType, myEffectType, AnimationCallSetup } from '#canvas3-nuxt/types/types';
8
8
  declare class Canvas3Class {
9
9
  canvasInitiated: import("vue").Ref<boolean, boolean>;
10
+ renderDisabled: boolean;
10
11
  mouseMoveInProgress: boolean;
11
12
  animationsRender: boolean;
12
13
  documentVisibility: boolean;
@@ -40,6 +41,7 @@ declare class Canvas3Class {
40
41
  yPrev: number;
41
42
  };
42
43
  init(canvasElement: HTMLElement, scrollableContent: HTMLElement, canvas3Options: Canvas3OptionsType): Promise<void>;
44
+ setRenderDisabled(status: boolean): void;
43
45
  setCanvasAndCamera(): void;
44
46
  resizeOnChange(): void;
45
47
  resizeImageStore(): void;
@@ -15,6 +15,7 @@ const canvasInitiated = ref(false);
15
15
  const ANIMATION_FALSE_STATE_DELAY = 0;
16
16
  class Canvas3Class {
17
17
  canvasInitiated = canvasInitiated;
18
+ renderDisabled = false;
18
19
  mouseMoveInProgress = false;
19
20
  animationsRender = false;
20
21
  documentVisibility = true;
@@ -90,6 +91,13 @@ class Canvas3Class {
90
91
  this.canvasInitiated.value = true;
91
92
  studio783log();
92
93
  }
94
+ setRenderDisabled(status) {
95
+ if (!status && this.renderDisabled) {
96
+ this.renderDisabled = false;
97
+ this.render();
98
+ }
99
+ this.renderDisabled = status;
100
+ }
93
101
  setCanvasAndCamera() {
94
102
  this.width = this.canvasContainer?.offsetWidth ?? 0;
95
103
  this.height = this.canvasContainer?.offsetHeight ?? 0;
@@ -453,6 +461,7 @@ class Canvas3Class {
453
461
  }
454
462
  try {
455
463
  if (!this.documentVisibility) return;
464
+ if (this.renderDisabled) return;
456
465
  requestAnimationFrame(this.render.bind(this));
457
466
  } catch (e) {
458
467
  console.error(e);
@@ -10,6 +10,7 @@ export declare const Canvas3: {
10
10
  removeMesh: (id: string) => void;
11
11
  setAnimationsToRender: (state: boolean) => void;
12
12
  setAnimationToRender: (callBackName: string, state: boolean, animationId: string) => void;
13
+ setRenderDisabled: (status: boolean) => void;
13
14
  resizeOnChange: () => void;
14
15
  scrollToElBySelector: (elQuerySelector: string, delay?: number, margin?: number) => void;
15
16
  setMeshPositionsUpdate: (state: boolean) => void;
@@ -14,6 +14,7 @@ export const Canvas3 = {
14
14
  removeMesh: mainClass.removeMesh.bind(mainClass),
15
15
  setAnimationsToRender: mainClass.setAnimationsToRender.bind(mainClass),
16
16
  setAnimationToRender: mainClass.setAnimationToRender.bind(mainClass),
17
+ setRenderDisabled: mainClass.setRenderDisabled.bind(mainClass),
17
18
  resizeOnChange: mainClass.resizeOnChange.bind(mainClass),
18
19
  scrollToElBySelector: mainClass.scrollToElBySelector.bind(mainClass),
19
20
  setMeshPositionsUpdate: mainClass.setMeshPositionsUpdate.bind(mainClass),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canvas3/nuxt",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,11 +41,13 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@nuxt/kit": "^4.0.0",
44
- "gsap": "^3.13.0",
45
- "three": "^0.178.0",
46
44
  "vite-plugin-glsl": "^1.5.1",
47
45
  "vue": "^3.5.18"
48
46
  },
47
+ "peerDependencies": {
48
+ "gsap": "^3.13.0",
49
+ "three": "^0.178.0"
50
+ },
49
51
  "devDependencies": {
50
52
  "@nuxt/devtools": "2.6.4",
51
53
  "@nuxt/eslint-config": "^1.2.0",
@@ -58,6 +60,8 @@
58
60
  "nuxt": "^4.4.6",
59
61
  "typescript": "~5.8.3",
60
62
  "vitest": "^3.2.4",
61
- "vue-tsc": "^3.0.1"
63
+ "vue-tsc": "^3.0.1",
64
+ "gsap": "^3.13.0",
65
+ "three": "^0.178.0"
62
66
  }
63
67
  }