@tsparticles/plugin-sounds 3.0.0-alpha.1 → 3.0.0-beta.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/README.md +15 -11
- package/browser/Options/Classes/SoundsAudio.js +2 -1
- package/browser/Options/Classes/SoundsEvent.js +4 -3
- package/browser/Options/Classes/SoundsVolume.js +2 -1
- package/browser/SoundsInstance.js +300 -279
- package/browser/index.js +6 -8
- package/browser/utils.js +0 -1
- package/cjs/Options/Classes/SoundsAudio.js +2 -1
- package/cjs/Options/Classes/SoundsEvent.js +4 -3
- package/cjs/Options/Classes/SoundsVolume.js +2 -1
- package/cjs/SoundsInstance.js +283 -281
- package/cjs/index.js +6 -19
- package/cjs/utils.js +0 -1
- package/esm/Options/Classes/SoundsAudio.js +2 -1
- package/esm/Options/Classes/SoundsEvent.js +4 -3
- package/esm/Options/Classes/SoundsVolume.js +2 -1
- package/esm/SoundsInstance.js +300 -279
- package/esm/index.js +6 -8
- package/esm/utils.js +0 -1
- package/package.json +6 -5
- package/report.html +4 -4
- package/tsparticles.plugin.sounds.js +343 -305
- package/tsparticles.plugin.sounds.min.js +1 -1
- package/tsparticles.plugin.sounds.min.js.LICENSE.txt +1 -8
- package/types/Options/Classes/SoundsAudio.d.ts +1 -1
- package/types/Options/Classes/SoundsEvent.d.ts +1 -1
- package/types/Options/Classes/SoundsVolume.d.ts +1 -1
- package/types/SoundsInstance.d.ts +15 -15
- package/types/enums.d.ts +4 -0
- package/types/index.d.ts +1 -1
- package/types/types.d.ts +16 -0
- package/umd/Options/Classes/SoundsAudio.js +3 -2
- package/umd/Options/Classes/SoundsEvent.js +5 -4
- package/umd/Options/Classes/SoundsVolume.js +3 -2
- package/umd/SoundsInstance.js +301 -280
- package/umd/index.js +6 -8
- package/umd/utils.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SoundsEvent = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
4
5
|
const SoundsAudio_1 = require("./SoundsAudio");
|
|
5
6
|
const SoundsMelody_1 = require("./SoundsMelody");
|
|
6
7
|
const SoundsNote_1 = require("./SoundsNote");
|
|
@@ -17,7 +18,7 @@ class SoundsEvent {
|
|
|
17
18
|
this.event = data.event;
|
|
18
19
|
}
|
|
19
20
|
if (data.audio !== undefined) {
|
|
20
|
-
if (data.audio
|
|
21
|
+
if ((0, engine_1.isArray)(data.audio)) {
|
|
21
22
|
this.audio = data.audio.map((s) => {
|
|
22
23
|
const tmp = new SoundsAudio_1.SoundsAudio();
|
|
23
24
|
tmp.load(s);
|
|
@@ -44,8 +45,8 @@ class SoundsEvent {
|
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
if (data.filter !== undefined) {
|
|
47
|
-
if (
|
|
48
|
-
if (
|
|
48
|
+
if ((0, engine_1.isString)(data.filter)) {
|
|
49
|
+
if ((0, engine_1.isFunction)(window[data.filter])) {
|
|
49
50
|
this.filter = window[data.filter];
|
|
50
51
|
}
|
|
51
52
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SoundsVolume = void 0;
|
|
4
|
+
const engine_1 = require("@tsparticles/engine");
|
|
4
5
|
class SoundsVolume {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.value = 100;
|
|
@@ -12,7 +13,7 @@ class SoundsVolume {
|
|
|
12
13
|
if (data === undefined) {
|
|
13
14
|
return;
|
|
14
15
|
}
|
|
15
|
-
if (
|
|
16
|
+
if ((0, engine_1.isObject)(data)) {
|
|
16
17
|
if (data.max !== undefined) {
|
|
17
18
|
this.max = data.max;
|
|
18
19
|
}
|