@tsparticles/plugin-sounds 4.0.0-alpha.5 → 4.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/30.min.js +33 -0
- package/915.min.js +1 -0
- package/browser/Options/Classes/Sounds.js +5 -0
- package/browser/Options/Classes/SoundsAudio.js +2 -0
- package/browser/Options/Classes/SoundsEvent.js +5 -0
- package/browser/Options/Classes/SoundsIcon.js +5 -0
- package/browser/Options/Classes/SoundsIcons.js +5 -0
- package/browser/Options/Classes/SoundsMelody.js +3 -0
- package/browser/Options/Classes/SoundsNote.js +2 -0
- package/browser/Options/Classes/SoundsVolume.js +4 -0
- package/browser/SoundsPlugin.js +2 -1
- package/browser/SoundsPluginInstance.js +247 -240
- package/browser/index.js +1 -1
- package/cjs/Options/Classes/Sounds.js +5 -0
- package/cjs/Options/Classes/SoundsAudio.js +2 -0
- package/cjs/Options/Classes/SoundsEvent.js +5 -0
- package/cjs/Options/Classes/SoundsIcon.js +5 -0
- package/cjs/Options/Classes/SoundsIcons.js +5 -0
- package/cjs/Options/Classes/SoundsMelody.js +3 -0
- package/cjs/Options/Classes/SoundsNote.js +2 -0
- package/cjs/Options/Classes/SoundsVolume.js +4 -0
- package/cjs/SoundsPlugin.js +2 -1
- package/cjs/SoundsPluginInstance.js +247 -240
- package/cjs/index.js +1 -1
- package/dist_browser_SoundsPluginInstance_js.js +3 -3
- package/dist_browser_SoundsPlugin_js.js +12 -12
- package/esm/Options/Classes/Sounds.js +5 -0
- package/esm/Options/Classes/SoundsAudio.js +2 -0
- package/esm/Options/Classes/SoundsEvent.js +5 -0
- package/esm/Options/Classes/SoundsIcon.js +5 -0
- package/esm/Options/Classes/SoundsIcons.js +5 -0
- package/esm/Options/Classes/SoundsMelody.js +3 -0
- package/esm/Options/Classes/SoundsNote.js +2 -0
- package/esm/Options/Classes/SoundsVolume.js +4 -0
- package/esm/SoundsPlugin.js +2 -1
- package/esm/SoundsPluginInstance.js +247 -240
- package/esm/index.js +1 -1
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.plugin.sounds.js +31 -19
- package/tsparticles.plugin.sounds.min.js +2 -2
- package/types/SoundsPlugin.d.ts +1 -1
- package/umd/Options/Classes/Sounds.js +5 -0
- package/umd/Options/Classes/SoundsAudio.js +2 -0
- package/umd/Options/Classes/SoundsEvent.js +5 -0
- package/umd/Options/Classes/SoundsIcon.js +5 -0
- package/umd/Options/Classes/SoundsIcons.js +5 -0
- package/umd/Options/Classes/SoundsMelody.js +3 -0
- package/umd/Options/Classes/SoundsNote.js +2 -0
- package/umd/Options/Classes/SoundsVolume.js +4 -0
- package/umd/SoundsPlugin.js +2 -1
- package/umd/SoundsPluginInstance.js +247 -240
- package/umd/index.js +1 -1
- package/296.min.js +0 -2
- package/296.min.js.LICENSE.txt +0 -1
- package/340.min.js +0 -2
- package/340.min.js.LICENSE.txt +0 -1
- package/tsparticles.plugin.sounds.min.js.LICENSE.txt +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\************************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Sounds: () => (/* binding */ Sounds)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SoundsEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsEvent.js */ \"./dist/browser/Options/Classes/SoundsEvent.js\");\n/* harmony import */ var _SoundsIcons_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SoundsIcons.js */ \"./dist/browser/Options/Classes/SoundsIcons.js\");\n/* harmony import */ var _SoundsVolume_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SoundsVolume.js */ \"./dist/browser/Options/Classes/SoundsVolume.js\");\n\n\n\n\nclass Sounds {\n
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Sounds: () => (/* binding */ Sounds)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SoundsEvent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsEvent.js */ \"./dist/browser/Options/Classes/SoundsEvent.js\");\n/* harmony import */ var _SoundsIcons_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SoundsIcons.js */ \"./dist/browser/Options/Classes/SoundsIcons.js\");\n/* harmony import */ var _SoundsVolume_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SoundsVolume.js */ \"./dist/browser/Options/Classes/SoundsVolume.js\");\n\n\n\n\nclass Sounds {\n autoPlay;\n enable;\n events;\n icons;\n volume;\n constructor(){\n this.autoPlay = true;\n this.enable = false;\n this.events = [];\n this.icons = new _SoundsIcons_js__WEBPACK_IMPORTED_MODULE_2__.SoundsIcons();\n this.volume = new _SoundsVolume_js__WEBPACK_IMPORTED_MODULE_3__.SoundsVolume();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.autoPlay !== undefined) {\n this.autoPlay = data.autoPlay;\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.events !== undefined) {\n this.events = data.events.map((t)=>{\n const event = new _SoundsEvent_js__WEBPACK_IMPORTED_MODULE_1__.SoundsEvent();\n event.load(t);\n return event;\n });\n }\n this.icons.load(data.icons);\n if (data.volume !== undefined) {\n this.volume.load(data.volume);\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/Options/Classes/Sounds.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ },
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
33
33
|
\*****************************************************/
|
|
34
34
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
35
|
|
|
36
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsAudio: () => (/* binding */ SoundsAudio)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SoundsAudio {\n
|
|
36
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsAudio: () => (/* binding */ SoundsAudio)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SoundsAudio {\n loop;\n source;\n constructor(){\n this.loop = false;\n this.source = \"\";\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isObject)(data)) {\n if (data.loop !== undefined) {\n this.loop = data.loop;\n }\n if (data.source !== undefined) {\n this.source = data.source;\n }\n } else {\n this.source = data;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/Options/Classes/SoundsAudio.js?\n}");
|
|
37
37
|
|
|
38
38
|
/***/ },
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
43
43
|
\*****************************************************/
|
|
44
44
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
45
45
|
|
|
46
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsEvent: () => (/* binding */ SoundsEvent)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SoundsAudio_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsAudio.js */ \"./dist/browser/Options/Classes/SoundsAudio.js\");\n/* harmony import */ var _SoundsMelody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SoundsMelody.js */ \"./dist/browser/Options/Classes/SoundsMelody.js\");\n/* harmony import */ var _SoundsNote_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SoundsNote.js */ \"./dist/browser/Options/Classes/SoundsNote.js\");\n\n\n\n\nclass SoundsEvent {\n
|
|
46
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsEvent: () => (/* binding */ SoundsEvent)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SoundsAudio_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsAudio.js */ \"./dist/browser/Options/Classes/SoundsAudio.js\");\n/* harmony import */ var _SoundsMelody_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SoundsMelody.js */ \"./dist/browser/Options/Classes/SoundsMelody.js\");\n/* harmony import */ var _SoundsNote_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SoundsNote.js */ \"./dist/browser/Options/Classes/SoundsNote.js\");\n\n\n\n\nclass SoundsEvent {\n audio;\n event;\n filter;\n melodies;\n notes;\n constructor(){\n this.event = [];\n this.notes = [];\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.event !== undefined) {\n this.event = data.event;\n }\n if (data.audio !== undefined) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(data.audio)) {\n this.audio = data.audio.map((s)=>{\n const tmp = new _SoundsAudio_js__WEBPACK_IMPORTED_MODULE_1__.SoundsAudio();\n tmp.load(s);\n return tmp;\n });\n } else {\n this.audio = new _SoundsAudio_js__WEBPACK_IMPORTED_MODULE_1__.SoundsAudio();\n this.audio.load(data.audio);\n }\n }\n if (data.notes !== undefined) {\n this.notes = data.notes.map((t)=>{\n const tmp = new _SoundsNote_js__WEBPACK_IMPORTED_MODULE_3__.SoundsNote();\n tmp.load(t);\n return tmp;\n });\n }\n if (data.melodies !== undefined) {\n this.melodies = data.melodies.map((t)=>{\n const tmp = new _SoundsMelody_js__WEBPACK_IMPORTED_MODULE_2__.SoundsMelody();\n tmp.load(t);\n return tmp;\n });\n }\n if (data.filter) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isString)(data.filter)) {\n const filterFunc = globalThis[data.filter];\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isFunction)(filterFunc)) {\n this.filter = filterFunc;\n }\n } else {\n this.filter = data.filter;\n }\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/Options/Classes/SoundsEvent.js?\n}");
|
|
47
47
|
|
|
48
48
|
/***/ },
|
|
49
49
|
|
|
@@ -53,7 +53,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
53
53
|
\****************************************************/
|
|
54
54
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
55
55
|
|
|
56
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsIcon: () => (/* binding */ SoundsIcon)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SoundsIcon {\n
|
|
56
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsIcon: () => (/* binding */ SoundsIcon)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SoundsIcon {\n height;\n path;\n style;\n svg;\n width;\n constructor(){\n this.width = 24;\n this.height = 24;\n this.style = \"\";\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.path !== undefined) {\n this.path = data.path;\n }\n if (data.svg !== undefined) {\n this.svg = data.svg;\n }\n if (data.width !== undefined) {\n this.width = data.width;\n }\n if (data.height !== undefined) {\n this.height = data.height;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/Options/Classes/SoundsIcon.js?\n}");
|
|
57
57
|
|
|
58
58
|
/***/ },
|
|
59
59
|
|
|
@@ -63,7 +63,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
63
63
|
\*****************************************************/
|
|
64
64
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
65
65
|
|
|
66
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsIcons: () => (/* binding */ SoundsIcons)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsIcon.js */ \"./dist/browser/Options/Classes/SoundsIcon.js\");\n\n\nclass SoundsIcons {\n
|
|
66
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsIcons: () => (/* binding */ SoundsIcons)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsIcon.js */ \"./dist/browser/Options/Classes/SoundsIcon.js\");\n\n\nclass SoundsIcons {\n enable;\n mute;\n unmute;\n volumeDown;\n volumeUp;\n constructor(){\n this.mute = new _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_1__.SoundsIcon();\n this.unmute = new _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_1__.SoundsIcon();\n this.volumeDown = new _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_1__.SoundsIcon();\n this.volumeUp = new _SoundsIcon_js__WEBPACK_IMPORTED_MODULE_1__.SoundsIcon();\n this.enable = false;\n this.mute.svg = `<?xml version=\"1.0\"?>\n<svg baseProfile=\"tiny\" height=\"24px\" version=\"1.2\" viewBox=\"0 0 24 24\" width=\"24px\"\n xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path fill=\"#fff\" d=\"M19.707,5.293c-0.391-0.391-1.023-0.391-1.414,0l-1.551,1.551c-0.345-0.688-0.987-1.02-1.604-1.02c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.237,0.754,2.302,1.826,2.76l-1.533,1.533c-0.391,0.391-0.391,1.023,0,1.414C5.488,19.902,5.744,20,6,20s0.512-0.098,0.707-0.293l2.527-2.527c0.697,0.174,1.416,0.455,1.875,0.762l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V9.414l2.707-2.707C20.098,6.316,20.098,5.684,19.707,5.293z M14.891,7.941c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8v1.293l-2,2V9.202L14.891,7.941z M7,12c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v2.439l-2.83,2.83C8.757,15.046,8.356,15,8,15c-0.552,0-1-0.448-1-1V12z M10.301,15.406L12,13.707v2.439C11.519,15.859,10.925,15.604,10.301,15.406z M14.994,18.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798v-4.091l2-2V18C15,18.046,14.998,18.086,14.994,18.12z\"/>\n </g>\n</svg>`;\n this.unmute.svg = `<?xml version=\"1.0\"?>\n<svg baseProfile=\"tiny\" height=\"24px\" version=\"1.2\" viewBox=\"0 0 24 24\" width=\"24px\"\n xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path fill=\"#fff\" d=\"M17.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C12.357,8.561,10.904,9,10,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C18.035,20.176,19,19.495,19,18V8C19,6.505,18.035,5.824,17.138,5.824z M14,16.146C12.907,15.495,11.211,15,10,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146V16.146z M17,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L15,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C16.998,7.914,17,7.954,17,8V18z\"/>\n </g>\n</svg>`;\n this.volumeDown.svg = `<?xml version=\"1.0\"?>\n<svg baseProfile=\"tiny\" height=\"24px\" version=\"1.2\" viewBox=\"0 0 24 24\" width=\"24px\"\n xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path fill=\"#fff\" d=\"M15.138,5.824c-0.449,0-0.905,0.152-1.356,0.453l-2.672,1.781C10.357,8.561,8.904,9,8,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C16.035,20.176,17,19.495,17,18V8C17,6.505,16.035,5.824,15.138,5.824z M8,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C10.907,15.495,9.211,15,8,15z M15,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L13,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C14.998,7.914,15,7.954,15,8V18z\"/>\n <path fill=\"#fff\" d=\"M18.292,10.294c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C18.488,15.902,18.744,16,19,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708s-0.398-1.984-1.123-2.707C19.317,9.903,18.683,9.901,18.292,10.294z\"/>\n </g>\n</svg>`;\n this.volumeUp.svg = `<?xml version=\"1.0\"?>\n<svg baseProfile=\"tiny\" height=\"24px\" version=\"1.2\" viewBox=\"0 0 24 24\" width=\"24px\"\n xml:space=\"preserve\" xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <g id=\"Layer_1\">\n <path fill=\"#fff\" d=\"M16.706,10.292c-0.389-0.389-1.023-0.391-1.414,0.002c-0.39,0.391-0.39,1.023,0.002,1.414c0.345,0.345,0.535,0.803,0.535,1.291c0,0.489-0.19,0.948-0.536,1.294c-0.391,0.39-0.391,1.023,0,1.414C15.488,15.902,15.744,16,16,16s0.512-0.098,0.707-0.293c0.724-0.723,1.122-1.685,1.122-2.708S17.431,11.015,16.706,10.292z\"/>\n <path fill=\"#fff\" d=\"M18.706,8.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c0.879,0.877,1.363,2.044,1.364,3.287c0.001,1.246-0.484,2.417-1.365,3.298c-0.391,0.391-0.391,1.023,0,1.414C17.488,17.902,17.744,18,18,18s0.512-0.098,0.707-0.293c1.259-1.259,1.952-2.933,1.951-4.713C20.657,11.217,19.964,9.547,18.706,8.292z\"/>\n <path fill=\"#fff\" d=\"M20.706,6.292c-0.391-0.389-1.023-0.39-1.414,0.002c-0.39,0.391-0.39,1.024,0.002,1.414c1.412,1.409,2.191,3.285,2.192,5.284c0.002,2.002-0.777,3.885-2.193,5.301c-0.391,0.391-0.391,1.023,0,1.414C19.488,19.902,19.744,20,20,20s0.512-0.098,0.707-0.293c1.794-1.794,2.781-4.18,2.779-6.717C23.485,10.457,22.497,8.078,20.706,6.292z\"/>\n <path fill=\"#fff\" d=\"M12.138,5.824c-0.449,0-0.905,0.152-1.356,0.453L8.109,8.059C7.357,8.561,5.904,9,5,9c-1.654,0-3,1.346-3,3v2c0,1.654,1.346,3,3,3c0.904,0,2.357,0.439,3.109,0.941l2.672,1.781c0.451,0.301,0.907,0.453,1.356,0.453C13.035,20.176,14,19.495,14,18V8C14,6.505,13.035,5.824,12.138,5.824z M5,15c-0.552,0-1-0.448-1-1v-2c0-0.552,0.448-1,1-1c1.211,0,2.907-0.495,4-1.146v6.293C7.907,15.495,6.211,15,5,15z M12,18c0,0.046-0.002,0.086-0.006,0.12c-0.03-0.016-0.065-0.036-0.104-0.062L10,16.798V9.202l1.891-1.261c0.038-0.025,0.073-0.046,0.104-0.062C11.998,7.914,12,7.954,12,8V18z\"/>\n </g>\n</svg>`;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n this.mute.load(data.mute);\n this.unmute.load(data.unmute);\n this.volumeDown.load(data.volumeDown);\n this.volumeUp.load(data.volumeUp);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/Options/Classes/SoundsIcons.js?\n}");
|
|
67
67
|
|
|
68
68
|
/***/ },
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
73
73
|
\******************************************************/
|
|
74
74
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
75
75
|
|
|
76
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsMelody: () => (/* binding */ SoundsMelody)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SoundsNote_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsNote.js */ \"./dist/browser/Options/Classes/SoundsNote.js\");\n\n\nclass SoundsMelody {\n
|
|
76
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsMelody: () => (/* binding */ SoundsMelody)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _SoundsNote_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SoundsNote.js */ \"./dist/browser/Options/Classes/SoundsNote.js\");\n\n\nclass SoundsMelody {\n loop;\n melodies;\n notes;\n constructor(){\n this.loop = false;\n this.melodies = [];\n this.notes = [];\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.loop !== undefined) {\n this.loop = data.loop;\n }\n if (data.melodies !== undefined) {\n this.melodies = data.melodies.map((s)=>{\n const tmp = new SoundsMelody();\n tmp.load(s);\n return tmp;\n });\n }\n if (data.notes !== undefined) {\n this.notes = data.notes.map((s)=>{\n const tmp = new _SoundsNote_js__WEBPACK_IMPORTED_MODULE_1__.SoundsNote();\n tmp.load(s);\n return tmp;\n });\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/Options/Classes/SoundsMelody.js?\n}");
|
|
77
77
|
|
|
78
78
|
/***/ },
|
|
79
79
|
|
|
@@ -83,7 +83,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
83
83
|
\****************************************************/
|
|
84
84
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
85
85
|
|
|
86
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsNote: () => (/* binding */ SoundsNote)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SoundsNote {\n
|
|
86
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsNote: () => (/* binding */ SoundsNote)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SoundsNote {\n duration;\n value;\n constructor(){\n this.duration = 500;\n this.value = [];\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.duration !== undefined) {\n this.duration = data.duration;\n }\n if (data.value !== undefined) {\n this.value = data.value;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/Options/Classes/SoundsNote.js?\n}");
|
|
87
87
|
|
|
88
88
|
/***/ },
|
|
89
89
|
|
|
@@ -93,7 +93,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
93
93
|
\******************************************************/
|
|
94
94
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
95
95
|
|
|
96
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsVolume: () => (/* binding */ SoundsVolume)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SoundsVolume {\n
|
|
96
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsVolume: () => (/* binding */ SoundsVolume)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass SoundsVolume {\n max;\n min;\n step;\n value;\n constructor(){\n this.value = 100;\n this.max = 100;\n this.min = 0;\n this.step = 10;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isObject)(data)) {\n if (data.max !== undefined) {\n this.max = data.max;\n }\n if (data.min !== undefined) {\n this.min = data.min;\n }\n if (data.step !== undefined) {\n this.step = data.step;\n }\n if (data.value !== undefined) {\n this.value = data.value;\n }\n } else {\n this.value = data;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/Options/Classes/SoundsVolume.js?\n}");
|
|
97
97
|
|
|
98
98
|
/***/ },
|
|
99
99
|
|
|
@@ -103,7 +103,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
103
103
|
\**************************************/
|
|
104
104
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
105
105
|
|
|
106
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsPlugin: () => (/* binding */ SoundsPlugin)\n/* harmony export */ });\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ \"./dist/browser/constants.js\");\n/* harmony import */ var _Options_Classes_Sounds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Sounds.js */ \"./dist/browser/Options/Classes/Sounds.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"./dist/browser/utils.js\");\n\n\n\nconst generalFirstClickHandler = ()
|
|
106
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SoundsPlugin: () => (/* binding */ SoundsPlugin)\n/* harmony export */ });\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ \"./dist/browser/constants.js\");\n/* harmony import */ var _Options_Classes_Sounds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Sounds.js */ \"./dist/browser/Options/Classes/Sounds.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils.js */ \"./dist/browser/utils.js\");\n\n\n\nconst generalFirstClickHandler = ()=>{\n removeEventListener(_constants_js__WEBPACK_IMPORTED_MODULE_0__.mouseDownEvent, generalFirstClickHandler);\n removeEventListener(_constants_js__WEBPACK_IMPORTED_MODULE_0__.touchStartEvent, generalFirstClickHandler);\n (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.unmuteWindow)();\n};\nclass SoundsPlugin {\n id = \"sounds\";\n _engine;\n constructor(engine){\n this._engine = engine;\n const listenerOptions = {\n capture: true,\n once: true\n };\n addEventListener(_constants_js__WEBPACK_IMPORTED_MODULE_0__.mouseDownEvent, generalFirstClickHandler, listenerOptions);\n addEventListener(_constants_js__WEBPACK_IMPORTED_MODULE_0__.touchStartEvent, generalFirstClickHandler, listenerOptions);\n }\n async getPlugin(container) {\n const { SoundsPluginInstance } = await __webpack_require__.e(/*! import() */ \"dist_browser_SoundsPluginInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./SoundsPluginInstance.js */ \"./dist/browser/SoundsPluginInstance.js\"));\n return new SoundsPluginInstance(container, this._engine);\n }\n loadOptions(_container, options, source) {\n if (!this.needsPlugin(options) && !this.needsPlugin(source)) {\n return;\n }\n let soundsOptions = options.sounds;\n if (soundsOptions?.load === undefined) {\n options.sounds = soundsOptions = new _Options_Classes_Sounds_js__WEBPACK_IMPORTED_MODULE_1__.Sounds();\n }\n soundsOptions.load(source?.sounds);\n }\n needsPlugin(options) {\n return options?.sounds?.enable ?? false;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/SoundsPlugin.js?\n}");
|
|
107
107
|
|
|
108
108
|
/***/ },
|
|
109
109
|
|
|
@@ -113,7 +113,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
113
113
|
\***********************************/
|
|
114
114
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
115
115
|
|
|
116
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ mouseDownEvent: () => (/* binding */ mouseDownEvent),\n/* harmony export */ touchStartEvent: () => (/* binding */ touchStartEvent)\n/* harmony export */ });\nconst mouseDownEvent = \"pointerdown\"
|
|
116
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ mouseDownEvent: () => (/* binding */ mouseDownEvent),\n/* harmony export */ touchStartEvent: () => (/* binding */ touchStartEvent)\n/* harmony export */ });\nconst mouseDownEvent = \"pointerdown\", touchStartEvent = \"touchstart\";\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/constants.js?\n}");
|
|
117
117
|
|
|
118
118
|
/***/ },
|
|
119
119
|
|
|
@@ -123,7 +123,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa
|
|
|
123
123
|
\*******************************/
|
|
124
124
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
125
125
|
|
|
126
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getNoteFrequency: () => (/* binding */ getNoteFrequency),\n/* harmony export */ isWindowMuted: () => (/* binding */ isWindowMuted),\n/* harmony export */ unmuteWindow: () => (/* binding */ unmuteWindow)\n/* harmony export */ });\nconst notes = new Map();\nnotes.set(\"C\", [16.35
|
|
126
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getNoteFrequency: () => (/* binding */ getNoteFrequency),\n/* harmony export */ isWindowMuted: () => (/* binding */ isWindowMuted),\n/* harmony export */ unmuteWindow: () => (/* binding */ unmuteWindow)\n/* harmony export */ });\nconst notes = new Map();\nnotes.set(\"C\", [\n 16.35,\n 32.7,\n 65.41,\n 130.81,\n 261.63,\n 523.25,\n 1046.5,\n 2093.0,\n 4186.01\n]);\nnotes.set(\"Db\", [\n 17.32,\n 34.65,\n 69.3,\n 138.59,\n 277.18,\n 554.37,\n 1108.73,\n 2217.46,\n 4434.92\n]);\nnotes.set(\"D\", [\n 18.35,\n 36.71,\n 73.42,\n 146.83,\n 293.66,\n 587.33,\n 1174.66,\n 2349.32,\n 4698.63\n]);\nnotes.set(\"Eb\", [\n 19.45,\n 38.89,\n 77.78,\n 155.56,\n 311.13,\n 622.25,\n 1244.51,\n 2489.02,\n 4978.03\n]);\nnotes.set(\"E\", [\n 20.6,\n 41.2,\n 82.41,\n 164.81,\n 329.63,\n 659.25,\n 1318.51,\n 2637.02,\n 5274.04\n]);\nnotes.set(\"F\", [\n 21.83,\n 43.65,\n 87.31,\n 174.61,\n 349.23,\n 698.46,\n 1396.91,\n 2793.83,\n 5587.65\n]);\nnotes.set(\"Gb\", [\n 23.12,\n 46.25,\n 92.5,\n 185.0,\n 369.99,\n 739.99,\n 1479.98,\n 2959.96,\n 5919.91\n]);\nnotes.set(\"G\", [\n 24.5,\n 49.0,\n 98.0,\n 196.0,\n 392.0,\n 783.99,\n 1567.98,\n 3135.96,\n 6271.93\n]);\nnotes.set(\"Ab\", [\n 25.96,\n 51.91,\n 103.83,\n 207.65,\n 415.3,\n 830.61,\n 1661.22,\n 3322.44,\n 6644.88\n]);\nnotes.set(\"A\", [\n 27.5,\n 55.0,\n 110.0,\n 220.0,\n 440.0,\n 880.0,\n 1760.0,\n 3520.0,\n 7040.0\n]);\nnotes.set(\"Bb\", [\n 29.14,\n 58.27,\n 116.54,\n 233.08,\n 466.16,\n 932.33,\n 1864.66,\n 3729.31,\n 7458.62\n]);\nnotes.set(\"B\", [\n 30.87,\n 61.74,\n 123.47,\n 246.94,\n 493.88,\n 987.77,\n 1975.53,\n 3951.07,\n 7902.13\n]);\nnotes.set(\"pause\", [\n 0\n]);\nfunction getNoteFrequency(note) {\n const regex = /(([A-G]b?)(\\d))|pause/i, result = regex.exec(note), groupKey = 2, defaultMatchKey = 0, innerGroupKey = 3;\n if (!result?.length) {\n return;\n }\n const noteKey = result[groupKey] ?? result[defaultMatchKey], noteItem = notes.get(noteKey);\n if (!noteItem) {\n return;\n }\n return noteItem[parseInt(result[innerGroupKey] ?? \"0\")];\n}\nlet muted = true;\nconst isWindowMuted = ()=>{\n return muted;\n};\nconst unmuteWindow = ()=>{\n muted = false;\n};\n\n\n//# sourceURL=webpack://@tsparticles/plugin-sounds/./dist/browser/utils.js?\n}");
|
|
127
127
|
|
|
128
128
|
/***/ }
|
|
129
129
|
|
|
@@ -3,6 +3,11 @@ import { SoundsEvent } from "./SoundsEvent.js";
|
|
|
3
3
|
import { SoundsIcons } from "./SoundsIcons.js";
|
|
4
4
|
import { SoundsVolume } from "./SoundsVolume.js";
|
|
5
5
|
export class Sounds {
|
|
6
|
+
autoPlay;
|
|
7
|
+
enable;
|
|
8
|
+
events;
|
|
9
|
+
icons;
|
|
10
|
+
volume;
|
|
6
11
|
constructor() {
|
|
7
12
|
this.autoPlay = true;
|
|
8
13
|
this.enable = false;
|
|
@@ -3,6 +3,11 @@ import { SoundsAudio } from "./SoundsAudio.js";
|
|
|
3
3
|
import { SoundsMelody } from "./SoundsMelody.js";
|
|
4
4
|
import { SoundsNote } from "./SoundsNote.js";
|
|
5
5
|
export class SoundsEvent {
|
|
6
|
+
audio;
|
|
7
|
+
event;
|
|
8
|
+
filter;
|
|
9
|
+
melodies;
|
|
10
|
+
notes;
|
|
6
11
|
constructor() {
|
|
7
12
|
this.event = [];
|
|
8
13
|
this.notes = [];
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { isNull } from "@tsparticles/engine";
|
|
2
2
|
import { SoundsIcon } from "./SoundsIcon.js";
|
|
3
3
|
export class SoundsIcons {
|
|
4
|
+
enable;
|
|
5
|
+
mute;
|
|
6
|
+
unmute;
|
|
7
|
+
volumeDown;
|
|
8
|
+
volumeUp;
|
|
4
9
|
constructor() {
|
|
5
10
|
this.mute = new SoundsIcon();
|
|
6
11
|
this.unmute = new SoundsIcon();
|
package/esm/SoundsPlugin.js
CHANGED