@tsparticles/updater-rotate 4.0.4 → 4.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/browser/RotateUpdater.js +3 -3
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/RotateUpdater.js +3 -3
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/RotateUpdater.js +3 -3
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.updater.rotate.js +5 -5
- package/tsparticles.updater.rotate.min.js +1 -1
- package/types/RotateUpdater.d.ts +1 -1
package/browser/RotateUpdater.js
CHANGED
|
@@ -2,9 +2,9 @@ import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, double
|
|
|
2
2
|
import { Rotate } from "./Options/Classes/Rotate.js";
|
|
3
3
|
const doublePIDeg = 360;
|
|
4
4
|
export class RotateUpdater {
|
|
5
|
-
container;
|
|
5
|
+
#container;
|
|
6
6
|
constructor(container) {
|
|
7
|
-
this
|
|
7
|
+
this.#container = container;
|
|
8
8
|
}
|
|
9
9
|
init(particle) {
|
|
10
10
|
const rotateOptions = particle.options.rotate;
|
|
@@ -38,7 +38,7 @@ export class RotateUpdater {
|
|
|
38
38
|
if (rotateAnimation.enable) {
|
|
39
39
|
particle.rotate.decay = identity - getRangeValue(rotateAnimation.decay);
|
|
40
40
|
particle.rotate.velocity =
|
|
41
|
-
(getRangeValue(rotateAnimation.speed) / doublePIDeg) * this
|
|
41
|
+
(getRangeValue(rotateAnimation.speed) / doublePIDeg) * this.#container.retina.reduceFactor;
|
|
42
42
|
if (!rotateAnimation.sync) {
|
|
43
43
|
particle.rotate.velocity *= getRandom();
|
|
44
44
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RotateUpdater } from "./RotateUpdater.js";
|
|
2
2
|
export async function loadRotateUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.0
|
|
3
|
+
engine.checkVersion("4.1.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
6
6
|
return Promise.resolve(new RotateUpdater(container));
|
package/browser/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadRotateUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0
|
|
2
|
+
engine.checkVersion("4.1.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("rotate", async (container) => {
|
|
5
5
|
const { RotateUpdater } = await import("./RotateUpdater.js");
|
package/cjs/RotateUpdater.js
CHANGED
|
@@ -2,9 +2,9 @@ import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, double
|
|
|
2
2
|
import { Rotate } from "./Options/Classes/Rotate.js";
|
|
3
3
|
const doublePIDeg = 360;
|
|
4
4
|
export class RotateUpdater {
|
|
5
|
-
container;
|
|
5
|
+
#container;
|
|
6
6
|
constructor(container) {
|
|
7
|
-
this
|
|
7
|
+
this.#container = container;
|
|
8
8
|
}
|
|
9
9
|
init(particle) {
|
|
10
10
|
const rotateOptions = particle.options.rotate;
|
|
@@ -38,7 +38,7 @@ export class RotateUpdater {
|
|
|
38
38
|
if (rotateAnimation.enable) {
|
|
39
39
|
particle.rotate.decay = identity - getRangeValue(rotateAnimation.decay);
|
|
40
40
|
particle.rotate.velocity =
|
|
41
|
-
(getRangeValue(rotateAnimation.speed) / doublePIDeg) * this
|
|
41
|
+
(getRangeValue(rotateAnimation.speed) / doublePIDeg) * this.#container.retina.reduceFactor;
|
|
42
42
|
if (!rotateAnimation.sync) {
|
|
43
43
|
particle.rotate.velocity *= getRandom();
|
|
44
44
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RotateUpdater } from "./RotateUpdater.js";
|
|
2
2
|
export async function loadRotateUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.0
|
|
3
|
+
engine.checkVersion("4.1.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
6
6
|
return Promise.resolve(new RotateUpdater(container));
|
package/cjs/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadRotateUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0
|
|
2
|
+
engine.checkVersion("4.1.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("rotate", async (container) => {
|
|
5
5
|
const { RotateUpdater } = await import("./RotateUpdater.js");
|
package/esm/RotateUpdater.js
CHANGED
|
@@ -2,9 +2,9 @@ import { AnimationStatus, DestroyType, RotateDirection, degToRad, double, double
|
|
|
2
2
|
import { Rotate } from "./Options/Classes/Rotate.js";
|
|
3
3
|
const doublePIDeg = 360;
|
|
4
4
|
export class RotateUpdater {
|
|
5
|
-
container;
|
|
5
|
+
#container;
|
|
6
6
|
constructor(container) {
|
|
7
|
-
this
|
|
7
|
+
this.#container = container;
|
|
8
8
|
}
|
|
9
9
|
init(particle) {
|
|
10
10
|
const rotateOptions = particle.options.rotate;
|
|
@@ -38,7 +38,7 @@ export class RotateUpdater {
|
|
|
38
38
|
if (rotateAnimation.enable) {
|
|
39
39
|
particle.rotate.decay = identity - getRangeValue(rotateAnimation.decay);
|
|
40
40
|
particle.rotate.velocity =
|
|
41
|
-
(getRangeValue(rotateAnimation.speed) / doublePIDeg) * this
|
|
41
|
+
(getRangeValue(rotateAnimation.speed) / doublePIDeg) * this.#container.retina.reduceFactor;
|
|
42
42
|
if (!rotateAnimation.sync) {
|
|
43
43
|
particle.rotate.velocity *= getRandom();
|
|
44
44
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RotateUpdater } from "./RotateUpdater.js";
|
|
2
2
|
export async function loadRotateUpdater(engine) {
|
|
3
|
-
engine.checkVersion("4.0
|
|
3
|
+
engine.checkVersion("4.1.0");
|
|
4
4
|
await engine.pluginManager.register(e => {
|
|
5
5
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
6
6
|
return Promise.resolve(new RotateUpdater(container));
|
package/esm/index.lazy.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadRotateUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0
|
|
2
|
+
engine.checkVersion("4.1.0");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("rotate", async (container) => {
|
|
5
5
|
const { RotateUpdater } = await import("./RotateUpdater.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-rotate",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "tsParticles particles rotate updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"./package.json": "./package.json"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@tsparticles/engine": "4.0
|
|
96
|
+
"@tsparticles/engine": "4.1.0"
|
|
97
97
|
},
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
|
|
|
4930
4930
|
</script>
|
|
4931
4931
|
<script>
|
|
4932
4932
|
/*<!--*/
|
|
4933
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.rotate.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"
|
|
4933
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.rotate.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"0e2acbe2-1","name":"RotateAnimation.js"},{"uid":"0e2acbe2-3","name":"Rotate.js"}]},{"uid":"0e2acbe2-5","name":"RotateUpdater.js"},{"uid":"0e2acbe2-7","name":"index.js"},{"uid":"0e2acbe2-9","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"0e2acbe2-1":{"renderedLength":795,"gzipLength":0,"brotliLength":0,"metaUid":"0e2acbe2-0"},"0e2acbe2-3":{"renderedLength":730,"gzipLength":0,"brotliLength":0,"metaUid":"0e2acbe2-2"},"0e2acbe2-5":{"renderedLength":2897,"gzipLength":0,"brotliLength":0,"metaUid":"0e2acbe2-4"},"0e2acbe2-7":{"renderedLength":311,"gzipLength":0,"brotliLength":0,"metaUid":"0e2acbe2-6"},"0e2acbe2-9":{"renderedLength":177,"gzipLength":0,"brotliLength":0,"metaUid":"0e2acbe2-8"}},"nodeMetas":{"0e2acbe2-0":{"id":"/dist/browser/Options/Classes/RotateAnimation.js","moduleParts":{"tsparticles.updater.rotate.js":"0e2acbe2-1"},"imported":[{"uid":"0e2acbe2-10"}],"importedBy":[{"uid":"0e2acbe2-2"}]},"0e2acbe2-2":{"id":"/dist/browser/Options/Classes/Rotate.js","moduleParts":{"tsparticles.updater.rotate.js":"0e2acbe2-3"},"imported":[{"uid":"0e2acbe2-10"},{"uid":"0e2acbe2-0"}],"importedBy":[{"uid":"0e2acbe2-4"}]},"0e2acbe2-4":{"id":"/dist/browser/RotateUpdater.js","moduleParts":{"tsparticles.updater.rotate.js":"0e2acbe2-5"},"imported":[{"uid":"0e2acbe2-10"},{"uid":"0e2acbe2-2"}],"importedBy":[{"uid":"0e2acbe2-6"}]},"0e2acbe2-6":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.rotate.js":"0e2acbe2-7"},"imported":[{"uid":"0e2acbe2-4"}],"importedBy":[{"uid":"0e2acbe2-8"}]},"0e2acbe2-8":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.rotate.js":"0e2acbe2-9"},"imported":[{"uid":"0e2acbe2-6"}],"importedBy":[],"isEntry":true},"0e2acbe2-10":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"0e2acbe2-4"},{"uid":"0e2acbe2-2"},{"uid":"0e2acbe2-0"}],"isExternal":true}},"env":{"rollup":"4.60.4"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4934
4934
|
|
|
4935
4935
|
const run = () => {
|
|
4936
4936
|
const width = window.innerWidth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* Updater v4.0
|
|
2
|
+
/* Updater v4.1.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
|
|
65
65
|
const doublePIDeg = 360;
|
|
66
66
|
class RotateUpdater {
|
|
67
|
-
container;
|
|
67
|
+
#container;
|
|
68
68
|
constructor(container) {
|
|
69
|
-
this
|
|
69
|
+
this.#container = container;
|
|
70
70
|
}
|
|
71
71
|
init(particle) {
|
|
72
72
|
const rotateOptions = particle.options.rotate;
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
if (rotateAnimation.enable) {
|
|
99
99
|
particle.rotate.decay = engine.identity - engine.getRangeValue(rotateAnimation.decay);
|
|
100
100
|
particle.rotate.velocity =
|
|
101
|
-
(engine.getRangeValue(rotateAnimation.speed) / doublePIDeg) * this
|
|
101
|
+
(engine.getRangeValue(rotateAnimation.speed) / doublePIDeg) * this.#container.retina.reduceFactor;
|
|
102
102
|
if (!rotateAnimation.sync) {
|
|
103
103
|
particle.rotate.velocity *= engine.getRandom();
|
|
104
104
|
}
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
async function loadRotateUpdater(engine) {
|
|
135
|
-
engine.checkVersion("4.0
|
|
135
|
+
engine.checkVersion("4.1.0");
|
|
136
136
|
await engine.pluginManager.register(e => {
|
|
137
137
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
138
138
|
return Promise.resolve(new RotateUpdater(container));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.rotate=t.__tsParticlesInternals.updaters.rotate||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{decay;enable;speed;sync;constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){e.isNull(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=e.setRangeValue(t.speed)),void 0!==t.decay&&(this.decay=e.setRangeValue(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class a extends e.ValueWithRandom{animation;direction;path;constructor(){super(),this.animation=new s,this.direction=e.RotateDirection.clockwise,this.path=!1,this.value=0}load(t){e.isNull(t)||(super.load(t),void 0!==t.direction&&(this.direction=t.direction),this.animation.load(t.animation),void 0!==t.path&&(this.path=t.path))}}class n{
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.rotate=t.__tsParticlesInternals.updaters.rotate||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{decay;enable;speed;sync;constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){e.isNull(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=e.setRangeValue(t.speed)),void 0!==t.decay&&(this.decay=e.setRangeValue(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class a extends e.ValueWithRandom{animation;direction;path;constructor(){super(),this.animation=new s,this.direction=e.RotateDirection.clockwise,this.path=!1,this.value=0}load(t){e.isNull(t)||(super.load(t),void 0!==t.direction&&(this.direction=t.direction),this.animation.load(t.animation),void 0!==t.path&&(this.path=t.path))}}class n{#t;constructor(t){this.#t=t}init(t){const s=t.options.rotate;if(!s)return;t.rotate={enable:s.animation.enable,value:e.degToRad(e.getRangeValue(s.value)),min:0,max:e.doublePI},t.pathRotation=s.path;let a=s.direction;if(a===e.RotateDirection.random){a=Math.floor(e.getRandom()*e.double)>0?e.RotateDirection.counterClockwise:e.RotateDirection.clockwise}switch(a){case e.RotateDirection.counterClockwise:case"counterClockwise":t.rotate.status=e.AnimationStatus.decreasing;break;case e.RotateDirection.clockwise:t.rotate.status=e.AnimationStatus.increasing}const n=s.animation;n.enable&&(t.rotate.decay=e.identity-e.getRangeValue(n.decay),t.rotate.velocity=e.getRangeValue(n.speed)/360*this.#t.retina.reduceFactor,n.sync||(t.rotate.velocity*=e.getRandom())),t.rotation=t.rotate.value}isEnabled(t){const e=t.options.rotate;return!!e&&(!t.destroyed&&!t.spawning&&(!!e.value||e.animation.enable||e.path))}loadOptions(t,...e){t.rotate??=new a;for(const s of e)t.rotate.load(s?.rotate)}update(t,s){this.isEnabled(t)&&(t.isRotating=!!t.rotate,t.rotate&&(e.updateAnimation(t,t.rotate,!1,e.DestroyType.none,s),t.rotation=t.rotate.value))}}async function r(t){t.checkVersion("4.1.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("rotate",t=>Promise.resolve(new n(t)))})}const l=globalThis;l.__tsParticlesInternals=l.__tsParticlesInternals??{},l.loadRotateUpdater=r,t.loadRotateUpdater=r}),Object.assign(globalThis.window||globalThis,{loadRotateUpdater:(globalThis.__tsParticlesInternals.updaters.rotate||{}).loadRotateUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
package/types/RotateUpdater.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type RotateParticlesOptions = ParticlesOptions & {
|
|
|
12
12
|
rotate?: Rotate;
|
|
13
13
|
};
|
|
14
14
|
export declare class RotateUpdater implements IParticleUpdater {
|
|
15
|
-
private
|
|
15
|
+
#private;
|
|
16
16
|
constructor(container: Container);
|
|
17
17
|
init(particle: RotateParticle): void;
|
|
18
18
|
isEnabled(particle: RotateParticle): boolean;
|