@tsparticles/preset-bubbles 4.0.0-alpha.2 → 4.0.0-alpha.5
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/126.min.js +1 -0
- package/182.min.js +1 -0
- package/204.min.js +1 -0
- package/231.min.js +1 -0
- package/270.min.js +1 -0
- package/278.min.js +1 -0
- package/28.min.js +1 -0
- package/3.min.js +1 -0
- package/302.min.js +1 -0
- package/316.min.js +1 -0
- package/337.min.js +1 -0
- package/356.min.js +1 -0
- package/382.min.js +1 -0
- package/406.min.js +1 -0
- package/47.min.js +1 -0
- package/508.min.js +1 -0
- package/523.min.js +1 -0
- package/530.min.js +1 -0
- package/596.min.js +1 -0
- package/608.min.js +1 -0
- package/646.min.js +1 -0
- package/691.min.js +1 -0
- package/730.min.js +1 -0
- package/731.min.js +1 -0
- package/819.min.js +1 -0
- package/830.min.js +1 -0
- package/834.min.js +1 -0
- package/844.min.js +1 -0
- package/85.min.js +1 -0
- package/922.min.js +1 -0
- package/930.min.js +1 -0
- package/964.min.js +1 -0
- package/README.md +7 -2
- package/browser/index.js +15 -5
- package/browser/options.js +5 -2
- package/cjs/index.js +15 -5
- package/cjs/options.js +5 -2
- package/dist_browser_options_js.js +2 -2
- package/esm/index.js +15 -5
- package/esm/options.js +5 -2
- package/node_modules_pnpm_tsparticles_basic_4_0_0-beta_1_node_modules_tsparticles_basic_browser_index_js.js +30 -0
- package/{node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_5_node_modules_tsparticles_plugin-e-50442a.js → node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-486a11.js} +7 -7
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-815c1c.js +100 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-9a4af1.js +30 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-c7125a.js +100 -0
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_plugin-em-e8ed4a.js +50 -0
- package/{node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-alpha_5_node_modules_tsparticles_plugin--7ee633.js → node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-beta_1_node_modules_tsparticles_plugin-h-8932d7.js} +7 -7
- package/{node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-alpha_5_node_modules_tsparticles_plugin--082572.js → node_modules_pnpm_tsparticles_plugin-hex-color_4_0_0-beta_1_node_modules_tsparticles_plugin-h-a0aea9.js} +7 -7
- package/node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-beta_1_node_modules_tsparticles_plugin-h-1179c3.js +30 -0
- package/{node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-alpha_5_node_modules_tsparticles_plugin--d17710.js → node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-beta_1_node_modules_tsparticles_plugin-h-1737bf.js} +7 -7
- package/node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_1_node_modules_tsparticles_plug-908f96.js +120 -0
- package/node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_1_node_modules_tsparticles_plug-d6e6b1.js +70 -0
- package/node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_1_node_modules_tsparticles_plugin-move_b-aa7108.js +30 -0
- package/{node_modules_pnpm_tsparticles_updater-color_4_0_0-alpha_5_node_modules_tsparticles_updater-co-9b6d65.js → node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_1_node_modules_tsparticles_plugin-move_b-c23e73.js} +5 -5
- package/node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-beta_1_node_modules_tsparticles_plugin-r-0f881a.js +30 -0
- package/{node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-alpha_5_node_modules_tsparticles_plugin--8050b3.js → node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-beta_1_node_modules_tsparticles_plugin-r-ae3d6b.js} +7 -7
- package/{node_modules_pnpm_tsparticles_shape-circle_4_0_0-alpha_5_node_modules_tsparticles_shape-circl-2a85dc.js → node_modules_pnpm_tsparticles_shape-circle_4_0_0-beta_1_node_modules_tsparticles_shape-circle-07826a.js} +12 -12
- package/{node_modules_pnpm_tsparticles_shape-circle_4_0_0-alpha_5_node_modules_tsparticles_shape-circl-d95142.js → node_modules_pnpm_tsparticles_shape-circle_4_0_0-beta_1_node_modules_tsparticles_shape-circle-c2187f.js} +7 -7
- package/node_modules_pnpm_tsparticles_updater-fill-color_4_0_0-beta_1_node_modules_tsparticles_update-75868d.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-fill-color_4_0_0-beta_1_node_modules_tsparticles_update-7cca03.js +30 -0
- package/node_modules_pnpm_tsparticles_updater-opacity_4_0_0-beta_1_node_modules_tsparticles_updater-o-138fb5.js +30 -0
- package/{node_modules_pnpm_tsparticles_updater-opacity_4_0_0-alpha_5_node_modules_tsparticles_updater--35fbab.js → node_modules_pnpm_tsparticles_updater-opacity_4_0_0-beta_1_node_modules_tsparticles_updater-o-8a311f.js} +7 -7
- package/{node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-alpha_5_node_modules_tsparticles_update-04964a.js → node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-beta_1_node_modules_tsparticles_updater-265a6a.js} +7 -7
- package/{node_modules_pnpm_tsparticles_updater-size_4_0_0-alpha_5_node_modules_tsparticles_updater-siz-7c3e56.js → node_modules_pnpm_tsparticles_updater-size_4_0_0-beta_1_node_modules_tsparticles_updater-size-124f3f.js} +7 -7
- package/node_modules_pnpm_tsparticles_updater-size_4_0_0-beta_1_node_modules_tsparticles_updater-size-cbf46f.js +30 -0
- package/package.json +5 -4
- package/report.html +84 -29
- package/tsparticles.preset.bubbles.bundle.js +336 -324
- package/tsparticles.preset.bubbles.bundle.min.js +2 -2
- package/tsparticles.preset.bubbles.js +45 -23
- package/tsparticles.preset.bubbles.min.js +2 -2
- package/umd/index.js +15 -5
- package/umd/options.js +5 -2
- package/vendors-node_modules_pnpm_tsparticles_engine_4_0_0-beta_1_node_modules_tsparticles_engine_bro-0bb20b.js +100 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_p-168eb1.js +30 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_p-c5a6f7.js +210 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-beta_1_node_modules_tspartic-d557a0.js +50 -0
- package/vendors-node_modules_pnpm_tsparticles_plugin-move_4_0_0-beta_1_node_modules_tsparticles_plugi-2dea06.js +40 -0
- package/vendors-node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-beta_1_node_modules_tsparticles-a5ec2f.js +80 -0
- package/121.min.js +0 -2
- package/121.min.js.LICENSE.txt +0 -1
- package/196.min.js +0 -2
- package/196.min.js.LICENSE.txt +0 -1
- package/2.min.js +0 -2
- package/2.min.js.LICENSE.txt +0 -1
- package/202.min.js +0 -2
- package/202.min.js.LICENSE.txt +0 -1
- package/294.min.js +0 -2
- package/294.min.js.LICENSE.txt +0 -1
- package/352.min.js +0 -2
- package/352.min.js.LICENSE.txt +0 -1
- package/413.min.js +0 -2
- package/413.min.js.LICENSE.txt +0 -1
- package/414.min.js +0 -2
- package/414.min.js.LICENSE.txt +0 -1
- package/420.min.js +0 -2
- package/420.min.js.LICENSE.txt +0 -1
- package/426.min.js +0 -2
- package/426.min.js.LICENSE.txt +0 -1
- package/429.min.js +0 -2
- package/429.min.js.LICENSE.txt +0 -1
- package/440.min.js +0 -2
- package/440.min.js.LICENSE.txt +0 -1
- package/464.min.js +0 -2
- package/464.min.js.LICENSE.txt +0 -1
- package/505.min.js +0 -2
- package/505.min.js.LICENSE.txt +0 -1
- package/56.min.js +0 -2
- package/56.min.js.LICENSE.txt +0 -1
- package/60.min.js +0 -2
- package/60.min.js.LICENSE.txt +0 -1
- package/668.min.js +0 -2
- package/668.min.js.LICENSE.txt +0 -1
- package/684.min.js +0 -2
- package/684.min.js.LICENSE.txt +0 -1
- package/685.min.js +0 -2
- package/685.min.js.LICENSE.txt +0 -1
- package/688.min.js +0 -2
- package/688.min.js.LICENSE.txt +0 -1
- package/726.min.js +0 -2
- package/726.min.js.LICENSE.txt +0 -1
- package/778.min.js +0 -2
- package/778.min.js.LICENSE.txt +0 -1
- package/792.min.js +0 -2
- package/792.min.js.LICENSE.txt +0 -1
- package/814.min.js +0 -2
- package/814.min.js.LICENSE.txt +0 -1
- package/847.min.js +0 -2
- package/847.min.js.LICENSE.txt +0 -1
- package/864.min.js +0 -2
- package/864.min.js.LICENSE.txt +0 -1
- package/909.min.js +0 -2
- package/909.min.js.LICENSE.txt +0 -1
- package/926.min.js +0 -2
- package/926.min.js.LICENSE.txt +0 -1
- package/933.min.js +0 -2
- package/933.min.js.LICENSE.txt +0 -1
- package/949.min.js +0 -2
- package/949.min.js.LICENSE.txt +0 -1
- package/990.min.js +0 -2
- package/990.min.js.LICENSE.txt +0 -1
- package/node_modules_pnpm_tsparticles_basic_4_0_0-alpha_5_node_modules_tsparticles_basic_browser_index_js.js +0 -30
- package/node_modules_pnpm_tsparticles_move-base_4_0_0-alpha_5_node_modules_tsparticles_move-base_brow-26eaee.js +0 -40
- package/node_modules_pnpm_tsparticles_move-base_4_0_0-alpha_5_node_modules_tsparticles_move-base_brow-29272f.js +0 -30
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_5_node_modules_tsparticles_plugin-e-051d5b.js +0 -50
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_5_node_modules_tsparticles_plugin-e-9414b7.js +0 -90
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_5_node_modules_tsparticles_plugin-e-b376d4.js +0 -90
- package/node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_5_node_modules_tsparticles_plugin-e-db7965.js +0 -30
- package/node_modules_pnpm_tsparticles_plugin-hsl-color_4_0_0-alpha_5_node_modules_tsparticles_plugin--175cc6.js +0 -30
- package/node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-alpha_5_node_modules_tsparticles_plu-4ef54e.js +0 -120
- package/node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-alpha_5_node_modules_tsparticles_plu-c0445f.js +0 -70
- package/node_modules_pnpm_tsparticles_plugin-rgb-color_4_0_0-alpha_5_node_modules_tsparticles_plugin--3fa544.js +0 -30
- package/node_modules_pnpm_tsparticles_updater-color_4_0_0-alpha_5_node_modules_tsparticles_updater-co-a17be7.js +0 -30
- package/node_modules_pnpm_tsparticles_updater-opacity_4_0_0-alpha_5_node_modules_tsparticles_updater--4bc1f3.js +0 -30
- package/node_modules_pnpm_tsparticles_updater-size_4_0_0-alpha_5_node_modules_tsparticles_updater-siz-547e88.js +0 -30
- package/tsparticles.preset.bubbles.bundle.min.js.LICENSE.txt +0 -1
- package/tsparticles.preset.bubbles.min.js.LICENSE.txt +0 -1
- package/vendors-node_modules_pnpm_tsparticles_engine_4_0_0-alpha_5_node_modules_tsparticles_engine_br-85ef38.js +0 -90
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_5_node_modules_tsparticles_-302925.js +0 -200
- package/vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-alpha_5_node_modules_tsparticles_-4cf04b.js +0 -30
- package/vendors-node_modules_pnpm_tsparticles_plugin-interactivity_4_0_0-alpha_5_node_modules_tsparti-98de40.js +0 -50
- package/vendors-node_modules_pnpm_tsparticles_updater-out-modes_4_0_0-alpha_5_node_modules_tsparticle-f9a455.js +0 -80
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v4.0.0-alpha.5
|
|
8
|
+
*/
|
|
9
|
+
"use strict";
|
|
10
|
+
/*
|
|
11
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
+
* This devtool is neither made for production nor for readable output files.
|
|
13
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
+
* or disable the default devtool with "devtool: false".
|
|
16
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
+
*/
|
|
18
|
+
(this["webpackChunk_tsparticles_preset_bubbles"] = this["webpackChunk_tsparticles_preset_bubbles"] || []).push([["vendors-node_modules_pnpm_tsparticles_engine_4_0_0-beta_1_node_modules_tsparticles_engine_bro-0bb20b"],{
|
|
19
|
+
|
|
20
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/CanvasManager.js"
|
|
21
|
+
/*!********************************************************************************************************************************!*\
|
|
22
|
+
!*** ../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/CanvasManager.js ***!
|
|
23
|
+
\********************************************************************************************************************************/
|
|
24
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
|
+
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CanvasManager: () => (/* binding */ CanvasManager)\n/* harmony export */ });\n/* harmony import */ var _Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/Utils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/Utils.js\");\n/* harmony import */ var _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils/Constants.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js\");\n/* harmony import */ var _Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Utils/ColorUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/ColorUtils.js\");\n/* harmony import */ var _RenderManager_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RenderManager.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/RenderManager.js\");\n\n\n\n\nfunction setStyle(canvas, style, important = false) {\n if (!style) {\n return;\n }\n const element = canvas, elementStyle = element.style, keys = new Set();\n for (let i = 0; i < elementStyle.length; i++) {\n const key = elementStyle.item(i);\n if (!key) {\n continue;\n }\n keys.add(key);\n }\n for (let i = 0; i < style.length; i++) {\n const key = style.item(i);\n if (!key) {\n continue;\n }\n keys.add(key);\n }\n for (const key of keys) {\n const value = style.getPropertyValue(key);\n if (value) {\n elementStyle.setProperty(key, value, important ? \"important\" : \"\");\n }\n else {\n elementStyle.removeProperty(key);\n }\n }\n}\nclass CanvasManager {\n element;\n render;\n size;\n zoom = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.defaultZoom;\n _container;\n _generated;\n _mutationObserver;\n _originalStyle;\n _pluginManager;\n _pointerEvents;\n _resizePlugins;\n _standardSize;\n _zoomCenter;\n constructor(pluginManager, container) {\n this._pluginManager = pluginManager;\n this._container = container;\n this.render = new _RenderManager_js__WEBPACK_IMPORTED_MODULE_3__.RenderManager(pluginManager, container, this);\n this._standardSize = {\n height: 0,\n width: 0,\n };\n const pxRatio = container.retina.pixelRatio, stdSize = this._standardSize;\n this.size = {\n height: stdSize.height * pxRatio,\n width: stdSize.width * pxRatio,\n };\n this._generated = false;\n this._resizePlugins = [];\n this._pointerEvents = \"none\";\n }\n get _fullScreen() {\n return this._container.actualOptions.fullScreen.enable;\n }\n destroy() {\n this.stop();\n if (this._generated) {\n const element = this.element;\n element?.remove();\n this.element = undefined;\n }\n else {\n this._resetOriginalStyle();\n }\n this.render.destroy();\n this._resizePlugins = [];\n }\n getZoomCenter() {\n const pxRatio = this._container.retina.pixelRatio, { width, height } = this.size;\n if (this._zoomCenter) {\n return this._zoomCenter;\n }\n return {\n x: (width * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.half) / pxRatio,\n y: (height * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.half) / pxRatio,\n };\n }\n init() {\n this._safeMutationObserver(obs => {\n obs.disconnect();\n });\n this._mutationObserver = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.safeMutationObserver)(records => {\n for (const record of records) {\n if (record.type === \"attributes\" && record.attributeName === \"style\") {\n this._repairStyle();\n }\n }\n });\n this.resize();\n this._initStyle();\n this.initBackground();\n this._safeMutationObserver(obs => {\n if (!this.element || !(this.element instanceof Node)) {\n return;\n }\n obs.observe(this.element, { attributes: true });\n });\n this.initPlugins();\n this.render.init();\n }\n initBackground() {\n const { _container } = this, options = _container.actualOptions, background = options.background, element = this.element;\n if (!element) {\n return;\n }\n const elementStyle = element.style, color = (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_2__.rangeColorToRgb)(this._pluginManager, background.color);\n if (color) {\n elementStyle.backgroundColor = (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_2__.getStyleFromRgb)(color, _container.hdr, background.opacity);\n }\n else {\n elementStyle.backgroundColor = \"\";\n }\n elementStyle.backgroundImage = background.image || \"\";\n elementStyle.backgroundPosition = background.position || \"\";\n elementStyle.backgroundRepeat = background.repeat || \"\";\n elementStyle.backgroundSize = background.size || \"\";\n }\n initPlugins() {\n this._resizePlugins = [];\n for (const plugin of this._container.plugins) {\n if (plugin.resize) {\n this._resizePlugins.push(plugin);\n }\n }\n }\n loadCanvas(canvas) {\n if (this._generated && this.element) {\n this.element.remove();\n }\n const container = this._container;\n this._generated =\n _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.generatedAttribute in canvas.dataset ? canvas.dataset[_Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.generatedAttribute] === \"true\" : this._generated;\n this.element = canvas;\n this.element.ariaHidden = \"true\";\n this._originalStyle = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.cloneStyle)(this.element.style);\n const standardSize = this._standardSize;\n standardSize.height = canvas.offsetHeight;\n standardSize.width = canvas.offsetWidth;\n const pxRatio = this._container.retina.pixelRatio, retinaSize = this.size;\n canvas.height = retinaSize.height = standardSize.height * pxRatio;\n canvas.width = retinaSize.width = standardSize.width * pxRatio;\n const canSupportHdrQuery = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.safeMatchMedia)(\"(color-gamut: p3)\");\n this.render.setContextSettings({\n alpha: true,\n colorSpace: canSupportHdrQuery?.matches && container.hdr ? \"display-p3\" : \"srgb\",\n desynchronized: true,\n willReadFrequently: false,\n });\n this.render.setContext(this.element.getContext(\"2d\", this.render.settings));\n this._safeMutationObserver(obs => {\n obs.disconnect();\n });\n container.retina.init();\n this.initBackground();\n this._safeMutationObserver(obs => {\n if (!this.element || !(this.element instanceof Node)) {\n return;\n }\n obs.observe(this.element, { attributes: true });\n });\n }\n resize() {\n if (!this.element) {\n return false;\n }\n const container = this._container, currentSize = container.canvas._standardSize, newSize = {\n width: this.element.offsetWidth,\n height: this.element.offsetHeight,\n }, pxRatio = container.retina.pixelRatio, retinaSize = {\n width: newSize.width * pxRatio,\n height: newSize.height * pxRatio,\n };\n if (newSize.height === currentSize.height &&\n newSize.width === currentSize.width &&\n retinaSize.height === this.element.height &&\n retinaSize.width === this.element.width) {\n return false;\n }\n const oldSize = { ...currentSize };\n currentSize.height = newSize.height;\n currentSize.width = newSize.width;\n const canvasSize = this.size;\n this.element.width = canvasSize.width = retinaSize.width;\n this.element.height = canvasSize.height = retinaSize.height;\n if (this._container.started) {\n container.particles.setResizeFactor({\n width: currentSize.width / oldSize.width,\n height: currentSize.height / oldSize.height,\n });\n }\n return true;\n }\n setPointerEvents(type) {\n const element = this.element;\n if (!element) {\n return;\n }\n this._pointerEvents = type;\n this._repairStyle();\n }\n setZoom(zoomLevel, center) {\n this.zoom = zoomLevel;\n this._zoomCenter = center;\n }\n stop() {\n this._safeMutationObserver(obs => {\n obs.disconnect();\n });\n this._mutationObserver = undefined;\n this.render.stop();\n }\n async windowResize() {\n if (!this.element || !this.resize()) {\n return;\n }\n const container = this._container, needsRefresh = container.updateActualOptions();\n container.particles.setDensity();\n this._applyResizePlugins();\n if (needsRefresh) {\n await container.refresh();\n }\n }\n _applyResizePlugins = () => {\n for (const plugin of this._resizePlugins) {\n plugin.resize?.();\n }\n };\n _initStyle = () => {\n const element = this.element, options = this._container.actualOptions;\n if (!element) {\n return;\n }\n if (this._fullScreen) {\n this._setFullScreenStyle();\n }\n else {\n this._resetOriginalStyle();\n }\n for (const key in options.style) {\n if (!key || !(key in options.style)) {\n continue;\n }\n const value = options.style[key];\n if (!value) {\n continue;\n }\n element.style.setProperty(key, value, \"important\");\n }\n };\n _repairStyle = () => {\n const element = this.element;\n if (!element) {\n return;\n }\n this._safeMutationObserver(observer => {\n observer.disconnect();\n });\n this._initStyle();\n this.initBackground();\n const pointerEvents = this._pointerEvents;\n element.style.pointerEvents = pointerEvents;\n element.setAttribute(\"pointer-events\", pointerEvents);\n this._safeMutationObserver(observer => {\n if (!(element instanceof Node)) {\n return;\n }\n observer.observe(element, { attributes: true });\n });\n };\n _resetOriginalStyle = () => {\n const element = this.element, originalStyle = this._originalStyle;\n if (!element || !originalStyle) {\n return;\n }\n setStyle(element, originalStyle, true);\n };\n _safeMutationObserver = callback => {\n if (!this._mutationObserver) {\n return;\n }\n callback(this._mutationObserver);\n };\n _setFullScreenStyle = () => {\n const element = this.element;\n if (!element) {\n return;\n }\n setStyle(element, (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.getFullScreenStyle)(this._container.actualOptions.fullScreen.zIndex), true);\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/CanvasManager.js?\n}");
|
|
27
|
+
|
|
28
|
+
/***/ },
|
|
29
|
+
|
|
30
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Container.js"
|
|
31
|
+
/*!****************************************************************************************************************************!*\
|
|
32
|
+
!*** ../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Container.js ***!
|
|
33
|
+
\****************************************************************************************************************************/
|
|
34
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
|
+
|
|
36
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Container: () => (/* binding */ Container)\n/* harmony export */ });\n/* harmony import */ var _Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/MathUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/MathUtils.js\");\n/* harmony import */ var _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils/Constants.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js\");\n/* harmony import */ var _CanvasManager_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CanvasManager.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/CanvasManager.js\");\n/* harmony import */ var _Utils_EventListeners_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Utils/EventListeners.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/EventListeners.js\");\n/* harmony import */ var _Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Enums/Types/EventType.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Enums/Types/EventType.js\");\n/* harmony import */ var _Options_Classes_Options_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Options/Classes/Options.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Options/Classes/Options.js\");\n/* harmony import */ var _ParticlesManager_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ParticlesManager.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/ParticlesManager.js\");\n/* harmony import */ var _Retina_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Retina.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Retina.js\");\n/* harmony import */ var _Utils_LogUtils_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Utils/LogUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/LogUtils.js\");\n/* harmony import */ var _Utils_OptionsUtils_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Utils/OptionsUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/OptionsUtils.js\");\n\n\n\n\n\n\n\n\n\n\nfunction guardCheck(container) {\n return !container.destroyed;\n}\nfunction updateDelta(delta, value, fpsLimit = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.defaultFps, smooth = false) {\n delta.value = value;\n delta.factor = smooth ? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.defaultFps / fpsLimit : (_Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.defaultFps * value) / _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.millisecondsToSeconds;\n}\nfunction loadContainerOptions(pluginManager, container, ...sourceOptionsArr) {\n const options = new _Options_Classes_Options_js__WEBPACK_IMPORTED_MODULE_5__.Options(pluginManager, container);\n (0,_Utils_OptionsUtils_js__WEBPACK_IMPORTED_MODULE_9__.loadOptions)(options, ...sourceOptionsArr);\n return options;\n}\nclass Container {\n actualOptions;\n canvas;\n destroyed;\n effectDrawers;\n fpsLimit;\n hdr;\n id;\n pageHidden;\n particleCreatedPlugins;\n particleDestroyedPlugins;\n particlePositionPlugins;\n particleUpdaters;\n particles;\n plugins;\n retina;\n shapeDrawers;\n started;\n zLayers;\n _delay;\n _delayTimeout;\n _delta = { value: 0, factor: 0 };\n _dispatchCallback;\n _drawAnimationFrame;\n _duration;\n _eventListeners;\n _firstStart;\n _initialSourceOptions;\n _lastFrameTime;\n _lifeTime;\n _onDestroy;\n _options;\n _paused;\n _pluginManager;\n _smooth;\n _sourceOptions;\n constructor(params) {\n const { dispatchCallback, pluginManager, id, onDestroy, sourceOptions } = params;\n this._pluginManager = pluginManager;\n this._dispatchCallback = dispatchCallback;\n this._onDestroy = onDestroy;\n this.id = Symbol(id);\n this.fpsLimit = 120;\n this.hdr = false;\n this._smooth = false;\n this._delay = 0;\n this._duration = 0;\n this._lifeTime = 0;\n this._firstStart = true;\n this.started = false;\n this.destroyed = false;\n this._paused = true;\n this._lastFrameTime = 0;\n this.zLayers = 100;\n this.pageHidden = false;\n this._sourceOptions = sourceOptions;\n this._initialSourceOptions = sourceOptions;\n this.effectDrawers = new Map();\n this.shapeDrawers = new Map();\n this.particleUpdaters = [];\n this.retina = new _Retina_js__WEBPACK_IMPORTED_MODULE_7__.Retina(this);\n this.canvas = new _CanvasManager_js__WEBPACK_IMPORTED_MODULE_2__.CanvasManager(this._pluginManager, this);\n this.particles = new _ParticlesManager_js__WEBPACK_IMPORTED_MODULE_6__.ParticlesManager(this._pluginManager, this);\n this.plugins = [];\n this.particleDestroyedPlugins = [];\n this.particleCreatedPlugins = [];\n this.particlePositionPlugins = [];\n this._options = loadContainerOptions(this._pluginManager, this);\n this.actualOptions = loadContainerOptions(this._pluginManager, this);\n this._eventListeners = new _Utils_EventListeners_js__WEBPACK_IMPORTED_MODULE_3__.EventListeners(this);\n this.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__.EventType.containerBuilt);\n }\n get animationStatus() {\n return !this._paused && !this.pageHidden && guardCheck(this);\n }\n get options() {\n return this._options;\n }\n get sourceOptions() {\n return this._sourceOptions;\n }\n addLifeTime(value) {\n this._lifeTime += value;\n }\n alive() {\n return !this._duration || this._lifeTime <= this._duration;\n }\n destroy(remove = true) {\n if (!guardCheck(this)) {\n return;\n }\n this.stop();\n this.particles.destroy();\n this.canvas.destroy();\n for (const [, effectDrawer] of this.effectDrawers) {\n effectDrawer.destroy?.(this);\n }\n for (const [, shapeDrawer] of this.shapeDrawers) {\n shapeDrawer.destroy?.(this);\n }\n for (const plugin of this.plugins) {\n plugin.destroy?.();\n }\n this.effectDrawers = new Map();\n this.shapeDrawers = new Map();\n this.particleUpdaters = [];\n this.plugins.length = 0;\n this._pluginManager.clearPlugins(this);\n this.destroyed = true;\n this._onDestroy(remove);\n this.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__.EventType.containerDestroyed);\n }\n dispatchEvent(type, data) {\n this._dispatchCallback(type, {\n container: this,\n data,\n });\n }\n draw(force) {\n if (!guardCheck(this)) {\n return;\n }\n let refreshTime = force;\n this._drawAnimationFrame = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_0__.animate)((timestamp) => {\n if (refreshTime) {\n this._lastFrameTime = undefined;\n refreshTime = false;\n }\n this._nextFrame(timestamp);\n });\n }\n async export(type, options = {}) {\n for (const plugin of this.plugins) {\n if (!plugin.export) {\n continue;\n }\n const res = await plugin.export(type, options);\n if (!res.supported) {\n continue;\n }\n return res.blob;\n }\n (0,_Utils_LogUtils_js__WEBPACK_IMPORTED_MODULE_8__.getLogger)().error(`Export plugin with type ${type} not found`);\n return undefined;\n }\n async init() {\n if (!guardCheck(this)) {\n return;\n }\n const allContainerPlugins = new Map();\n for (const plugin of this._pluginManager.plugins) {\n const containerPlugin = await plugin.getPlugin(this);\n if (containerPlugin.preInit) {\n await containerPlugin.preInit();\n }\n allContainerPlugins.set(plugin, containerPlugin);\n }\n await this.initDrawersAndUpdaters();\n this._options = loadContainerOptions(this._pluginManager, this, this._initialSourceOptions, this.sourceOptions);\n this.actualOptions = loadContainerOptions(this._pluginManager, this, this._options);\n this.plugins.length = 0;\n this.particleDestroyedPlugins.length = 0;\n this.particleCreatedPlugins.length = 0;\n this.particlePositionPlugins.length = 0;\n for (const [plugin, containerPlugin] of allContainerPlugins) {\n if (plugin.needsPlugin(this.actualOptions)) {\n this.plugins.push(containerPlugin);\n if (containerPlugin.particleCreated) {\n this.particleCreatedPlugins.push(containerPlugin);\n }\n if (containerPlugin.particleDestroyed) {\n this.particleDestroyedPlugins.push(containerPlugin);\n }\n if (containerPlugin.particlePosition) {\n this.particlePositionPlugins.push(containerPlugin);\n }\n }\n }\n this.retina.init();\n this.canvas.init();\n this.updateActualOptions();\n this.canvas.initBackground();\n this.canvas.resize();\n const { delay, duration, fpsLimit, hdr, smooth, zLayers } = this.actualOptions;\n this.hdr = hdr;\n this.zLayers = zLayers;\n this._duration = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(duration) * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.millisecondsToSeconds;\n this._delay = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(delay) * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.millisecondsToSeconds;\n this._lifeTime = 0;\n this.fpsLimit = fpsLimit > _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.minFpsLimit ? fpsLimit : _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.defaultFpsLimit;\n this._smooth = smooth;\n for (const plugin of this.plugins) {\n await plugin.init?.();\n }\n await this.particles.init();\n this.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__.EventType.containerInit);\n this.particles.setDensity();\n for (const plugin of this.plugins) {\n plugin.particlesSetup?.();\n }\n this.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__.EventType.particlesSetup);\n }\n async initDrawersAndUpdaters() {\n const pluginManager = this._pluginManager;\n this.effectDrawers = await pluginManager.getEffectDrawers(this, true);\n this.shapeDrawers = await pluginManager.getShapeDrawers(this, true);\n this.particleUpdaters = await pluginManager.getUpdaters(this, true);\n }\n pause() {\n if (!guardCheck(this)) {\n return;\n }\n if (this._drawAnimationFrame !== undefined) {\n (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_0__.cancelAnimation)(this._drawAnimationFrame);\n delete this._drawAnimationFrame;\n }\n if (this._paused) {\n return;\n }\n for (const plugin of this.plugins) {\n plugin.pause?.();\n }\n if (!this.pageHidden) {\n this._paused = true;\n }\n this.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__.EventType.containerPaused);\n }\n play(force) {\n if (!guardCheck(this)) {\n return;\n }\n const needsUpdate = this._paused || force;\n if (this._firstStart && !this.actualOptions.autoPlay) {\n this._firstStart = false;\n return;\n }\n if (this._paused) {\n this._paused = false;\n }\n if (needsUpdate) {\n for (const plugin of this.plugins) {\n if (plugin.play) {\n plugin.play();\n }\n }\n }\n this.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__.EventType.containerPlay);\n this.draw(needsUpdate ?? false);\n }\n async refresh() {\n if (!guardCheck(this)) {\n return;\n }\n this.stop();\n return this.start();\n }\n async reset(sourceOptions) {\n if (!guardCheck(this)) {\n return;\n }\n this._initialSourceOptions = sourceOptions;\n this._sourceOptions = sourceOptions;\n this._options = loadContainerOptions(this._pluginManager, this, this._initialSourceOptions, this.sourceOptions);\n this.actualOptions = loadContainerOptions(this._pluginManager, this, this._options);\n return this.refresh();\n }\n async start() {\n if (!guardCheck(this) || this.started) {\n return;\n }\n await this.init();\n this.started = true;\n await new Promise(resolve => {\n const start = async () => {\n this._eventListeners.addListeners();\n for (const plugin of this.plugins) {\n await plugin.start?.();\n }\n this.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__.EventType.containerStarted);\n this.play();\n resolve();\n };\n this._delayTimeout = setTimeout(() => void start(), this._delay);\n });\n }\n stop() {\n if (!guardCheck(this) || !this.started) {\n return;\n }\n if (this._delayTimeout) {\n clearTimeout(this._delayTimeout);\n delete this._delayTimeout;\n }\n this._firstStart = true;\n this.started = false;\n this._eventListeners.removeListeners();\n this.pause();\n this.particles.clear();\n this.canvas.stop();\n for (const plugin of this.plugins) {\n plugin.stop?.();\n }\n this.particleCreatedPlugins.length = 0;\n this.particleDestroyedPlugins.length = 0;\n this.particlePositionPlugins.length = 0;\n this._sourceOptions = this._options;\n this.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_4__.EventType.containerStopped);\n }\n updateActualOptions() {\n let refresh = false;\n for (const plugin of this.plugins) {\n if (plugin.updateActualOptions) {\n refresh = plugin.updateActualOptions() || refresh;\n }\n }\n return refresh;\n }\n _nextFrame = (timestamp) => {\n try {\n if (!this._smooth &&\n this._lastFrameTime !== undefined &&\n timestamp < this._lastFrameTime + _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.millisecondsToSeconds / this.fpsLimit) {\n this.draw(false);\n return;\n }\n this._lastFrameTime ??= timestamp;\n updateDelta(this._delta, timestamp - this._lastFrameTime, this.fpsLimit, this._smooth);\n this.addLifeTime(this._delta.value);\n this._lastFrameTime = timestamp;\n if (this._delta.value > _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.millisecondsToSeconds) {\n this.draw(false);\n return;\n }\n this.canvas.render.drawParticles(this._delta);\n if (!this.alive()) {\n this.destroy();\n return;\n }\n if (this.animationStatus) {\n this.draw(false);\n }\n }\n catch (e) {\n (0,_Utils_LogUtils_js__WEBPACK_IMPORTED_MODULE_8__.getLogger)().error(\"error in animation loop\", e);\n }\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Container.js?\n}");
|
|
37
|
+
|
|
38
|
+
/***/ },
|
|
39
|
+
|
|
40
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Particle.js"
|
|
41
|
+
/*!***************************************************************************************************************************!*\
|
|
42
|
+
!*** ../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Particle.js ***!
|
|
43
|
+
\***************************************************************************************************************************/
|
|
44
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
45
|
+
|
|
46
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Particle: () => (/* binding */ Particle)\n/* harmony export */ });\n/* harmony import */ var _Utils_Vectors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils/Vectors.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Vectors.js\");\n/* harmony import */ var _Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Utils/ColorUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/ColorUtils.js\");\n/* harmony import */ var _Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Utils/MathUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/MathUtils.js\");\n/* harmony import */ var _Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Utils/Utils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/Utils.js\");\n/* harmony import */ var _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils/Constants.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js\");\n/* harmony import */ var _Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Enums/Types/EventType.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Enums/Types/EventType.js\");\n/* harmony import */ var _Enums_Directions_MoveDirection_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Enums/Directions/MoveDirection.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Enums/Directions/MoveDirection.js\");\n/* harmony import */ var _Enums_Modes_OutMode_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Enums/Modes/OutMode.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Enums/Modes/OutMode.js\");\n/* harmony import */ var _Enums_Types_ParticleOutType_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Enums/Types/ParticleOutType.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Enums/Types/ParticleOutType.js\");\n/* harmony import */ var _Utils_OptionsUtils_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Utils/OptionsUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/OptionsUtils.js\");\n\n\n\n\n\n\n\n\n\n\nfunction loadEffectData(effect, effectOptions, id, reduceDuplicates) {\n const effectData = effectOptions.options[effect];\n return (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.deepExtend)({\n close: effectOptions.close,\n }, (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.itemFromSingleOrMultiple)(effectData, id, reduceDuplicates));\n}\nfunction loadShapeData(shape, shapeOptions, id, reduceDuplicates) {\n const shapeData = shapeOptions.options[shape];\n return (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.deepExtend)({\n close: shapeOptions.close,\n }, (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.itemFromSingleOrMultiple)(shapeData, id, reduceDuplicates));\n}\nfunction fixOutMode(data) {\n if (!(0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.isInArray)(data.outMode, data.checkModes)) {\n return;\n }\n const diameter = data.radius * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.double;\n if (data.coord > data.maxCoord - diameter) {\n data.setCb(-data.radius);\n }\n else if (data.coord < diameter) {\n data.setCb(data.radius);\n }\n}\nclass Particle {\n backColor;\n bubble;\n destroyed;\n direction;\n effect;\n effectClose;\n effectData;\n fillColor;\n fillEnabled;\n fillOpacity;\n group;\n id;\n ignoresResizeRatio;\n initialPosition;\n initialVelocity;\n isRotating;\n lastPathTime;\n misplaced;\n moveCenter;\n offset;\n opacity;\n options;\n outType;\n pathRotation;\n position;\n randomIndexData;\n retina;\n roll;\n rotation;\n shape;\n shapeClose;\n shapeData;\n sides;\n size;\n slow;\n spawning;\n strokeColor;\n strokeOpacity;\n strokeWidth;\n unbreakable;\n velocity;\n zIndexFactor;\n _cachedOpacityData = {\n fillOpacity: _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultOpacity,\n opacity: _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultOpacity,\n strokeOpacity: _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultOpacity,\n };\n _cachedPosition = _Utils_Vectors_js__WEBPACK_IMPORTED_MODULE_0__.Vector3d.origin;\n _cachedRotateData = { sin: 0, cos: 0 };\n _cachedTransform = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n };\n _container;\n _pluginManager;\n constructor(pluginManager, container) {\n this._pluginManager = pluginManager;\n this._container = container;\n }\n destroy(override) {\n if (this.unbreakable || this.destroyed) {\n return;\n }\n this.destroyed = true;\n this.bubble.inRange = false;\n this.slow.inRange = false;\n const container = this._container, shapeDrawer = this.shape ? container.shapeDrawers.get(this.shape) : undefined;\n shapeDrawer?.particleDestroy?.(this);\n for (const plugin of container.particleDestroyedPlugins) {\n plugin.particleDestroyed?.(this, override);\n }\n for (const updater of container.particleUpdaters) {\n updater.particleDestroyed?.(this, override);\n }\n this._container.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_5__.EventType.particleDestroyed, {\n particle: this,\n });\n }\n draw(delta) {\n const container = this._container, render = container.canvas.render;\n render.drawParticlePlugins(this, delta);\n render.drawParticle(this, delta);\n }\n getAngle() {\n return this.rotation + (this.pathRotation ? this.velocity.angle : _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultAngle);\n }\n getFillColor() {\n return this._getRollColor(this.bubble.color ?? (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_1__.getHslFromAnimation)(this.fillColor));\n }\n getMass() {\n return this.getRadius() ** _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.squareExp * Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.half;\n }\n getOpacity() {\n const zIndexOptions = this.options.zIndex, zIndexFactor = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.zIndexFactorOffset - this.zIndexFactor, zOpacityFactor = zIndexFactor ** zIndexOptions.opacityRate, opacity = this.bubble.opacity ?? (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(this.opacity?.value ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultOpacity), fillOpacity = this.fillOpacity ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultOpacity, strokeOpacity = this.strokeOpacity ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultOpacity;\n this._cachedOpacityData.fillOpacity = opacity * fillOpacity * zOpacityFactor;\n this._cachedOpacityData.opacity = opacity * zOpacityFactor;\n this._cachedOpacityData.strokeOpacity = opacity * strokeOpacity * zOpacityFactor;\n return this._cachedOpacityData;\n }\n getPosition() {\n this._cachedPosition.x = this.position.x + this.offset.x;\n this._cachedPosition.y = this.position.y + this.offset.y;\n this._cachedPosition.z = this.position.z;\n return this._cachedPosition;\n }\n getRadius() {\n return this.bubble.radius ?? this.size.value;\n }\n getRotateData() {\n const angle = this.getAngle();\n this._cachedRotateData.sin = Math.sin(angle);\n this._cachedRotateData.cos = Math.cos(angle);\n return this._cachedRotateData;\n }\n getStrokeColor() {\n return this._getRollColor(this.bubble.color ?? (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_1__.getHslFromAnimation)(this.strokeColor));\n }\n getTransformData(externalTransform) {\n const rotateData = this.getRotateData(), rotating = this.isRotating;\n this._cachedTransform.a = rotateData.cos * (externalTransform.a ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultTransform.a);\n this._cachedTransform.b = rotating\n ? rotateData.sin * (externalTransform.b ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.identity)\n : (externalTransform.b ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultTransform.b);\n this._cachedTransform.c = rotating\n ? -rotateData.sin * (externalTransform.c ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.identity)\n : (externalTransform.c ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultTransform.c);\n this._cachedTransform.d = rotateData.cos * (externalTransform.d ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultTransform.d);\n return this._cachedTransform;\n }\n init(id, position, overrideOptions, group) {\n const container = this._container;\n this.id = id;\n this.group = group;\n this.effectClose = true;\n this.shapeClose = true;\n this.pathRotation = false;\n this.lastPathTime = 0;\n this.destroyed = false;\n this.unbreakable = false;\n this.isRotating = false;\n this.rotation = 0;\n this.misplaced = false;\n this.retina = {\n maxDistance: {},\n maxSpeed: 0,\n moveDrift: 0,\n moveSpeed: 0,\n sizeAnimationSpeed: 0,\n };\n this.outType = _Enums_Types_ParticleOutType_js__WEBPACK_IMPORTED_MODULE_8__.ParticleOutType.normal;\n this.ignoresResizeRatio = true;\n const pxRatio = container.retina.pixelRatio, mainOptions = container.actualOptions, particlesOptions = (0,_Utils_OptionsUtils_js__WEBPACK_IMPORTED_MODULE_9__.loadParticlesOptions)(this._pluginManager, container, mainOptions.particles), reduceDuplicates = particlesOptions.reduceDuplicates, effectType = particlesOptions.effect.type, shapeType = particlesOptions.shape.type;\n this.effect = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.itemFromSingleOrMultiple)(effectType, this.id, reduceDuplicates);\n this.shape = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.itemFromSingleOrMultiple)(shapeType, this.id, reduceDuplicates);\n const effectOptions = particlesOptions.effect, shapeOptions = particlesOptions.shape;\n if (overrideOptions) {\n if (overrideOptions.effect?.type) {\n const overrideEffectType = overrideOptions.effect.type, effect = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.itemFromSingleOrMultiple)(overrideEffectType, this.id, reduceDuplicates);\n if (effect) {\n this.effect = effect;\n effectOptions.load(overrideOptions.effect);\n }\n }\n if (overrideOptions.shape?.type) {\n const overrideShapeType = overrideOptions.shape.type, shape = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.itemFromSingleOrMultiple)(overrideShapeType, this.id, reduceDuplicates);\n if (shape) {\n this.shape = shape;\n shapeOptions.load(overrideOptions.shape);\n }\n }\n }\n if (this.effect === _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.randomColorValue) {\n const availableEffects = [...this._container.effectDrawers.keys()];\n this.effect = availableEffects[Math.floor((0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRandom)() * availableEffects.length)];\n }\n if (this.shape === _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.randomColorValue) {\n const availableShapes = [...this._container.shapeDrawers.keys()];\n this.shape = availableShapes[Math.floor((0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRandom)() * availableShapes.length)];\n }\n this.effectData = this.effect ? loadEffectData(this.effect, effectOptions, this.id, reduceDuplicates) : undefined;\n this.shapeData = this.shape ? loadShapeData(this.shape, shapeOptions, this.id, reduceDuplicates) : undefined;\n particlesOptions.load(overrideOptions);\n const effectData = this.effectData;\n if (effectData) {\n particlesOptions.load(effectData.particles);\n }\n const shapeData = this.shapeData;\n if (shapeData) {\n particlesOptions.load(shapeData.particles);\n }\n this.effectClose = effectData?.close ?? particlesOptions.effect.close;\n this.shapeClose = shapeData?.close ?? particlesOptions.shape.close;\n this.options = particlesOptions;\n container.retina.initParticle(this);\n this.size = (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.initParticleNumericAnimationValue)(this.options.size, pxRatio);\n this.bubble = {\n inRange: false,\n };\n this.slow = {\n inRange: false,\n factor: 1,\n };\n this._initPosition(position);\n this.initialVelocity = this._calculateVelocity();\n this.velocity = this.initialVelocity.copy();\n const particles = container.particles;\n particles.setLastZIndex(this.position.z);\n this.zIndexFactor = this.position.z / container.zLayers;\n this.sides = 24;\n let effectDrawer, shapeDrawer;\n if (this.effect) {\n effectDrawer = container.effectDrawers.get(this.effect);\n }\n if (effectDrawer?.loadEffect) {\n effectDrawer.loadEffect(this);\n }\n if (this.shape) {\n shapeDrawer = container.shapeDrawers.get(this.shape);\n }\n if (shapeDrawer?.loadShape) {\n shapeDrawer.loadShape(this);\n }\n const sideCountFunc = shapeDrawer?.getSidesCount;\n if (sideCountFunc) {\n this.sides = sideCountFunc(this);\n }\n this.spawning = false;\n for (const updater of container.particleUpdaters) {\n updater.init(this);\n }\n effectDrawer?.particleInit?.(container, this);\n shapeDrawer?.particleInit?.(container, this);\n for (const plugin of container.particleCreatedPlugins) {\n plugin.particleCreated?.(this);\n }\n }\n isInsideCanvas() {\n const radius = this.getRadius(), canvasSize = this._container.canvas.size, position = this.position;\n return (position.x >= -radius &&\n position.y >= -radius &&\n position.y <= canvasSize.height + radius &&\n position.x <= canvasSize.width + radius);\n }\n isShowingBack() {\n if (!this.roll) {\n return false;\n }\n const angle = this.roll.angle;\n if (this.roll.horizontal && this.roll.vertical) {\n const normalizedAngle = angle % _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.doublePI, adjustedAngle = normalizedAngle < _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultAngle ? normalizedAngle + _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.doublePI : normalizedAngle;\n return adjustedAngle >= Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.half && adjustedAngle < Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.triple * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.half;\n }\n if (this.roll.horizontal) {\n const normalizedAngle = (angle + Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.half) % (Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.double), adjustedAngle = normalizedAngle < _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultAngle ? normalizedAngle + Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.double : normalizedAngle;\n return adjustedAngle >= Math.PI && adjustedAngle < Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.double;\n }\n if (this.roll.vertical) {\n const normalizedAngle = angle % (Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.double), adjustedAngle = normalizedAngle < _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultAngle ? normalizedAngle + Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.double : normalizedAngle;\n return adjustedAngle >= Math.PI && adjustedAngle < Math.PI * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.double;\n }\n return false;\n }\n isVisible() {\n return !this.destroyed && !this.spawning && this.isInsideCanvas();\n }\n reset() {\n for (const updater of this._container.particleUpdaters) {\n updater.reset?.(this);\n }\n }\n _calcPosition = (position, zIndex) => {\n let tryCount = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.defaultRetryCount, posVec = position ? _Utils_Vectors_js__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create(position.x, position.y, zIndex) : undefined;\n const container = this._container, plugins = container.particlePositionPlugins, outModes = this.options.move.outModes, radius = this.getRadius(), canvasSize = container.canvas.size, abortController = new AbortController(), { signal } = abortController;\n while (!signal.aborted) {\n for (const plugin of plugins) {\n const pluginPos = plugin.particlePosition?.(posVec, this);\n if (pluginPos) {\n return _Utils_Vectors_js__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create(pluginPos.x, pluginPos.y, zIndex);\n }\n }\n const exactPosition = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.calcExactPositionOrRandomFromSize)({\n size: canvasSize,\n position: posVec,\n }), pos = _Utils_Vectors_js__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create(exactPosition.x, exactPosition.y, zIndex);\n this._fixHorizontal(pos, radius, outModes.left ?? outModes.default);\n this._fixHorizontal(pos, radius, outModes.right ?? outModes.default);\n this._fixVertical(pos, radius, outModes.top ?? outModes.default);\n this._fixVertical(pos, radius, outModes.bottom ?? outModes.default);\n let isValidPosition = true;\n for (const plugin of container.particles.checkParticlePositionPlugins) {\n isValidPosition = plugin.checkParticlePosition?.(this, pos, tryCount) ?? true;\n if (!isValidPosition) {\n break;\n }\n }\n if (isValidPosition) {\n return pos;\n }\n tryCount += _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.tryCountIncrement;\n posVec = undefined;\n }\n return posVec;\n };\n _calculateVelocity = () => {\n const baseVelocity = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getParticleBaseVelocity)(this.direction), res = baseVelocity.copy(), moveOptions = this.options.move;\n if (moveOptions.direction === _Enums_Directions_MoveDirection_js__WEBPACK_IMPORTED_MODULE_6__.MoveDirection.inside || moveOptions.direction === _Enums_Directions_MoveDirection_js__WEBPACK_IMPORTED_MODULE_6__.MoveDirection.outside) {\n return res;\n }\n const rad = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.degToRad)((0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(moveOptions.angle.value)), radOffset = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.degToRad)((0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(moveOptions.angle.offset)), range = {\n left: radOffset - rad * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.half,\n right: radOffset + rad * _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.half,\n };\n if (!moveOptions.straight) {\n res.angle += (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.randomInRangeValue)((0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.setRangeValue)(range.left, range.right));\n }\n if (moveOptions.random && typeof moveOptions.speed === \"number\") {\n res.length *= (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRandom)();\n }\n return res;\n };\n _fixHorizontal = (pos, radius, outMode) => {\n fixOutMode({\n outMode,\n checkModes: [_Enums_Modes_OutMode_js__WEBPACK_IMPORTED_MODULE_7__.OutMode.bounce],\n coord: pos.x,\n maxCoord: this._container.canvas.size.width,\n setCb: (value) => (pos.x += value),\n radius,\n });\n };\n _fixVertical = (pos, radius, outMode) => {\n fixOutMode({\n outMode,\n checkModes: [_Enums_Modes_OutMode_js__WEBPACK_IMPORTED_MODULE_7__.OutMode.bounce],\n coord: pos.y,\n maxCoord: this._container.canvas.size.height,\n setCb: (value) => (pos.y += value),\n radius,\n });\n };\n _getRollColor = color => {\n if (!color || !this.roll || (!this.backColor && !this.roll.alter)) {\n return color;\n }\n if (!this.isShowingBack()) {\n return color;\n }\n if (this.backColor) {\n return this.backColor;\n }\n if (this.roll.alter) {\n return (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_1__.alterHsl)(color, this.roll.alter.type, this.roll.alter.value);\n }\n return color;\n };\n _initPosition = position => {\n const container = this._container, zIndexValue = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getRangeValue)(this.options.zIndex.value), initialPosition = this._calcPosition(position, (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.clamp)(zIndexValue, _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_4__.minZ, container.zLayers));\n if (!initialPosition) {\n throw new Error(\"a valid position cannot be found for particle\");\n }\n this.position = initialPosition;\n this.initialPosition = this.position.copy();\n const canvasSize = container.canvas.size;\n this.moveCenter = {\n ...(0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_3__.getPosition)(this.options.move.center, canvasSize),\n radius: this.options.move.center.radius,\n mode: this.options.move.center.mode,\n };\n this.direction = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_2__.getParticleDirectionAngle)(this.options.move.direction, this.position, this.moveCenter);\n switch (this.options.move.direction) {\n case _Enums_Directions_MoveDirection_js__WEBPACK_IMPORTED_MODULE_6__.MoveDirection.inside:\n this.outType = _Enums_Types_ParticleOutType_js__WEBPACK_IMPORTED_MODULE_8__.ParticleOutType.inside;\n break;\n case _Enums_Directions_MoveDirection_js__WEBPACK_IMPORTED_MODULE_6__.MoveDirection.outside:\n this.outType = _Enums_Types_ParticleOutType_js__WEBPACK_IMPORTED_MODULE_8__.ParticleOutType.outside;\n break;\n default:\n break;\n }\n this.offset = _Utils_Vectors_js__WEBPACK_IMPORTED_MODULE_0__.Vector.origin;\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Particle.js?\n}");
|
|
47
|
+
|
|
48
|
+
/***/ },
|
|
49
|
+
|
|
50
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/ParticlesManager.js"
|
|
51
|
+
/*!***********************************************************************************************************************************!*\
|
|
52
|
+
!*** ../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/ParticlesManager.js ***!
|
|
53
|
+
\***********************************************************************************************************************************/
|
|
54
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
55
|
+
|
|
56
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ParticlesManager: () => (/* binding */ ParticlesManager)\n/* harmony export */ });\n/* harmony import */ var _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils/Constants.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js\");\n/* harmony import */ var _Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Enums/Types/EventType.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Enums/Types/EventType.js\");\n/* harmony import */ var _Enums_Modes_LimitMode_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Enums/Modes/LimitMode.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Enums/Modes/LimitMode.js\");\n/* harmony import */ var _Particle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Particle.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Particle.js\");\n/* harmony import */ var _Utils_SpatialHashGrid_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils/SpatialHashGrid.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/SpatialHashGrid.js\");\n/* harmony import */ var _Utils_LogUtils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Utils/LogUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/LogUtils.js\");\n/* harmony import */ var _Utils_OptionsUtils_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Utils/OptionsUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/OptionsUtils.js\");\n\n\n\n\n\n\n\nclass ParticlesManager {\n checkParticlePositionPlugins;\n grid;\n _array;\n _container;\n _groupLimits;\n _limit;\n _maxZIndex;\n _minZIndex;\n _needsSort;\n _nextId;\n _particleResetPlugins;\n _particleUpdatePlugins;\n _pluginManager;\n _pool;\n _postParticleUpdatePlugins;\n _postUpdatePlugins;\n _resizeFactor;\n _updatePlugins;\n _zArray;\n constructor(pluginManager, container) {\n this._pluginManager = pluginManager;\n this._container = container;\n this._nextId = 0;\n this._array = [];\n this._zArray = [];\n this._pool = [];\n this._limit = 0;\n this._groupLimits = new Map();\n this._needsSort = false;\n this._minZIndex = 0;\n this._maxZIndex = 0;\n this.grid = new _Utils_SpatialHashGrid_js__WEBPACK_IMPORTED_MODULE_4__.SpatialHashGrid(_Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.spatialHashGridCellSize);\n this.checkParticlePositionPlugins = [];\n this._particleResetPlugins = [];\n this._particleUpdatePlugins = [];\n this._postUpdatePlugins = [];\n this._postParticleUpdatePlugins = [];\n this._updatePlugins = [];\n }\n get count() {\n return this._array.length;\n }\n addParticle(position, overrideOptions, group, initializer) {\n const limitMode = this._container.actualOptions.particles.number.limit.mode, limit = group === undefined ? this._limit : (this._groupLimits.get(group) ?? this._limit), currentCount = this.count;\n if (limit > _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.minLimit) {\n switch (limitMode) {\n case _Enums_Modes_LimitMode_js__WEBPACK_IMPORTED_MODULE_2__.LimitMode.delete: {\n const countToRemove = currentCount + _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.countOffset - limit;\n if (countToRemove > _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.minCount) {\n this.removeQuantity(countToRemove);\n }\n break;\n }\n case _Enums_Modes_LimitMode_js__WEBPACK_IMPORTED_MODULE_2__.LimitMode.wait:\n if (currentCount >= limit) {\n return;\n }\n break;\n default:\n break;\n }\n }\n try {\n const particle = this._pool.pop() ?? new _Particle_js__WEBPACK_IMPORTED_MODULE_3__.Particle(this._pluginManager, this._container);\n particle.init(this._nextId, position, overrideOptions, group);\n let canAdd = true;\n if (initializer) {\n canAdd = initializer(particle);\n }\n if (!canAdd) {\n this._pool.push(particle);\n return;\n }\n this._array.push(particle);\n this._zArray.push(particle);\n this._nextId++;\n this._container.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_1__.EventType.particleAdded, {\n particle,\n });\n return particle;\n }\n catch (e) {\n (0,_Utils_LogUtils_js__WEBPACK_IMPORTED_MODULE_5__.getLogger)().warning(`error adding particle: ${e}`);\n }\n return undefined;\n }\n clear() {\n this._array = [];\n this._zArray = [];\n }\n destroy() {\n this._array = [];\n this._pool.length = 0;\n this._zArray = [];\n this.checkParticlePositionPlugins = [];\n this._particleResetPlugins = [];\n this._particleUpdatePlugins = [];\n this._postUpdatePlugins = [];\n this._postParticleUpdatePlugins = [];\n this._updatePlugins = [];\n }\n drawParticles(delta) {\n for (const particle of this._zArray) {\n particle.draw(delta);\n }\n }\n filter(condition) {\n return this._array.filter(condition);\n }\n find(condition) {\n return this._array.find(condition);\n }\n get(index) {\n return this._array[index];\n }\n async init() {\n const container = this._container, options = container.actualOptions;\n this._minZIndex = 0;\n this._maxZIndex = 0;\n this._needsSort = false;\n this.checkParticlePositionPlugins = [];\n this._updatePlugins = [];\n this._particleUpdatePlugins = [];\n this._postUpdatePlugins = [];\n this._particleResetPlugins = [];\n this._postParticleUpdatePlugins = [];\n this.grid = new _Utils_SpatialHashGrid_js__WEBPACK_IMPORTED_MODULE_4__.SpatialHashGrid(_Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.spatialHashGridCellSize * container.retina.pixelRatio);\n for (const plugin of container.plugins) {\n if (plugin.redrawInit) {\n await plugin.redrawInit();\n }\n if (plugin.checkParticlePosition) {\n this.checkParticlePositionPlugins.push(plugin);\n }\n if (plugin.update) {\n this._updatePlugins.push(plugin);\n }\n if (plugin.particleUpdate) {\n this._particleUpdatePlugins.push(plugin);\n }\n if (plugin.postUpdate) {\n this._postUpdatePlugins.push(plugin);\n }\n if (plugin.particleReset) {\n this._particleResetPlugins.push(plugin);\n }\n if (plugin.postParticleUpdate) {\n this._postParticleUpdatePlugins.push(plugin);\n }\n }\n await this._container.initDrawersAndUpdaters();\n for (const drawer of this._container.effectDrawers.values()) {\n await drawer.init?.(container);\n }\n for (const drawer of this._container.shapeDrawers.values()) {\n await drawer.init?.(container);\n }\n let handled = false;\n for (const plugin of container.plugins) {\n handled = plugin.particlesInitialization?.() ?? handled;\n if (handled) {\n break;\n }\n }\n if (!handled) {\n const particlesOptions = options.particles, groups = particlesOptions.groups;\n for (const group in groups) {\n const groupOptions = groups[group];\n if (!groupOptions) {\n continue;\n }\n for (let i = this.count, j = 0; j < groupOptions.number.value && i < particlesOptions.number.value; i++, j++) {\n this.addParticle(undefined, groupOptions, group);\n }\n }\n for (let i = this.count; i < particlesOptions.number.value; i++) {\n this.addParticle();\n }\n }\n }\n push(nb, position, overrideOptions, group) {\n for (let i = 0; i < nb; i++) {\n this.addParticle(position, overrideOptions, group);\n }\n }\n async redraw() {\n this.clear();\n await this.init();\n this._container.canvas.render.drawParticles({ value: 0, factor: 0 });\n }\n remove(particle, group, override) {\n this.removeAt(this._array.indexOf(particle), undefined, group, override);\n }\n removeAt(index, quantity = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.defaultRemoveQuantity, group, override) {\n if (index < _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.minIndex || index > this.count) {\n return;\n }\n let deleted = 0;\n for (let i = index; deleted < quantity && i < this.count; i++) {\n if (this._removeParticle(i, group, override)) {\n i--;\n deleted++;\n }\n }\n }\n removeQuantity(quantity, group) {\n this.removeAt(_Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.minIndex, quantity, group);\n }\n setDensity() {\n const options = this._container.actualOptions, groups = options.particles.groups;\n let pluginsCount = 0;\n for (const plugin of this._container.plugins) {\n if (plugin.particlesDensityCount) {\n pluginsCount += plugin.particlesDensityCount();\n }\n }\n for (const group in groups) {\n const groupData = groups[group];\n if (!groupData) {\n continue;\n }\n const groupDataOptions = (0,_Utils_OptionsUtils_js__WEBPACK_IMPORTED_MODULE_6__.loadParticlesOptions)(this._pluginManager, this._container, groupData);\n this._applyDensity(groupDataOptions, pluginsCount, group);\n }\n this._applyDensity(options.particles, pluginsCount);\n }\n setLastZIndex(zIndex) {\n this._needsSort ||= zIndex >= this._maxZIndex || (zIndex > this._minZIndex && zIndex < this._maxZIndex);\n }\n setResizeFactor(factor) {\n this._resizeFactor = factor;\n }\n update(delta) {\n const particlesToDelete = new Set();\n this.grid.clear();\n for (const plugin of this._updatePlugins) {\n plugin.update?.(delta);\n }\n const resizeFactor = this._resizeFactor;\n for (const particle of this._array) {\n if (resizeFactor && !particle.ignoresResizeRatio) {\n particle.position.x *= resizeFactor.width;\n particle.position.y *= resizeFactor.height;\n particle.initialPosition.x *= resizeFactor.width;\n particle.initialPosition.y *= resizeFactor.height;\n }\n particle.ignoresResizeRatio = false;\n for (const plugin of this._particleResetPlugins) {\n plugin.particleReset?.(particle);\n }\n for (const plugin of this._particleUpdatePlugins) {\n if (particle.destroyed) {\n break;\n }\n plugin.particleUpdate?.(particle, delta);\n }\n if (particle.destroyed) {\n particlesToDelete.add(particle);\n continue;\n }\n this.grid.insert(particle);\n }\n for (const plugin of this._postUpdatePlugins) {\n plugin.postUpdate?.(delta);\n }\n for (const particle of this._array) {\n if (particle.destroyed) {\n particlesToDelete.add(particle);\n continue;\n }\n for (const updater of this._container.particleUpdaters) {\n updater.update(particle, delta);\n }\n if (!particle.destroyed && !particle.spawning) {\n for (const plugin of this._postParticleUpdatePlugins) {\n plugin.postParticleUpdate?.(particle, delta);\n }\n }\n else if (particle.destroyed) {\n particlesToDelete.add(particle);\n }\n }\n if (particlesToDelete.size) {\n for (const particle of particlesToDelete) {\n this.remove(particle);\n }\n }\n delete this._resizeFactor;\n if (this._needsSort) {\n const zArray = this._zArray;\n zArray.sort((a, b) => b.position.z - a.position.z || a.id - b.id);\n const firstItem = zArray[_Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.minIndex], lastItem = zArray[zArray.length - _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.lengthOffset];\n if (!firstItem || !lastItem) {\n return;\n }\n this._maxZIndex = firstItem.position.z;\n this._minZIndex = lastItem.position.z;\n this._needsSort = false;\n }\n }\n _addToPool = (...particles) => {\n this._pool.push(...particles);\n };\n _applyDensity = (options, pluginsCount, group, groupOptions) => {\n const numberOptions = options.number;\n if (!numberOptions.density.enable) {\n if (group === undefined) {\n this._limit = numberOptions.limit.value;\n }\n else if (groupOptions?.number.limit.value ?? numberOptions.limit.value) {\n this._groupLimits.set(group, groupOptions?.number.limit.value ?? numberOptions.limit.value);\n }\n return;\n }\n const densityFactor = this._initDensityFactor(numberOptions.density), optParticlesNumber = numberOptions.value, optParticlesLimit = numberOptions.limit.value > _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.minLimit ? numberOptions.limit.value : optParticlesNumber, particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + pluginsCount, particlesCount = Math.min(this.count, this.filter(t => t.group === group).length);\n if (group === undefined) {\n this._limit = numberOptions.limit.value * densityFactor;\n }\n else {\n this._groupLimits.set(group, numberOptions.limit.value * densityFactor);\n }\n if (particlesCount < particlesNumber) {\n this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);\n }\n else if (particlesCount > particlesNumber) {\n this.removeQuantity(particlesCount - particlesNumber, group);\n }\n };\n _initDensityFactor = densityOptions => {\n const container = this._container;\n if (!container.canvas.element || !densityOptions.enable) {\n return _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.defaultDensityFactor;\n }\n const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;\n return (canvas.width * canvas.height) / (densityOptions.height * densityOptions.width * pxRatio ** _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.squareExp);\n };\n _removeParticle = (index, group, override) => {\n const particle = this._array[index];\n if (!particle) {\n return false;\n }\n if (particle.group !== group) {\n return false;\n }\n const zIdx = this._zArray.indexOf(particle);\n this._array.splice(index, _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.deleteCount);\n this._zArray.splice(zIdx, _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.deleteCount);\n particle.destroy(override);\n this._container.dispatchEvent(_Enums_Types_EventType_js__WEBPACK_IMPORTED_MODULE_1__.EventType.particleRemoved, {\n particle,\n });\n this._addToPool(particle);\n return true;\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/ParticlesManager.js?\n}");
|
|
57
|
+
|
|
58
|
+
/***/ },
|
|
59
|
+
|
|
60
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/RenderManager.js"
|
|
61
|
+
/*!********************************************************************************************************************************!*\
|
|
62
|
+
!*** ../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/RenderManager.js ***!
|
|
63
|
+
\********************************************************************************************************************************/
|
|
64
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
65
|
+
|
|
66
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RenderManager: () => (/* binding */ RenderManager)\n/* harmony export */ });\n/* harmony import */ var _Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Utils/CanvasUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/CanvasUtils.js\");\n/* harmony import */ var _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils/Constants.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js\");\n/* harmony import */ var _Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Utils/ColorUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/ColorUtils.js\");\n\n\n\nconst fColorIndex = 0, sColorIndex = 1;\nfunction setTransformValue(factor, newFactor, key) {\n const newValue = newFactor[key];\n if (newValue !== undefined) {\n factor[key] = (factor[key] ?? _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.defaultTransformValue) * newValue;\n }\n}\nclass RenderManager {\n _canvasClearPlugins;\n _canvasManager;\n _canvasPaintPlugins;\n _clearDrawPlugins;\n _colorPlugins;\n _container;\n _context;\n _contextSettings;\n _drawParticlePlugins;\n _drawParticlesCleanupPlugins;\n _drawParticlesSetupPlugins;\n _drawPlugins;\n _drawSettingsCleanupPlugins;\n _drawSettingsSetupPlugins;\n _pluginManager;\n _postDrawUpdaters;\n _preDrawUpdaters;\n _reusableColorStyles = {};\n _reusablePluginColors = [undefined, undefined];\n _reusableTransform = {};\n constructor(pluginManager, container, canvasManager) {\n this._pluginManager = pluginManager;\n this._container = container;\n this._canvasManager = canvasManager;\n this._context = null;\n this._preDrawUpdaters = [];\n this._postDrawUpdaters = [];\n this._colorPlugins = [];\n this._canvasClearPlugins = [];\n this._canvasPaintPlugins = [];\n this._clearDrawPlugins = [];\n this._drawParticlePlugins = [];\n this._drawParticlesCleanupPlugins = [];\n this._drawParticlesSetupPlugins = [];\n this._drawPlugins = [];\n this._drawSettingsSetupPlugins = [];\n this._drawSettingsCleanupPlugins = [];\n }\n get settings() {\n return this._contextSettings;\n }\n canvasClear() {\n if (!this._container.actualOptions.clear) {\n return;\n }\n this.draw(ctx => {\n (0,_Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_0__.clear)(ctx, this._canvasManager.size);\n });\n }\n clear() {\n let pluginHandled = false;\n for (const plugin of this._canvasClearPlugins) {\n pluginHandled = plugin.canvasClear?.() ?? false;\n if (pluginHandled) {\n break;\n }\n }\n if (pluginHandled) {\n return;\n }\n this.canvasClear();\n }\n destroy() {\n this.stop();\n this._preDrawUpdaters = [];\n this._postDrawUpdaters = [];\n this._colorPlugins = [];\n this._canvasClearPlugins = [];\n this._canvasPaintPlugins = [];\n this._clearDrawPlugins = [];\n this._drawParticlePlugins = [];\n this._drawParticlesCleanupPlugins = [];\n this._drawParticlesSetupPlugins = [];\n this._drawPlugins = [];\n this._drawSettingsSetupPlugins = [];\n this._drawSettingsCleanupPlugins = [];\n }\n draw(cb) {\n const ctx = this._context;\n if (!ctx) {\n return;\n }\n return cb(ctx);\n }\n drawParticle(particle, delta) {\n if (particle.spawning || particle.destroyed) {\n return;\n }\n const radius = particle.getRadius();\n if (radius <= _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.minimumSize) {\n return;\n }\n const pfColor = particle.getFillColor(), psColor = particle.getStrokeColor();\n let [fColor, sColor] = this._getPluginParticleColors(particle);\n fColor ??= pfColor;\n sColor ??= psColor;\n if (!fColor && !sColor) {\n return;\n }\n const container = this._container, zIndexOptions = particle.options.zIndex, zIndexFactor = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.zIndexFactorOffset - particle.zIndexFactor, { fillOpacity, opacity, strokeOpacity } = particle.getOpacity(), transform = this._reusableTransform, colorStyles = this._reusableColorStyles, fill = fColor ? (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_2__.getStyleFromHsl)(fColor, container.hdr, fillOpacity * opacity) : undefined, stroke = sColor ? (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_2__.getStyleFromHsl)(sColor, container.hdr, strokeOpacity * opacity) : fill;\n transform.a = transform.b = transform.c = transform.d = undefined;\n colorStyles.fill = fill;\n colorStyles.stroke = stroke;\n this.draw((context) => {\n for (const plugin of this._drawParticlesSetupPlugins) {\n plugin.drawParticleSetup?.(context, particle, delta);\n }\n this._applyPreDrawUpdaters(context, particle, radius, opacity, colorStyles, transform);\n (0,_Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_0__.drawParticle)({\n container,\n context,\n particle,\n delta,\n colorStyles,\n radius: radius * zIndexFactor ** zIndexOptions.sizeRate,\n opacity: opacity,\n transform,\n });\n this._applyPostDrawUpdaters(particle);\n for (const plugin of this._drawParticlesCleanupPlugins) {\n plugin.drawParticleCleanup?.(context, particle, delta);\n }\n });\n }\n drawParticlePlugins(particle, delta) {\n this.draw(ctx => {\n for (const plugin of this._drawParticlePlugins) {\n (0,_Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_0__.drawParticlePlugin)(ctx, plugin, particle, delta);\n }\n });\n }\n drawParticles(delta) {\n const { particles } = this._container;\n this.clear();\n particles.update(delta);\n this.draw(ctx => {\n for (const plugin of this._drawSettingsSetupPlugins) {\n plugin.drawSettingsSetup?.(ctx, delta);\n }\n for (const plugin of this._drawPlugins) {\n plugin.draw?.(ctx, delta);\n }\n particles.drawParticles(delta);\n for (const plugin of this._clearDrawPlugins) {\n plugin.clearDraw?.(ctx, delta);\n }\n for (const plugin of this._drawSettingsCleanupPlugins) {\n plugin.drawSettingsCleanup?.(ctx, delta);\n }\n });\n }\n init() {\n this.initUpdaters();\n this.initPlugins();\n this.paint();\n }\n initPlugins() {\n this._colorPlugins = [];\n this._canvasClearPlugins = [];\n this._canvasPaintPlugins = [];\n this._clearDrawPlugins = [];\n this._drawParticlePlugins = [];\n this._drawParticlesSetupPlugins = [];\n this._drawParticlesCleanupPlugins = [];\n this._drawPlugins = [];\n this._drawSettingsSetupPlugins = [];\n this._drawSettingsCleanupPlugins = [];\n for (const plugin of this._container.plugins) {\n if (plugin.particleFillColor ?? plugin.particleStrokeColor) {\n this._colorPlugins.push(plugin);\n }\n if (plugin.canvasClear) {\n this._canvasClearPlugins.push(plugin);\n }\n if (plugin.canvasPaint) {\n this._canvasPaintPlugins.push(plugin);\n }\n if (plugin.drawParticle) {\n this._drawParticlePlugins.push(plugin);\n }\n if (plugin.drawParticleSetup) {\n this._drawParticlesSetupPlugins.push(plugin);\n }\n if (plugin.drawParticleCleanup) {\n this._drawParticlesCleanupPlugins.push(plugin);\n }\n if (plugin.draw) {\n this._drawPlugins.push(plugin);\n }\n if (plugin.drawSettingsSetup) {\n this._drawSettingsSetupPlugins.push(plugin);\n }\n if (plugin.drawSettingsCleanup) {\n this._drawSettingsCleanupPlugins.push(plugin);\n }\n if (plugin.clearDraw) {\n this._clearDrawPlugins.push(plugin);\n }\n }\n }\n initUpdaters() {\n this._preDrawUpdaters = [];\n this._postDrawUpdaters = [];\n for (const updater of this._container.particleUpdaters) {\n if (updater.afterDraw) {\n this._postDrawUpdaters.push(updater);\n }\n if (updater.getColorStyles ?? updater.getTransformValues ?? updater.beforeDraw) {\n this._preDrawUpdaters.push(updater);\n }\n }\n }\n paint() {\n let handled = false;\n for (const plugin of this._canvasPaintPlugins) {\n handled = plugin.canvasPaint?.() ?? false;\n if (handled) {\n break;\n }\n }\n if (handled) {\n return;\n }\n this.paintBase();\n }\n paintBase(baseColor) {\n this.draw(ctx => {\n (0,_Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_0__.paintBase)(ctx, this._canvasManager.size, baseColor);\n });\n }\n paintImage(image, opacity) {\n this.draw(ctx => {\n (0,_Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_0__.paintImage)(ctx, this._canvasManager.size, image, opacity);\n });\n }\n setContext(context) {\n this._context = context;\n if (this._context) {\n this._context.globalCompositeOperation = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_1__.defaultCompositeValue;\n }\n }\n setContextSettings(settings) {\n this._contextSettings = settings;\n }\n stop() {\n this.draw(ctx => {\n (0,_Utils_CanvasUtils_js__WEBPACK_IMPORTED_MODULE_0__.clear)(ctx, this._canvasManager.size);\n });\n }\n _applyPostDrawUpdaters = particle => {\n for (const updater of this._postDrawUpdaters) {\n updater.afterDraw?.(particle);\n }\n };\n _applyPreDrawUpdaters = (ctx, particle, radius, zOpacity, colorStyles, transform) => {\n for (const updater of this._preDrawUpdaters) {\n if (updater.getColorStyles) {\n const { fill, stroke } = updater.getColorStyles(particle, ctx, radius, zOpacity);\n if (fill) {\n colorStyles.fill = fill;\n }\n if (stroke) {\n colorStyles.stroke = stroke;\n }\n }\n if (updater.getTransformValues) {\n const updaterTransform = updater.getTransformValues(particle);\n for (const key in updaterTransform) {\n setTransformValue(transform, updaterTransform, key);\n }\n }\n updater.beforeDraw?.(particle);\n }\n };\n _getPluginParticleColors = particle => {\n let fColor, sColor;\n for (const plugin of this._colorPlugins) {\n if (!fColor && plugin.particleFillColor) {\n fColor = (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_2__.rangeColorToHsl)(this._pluginManager, plugin.particleFillColor(particle));\n }\n if (!sColor && plugin.particleStrokeColor) {\n sColor = (0,_Utils_ColorUtils_js__WEBPACK_IMPORTED_MODULE_2__.rangeColorToHsl)(this._pluginManager, plugin.particleStrokeColor(particle));\n }\n if (fColor && sColor) {\n break;\n }\n }\n this._reusablePluginColors[fColorIndex] = fColor;\n this._reusablePluginColors[sColorIndex] = sColor;\n return this._reusablePluginColors;\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/RenderManager.js?\n}");
|
|
67
|
+
|
|
68
|
+
/***/ },
|
|
69
|
+
|
|
70
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Retina.js"
|
|
71
|
+
/*!*************************************************************************************************************************!*\
|
|
72
|
+
!*** ../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Retina.js ***!
|
|
73
|
+
\*************************************************************************************************************************/
|
|
74
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
75
|
+
|
|
76
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Retina: () => (/* binding */ Retina)\n/* harmony export */ });\n/* harmony import */ var _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils/Constants.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js\");\n/* harmony import */ var _Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Utils/MathUtils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/MathUtils.js\");\n\n\nclass Retina {\n container;\n pixelRatio;\n reduceFactor;\n constructor(container) {\n this.container = container;\n this.pixelRatio = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.defaultRatio;\n this.reduceFactor = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.defaultReduceFactor;\n }\n init() {\n const container = this.container, options = container.actualOptions;\n this.pixelRatio = options.detectRetina ? devicePixelRatio : _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.defaultRatio;\n this.reduceFactor = _Utils_Constants_js__WEBPACK_IMPORTED_MODULE_0__.defaultReduceFactor;\n const ratio = this.pixelRatio, canvas = container.canvas;\n if (canvas.element) {\n const element = canvas.element;\n canvas.size.width = element.offsetWidth * ratio;\n canvas.size.height = element.offsetHeight * ratio;\n }\n }\n initParticle(particle) {\n const options = particle.options, ratio = this.pixelRatio, moveOptions = options.move, moveDistance = moveOptions.distance, props = particle.retina;\n props.maxSpeed = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_1__.getRangeValue)(moveOptions.gravity.maxSpeed) * ratio;\n props.moveDrift = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_1__.getRangeValue)(moveOptions.drift) * ratio;\n props.moveSpeed = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_1__.getRangeValue)(moveOptions.speed) * ratio;\n props.sizeAnimationSpeed = (0,_Utils_MathUtils_js__WEBPACK_IMPORTED_MODULE_1__.getRangeValue)(options.size.animation.speed) * ratio;\n const maxDistance = props.maxDistance;\n maxDistance.horizontal = moveDistance.horizontal === undefined ? undefined : moveDistance.horizontal * ratio;\n maxDistance.vertical = moveDistance.vertical === undefined ? undefined : moveDistance.vertical * ratio;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Retina.js?\n}");
|
|
77
|
+
|
|
78
|
+
/***/ },
|
|
79
|
+
|
|
80
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/EventListeners.js"
|
|
81
|
+
/*!***************************************************************************************************************************************!*\
|
|
82
|
+
!*** ../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/EventListeners.js ***!
|
|
83
|
+
\***************************************************************************************************************************************/
|
|
84
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
85
|
+
|
|
86
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EventListeners: () => (/* binding */ EventListeners)\n/* harmony export */ });\n/* harmony import */ var _Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Utils/Utils.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Utils/Utils.js\");\n/* harmony import */ var _Constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Constants.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Constants.js\");\n\n\nclass EventListeners {\n container;\n _handlers;\n _resizeObserver;\n _resizeTimeout;\n constructor(container) {\n this.container = container;\n this._handlers = {\n visibilityChange: () => {\n this._handleVisibilityChange();\n },\n resize: () => {\n this._handleWindowResize();\n },\n };\n }\n addListeners() {\n this._manageListeners(true);\n }\n removeListeners() {\n this._manageListeners(false);\n }\n _handleVisibilityChange = () => {\n const container = this.container, options = container.actualOptions;\n if (!options.pauseOnBlur) {\n return;\n }\n if ((0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.safeDocument)().hidden) {\n container.pageHidden = true;\n container.pause();\n }\n else {\n container.pageHidden = false;\n if (container.animationStatus) {\n container.play(true);\n }\n else {\n container.draw(true);\n }\n }\n };\n _handleWindowResize = () => {\n if (this._resizeTimeout) {\n clearTimeout(this._resizeTimeout);\n delete this._resizeTimeout;\n }\n const handleResize = async () => {\n const canvas = this.container.canvas;\n await canvas.windowResize();\n };\n this._resizeTimeout = setTimeout(() => void handleResize(), this.container.actualOptions.resize.delay * _Constants_js__WEBPACK_IMPORTED_MODULE_1__.millisecondsToSeconds);\n };\n _manageListeners = add => {\n const handlers = this._handlers;\n this._manageResize(add);\n (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.manageListener)(document, _Constants_js__WEBPACK_IMPORTED_MODULE_1__.visibilityChangeEvent, handlers.visibilityChange, add, false);\n };\n _manageResize = add => {\n const handlers = this._handlers, container = this.container, options = container.actualOptions;\n if (!options.resize.enable) {\n return;\n }\n if (typeof ResizeObserver === \"undefined\") {\n (0,_Utils_Utils_js__WEBPACK_IMPORTED_MODULE_0__.manageListener)(globalThis, _Constants_js__WEBPACK_IMPORTED_MODULE_1__.resizeEvent, handlers.resize, add);\n return;\n }\n const canvasEl = container.canvas.element;\n if (this._resizeObserver && !add) {\n if (canvasEl) {\n this._resizeObserver.unobserve(canvasEl);\n }\n this._resizeObserver.disconnect();\n delete this._resizeObserver;\n }\n else if (!this._resizeObserver && add && canvasEl) {\n this._resizeObserver = new ResizeObserver((entries) => {\n const entry = entries.find(e => e.target === canvasEl);\n if (!entry) {\n return;\n }\n this._handleWindowResize();\n });\n this._resizeObserver.observe(canvasEl);\n }\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/EventListeners.js?\n}");
|
|
87
|
+
|
|
88
|
+
/***/ },
|
|
89
|
+
|
|
90
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/SpatialHashGrid.js"
|
|
91
|
+
/*!****************************************************************************************************************************************!*\
|
|
92
|
+
!*** ../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/SpatialHashGrid.js ***!
|
|
93
|
+
\****************************************************************************************************************************************/
|
|
94
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
95
|
+
|
|
96
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SpatialHashGrid: () => (/* binding */ SpatialHashGrid)\n/* harmony export */ });\n/* harmony import */ var _Ranges_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Ranges.js */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/Ranges.js\");\n\nclass SpatialHashGrid {\n _cellSize;\n _cells = new Map();\n _circlePool = [];\n _circlePoolIdx;\n _pendingCellSize;\n _rectanglePool = [];\n _rectanglePoolIdx;\n constructor(cellSize) {\n this._cellSize = cellSize;\n this._circlePoolIdx = 0;\n this._rectanglePoolIdx = 0;\n }\n clear() {\n this._cells.clear();\n const pendingCellSize = this._pendingCellSize;\n if (pendingCellSize) {\n this._cellSize = pendingCellSize;\n }\n this._pendingCellSize = undefined;\n }\n insert(particle) {\n const { x, y } = particle.getPosition(), key = this._cellKeyFromCoords(x, y);\n if (!this._cells.has(key)) {\n this._cells.set(key, []);\n }\n this._cells.get(key)?.push(particle);\n }\n query(range, check, out = []) {\n const bounds = this._getRangeBounds(range);\n if (!bounds) {\n return out;\n }\n const minCellX = Math.floor(bounds.minX / this._cellSize), maxCellX = Math.floor(bounds.maxX / this._cellSize), minCellY = Math.floor(bounds.minY / this._cellSize), maxCellY = Math.floor(bounds.maxY / this._cellSize);\n for (let cx = minCellX; cx <= maxCellX; cx++) {\n for (let cy = minCellY; cy <= maxCellY; cy++) {\n const key = `${cx}_${cy}`, cellParticles = this._cells.get(key);\n if (!cellParticles) {\n continue;\n }\n for (const p of cellParticles) {\n if (check && !check(p)) {\n continue;\n }\n if (range.contains(p.getPosition())) {\n out.push(p);\n }\n }\n }\n }\n return out;\n }\n queryCircle(position, radius, check, out = []) {\n const circle = this._acquireCircle(position.x, position.y, radius), result = this.query(circle, check, out);\n this._releaseShapes();\n return result;\n }\n queryRectangle(position, size, check, out = []) {\n const rect = this._acquireRectangle(position.x, position.y, size.width, size.height), result = this.query(rect, check, out);\n this._releaseShapes();\n return result;\n }\n setCellSize(cellSize) {\n this._pendingCellSize = cellSize;\n }\n _acquireCircle(x, y, r) {\n return (this._circlePool[this._circlePoolIdx++] ??= new _Ranges_js__WEBPACK_IMPORTED_MODULE_0__.Circle(x, y, r)).reset(x, y, r);\n }\n _acquireRectangle(x, y, w, h) {\n return (this._rectanglePool[this._rectanglePoolIdx++] ??= new _Ranges_js__WEBPACK_IMPORTED_MODULE_0__.Rectangle(x, y, w, h)).reset(x, y, w, h);\n }\n _cellKeyFromCoords(x, y) {\n const cellX = Math.floor(x / this._cellSize), cellY = Math.floor(y / this._cellSize);\n return `${cellX}_${cellY}`;\n }\n _getRangeBounds(range) {\n if (range instanceof _Ranges_js__WEBPACK_IMPORTED_MODULE_0__.Circle) {\n const r = range.radius, { x, y } = range.position;\n return {\n minX: x - r,\n maxX: x + r,\n minY: y - r,\n maxY: y + r,\n };\n }\n if (range instanceof _Ranges_js__WEBPACK_IMPORTED_MODULE_0__.Rectangle) {\n const { x, y } = range.position, { width, height } = range.size;\n return {\n minX: x,\n maxX: x + width,\n minY: y,\n maxY: y + height,\n };\n }\n return null;\n }\n _releaseShapes() {\n this._circlePoolIdx = 0;\n this._rectanglePoolIdx = 0;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/Core/Utils/SpatialHashGrid.js?\n}");
|
|
97
|
+
|
|
98
|
+
/***/ }
|
|
99
|
+
|
|
100
|
+
}]);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Author : Matteo Bruni
|
|
3
|
+
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
+
* Demo / Generator : https://particles.js.org/
|
|
5
|
+
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
+
* How to use? : Check the GitHub README
|
|
7
|
+
* v4.0.0-alpha.5
|
|
8
|
+
*/
|
|
9
|
+
"use strict";
|
|
10
|
+
/*
|
|
11
|
+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
+
* This devtool is neither made for production nor for readable output files.
|
|
13
|
+
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
+
* or disable the default devtool with "devtool: false".
|
|
16
|
+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
+
*/
|
|
18
|
+
(this["webpackChunk_tsparticles_preset_bubbles"] = this["webpackChunk_tsparticles_preset_bubbles"] || []).push([["vendors-node_modules_pnpm_tsparticles_plugin-emitters_4_0_0-beta_1_node_modules_tsparticles_p-168eb1"],{
|
|
19
|
+
|
|
20
|
+
/***/ "../../node_modules/.pnpm/@tsparticles+plugin-emitters@4.0.0-beta.1/node_modules/@tsparticles/plugin-emitters/browser/EmitterInstance.js"
|
|
21
|
+
/*!***********************************************************************************************************************************************!*\
|
|
22
|
+
!*** ../../node_modules/.pnpm/@tsparticles+plugin-emitters@4.0.0-beta.1/node_modules/@tsparticles/plugin-emitters/browser/EmitterInstance.js ***!
|
|
23
|
+
\***********************************************************************************************************************************************/
|
|
24
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
|
+
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EmitterInstance: () => (/* binding */ EmitterInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../node_modules/.pnpm/@tsparticles+engine@4.0.0-beta.1/node_modules/@tsparticles/engine/browser/index.js\");\n/* harmony import */ var _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Emitter.js */ \"../../node_modules/.pnpm/@tsparticles+plugin-emitters@4.0.0-beta.1/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/Emitter.js\");\n/* harmony import */ var _Options_Classes_EmitterSize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/EmitterSize.js */ \"../../node_modules/.pnpm/@tsparticles+plugin-emitters@4.0.0-beta.1/node_modules/@tsparticles/plugin-emitters/browser/Options/Classes/EmitterSize.js\");\n\n\n\nconst defaultLifeDelay = 0, minLifeCount = 0, defaultSpawnDelay = 0, defaultEmitDelay = 0, defaultLifeCount = -1, defaultColorAnimationFactor = 1, colorFactor = 3.6, defaultStrokeWidth = 1;\nfunction setParticlesOptionsFillColor(particlesOptions, color, opacity, enable) {\n particlesOptions.fill = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Fill();\n particlesOptions.fill.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(undefined, { value: color });\n particlesOptions.fill.enable = enable;\n particlesOptions.fill.opacity = opacity;\n}\nfunction setParticlesOptionsStrokeColor(particlesOptions, color, opacity, width) {\n particlesOptions.stroke = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Stroke();\n particlesOptions.stroke.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(undefined, { value: color });\n particlesOptions.stroke.opacity = opacity;\n particlesOptions.stroke.width = width;\n}\nclass EmitterInstance {\n fill;\n name;\n options;\n position;\n size;\n spawnFillColor;\n spawnFillEnabled;\n spawnFillOpacity;\n spawnStrokeColor;\n spawnStrokeOpacity;\n spawnStrokeWidth;\n _container;\n _currentDuration;\n _currentEmitDelay;\n _currentSpawnDelay;\n _duration;\n _emitDelay;\n _firstSpawn;\n _immortal;\n _initialPosition;\n _lifeCount;\n _mutationObserver;\n _particlesOptions;\n _paused;\n _pluginManager;\n _removeCallback;\n _resizeObserver;\n _shape;\n _size;\n _spawnDelay;\n _startParticlesAdded;\n constructor(pluginManager, container, removeCallback, options, position) {\n this._pluginManager = pluginManager;\n this._container = container;\n this._removeCallback = removeCallback;\n this._currentDuration = 0;\n this._currentEmitDelay = 0;\n this._currentSpawnDelay = 0;\n this._initialPosition = position;\n if (options instanceof _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter) {\n this.options = options;\n }\n else {\n this.options = new _Options_Classes_Emitter_js__WEBPACK_IMPORTED_MODULE_1__.Emitter();\n this.options.load(options);\n }\n this._spawnDelay = container.retina.reduceFactor\n ? ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.delay ?? defaultLifeDelay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds) /\n container.retina.reduceFactor\n : Infinity;\n this.position = this._initialPosition ?? this._calcPosition();\n this.name = this.options.name;\n this.fill = this.options.fill;\n this._firstSpawn = !this.options.life.wait;\n this._startParticlesAdded = false;\n const particlesOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, this.options.particles);\n particlesOptions.move ??= {};\n particlesOptions.move.direction ??= this.options.direction;\n if (this.options.spawn.fill?.color) {\n this.spawnFillColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this._pluginManager, this.options.spawn.fill.color);\n }\n if (this.options.spawn.stroke?.color) {\n this.spawnStrokeColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this._pluginManager, this.options.spawn.stroke.color);\n }\n this._paused = !this.options.autoPlay;\n this._particlesOptions = particlesOptions;\n this._size = this._calcSize();\n this.size = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getSize)(this._size, this._container.canvas.size);\n this._lifeCount = this.options.life.count ?? defaultLifeCount;\n this._immortal = this._lifeCount <= minLifeCount;\n if (this.options.domId) {\n const element = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.safeDocument)().getElementById(this.options.domId);\n if (element) {\n this._mutationObserver = new MutationObserver(() => {\n this.resize();\n });\n this._resizeObserver = new ResizeObserver(() => {\n this.resize();\n });\n this._mutationObserver.observe(element, {\n attributes: true,\n attributeFilter: [\"style\", \"width\", \"height\"],\n });\n this._resizeObserver.observe(element);\n }\n }\n const shapeOptions = this.options.shape, shapeGenerator = this._pluginManager.emitterShapeManager?.getShapeGenerator(shapeOptions.type);\n if (shapeGenerator) {\n this._shape = shapeGenerator.generate(this._container, this.position, this.size, this.fill, shapeOptions.options);\n }\n this._container.dispatchEvent(\"emitterCreated\", {\n emitter: this,\n });\n this.play();\n }\n externalPause() {\n this._paused = true;\n this.pause();\n }\n externalPlay() {\n this._paused = false;\n this.play();\n }\n async init() {\n await this._shape?.init();\n }\n pause() {\n if (this._paused) {\n return;\n }\n delete this._emitDelay;\n }\n play() {\n if (this._paused) {\n return;\n }\n if (!((this._lifeCount > minLifeCount || this._immortal || !this.options.life.count) &&\n (this._firstSpawn || this._currentSpawnDelay >= (this._spawnDelay ?? defaultSpawnDelay)))) {\n return;\n }\n const container = this._container;\n if (this._emitDelay === undefined) {\n const delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.delay);\n this._emitDelay = container.retina.reduceFactor\n ? (delay * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds) / container.retina.reduceFactor\n : Infinity;\n }\n if (this._lifeCount > minLifeCount || this._immortal) {\n this._prepareToDie();\n }\n }\n resize() {\n const initialPosition = this._initialPosition, container = this._container;\n this.position =\n initialPosition && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isPointInside)(initialPosition, container.canvas.size, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Vector.origin)\n ? initialPosition\n : this._calcPosition();\n this._size = this._calcSize();\n this.size = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getSize)(this._size, container.canvas.size);\n this._shape?.resize(this.position, this.size);\n }\n update(delta) {\n if (this._paused) {\n return;\n }\n const container = this._container;\n if (this._firstSpawn) {\n this._firstSpawn = false;\n this._currentSpawnDelay = this._spawnDelay ?? defaultSpawnDelay;\n this._currentEmitDelay = this._emitDelay ?? defaultEmitDelay;\n }\n if (!this._startParticlesAdded) {\n this._startParticlesAdded = true;\n this._emitParticles(this.options.startCount);\n }\n if (this._duration !== undefined) {\n this._currentDuration += delta.value;\n if (this._currentDuration >= this._duration) {\n this.pause();\n if (this._spawnDelay !== undefined) {\n delete this._spawnDelay;\n }\n if (!this._immortal) {\n this._lifeCount--;\n }\n if (this._lifeCount > minLifeCount || this._immortal) {\n this.position = this._calcPosition();\n this._shape?.resize(this.position, this.size);\n this._spawnDelay = container.retina.reduceFactor\n ? ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.delay ?? defaultLifeDelay) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds) /\n container.retina.reduceFactor\n : Infinity;\n }\n else {\n this._destroy();\n }\n this._currentDuration -= this._duration;\n delete this._duration;\n }\n }\n if (this._spawnDelay !== undefined) {\n this._currentSpawnDelay += delta.value;\n if (this._currentSpawnDelay >= this._spawnDelay) {\n this._container.dispatchEvent(\"emitterPlay\");\n this.play();\n this._currentSpawnDelay -= this._spawnDelay;\n delete this._spawnDelay;\n }\n }\n if (this._emitDelay !== undefined) {\n this._currentEmitDelay += delta.value;\n if (this._currentEmitDelay >= this._emitDelay) {\n this._emit();\n this._currentEmitDelay -= this._emitDelay;\n }\n }\n }\n _calcPosition() {\n const container = this._container;\n if (this.options.domId) {\n const element = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.safeDocument)().getElementById(this.options.domId);\n if (element) {\n const elRect = element.getBoundingClientRect(), pxRatio = container.retina.pixelRatio;\n return {\n x: (elRect.x + elRect.width * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half) * pxRatio,\n y: (elRect.y + elRect.height * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half) * pxRatio,\n };\n }\n }\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.calcPositionOrRandomFromSizeRanged)({\n size: container.canvas.size,\n position: this.options.position,\n });\n }\n _calcSize() {\n const container = this._container;\n if (this.options.domId) {\n const element = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.safeDocument)().getElementById(this.options.domId);\n if (element) {\n const elRect = element.getBoundingClientRect();\n return {\n width: elRect.width * container.retina.pixelRatio,\n height: elRect.height * container.retina.pixelRatio,\n mode: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.PixelMode.precise,\n };\n }\n }\n return (this.options.size ??\n (() => {\n const size = new _Options_Classes_EmitterSize_js__WEBPACK_IMPORTED_MODULE_2__.EmitterSize();\n size.load({\n height: 0,\n mode: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.PixelMode.percent,\n width: 0,\n });\n return size;\n })());\n }\n _destroy = () => {\n this._mutationObserver?.disconnect();\n this._mutationObserver = undefined;\n this._resizeObserver?.disconnect();\n this._resizeObserver = undefined;\n this._removeCallback(this);\n this._container.dispatchEvent(\"emitterDestroyed\", {\n emitter: this,\n });\n };\n _emit() {\n if (this._paused) {\n return;\n }\n const quantity = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.quantity);\n this._emitParticles(quantity);\n }\n _emitParticles(quantity) {\n const singleParticlesOptions = ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(this._particlesOptions) ??\n {}), fillHslAnimation = this.options.spawn.fill?.color.animation, fillEnabled = this.options.spawn.fill?.enable ?? !!this.options.spawn.fill?.color, fillOpacity = this.options.spawn.fill?.opacity === undefined\n ? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.defaultOpacity\n : (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.spawn.fill.opacity), strokeHslAnimation = this.options.spawn.stroke?.color?.animation, strokeOpacity = this.options.spawn.stroke?.opacity === undefined\n ? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.defaultOpacity\n : (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.spawn.stroke.opacity), strokeWidth = this.options.spawn.stroke?.width === undefined\n ? defaultStrokeWidth\n : (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.spawn.stroke.width), reduceFactor = this._container.retina.reduceFactor, needsFillColorAnimation = !!fillHslAnimation, needsStrokeColorAnimation = !!strokeHslAnimation, needsShapeData = !!this._shape, needsColorAnimation = needsFillColorAnimation || needsStrokeColorAnimation, needsCopy = needsColorAnimation || needsShapeData, maxValues = needsColorAnimation ? { h: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.hMax, s: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.sMax, l: _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.lMax } : null, shapeOptions = this.options.shape;\n for (let i = 0; i < quantity * reduceFactor; i++) {\n const particlesOptions = needsCopy\n ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, singleParticlesOptions)\n : singleParticlesOptions;\n this.spawnFillOpacity = fillOpacity;\n this.spawnFillEnabled = fillEnabled;\n this.spawnStrokeOpacity = strokeOpacity;\n this.spawnStrokeWidth = strokeWidth;\n if (this.spawnFillColor) {\n if (fillHslAnimation && maxValues) {\n this.spawnFillColor.h = this._setColorAnimation(fillHslAnimation.h, this.spawnFillColor.h, maxValues.h, colorFactor);\n this.spawnFillColor.s = this._setColorAnimation(fillHslAnimation.s, this.spawnFillColor.s, maxValues.s);\n this.spawnFillColor.l = this._setColorAnimation(fillHslAnimation.l, this.spawnFillColor.l, maxValues.l);\n }\n setParticlesOptionsFillColor(particlesOptions, this.spawnFillColor, this.spawnFillOpacity, this.spawnFillEnabled);\n }\n if (this.spawnStrokeColor) {\n if (strokeHslAnimation && maxValues) {\n this.spawnStrokeColor.h = this._setColorAnimation(strokeHslAnimation.h, this.spawnStrokeColor.h, maxValues.h, colorFactor);\n this.spawnStrokeColor.s = this._setColorAnimation(strokeHslAnimation.s, this.spawnStrokeColor.s, maxValues.s);\n this.spawnStrokeColor.l = this._setColorAnimation(strokeHslAnimation.l, this.spawnStrokeColor.l, maxValues.l);\n }\n setParticlesOptionsStrokeColor(particlesOptions, this.spawnStrokeColor, this.spawnStrokeOpacity, this.spawnStrokeWidth);\n }\n let position = this.position;\n if (this._shape) {\n const shapePosData = this._shape.randomPosition();\n if (shapePosData) {\n position = shapePosData.position;\n const replaceData = shapeOptions.replace;\n if (replaceData.color && shapePosData.color) {\n setParticlesOptionsFillColor(particlesOptions, shapePosData.color, replaceData.opacity ? (shapePosData.opacity ?? _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.defaultOpacity) : _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.defaultOpacity, true);\n }\n }\n else {\n position = null;\n }\n }\n if (position) {\n this._container.particles.addParticle(position, particlesOptions);\n }\n }\n }\n _prepareToDie = () => {\n if (this._paused) {\n return;\n }\n const duration = this.options.life.duration !== undefined ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.life.duration) : undefined, minDuration = 0, minLifeCount = 0;\n if ((this._lifeCount > minLifeCount || this._immortal) && duration !== undefined && duration > minDuration) {\n this._duration = duration * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n }\n };\n _setColorAnimation = (animation, initValue, maxValue, factor = defaultColorAnimationFactor) => {\n const container = this._container;\n if (!animation.enable) {\n return initValue;\n }\n const colorOffset = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.randomInRangeValue)(animation.offset), delay = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(this.options.rate.delay), emitFactor = container.retina.reduceFactor\n ? (delay * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds) / container.retina.reduceFactor\n : Infinity, colorSpeed = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(animation.speed);\n return (initValue + (colorSpeed * container.fpsLimit) / emitFactor + colorOffset * factor) % maxValue;\n };\n}\n\n\n//# sourceURL=webpack://@tsparticles/preset-bubbles/../../node_modules/.pnpm/@tsparticles+plugin-emitters@4.0.0-beta.1/node_modules/@tsparticles/plugin-emitters/browser/EmitterInstance.js?\n}");
|
|
27
|
+
|
|
28
|
+
/***/ }
|
|
29
|
+
|
|
30
|
+
}]);
|