UNPKG

3 kBJavaScriptView Raw
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 * v3.3.0
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_fireworks"] = this["webpackChunk_tsparticles_fireworks"] || []).push([["updaters_size_dist_browser_SizeUpdater_js"],{
19
20/***/ "../../updaters/size/dist/browser/SizeUpdater.js":
21/*!*******************************************************!*\
22 !*** ../../updaters/size/dist/browser/SizeUpdater.js ***!
23 \*******************************************************/
24/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
25
26eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SizeUpdater: () => (/* binding */ SizeUpdater)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"../../engine/dist/browser/index.js\");\n\nconst minLoops = 0;\nclass SizeUpdater {\n init(particle) {\n const container = particle.container,\n sizeOptions = particle.options.size,\n sizeAnimation = sizeOptions.animation;\n if (sizeAnimation.enable) {\n particle.size.velocity = (particle.retina.sizeAnimationSpeed ?? container.retina.sizeAnimationSpeed) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.percentDenominator * container.retina.reduceFactor;\n if (!sizeAnimation.sync) {\n particle.size.velocity *= (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)();\n }\n }\n }\n isEnabled(particle) {\n return !particle.destroyed && !particle.spawning && particle.size.enable && ((particle.size.maxLoops ?? minLoops) <= minLoops || (particle.size.maxLoops ?? minLoops) > minLoops && (particle.size.loops ?? minLoops) < (particle.size.maxLoops ?? minLoops));\n }\n reset(particle) {\n particle.size.loops = minLoops;\n }\n update(particle, delta) {\n if (!this.isEnabled(particle)) {\n return;\n }\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.updateAnimation)(particle, particle.size, true, particle.options.size.animation.destroy, delta);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/fireworks/../../updaters/size/dist/browser/SizeUpdater.js?");
27
28/***/ })
29
30}]);
\No newline at end of file