@tsparticles/interaction-light 3.9.1 → 4.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/271.min.js +2 -0
- package/271.min.js.LICENSE.txt +1 -0
- package/547.min.js +2 -0
- package/547.min.js.LICENSE.txt +1 -0
- package/browser/ExternalLighter.js +1 -3
- package/browser/ParticlesLighter.js +1 -1
- package/browser/Utils.js +11 -7
- package/browser/index.js +12 -14
- package/cjs/ExternalLighter.js +9 -15
- package/cjs/Options/Classes/Light.js +7 -11
- package/cjs/Options/Classes/LightArea.js +5 -9
- package/cjs/Options/Classes/LightGradient.js +7 -11
- package/cjs/Options/Classes/LightOptions.js +1 -2
- package/cjs/Options/Classes/LightShadow.js +5 -9
- package/cjs/Options/Interfaces/ILight.js +1 -2
- package/cjs/Options/Interfaces/ILightArea.js +1 -2
- package/cjs/Options/Interfaces/ILightGradient.js +1 -2
- package/cjs/Options/Interfaces/ILightShadow.js +1 -2
- package/cjs/ParticlesLighter.js +7 -11
- package/cjs/Types.js +1 -2
- package/cjs/Utils.js +15 -16
- package/cjs/index.js +16 -35
- package/dist_browser_ExternalLighter_js.js +40 -0
- package/dist_browser_ParticlesLighter_js.js +40 -0
- package/esm/ExternalLighter.js +1 -3
- package/esm/ParticlesLighter.js +1 -1
- package/esm/Utils.js +11 -7
- package/esm/index.js +12 -14
- package/package.json +4 -3
- package/report.html +5 -4
- package/tsparticles.interaction.light.js +225 -66
- package/tsparticles.interaction.light.min.js +1 -1
- package/tsparticles.interaction.light.min.js.LICENSE.txt +1 -1
- package/types/index.d.ts +5 -5
- package/umd/ExternalLighter.js +1 -3
- package/umd/ParticlesLighter.js +1 -1
- package/umd/Utils.js +11 -7
- package/umd/index.js +36 -15
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
*
|
|
7
|
+
* v4.0.0-alpha.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,95 +28,65 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
-
/***/ "./dist/browser/
|
|
32
|
-
/*!*****************************************!*\
|
|
33
|
-
!*** ./dist/browser/ExternalLighter.js ***!
|
|
34
|
-
\*****************************************/
|
|
35
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
36
|
-
|
|
37
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ExternalLighter: () => (/* binding */ ExternalLighter)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n/* harmony import */ var _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Light.js */ \"./dist/browser/Options/Classes/Light.js\");\n\n\n\nclass ExternalLighter extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n constructor(container, engine) {\n super(container);\n this._engine = engine;\n }\n clear() {}\n init() {}\n interact() {\n const container = this.container,\n options = container.actualOptions,\n interactivity = container.interactivity;\n if (!options.interactivity.events.onHover.enable || interactivity.status !== \"pointermove\") {\n return;\n }\n const mousePos = interactivity.mouse.position;\n if (!mousePos) {\n return;\n }\n container.canvas.draw(ctx => {\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawLight)(container, ctx, mousePos);\n });\n }\n isEnabled(particle) {\n const container = this.container,\n mouse = container.interactivity.mouse,\n interactivity = particle?.interactivity ?? container.actualOptions.interactivity,\n events = interactivity.events;\n if (!(events.onHover.enable && mouse.position)) {\n return false;\n }\n const res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(_Utils_js__WEBPACK_IMPORTED_MODULE_1__.lightMode, events.onHover.mode);\n if (res && interactivity.modes.light) {\n const lightGradient = interactivity.modes.light.area.gradient;\n container.canvas.mouseLight = {\n start: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(this._engine, lightGradient.start),\n stop: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(this._engine, lightGradient.stop)\n };\n }\n return res;\n }\n loadModeOptions(options, ...sources) {\n if (!options.light) {\n options.light = new _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_2__.Light();\n }\n for (const source of sources) {\n options.light.load(source?.light);\n }\n }\n reset() {}\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/ExternalLighter.js?\n}");
|
|
38
|
-
|
|
39
|
-
/***/ }),
|
|
40
|
-
|
|
41
|
-
/***/ "./dist/browser/Options/Classes/Light.js":
|
|
31
|
+
/***/ "./dist/browser/Options/Classes/Light.js"
|
|
42
32
|
/*!***********************************************!*\
|
|
43
33
|
!*** ./dist/browser/Options/Classes/Light.js ***!
|
|
44
34
|
\***********************************************/
|
|
45
|
-
|
|
35
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
36
|
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* binding */ Light)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var
|
|
37
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* binding */ Light)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _LightArea_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _LightShadow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\n\n\n\nclass Light {\n constructor() {\n this.area = new _LightArea_js__WEBPACK_IMPORTED_MODULE_1__.LightArea();\n this.shadow = new _LightShadow_js__WEBPACK_IMPORTED_MODULE_2__.LightShadow();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.area.load(data.area);\n this.shadow.load(data.shadow);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/Light.js?\n}");
|
|
48
38
|
|
|
49
|
-
/***/ }
|
|
39
|
+
/***/ },
|
|
50
40
|
|
|
51
|
-
/***/ "./dist/browser/Options/Classes/LightArea.js"
|
|
41
|
+
/***/ "./dist/browser/Options/Classes/LightArea.js"
|
|
52
42
|
/*!***************************************************!*\
|
|
53
43
|
!*** ./dist/browser/Options/Classes/LightArea.js ***!
|
|
54
44
|
\***************************************************/
|
|
55
|
-
|
|
45
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
46
|
|
|
57
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightArea: () => (/* binding */ LightArea)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var
|
|
47
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightArea: () => (/* binding */ LightArea)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _LightGradient_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n\n\nclass LightArea {\n constructor() {\n this.gradient = new _LightGradient_js__WEBPACK_IMPORTED_MODULE_1__.LightGradient();\n this.radius = 1000;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.gradient.load(data.gradient);\n if (data.radius !== undefined) {\n this.radius = data.radius;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightArea.js?\n}");
|
|
58
48
|
|
|
59
|
-
/***/ }
|
|
49
|
+
/***/ },
|
|
60
50
|
|
|
61
|
-
/***/ "./dist/browser/Options/Classes/LightGradient.js"
|
|
51
|
+
/***/ "./dist/browser/Options/Classes/LightGradient.js"
|
|
62
52
|
/*!*******************************************************!*\
|
|
63
53
|
!*** ./dist/browser/Options/Classes/LightGradient.js ***!
|
|
64
54
|
\*******************************************************/
|
|
65
|
-
|
|
55
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
66
56
|
|
|
67
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightGradient: () => (/* binding */ LightGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightGradient: () => (/* binding */ LightGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass LightGradient {\n constructor() {\n this.start = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.stop = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.start.value = \"#ffffff\";\n this.stop.value = \"#000000\";\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.start = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.start, data.start);\n this.stop = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.stop, data.stop);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightGradient.js?\n}");
|
|
68
58
|
|
|
69
|
-
/***/ }
|
|
59
|
+
/***/ },
|
|
70
60
|
|
|
71
|
-
/***/ "./dist/browser/Options/Classes/LightShadow.js"
|
|
61
|
+
/***/ "./dist/browser/Options/Classes/LightShadow.js"
|
|
72
62
|
/*!*****************************************************!*\
|
|
73
63
|
!*** ./dist/browser/Options/Classes/LightShadow.js ***!
|
|
74
64
|
\*****************************************************/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightShadow: () => (/* binding */ LightShadow)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass LightShadow {\n constructor() {\n this.color = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.color.value = \"#000000\";\n this.length = 2000;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n if (data.length !== undefined) {\n this.length = data.length;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightShadow.js?\n}");
|
|
78
|
-
|
|
79
|
-
/***/ }),
|
|
80
|
-
|
|
81
|
-
/***/ "./dist/browser/ParticlesLighter.js":
|
|
82
|
-
/*!******************************************!*\
|
|
83
|
-
!*** ./dist/browser/ParticlesLighter.js ***!
|
|
84
|
-
\******************************************/
|
|
85
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
86
|
-
|
|
87
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ParticlesLighter: () => (/* binding */ ParticlesLighter)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\nclass ParticlesLighter extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ParticlesInteractorBase {\n constructor(container, engine) {\n super(container);\n this._engine = engine;\n }\n clear() {}\n init() {}\n interact(particle) {\n const container = this.container,\n options = container.actualOptions,\n interactivity = container.interactivity;\n if (!options.interactivity.events.onHover.enable || interactivity.status !== \"pointermove\") {\n return;\n }\n const mousePos = interactivity.mouse.position;\n if (!mousePos) {\n return;\n }\n container.canvas.draw(ctx => {\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawParticleShadow)(container, ctx, particle, mousePos);\n });\n }\n isEnabled(particle) {\n const container = this.container,\n interactivity = particle.interactivity ?? container.actualOptions.interactivity,\n mouse = container.interactivity.mouse,\n events = interactivity.events;\n if (!(events.onHover.enable && mouse.position)) {\n return false;\n }\n const res = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(_Utils_js__WEBPACK_IMPORTED_MODULE_1__.lightMode, events.onHover.mode);\n if (res && interactivity.modes.light) {\n const shadowOptions = interactivity.modes.light.shadow;\n particle.lightShadow = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(this._engine, shadowOptions.color);\n }\n return res;\n }\n reset() {}\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/ParticlesLighter.js?\n}");
|
|
65
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
88
66
|
|
|
89
|
-
|
|
67
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightShadow: () => (/* binding */ LightShadow)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass LightShadow {\n constructor() {\n this.color = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.color.value = \"#000000\";\n this.length = 2000;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n if (data.length !== undefined) {\n this.length = data.length;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightShadow.js?\n}");
|
|
90
68
|
|
|
91
|
-
/***/
|
|
92
|
-
/*!*******************************!*\
|
|
93
|
-
!*** ./dist/browser/Utils.js ***!
|
|
94
|
-
\*******************************/
|
|
95
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
96
|
-
|
|
97
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawLight: () => (/* binding */ drawLight),\n/* harmony export */ drawParticleShadow: () => (/* binding */ drawParticleShadow),\n/* harmony export */ lightMode: () => (/* binding */ lightMode)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst gradientPos = {\n max: 1,\n min: 0\n },\n half = 0.5,\n double = 2,\n halfPI = Math.PI * half,\n doublePI = Math.PI * double,\n quarter = 0.25,\n quarterPI = Math.PI * quarter,\n arcStart = 0;\nconst lightMode = \"light\";\nfunction drawLight(container, context, mousePos) {\n const lightOptions = container.actualOptions.interactivity.modes.light?.area;\n if (!lightOptions) {\n return;\n }\n context.beginPath();\n context.arc(mousePos.x, mousePos.y, lightOptions.radius, arcStart, doublePI);\n const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius);\n const gradientRgb = container.canvas.mouseLight;\n if (!gradientRgb?.start || !gradientRgb.stop) {\n return;\n }\n gradientAmbientLight.addColorStop(gradientPos.min, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(gradientRgb.start));\n gradientAmbientLight.addColorStop(gradientPos.max, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(gradientRgb.stop));\n context.fillStyle = gradientAmbientLight;\n context.fill();\n}\nfunction drawParticleShadow(container, context, particle, mousePos) {\n const pos = particle.getPosition(),\n shadowOptions = container.actualOptions.interactivity.modes.light?.shadow;\n if (!shadowOptions) {\n return;\n }\n const shadowRgb = particle.lightShadow;\n if (!shadowRgb) {\n return;\n }\n const radius = particle.getRadius(),\n sides = particle.sides,\n full = doublePI / sides,\n angle = -particle.rotation + quarterPI,\n factor = 1,\n dots = [];\n for (let i = 0; i < sides; i++) {\n dots.push({\n x: pos.x + radius * Math.sin(angle + full * i) * factor,\n y: pos.y + radius * Math.cos(angle + full * i) * factor\n });\n }\n const points = [],\n shadowLength = shadowOptions.length;\n for (const dot of dots) {\n const dotAngle = Math.atan2(mousePos.y - dot.y, mousePos.x - dot.x),\n end = {\n x: dot.x + shadowLength * Math.sin(-dotAngle - halfPI),\n y: dot.y + shadowLength * Math.cos(-dotAngle - halfPI)\n };\n points.push({\n end: end,\n start: dot\n });\n }\n const shadowColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getStyleFromRgb)(shadowRgb),\n lastOffset = 1,\n firstPos = 0,\n last = points.length - lastOffset;\n for (let i = last, n = 0; i >= firstPos; n = i--) {\n context.beginPath();\n context.moveTo(points[i].start.x, points[i].start.y);\n context.lineTo(points[n].start.x, points[n].start.y);\n context.lineTo(points[n].end.x, points[n].end.y);\n context.lineTo(points[i].end.x, points[i].end.y);\n context.fillStyle = shadowColor;\n context.fill();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Utils.js?\n}");
|
|
98
|
-
|
|
99
|
-
/***/ }),
|
|
69
|
+
/***/ },
|
|
100
70
|
|
|
101
|
-
/***/ "./dist/browser/index.js"
|
|
71
|
+
/***/ "./dist/browser/index.js"
|
|
102
72
|
/*!*******************************!*\
|
|
103
73
|
!*** ./dist/browser/index.js ***!
|
|
104
74
|
\*******************************/
|
|
105
|
-
|
|
75
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
106
76
|
|
|
107
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* reexport safe */
|
|
77
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* reexport safe */ _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_0__.Light),\n/* harmony export */ LightArea: () => (/* reexport safe */ _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_1__.LightArea),\n/* harmony export */ LightGradient: () => (/* reexport safe */ _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_2__.LightGradient),\n/* harmony export */ LightShadow: () => (/* reexport safe */ _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_3__.LightShadow),\n/* harmony export */ loadLightInteraction: () => (/* binding */ loadLightInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Light.js */ \"./dist/browser/Options/Classes/Light.js\");\n/* harmony import */ var _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n/* harmony import */ var _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\nfunction loadLightInteraction(engine) {\n engine.checkVersion(\"4.0.0-alpha.0\");\n engine.register(e => {\n e.addInteractor(\"externalLight\", async container => {\n const {\n ExternalLighter\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExternalLighter_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExternalLighter.js */ \"./dist/browser/ExternalLighter.js\"));\n return new ExternalLighter(container, engine);\n });\n e.addInteractor(\"particlesLight\", async container => {\n const {\n ParticlesLighter\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_ParticlesLighter_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ParticlesLighter.js */ \"./dist/browser/ParticlesLighter.js\"));\n return new ParticlesLighter(container, engine);\n });\n });\n}\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/index.js?\n}");
|
|
108
78
|
|
|
109
|
-
/***/ }
|
|
79
|
+
/***/ },
|
|
110
80
|
|
|
111
|
-
/***/ "@tsparticles/engine"
|
|
81
|
+
/***/ "@tsparticles/engine"
|
|
112
82
|
/*!*********************************************************************************************************************************!*\
|
|
113
83
|
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
114
84
|
\*********************************************************************************************************************************/
|
|
115
|
-
|
|
85
|
+
(module) {
|
|
116
86
|
|
|
117
87
|
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
118
88
|
|
|
119
|
-
/***/ }
|
|
89
|
+
/***/ }
|
|
120
90
|
|
|
121
91
|
/******/ });
|
|
122
92
|
/************************************************************************/
|
|
@@ -130,6 +100,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
130
100
|
/******/ if (cachedModule !== undefined) {
|
|
131
101
|
/******/ return cachedModule.exports;
|
|
132
102
|
/******/ }
|
|
103
|
+
/******/ // Check if module exists (development only)
|
|
104
|
+
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
105
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
106
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
107
|
+
/******/ throw e;
|
|
108
|
+
/******/ }
|
|
133
109
|
/******/ // Create a new module (and put it into the cache)
|
|
134
110
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
135
111
|
/******/ // no module.id needed
|
|
@@ -144,19 +120,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
144
120
|
/******/ return module.exports;
|
|
145
121
|
/******/ }
|
|
146
122
|
/******/
|
|
147
|
-
|
|
148
|
-
/******/
|
|
149
|
-
/******/ (() => {
|
|
150
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
151
|
-
/******/ __webpack_require__.n = (module) => {
|
|
152
|
-
/******/ var getter = module && module.__esModule ?
|
|
153
|
-
/******/ () => (module['default']) :
|
|
154
|
-
/******/ () => (module);
|
|
155
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
|
156
|
-
/******/ return getter;
|
|
157
|
-
/******/ };
|
|
158
|
-
/******/ })();
|
|
123
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
124
|
+
/******/ __webpack_require__.m = __webpack_modules__;
|
|
159
125
|
/******/
|
|
126
|
+
/************************************************************************/
|
|
160
127
|
/******/ /* webpack/runtime/define property getters */
|
|
161
128
|
/******/ (() => {
|
|
162
129
|
/******/ // define getter functions for harmony exports
|
|
@@ -169,11 +136,90 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
169
136
|
/******/ };
|
|
170
137
|
/******/ })();
|
|
171
138
|
/******/
|
|
139
|
+
/******/ /* webpack/runtime/ensure chunk */
|
|
140
|
+
/******/ (() => {
|
|
141
|
+
/******/ __webpack_require__.f = {};
|
|
142
|
+
/******/ // This file contains only the entry chunk.
|
|
143
|
+
/******/ // The chunk loading function for additional chunks
|
|
144
|
+
/******/ __webpack_require__.e = (chunkId) => {
|
|
145
|
+
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
146
|
+
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
147
|
+
/******/ return promises;
|
|
148
|
+
/******/ }, []));
|
|
149
|
+
/******/ };
|
|
150
|
+
/******/ })();
|
|
151
|
+
/******/
|
|
152
|
+
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
153
|
+
/******/ (() => {
|
|
154
|
+
/******/ // This function allow to reference async chunks
|
|
155
|
+
/******/ __webpack_require__.u = (chunkId) => {
|
|
156
|
+
/******/ // return url for filenames based on template
|
|
157
|
+
/******/ return "" + chunkId + ".js";
|
|
158
|
+
/******/ };
|
|
159
|
+
/******/ })();
|
|
160
|
+
/******/
|
|
161
|
+
/******/ /* webpack/runtime/global */
|
|
162
|
+
/******/ (() => {
|
|
163
|
+
/******/ __webpack_require__.g = (function() {
|
|
164
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
165
|
+
/******/ try {
|
|
166
|
+
/******/ return this || new Function('return this')();
|
|
167
|
+
/******/ } catch (e) {
|
|
168
|
+
/******/ if (typeof window === 'object') return window;
|
|
169
|
+
/******/ }
|
|
170
|
+
/******/ })();
|
|
171
|
+
/******/ })();
|
|
172
|
+
/******/
|
|
172
173
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
173
174
|
/******/ (() => {
|
|
174
175
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
175
176
|
/******/ })();
|
|
176
177
|
/******/
|
|
178
|
+
/******/ /* webpack/runtime/load script */
|
|
179
|
+
/******/ (() => {
|
|
180
|
+
/******/ var inProgress = {};
|
|
181
|
+
/******/ var dataWebpackPrefix = "@tsparticles/interaction-light:";
|
|
182
|
+
/******/ // loadScript function to load a script via script tag
|
|
183
|
+
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
184
|
+
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
185
|
+
/******/ var script, needAttach;
|
|
186
|
+
/******/ if(key !== undefined) {
|
|
187
|
+
/******/ var scripts = document.getElementsByTagName("script");
|
|
188
|
+
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
189
|
+
/******/ var s = scripts[i];
|
|
190
|
+
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
191
|
+
/******/ }
|
|
192
|
+
/******/ }
|
|
193
|
+
/******/ if(!script) {
|
|
194
|
+
/******/ needAttach = true;
|
|
195
|
+
/******/ script = document.createElement('script');
|
|
196
|
+
/******/
|
|
197
|
+
/******/ script.charset = 'utf-8';
|
|
198
|
+
/******/ if (__webpack_require__.nc) {
|
|
199
|
+
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
200
|
+
/******/ }
|
|
201
|
+
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
202
|
+
/******/
|
|
203
|
+
/******/ script.src = url;
|
|
204
|
+
/******/ }
|
|
205
|
+
/******/ inProgress[url] = [done];
|
|
206
|
+
/******/ var onScriptComplete = (prev, event) => {
|
|
207
|
+
/******/ // avoid mem leaks in IE.
|
|
208
|
+
/******/ script.onerror = script.onload = null;
|
|
209
|
+
/******/ clearTimeout(timeout);
|
|
210
|
+
/******/ var doneFns = inProgress[url];
|
|
211
|
+
/******/ delete inProgress[url];
|
|
212
|
+
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
213
|
+
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
214
|
+
/******/ if(prev) return prev(event);
|
|
215
|
+
/******/ }
|
|
216
|
+
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
217
|
+
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
218
|
+
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
219
|
+
/******/ needAttach && document.head.appendChild(script);
|
|
220
|
+
/******/ };
|
|
221
|
+
/******/ })();
|
|
222
|
+
/******/
|
|
177
223
|
/******/ /* webpack/runtime/make namespace object */
|
|
178
224
|
/******/ (() => {
|
|
179
225
|
/******/ // define __esModule on exports
|
|
@@ -185,6 +231,119 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
185
231
|
/******/ };
|
|
186
232
|
/******/ })();
|
|
187
233
|
/******/
|
|
234
|
+
/******/ /* webpack/runtime/publicPath */
|
|
235
|
+
/******/ (() => {
|
|
236
|
+
/******/ var scriptUrl;
|
|
237
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
238
|
+
/******/ var document = __webpack_require__.g.document;
|
|
239
|
+
/******/ if (!scriptUrl && document) {
|
|
240
|
+
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
241
|
+
/******/ scriptUrl = document.currentScript.src;
|
|
242
|
+
/******/ if (!scriptUrl) {
|
|
243
|
+
/******/ var scripts = document.getElementsByTagName("script");
|
|
244
|
+
/******/ if(scripts.length) {
|
|
245
|
+
/******/ var i = scripts.length - 1;
|
|
246
|
+
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
|
|
247
|
+
/******/ }
|
|
248
|
+
/******/ }
|
|
249
|
+
/******/ }
|
|
250
|
+
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
251
|
+
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
252
|
+
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
253
|
+
/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
254
|
+
/******/ __webpack_require__.p = scriptUrl;
|
|
255
|
+
/******/ })();
|
|
256
|
+
/******/
|
|
257
|
+
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
258
|
+
/******/ (() => {
|
|
259
|
+
/******/ // no baseURI
|
|
260
|
+
/******/
|
|
261
|
+
/******/ // object to store loaded and loading chunks
|
|
262
|
+
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
263
|
+
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
264
|
+
/******/ var installedChunks = {
|
|
265
|
+
/******/ "tsparticles.interaction.light": 0
|
|
266
|
+
/******/ };
|
|
267
|
+
/******/
|
|
268
|
+
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
269
|
+
/******/ // JSONP chunk loading for javascript
|
|
270
|
+
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
271
|
+
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
272
|
+
/******/
|
|
273
|
+
/******/ // a Promise means "currently loading".
|
|
274
|
+
/******/ if(installedChunkData) {
|
|
275
|
+
/******/ promises.push(installedChunkData[2]);
|
|
276
|
+
/******/ } else {
|
|
277
|
+
/******/ if(true) { // all chunks have JS
|
|
278
|
+
/******/ // setup Promise in chunk cache
|
|
279
|
+
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
280
|
+
/******/ promises.push(installedChunkData[2] = promise);
|
|
281
|
+
/******/
|
|
282
|
+
/******/ // start chunk loading
|
|
283
|
+
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
284
|
+
/******/ // create error before stack unwound to get useful stacktrace later
|
|
285
|
+
/******/ var error = new Error();
|
|
286
|
+
/******/ var loadingEnded = (event) => {
|
|
287
|
+
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
288
|
+
/******/ installedChunkData = installedChunks[chunkId];
|
|
289
|
+
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
290
|
+
/******/ if(installedChunkData) {
|
|
291
|
+
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
292
|
+
/******/ var realSrc = event && event.target && event.target.src;
|
|
293
|
+
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
294
|
+
/******/ error.name = 'ChunkLoadError';
|
|
295
|
+
/******/ error.type = errorType;
|
|
296
|
+
/******/ error.request = realSrc;
|
|
297
|
+
/******/ installedChunkData[1](error);
|
|
298
|
+
/******/ }
|
|
299
|
+
/******/ }
|
|
300
|
+
/******/ };
|
|
301
|
+
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
302
|
+
/******/ }
|
|
303
|
+
/******/ }
|
|
304
|
+
/******/ }
|
|
305
|
+
/******/ };
|
|
306
|
+
/******/
|
|
307
|
+
/******/ // no prefetching
|
|
308
|
+
/******/
|
|
309
|
+
/******/ // no preloaded
|
|
310
|
+
/******/
|
|
311
|
+
/******/ // no HMR
|
|
312
|
+
/******/
|
|
313
|
+
/******/ // no HMR manifest
|
|
314
|
+
/******/
|
|
315
|
+
/******/ // no on chunks loaded
|
|
316
|
+
/******/
|
|
317
|
+
/******/ // install a JSONP callback for chunk loading
|
|
318
|
+
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
319
|
+
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
320
|
+
/******/ // add "moreModules" to the modules object,
|
|
321
|
+
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
322
|
+
/******/ var moduleId, chunkId, i = 0;
|
|
323
|
+
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
324
|
+
/******/ for(moduleId in moreModules) {
|
|
325
|
+
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
326
|
+
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
327
|
+
/******/ }
|
|
328
|
+
/******/ }
|
|
329
|
+
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
330
|
+
/******/ }
|
|
331
|
+
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
332
|
+
/******/ for(;i < chunkIds.length; i++) {
|
|
333
|
+
/******/ chunkId = chunkIds[i];
|
|
334
|
+
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
335
|
+
/******/ installedChunks[chunkId][0]();
|
|
336
|
+
/******/ }
|
|
337
|
+
/******/ installedChunks[chunkId] = 0;
|
|
338
|
+
/******/ }
|
|
339
|
+
/******/
|
|
340
|
+
/******/ }
|
|
341
|
+
/******/
|
|
342
|
+
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_light"] = this["webpackChunk_tsparticles_interaction_light"] || [];
|
|
343
|
+
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
344
|
+
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
345
|
+
/******/ })();
|
|
346
|
+
/******/
|
|
188
347
|
/************************************************************************/
|
|
189
348
|
/******/
|
|
190
349
|
/******/ // startup
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.interaction.light.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],e);else{var
|
|
2
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],e);else{var r="object"==typeof exports?e(require("@tsparticles/engine")):e(t.window);for(var o in r)("object"==typeof exports?exports:t)[o]=r[o]}}(this,(t=>(()=>{var e,r,o={178(t,e,r){r.d(e,{O:()=>a});var o=r(303),i=r(423);class a{constructor(){this.gradient=new i.V,this.radius=1e3}load(t){(0,o.isNull)(t)||(this.gradient.load(t.gradient),void 0!==t.radius&&(this.radius=t.radius))}}},303(e){e.exports=t},423(t,e,r){r.d(e,{V:()=>i});var o=r(303);class i{constructor(){this.start=new o.OptionsColor,this.stop=new o.OptionsColor,this.start.value="#ffffff",this.stop.value="#000000"}load(t){(0,o.isNull)(t)||(this.start=o.OptionsColor.create(this.start,t.start),this.stop=o.OptionsColor.create(this.stop,t.stop))}}},831(t,e,r){r.d(e,{v:()=>n});var o=r(303),i=r(178),a=r(899);class n{constructor(){this.area=new i.O,this.shadow=new a.X}load(t){(0,o.isNull)(t)||(this.area.load(t.area),this.shadow.load(t.shadow))}}},899(t,e,r){r.d(e,{X:()=>i});var o=r(303);class i{constructor(){this.color=new o.OptionsColor,this.color.value="#000000",this.length=2e3}load(t){(0,o.isNull)(t)||(this.color=o.OptionsColor.create(this.color,t.color),void 0!==t.length&&(this.length=t.length))}}}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.m=o,a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,r)=>(a.f[r](t,e),e)),[])),a.u=t=>t+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),e={},r="@tsparticles/interaction-light:",a.l=(t,o,i,n)=>{if(e[t])e[t].push(o);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var p=c[d];if(p.getAttribute("src")==t||p.getAttribute("data-webpack")==r+i){s=p;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",a.nc&&s.setAttribute("nonce",a.nc),s.setAttribute("data-webpack",r+i),s.src=t),e[t]=[o];var h=(r,o)=>{s.onerror=s.onload=null,clearTimeout(u);var i=e[t];if(delete e[t],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((t=>t(o))),r)return r(o)},u=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!t||!/^http(s?):/.test(t));)t=r[o--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{var t={595:0};a.f.j=(e,r)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,i)=>o=t[e]=[r,i]));r.push(o[2]=i);var n=a.p+a.u(e),s=new Error;a.l(n,(r=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;s.message="Loading chunk "+e+" failed.\n("+i+": "+n+")",s.name="ChunkLoadError",s.type=i,s.request=n,o[1](s)}}),"chunk-"+e,e)}};var e=(e,r)=>{var o,i,[n,s,l]=r,c=0;if(n.some((e=>0!==t[e]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);if(l)l(a)}for(e&&e(r);c<n.length;c++)i=n[c],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=this.webpackChunk_tsparticles_interaction_light=this.webpackChunk_tsparticles_interaction_light||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var n={};a.r(n),a.d(n,{Light:()=>s.v,LightArea:()=>l.O,LightGradient:()=>c.V,LightShadow:()=>d.X,loadLightInteraction:()=>p});var s=a(831),l=a(178),c=a(423),d=a(899);function p(t){t.checkVersion("4.0.0-alpha.0"),t.register((e=>{e.addInteractor("externalLight",(async e=>{const{ExternalLighter:r}=await a.e(271).then(a.bind(a,271));return new r(e,t)})),e.addInteractor("particlesLight",(async e=>{const{ParticlesLighter:r}=await a.e(547).then(a.bind(a,547));return new r(e,t)}))}))}return n})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Light Interaction
|
|
1
|
+
/*! tsParticles Light Interaction v4.0.0-alpha.0 by Matteo Bruni */
|
package/types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Engine } from "@tsparticles/engine";
|
|
2
|
-
export declare function loadLightInteraction(engine: Engine
|
|
2
|
+
export declare function loadLightInteraction(engine: Engine): void;
|
|
3
3
|
export * from "./Options/Classes/Light.js";
|
|
4
4
|
export * from "./Options/Classes/LightArea.js";
|
|
5
5
|
export * from "./Options/Classes/LightGradient.js";
|
|
6
6
|
export * from "./Options/Classes/LightShadow.js";
|
|
7
|
-
export * from "./Options/Interfaces/ILight.js";
|
|
8
|
-
export * from "./Options/Interfaces/ILightArea.js";
|
|
9
|
-
export * from "./Options/Interfaces/ILightGradient.js";
|
|
10
|
-
export * from "./Options/Interfaces/ILightShadow.js";
|
|
7
|
+
export type * from "./Options/Interfaces/ILight.js";
|
|
8
|
+
export type * from "./Options/Interfaces/ILightArea.js";
|
|
9
|
+
export type * from "./Options/Interfaces/ILightGradient.js";
|
|
10
|
+
export type * from "./Options/Interfaces/ILightShadow.js";
|
package/umd/ExternalLighter.js
CHANGED
|
@@ -51,9 +51,7 @@
|
|
|
51
51
|
return res;
|
|
52
52
|
}
|
|
53
53
|
loadModeOptions(options, ...sources) {
|
|
54
|
-
|
|
55
|
-
options.light = new Light_js_1.Light();
|
|
56
|
-
}
|
|
54
|
+
options.light ??= new Light_js_1.Light();
|
|
57
55
|
for (const source of sources) {
|
|
58
56
|
options.light.load(source?.light);
|
|
59
57
|
}
|
package/umd/ParticlesLighter.js
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
isEnabled(particle) {
|
|
38
|
-
const container = this.container, interactivity = particle.interactivity
|
|
38
|
+
const container = this.container, interactivity = particle.interactivity, mouse = container.interactivity.mouse, events = interactivity.events;
|
|
39
39
|
if (!(events.onHover.enable && mouse.position)) {
|
|
40
40
|
return false;
|
|
41
41
|
}
|
package/umd/Utils.js
CHANGED
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
if (!gradientRgb?.start || !gradientRgb.stop) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
gradientAmbientLight.addColorStop(gradientPos.min, (0, engine_1.getStyleFromRgb)(gradientRgb.start));
|
|
34
|
-
gradientAmbientLight.addColorStop(gradientPos.max, (0, engine_1.getStyleFromRgb)(gradientRgb.stop));
|
|
33
|
+
gradientAmbientLight.addColorStop(gradientPos.min, (0, engine_1.getStyleFromRgb)(gradientRgb.start, container.hdr));
|
|
34
|
+
gradientAmbientLight.addColorStop(gradientPos.max, (0, engine_1.getStyleFromRgb)(gradientRgb.stop, container.hdr));
|
|
35
35
|
context.fillStyle = gradientAmbientLight;
|
|
36
36
|
context.fill();
|
|
37
37
|
}
|
|
@@ -62,13 +62,17 @@
|
|
|
62
62
|
start: dot,
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
const shadowColor = (0, engine_1.getStyleFromRgb)(shadowRgb), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;
|
|
65
|
+
const shadowColor = (0, engine_1.getStyleFromRgb)(shadowRgb, container.hdr), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;
|
|
66
66
|
for (let i = last, n = 0; i >= firstPos; n = i--) {
|
|
67
67
|
context.beginPath();
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
const iPoint = points[i], nPoint = points[n];
|
|
69
|
+
if (!iPoint || !nPoint) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
context.moveTo(iPoint.start.x, iPoint.start.y);
|
|
73
|
+
context.lineTo(nPoint.start.x, nPoint.start.y);
|
|
74
|
+
context.lineTo(nPoint.end.x, nPoint.end.y);
|
|
75
|
+
context.lineTo(iPoint.end.x, iPoint.end.y);
|
|
72
76
|
context.fillStyle = shadowColor;
|
|
73
77
|
context.fill();
|
|
74
78
|
}
|
package/umd/index.js
CHANGED
|
@@ -9,6 +9,28 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
9
9
|
if (k2 === undefined) k2 = k;
|
|
10
10
|
o[k2] = m[k];
|
|
11
11
|
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
18
|
+
var ownKeys = function(o) {
|
|
19
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
20
|
+
var ar = [];
|
|
21
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
22
|
+
return ar;
|
|
23
|
+
};
|
|
24
|
+
return ownKeys(o);
|
|
25
|
+
};
|
|
26
|
+
return function (mod) {
|
|
27
|
+
if (mod && mod.__esModule) return mod;
|
|
28
|
+
var result = {};
|
|
29
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
30
|
+
__setModuleDefault(result, mod);
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
12
34
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
13
35
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
14
36
|
};
|
|
@@ -18,29 +40,28 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
40
|
if (v !== undefined) module.exports = v;
|
|
19
41
|
}
|
|
20
42
|
else if (typeof define === "function" && define.amd) {
|
|
21
|
-
define(["require", "exports", "./
|
|
43
|
+
define(["require", "exports", "./Options/Classes/Light.js", "./Options/Classes/LightArea.js", "./Options/Classes/LightGradient.js", "./Options/Classes/LightShadow.js"], factory);
|
|
22
44
|
}
|
|
23
45
|
})(function (require, exports) {
|
|
24
46
|
"use strict";
|
|
47
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
25
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
49
|
exports.loadLightInteraction = loadLightInteraction;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
50
|
+
function loadLightInteraction(engine) {
|
|
51
|
+
engine.checkVersion("4.0.0-alpha.0");
|
|
52
|
+
engine.register(e => {
|
|
53
|
+
e.addInteractor("externalLight", async (container) => {
|
|
54
|
+
const { ExternalLighter } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ExternalLighter.js"))) : new Promise((resolve_1, reject_1) => { require(["./ExternalLighter.js"], resolve_1, reject_1); }).then(__importStar));
|
|
55
|
+
return new ExternalLighter(container, engine);
|
|
56
|
+
});
|
|
57
|
+
e.addInteractor("particlesLight", async (container) => {
|
|
58
|
+
const { ParticlesLighter } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ParticlesLighter.js"))) : new Promise((resolve_2, reject_2) => { require(["./ParticlesLighter.js"], resolve_2, reject_2); }).then(__importStar));
|
|
59
|
+
return new ParticlesLighter(container, engine);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
37
62
|
}
|
|
38
63
|
__exportStar(require("./Options/Classes/Light.js"), exports);
|
|
39
64
|
__exportStar(require("./Options/Classes/LightArea.js"), exports);
|
|
40
65
|
__exportStar(require("./Options/Classes/LightGradient.js"), exports);
|
|
41
66
|
__exportStar(require("./Options/Classes/LightShadow.js"), exports);
|
|
42
|
-
__exportStar(require("./Options/Interfaces/ILight.js"), exports);
|
|
43
|
-
__exportStar(require("./Options/Interfaces/ILightArea.js"), exports);
|
|
44
|
-
__exportStar(require("./Options/Interfaces/ILightGradient.js"), exports);
|
|
45
|
-
__exportStar(require("./Options/Interfaces/ILightShadow.js"), exports);
|
|
46
67
|
});
|