@tsparticles/interaction-light 3.2.2 → 3.4.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/browser/ExternalLighter.js +2 -3
- package/browser/ParticlesLighter.js +2 -3
- package/browser/index.js +6 -6
- package/cjs/ExternalLighter.js +2 -3
- package/cjs/ParticlesLighter.js +2 -3
- package/cjs/index.js +6 -18
- package/esm/ExternalLighter.js +2 -3
- package/esm/ParticlesLighter.js +2 -3
- package/esm/index.js +6 -6
- package/package.json +2 -2
- package/report.html +1 -1
- package/tsparticles.interaction.light.js +32 -200
- package/tsparticles.interaction.light.min.js +1 -1
- package/tsparticles.interaction.light.min.js.LICENSE.txt +1 -1
- package/types/ExternalLighter.d.ts +1 -1
- package/types/ParticlesLighter.d.ts +1 -1
- package/umd/ExternalLighter.js +2 -3
- package/umd/ParticlesLighter.js +2 -3
- package/umd/index.js +7 -20
- package/338.min.js +0 -2
- package/338.min.js.LICENSE.txt +0 -1
- package/388.min.js +0 -2
- package/388.min.js.LICENSE.txt +0 -1
- package/dist_browser_ExternalLighter_js.js +0 -40
- package/dist_browser_ParticlesLighter_js.js +0 -40
|
@@ -9,7 +9,7 @@ export class ExternalLighter extends ExternalInteractorBase {
|
|
|
9
9
|
}
|
|
10
10
|
init() {
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interact() {
|
|
13
13
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity;
|
|
14
14
|
if (!options.interactivity.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
15
15
|
return;
|
|
@@ -18,10 +18,9 @@ export class ExternalLighter extends ExternalInteractorBase {
|
|
|
18
18
|
if (!mousePos) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
container.canvas.draw(
|
|
21
|
+
container.canvas.draw(ctx => {
|
|
22
22
|
drawLight(container, ctx, mousePos);
|
|
23
23
|
});
|
|
24
|
-
await Promise.resolve();
|
|
25
24
|
}
|
|
26
25
|
isEnabled(particle) {
|
|
27
26
|
const container = this.container, mouse = container.interactivity.mouse, interactivity = particle?.interactivity ?? container.actualOptions.interactivity, events = interactivity.events;
|
|
@@ -8,7 +8,7 @@ export class ParticlesLighter extends ParticlesInteractorBase {
|
|
|
8
8
|
}
|
|
9
9
|
init() {
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
interact(particle) {
|
|
12
12
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity;
|
|
13
13
|
if (!options.interactivity.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
14
14
|
return;
|
|
@@ -17,10 +17,9 @@ export class ParticlesLighter extends ParticlesInteractorBase {
|
|
|
17
17
|
if (!mousePos) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
container.canvas.draw(
|
|
20
|
+
container.canvas.draw(ctx => {
|
|
21
21
|
drawParticleShadow(container, ctx, particle, mousePos);
|
|
22
22
|
});
|
|
23
|
-
await Promise.resolve();
|
|
24
23
|
}
|
|
25
24
|
isEnabled(particle) {
|
|
26
25
|
const container = this.container, interactivity = particle.interactivity ?? container.actualOptions.interactivity, mouse = container.interactivity.mouse, events = interactivity.events;
|
package/browser/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { ExternalLighter } from "./ExternalLighter.js";
|
|
2
|
+
import { ParticlesLighter } from "./ParticlesLighter.js";
|
|
1
3
|
export async function loadLightInteraction(engine, refresh = true) {
|
|
2
|
-
await engine.addInteractor("externalLight",
|
|
3
|
-
|
|
4
|
-
return new ExternalLighter(container);
|
|
4
|
+
await engine.addInteractor("externalLight", container => {
|
|
5
|
+
return Promise.resolve(new ExternalLighter(container));
|
|
5
6
|
}, refresh);
|
|
6
|
-
await engine.addInteractor("particlesLight",
|
|
7
|
-
|
|
8
|
-
return new ParticlesLighter(container);
|
|
7
|
+
await engine.addInteractor("particlesLight", container => {
|
|
8
|
+
return Promise.resolve(new ParticlesLighter(container));
|
|
9
9
|
}, refresh);
|
|
10
10
|
}
|
|
11
11
|
export * from "./Options/Classes/Light.js";
|
package/cjs/ExternalLighter.js
CHANGED
|
@@ -12,7 +12,7 @@ class ExternalLighter extends engine_1.ExternalInteractorBase {
|
|
|
12
12
|
}
|
|
13
13
|
init() {
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
interact() {
|
|
16
16
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity;
|
|
17
17
|
if (!options.interactivity.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
18
18
|
return;
|
|
@@ -21,10 +21,9 @@ class ExternalLighter extends engine_1.ExternalInteractorBase {
|
|
|
21
21
|
if (!mousePos) {
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
container.canvas.draw(
|
|
24
|
+
container.canvas.draw(ctx => {
|
|
25
25
|
(0, Utils_js_1.drawLight)(container, ctx, mousePos);
|
|
26
26
|
});
|
|
27
|
-
await Promise.resolve();
|
|
28
27
|
}
|
|
29
28
|
isEnabled(particle) {
|
|
30
29
|
const container = this.container, mouse = container.interactivity.mouse, interactivity = particle?.interactivity ?? container.actualOptions.interactivity, events = interactivity.events;
|
package/cjs/ParticlesLighter.js
CHANGED
|
@@ -11,7 +11,7 @@ class ParticlesLighter extends engine_1.ParticlesInteractorBase {
|
|
|
11
11
|
}
|
|
12
12
|
init() {
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
interact(particle) {
|
|
15
15
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity;
|
|
16
16
|
if (!options.interactivity.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
17
17
|
return;
|
|
@@ -20,10 +20,9 @@ class ParticlesLighter extends engine_1.ParticlesInteractorBase {
|
|
|
20
20
|
if (!mousePos) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
container.canvas.draw(
|
|
23
|
+
container.canvas.draw(ctx => {
|
|
24
24
|
(0, Utils_js_1.drawParticleShadow)(container, ctx, particle, mousePos);
|
|
25
25
|
});
|
|
26
|
-
await Promise.resolve();
|
|
27
26
|
}
|
|
28
27
|
isEnabled(particle) {
|
|
29
28
|
const container = this.container, interactivity = particle.interactivity ?? container.actualOptions.interactivity, mouse = container.interactivity.mouse, events = interactivity.events;
|
package/cjs/index.js
CHANGED
|
@@ -10,31 +10,19 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
15
|
};
|
|
28
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
17
|
exports.loadLightInteraction = void 0;
|
|
18
|
+
const ExternalLighter_js_1 = require("./ExternalLighter.js");
|
|
19
|
+
const ParticlesLighter_js_1 = require("./ParticlesLighter.js");
|
|
30
20
|
async function loadLightInteraction(engine, refresh = true) {
|
|
31
|
-
await engine.addInteractor("externalLight",
|
|
32
|
-
|
|
33
|
-
return new ExternalLighter(container);
|
|
21
|
+
await engine.addInteractor("externalLight", container => {
|
|
22
|
+
return Promise.resolve(new ExternalLighter_js_1.ExternalLighter(container));
|
|
34
23
|
}, refresh);
|
|
35
|
-
await engine.addInteractor("particlesLight",
|
|
36
|
-
|
|
37
|
-
return new ParticlesLighter(container);
|
|
24
|
+
await engine.addInteractor("particlesLight", container => {
|
|
25
|
+
return Promise.resolve(new ParticlesLighter_js_1.ParticlesLighter(container));
|
|
38
26
|
}, refresh);
|
|
39
27
|
}
|
|
40
28
|
exports.loadLightInteraction = loadLightInteraction;
|
package/esm/ExternalLighter.js
CHANGED
|
@@ -9,7 +9,7 @@ export class ExternalLighter extends ExternalInteractorBase {
|
|
|
9
9
|
}
|
|
10
10
|
init() {
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
interact() {
|
|
13
13
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity;
|
|
14
14
|
if (!options.interactivity.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
15
15
|
return;
|
|
@@ -18,10 +18,9 @@ export class ExternalLighter extends ExternalInteractorBase {
|
|
|
18
18
|
if (!mousePos) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
container.canvas.draw(
|
|
21
|
+
container.canvas.draw(ctx => {
|
|
22
22
|
drawLight(container, ctx, mousePos);
|
|
23
23
|
});
|
|
24
|
-
await Promise.resolve();
|
|
25
24
|
}
|
|
26
25
|
isEnabled(particle) {
|
|
27
26
|
const container = this.container, mouse = container.interactivity.mouse, interactivity = particle?.interactivity ?? container.actualOptions.interactivity, events = interactivity.events;
|
package/esm/ParticlesLighter.js
CHANGED
|
@@ -8,7 +8,7 @@ export class ParticlesLighter extends ParticlesInteractorBase {
|
|
|
8
8
|
}
|
|
9
9
|
init() {
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
interact(particle) {
|
|
12
12
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity;
|
|
13
13
|
if (!options.interactivity.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
14
14
|
return;
|
|
@@ -17,10 +17,9 @@ export class ParticlesLighter extends ParticlesInteractorBase {
|
|
|
17
17
|
if (!mousePos) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
container.canvas.draw(
|
|
20
|
+
container.canvas.draw(ctx => {
|
|
21
21
|
drawParticleShadow(container, ctx, particle, mousePos);
|
|
22
22
|
});
|
|
23
|
-
await Promise.resolve();
|
|
24
23
|
}
|
|
25
24
|
isEnabled(particle) {
|
|
26
25
|
const container = this.container, interactivity = particle.interactivity ?? container.actualOptions.interactivity, mouse = container.interactivity.mouse, events = interactivity.events;
|
package/esm/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { ExternalLighter } from "./ExternalLighter.js";
|
|
2
|
+
import { ParticlesLighter } from "./ParticlesLighter.js";
|
|
1
3
|
export async function loadLightInteraction(engine, refresh = true) {
|
|
2
|
-
await engine.addInteractor("externalLight",
|
|
3
|
-
|
|
4
|
-
return new ExternalLighter(container);
|
|
4
|
+
await engine.addInteractor("externalLight", container => {
|
|
5
|
+
return Promise.resolve(new ExternalLighter(container));
|
|
5
6
|
}, refresh);
|
|
6
|
-
await engine.addInteractor("particlesLight",
|
|
7
|
-
|
|
8
|
-
return new ParticlesLighter(container);
|
|
7
|
+
await engine.addInteractor("particlesLight", container => {
|
|
8
|
+
return Promise.resolve(new ParticlesLighter(container));
|
|
9
9
|
}, refresh);
|
|
10
10
|
}
|
|
11
11
|
export * from "./Options/Classes/Light.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-light",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "tsParticles Light interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"./package.json": "./package.json"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@tsparticles/engine": "^3.
|
|
104
|
+
"@tsparticles/engine": "^3.4.0"
|
|
105
105
|
},
|
|
106
106
|
"publishConfig": {
|
|
107
107
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/interaction-light [
|
|
6
|
+
<title>@tsparticles/interaction-light [13 May 2024 at 00:08]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -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
|
-
* v3.
|
|
7
|
+
* v3.4.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,6 +28,16 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
+
/***/ "./dist/browser/ExternalLighter.js":
|
|
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) {\n super(container);\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)(lightGradient.start),\n stop: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(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?");
|
|
38
|
+
|
|
39
|
+
/***/ }),
|
|
40
|
+
|
|
31
41
|
/***/ "./dist/browser/Options/Classes/Light.js":
|
|
32
42
|
/*!***********************************************!*\
|
|
33
43
|
!*** ./dist/browser/Options/Classes/Light.js ***!
|
|
@@ -68,13 +78,33 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
68
78
|
|
|
69
79
|
/***/ }),
|
|
70
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) {\n super(container);\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)(shadowOptions.color);\n }\n return res;\n }\n reset() {}\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/ParticlesLighter.js?");
|
|
88
|
+
|
|
89
|
+
/***/ }),
|
|
90
|
+
|
|
91
|
+
/***/ "./dist/browser/Utils.js":
|
|
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?");
|
|
98
|
+
|
|
99
|
+
/***/ }),
|
|
100
|
+
|
|
71
101
|
/***/ "./dist/browser/index.js":
|
|
72
102
|
/*!*******************************!*\
|
|
73
103
|
!*** ./dist/browser/index.js ***!
|
|
74
104
|
\*******************************/
|
|
75
105
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
76
106
|
|
|
77
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* reexport safe */
|
|
107
|
+
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_2__.Light),\n/* harmony export */ LightArea: () => (/* reexport safe */ _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_3__.LightArea),\n/* harmony export */ LightGradient: () => (/* reexport safe */ _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_4__.LightGradient),\n/* harmony export */ LightShadow: () => (/* reexport safe */ _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_5__.LightShadow),\n/* harmony export */ loadLightInteraction: () => (/* binding */ loadLightInteraction)\n/* harmony export */ });\n/* harmony import */ var _ExternalLighter_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ExternalLighter.js */ \"./dist/browser/ExternalLighter.js\");\n/* harmony import */ var _ParticlesLighter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ParticlesLighter.js */ \"./dist/browser/ParticlesLighter.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/* harmony import */ var _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Options/Classes/LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n/* harmony import */ var _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Options/Classes/LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\n\n\nasync function loadLightInteraction(engine, refresh = true) {\n await engine.addInteractor(\"externalLight\", container => {\n return Promise.resolve(new _ExternalLighter_js__WEBPACK_IMPORTED_MODULE_0__.ExternalLighter(container));\n }, refresh);\n await engine.addInteractor(\"particlesLight\", container => {\n return Promise.resolve(new _ParticlesLighter_js__WEBPACK_IMPORTED_MODULE_1__.ParticlesLighter(container));\n }, refresh);\n}\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/index.js?");
|
|
78
108
|
|
|
79
109
|
/***/ }),
|
|
80
110
|
|
|
@@ -114,9 +144,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
114
144
|
/******/ return module.exports;
|
|
115
145
|
/******/ }
|
|
116
146
|
/******/
|
|
117
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
118
|
-
/******/ __webpack_require__.m = __webpack_modules__;
|
|
119
|
-
/******/
|
|
120
147
|
/************************************************************************/
|
|
121
148
|
/******/ /* webpack/runtime/compat get default export */
|
|
122
149
|
/******/ (() => {
|
|
@@ -142,91 +169,11 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
142
169
|
/******/ };
|
|
143
170
|
/******/ })();
|
|
144
171
|
/******/
|
|
145
|
-
/******/ /* webpack/runtime/ensure chunk */
|
|
146
|
-
/******/ (() => {
|
|
147
|
-
/******/ __webpack_require__.f = {};
|
|
148
|
-
/******/ // This file contains only the entry chunk.
|
|
149
|
-
/******/ // The chunk loading function for additional chunks
|
|
150
|
-
/******/ __webpack_require__.e = (chunkId) => {
|
|
151
|
-
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
152
|
-
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
153
|
-
/******/ return promises;
|
|
154
|
-
/******/ }, []));
|
|
155
|
-
/******/ };
|
|
156
|
-
/******/ })();
|
|
157
|
-
/******/
|
|
158
|
-
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
159
|
-
/******/ (() => {
|
|
160
|
-
/******/ // This function allow to reference async chunks
|
|
161
|
-
/******/ __webpack_require__.u = (chunkId) => {
|
|
162
|
-
/******/ // return url for filenames based on template
|
|
163
|
-
/******/ return "" + chunkId + ".js";
|
|
164
|
-
/******/ };
|
|
165
|
-
/******/ })();
|
|
166
|
-
/******/
|
|
167
|
-
/******/ /* webpack/runtime/global */
|
|
168
|
-
/******/ (() => {
|
|
169
|
-
/******/ __webpack_require__.g = (function() {
|
|
170
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
171
|
-
/******/ try {
|
|
172
|
-
/******/ return this || new Function('return this')();
|
|
173
|
-
/******/ } catch (e) {
|
|
174
|
-
/******/ if (typeof window === 'object') return window;
|
|
175
|
-
/******/ }
|
|
176
|
-
/******/ })();
|
|
177
|
-
/******/ })();
|
|
178
|
-
/******/
|
|
179
172
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
180
173
|
/******/ (() => {
|
|
181
174
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
182
175
|
/******/ })();
|
|
183
176
|
/******/
|
|
184
|
-
/******/ /* webpack/runtime/load script */
|
|
185
|
-
/******/ (() => {
|
|
186
|
-
/******/ var inProgress = {};
|
|
187
|
-
/******/ var dataWebpackPrefix = "@tsparticles/interaction-light:";
|
|
188
|
-
/******/ // loadScript function to load a script via script tag
|
|
189
|
-
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
190
|
-
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
191
|
-
/******/ var script, needAttach;
|
|
192
|
-
/******/ if(key !== undefined) {
|
|
193
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
194
|
-
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
195
|
-
/******/ var s = scripts[i];
|
|
196
|
-
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
197
|
-
/******/ }
|
|
198
|
-
/******/ }
|
|
199
|
-
/******/ if(!script) {
|
|
200
|
-
/******/ needAttach = true;
|
|
201
|
-
/******/ script = document.createElement('script');
|
|
202
|
-
/******/
|
|
203
|
-
/******/ script.charset = 'utf-8';
|
|
204
|
-
/******/ script.timeout = 120;
|
|
205
|
-
/******/ if (__webpack_require__.nc) {
|
|
206
|
-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
207
|
-
/******/ }
|
|
208
|
-
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
209
|
-
/******/
|
|
210
|
-
/******/ script.src = url;
|
|
211
|
-
/******/ }
|
|
212
|
-
/******/ inProgress[url] = [done];
|
|
213
|
-
/******/ var onScriptComplete = (prev, event) => {
|
|
214
|
-
/******/ // avoid mem leaks in IE.
|
|
215
|
-
/******/ script.onerror = script.onload = null;
|
|
216
|
-
/******/ clearTimeout(timeout);
|
|
217
|
-
/******/ var doneFns = inProgress[url];
|
|
218
|
-
/******/ delete inProgress[url];
|
|
219
|
-
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
220
|
-
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
221
|
-
/******/ if(prev) return prev(event);
|
|
222
|
-
/******/ }
|
|
223
|
-
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
224
|
-
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
225
|
-
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
226
|
-
/******/ needAttach && document.head.appendChild(script);
|
|
227
|
-
/******/ };
|
|
228
|
-
/******/ })();
|
|
229
|
-
/******/
|
|
230
177
|
/******/ /* webpack/runtime/make namespace object */
|
|
231
178
|
/******/ (() => {
|
|
232
179
|
/******/ // define __esModule on exports
|
|
@@ -238,121 +185,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
238
185
|
/******/ };
|
|
239
186
|
/******/ })();
|
|
240
187
|
/******/
|
|
241
|
-
/******/ /* webpack/runtime/publicPath */
|
|
242
|
-
/******/ (() => {
|
|
243
|
-
/******/ var scriptUrl;
|
|
244
|
-
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
245
|
-
/******/ var document = __webpack_require__.g.document;
|
|
246
|
-
/******/ if (!scriptUrl && document) {
|
|
247
|
-
/******/ if (document.currentScript)
|
|
248
|
-
/******/ scriptUrl = document.currentScript.src;
|
|
249
|
-
/******/ if (!scriptUrl) {
|
|
250
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
251
|
-
/******/ if(scripts.length) {
|
|
252
|
-
/******/ var i = scripts.length - 1;
|
|
253
|
-
/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;
|
|
254
|
-
/******/ }
|
|
255
|
-
/******/ }
|
|
256
|
-
/******/ }
|
|
257
|
-
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
258
|
-
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
259
|
-
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
260
|
-
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
261
|
-
/******/ __webpack_require__.p = scriptUrl;
|
|
262
|
-
/******/ })();
|
|
263
|
-
/******/
|
|
264
|
-
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
265
|
-
/******/ (() => {
|
|
266
|
-
/******/ // no baseURI
|
|
267
|
-
/******/
|
|
268
|
-
/******/ // object to store loaded and loading chunks
|
|
269
|
-
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
270
|
-
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
271
|
-
/******/ var installedChunks = {
|
|
272
|
-
/******/ "tsparticles.interaction.light": 0
|
|
273
|
-
/******/ };
|
|
274
|
-
/******/
|
|
275
|
-
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
276
|
-
/******/ // JSONP chunk loading for javascript
|
|
277
|
-
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
278
|
-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
279
|
-
/******/
|
|
280
|
-
/******/ // a Promise means "currently loading".
|
|
281
|
-
/******/ if(installedChunkData) {
|
|
282
|
-
/******/ promises.push(installedChunkData[2]);
|
|
283
|
-
/******/ } else {
|
|
284
|
-
/******/ if(true) { // all chunks have JS
|
|
285
|
-
/******/ // setup Promise in chunk cache
|
|
286
|
-
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
287
|
-
/******/ promises.push(installedChunkData[2] = promise);
|
|
288
|
-
/******/
|
|
289
|
-
/******/ // start chunk loading
|
|
290
|
-
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
291
|
-
/******/ // create error before stack unwound to get useful stacktrace later
|
|
292
|
-
/******/ var error = new Error();
|
|
293
|
-
/******/ var loadingEnded = (event) => {
|
|
294
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
295
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
296
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
297
|
-
/******/ if(installedChunkData) {
|
|
298
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
299
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
300
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
301
|
-
/******/ error.name = 'ChunkLoadError';
|
|
302
|
-
/******/ error.type = errorType;
|
|
303
|
-
/******/ error.request = realSrc;
|
|
304
|
-
/******/ installedChunkData[1](error);
|
|
305
|
-
/******/ }
|
|
306
|
-
/******/ }
|
|
307
|
-
/******/ };
|
|
308
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
309
|
-
/******/ }
|
|
310
|
-
/******/ }
|
|
311
|
-
/******/ }
|
|
312
|
-
/******/ };
|
|
313
|
-
/******/
|
|
314
|
-
/******/ // no prefetching
|
|
315
|
-
/******/
|
|
316
|
-
/******/ // no preloaded
|
|
317
|
-
/******/
|
|
318
|
-
/******/ // no HMR
|
|
319
|
-
/******/
|
|
320
|
-
/******/ // no HMR manifest
|
|
321
|
-
/******/
|
|
322
|
-
/******/ // no on chunks loaded
|
|
323
|
-
/******/
|
|
324
|
-
/******/ // install a JSONP callback for chunk loading
|
|
325
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
326
|
-
/******/ var chunkIds = data[0];
|
|
327
|
-
/******/ var moreModules = data[1];
|
|
328
|
-
/******/ var runtime = data[2];
|
|
329
|
-
/******/ // add "moreModules" to the modules object,
|
|
330
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
331
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
332
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
333
|
-
/******/ for(moduleId in moreModules) {
|
|
334
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
335
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
336
|
-
/******/ }
|
|
337
|
-
/******/ }
|
|
338
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
339
|
-
/******/ }
|
|
340
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
341
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
342
|
-
/******/ chunkId = chunkIds[i];
|
|
343
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
344
|
-
/******/ installedChunks[chunkId][0]();
|
|
345
|
-
/******/ }
|
|
346
|
-
/******/ installedChunks[chunkId] = 0;
|
|
347
|
-
/******/ }
|
|
348
|
-
/******/
|
|
349
|
-
/******/ }
|
|
350
|
-
/******/
|
|
351
|
-
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_light"] = this["webpackChunk_tsparticles_interaction_light"] || [];
|
|
352
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
353
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
354
|
-
/******/ })();
|
|
355
|
-
/******/
|
|
356
188
|
/************************************************************************/
|
|
357
189
|
/******/
|
|
358
190
|
/******/ // 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 o="object"==typeof exports?e(require("@tsparticles/engine")):e(t.window);for(var i in o)("object"==typeof exports?exports:t)[i]=o[i]}}(this,(t=>(()=>{var e={303:e=>{e.exports=t}},o={};function i(t){var r=o[t];if(void 0!==r)return r.exports;var s=o[t]={exports:{}};return e[t](s,s.exports,i),s.exports}i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{i.r(r),i.d(r,{Light:()=>u,LightArea:()=>d,LightGradient:()=>c,LightShadow:()=>h,loadLightInteraction:()=>f});var t=i(303);const e=1,o=0,s=.5*Math.PI,n=2*Math.PI,a=.25*Math.PI,l="light";class c{constructor(){this.start=new t.OptionsColor,this.stop=new t.OptionsColor,this.start.value="#ffffff",this.stop.value="#000000"}load(e){e&&(this.start=t.OptionsColor.create(this.start,e.start),this.stop=t.OptionsColor.create(this.stop,e.stop))}}class d{constructor(){this.gradient=new c,this.radius=1e3}load(t){t&&(this.gradient.load(t.gradient),void 0!==t.radius&&(this.radius=t.radius))}}class h{constructor(){this.color=new t.OptionsColor,this.color.value="#000000",this.length=2e3}load(e){e&&(this.color=t.OptionsColor.create(this.color,e.color),void 0!==e.length&&(this.length=e.length))}}class u{constructor(){this.area=new d,this.shadow=new h}load(t){t&&(this.area.load(t.area),this.shadow.load(t.shadow))}}class p extends t.ExternalInteractorBase{constructor(t){super(t)}clear(){}init(){}interact(){const i=this.container,r=i.actualOptions,s=i.interactivity;if(!r.interactivity.events.onHover.enable||"pointermove"!==s.status)return;const a=s.mouse.position;a&&i.canvas.draw((r=>{!function(i,r,s){const a=i.actualOptions.interactivity.modes.light?.area;if(!a)return;r.beginPath(),r.arc(s.x,s.y,a.radius,0,n);const l=r.createRadialGradient(s.x,s.y,0,s.x,s.y,a.radius),c=i.canvas.mouseLight;c?.start&&c.stop&&(l.addColorStop(o,(0,t.getStyleFromRgb)(c.start)),l.addColorStop(e,(0,t.getStyleFromRgb)(c.stop)),r.fillStyle=l,r.fill())}(i,r,a)}))}isEnabled(e){const o=this.container,i=o.interactivity.mouse,r=e?.interactivity??o.actualOptions.interactivity,s=r.events;if(!s.onHover.enable||!i.position)return!1;const n=(0,t.isInArray)(l,s.onHover.mode);if(n&&r.modes.light){const e=r.modes.light.area.gradient;o.canvas.mouseLight={start:(0,t.rangeColorToRgb)(e.start),stop:(0,t.rangeColorToRgb)(e.stop)}}return n}loadModeOptions(t,...e){t.light||(t.light=new u);for(const o of e)t.light.load(o?.light)}reset(){}}class g extends t.ParticlesInteractorBase{constructor(t){super(t)}clear(){}init(){}interact(e){const o=this.container,i=o.actualOptions,r=o.interactivity;if(!i.interactivity.events.onHover.enable||"pointermove"!==r.status)return;const l=r.mouse.position;l&&o.canvas.draw((i=>{!function(e,o,i,r){const l=i.getPosition(),c=e.actualOptions.interactivity.modes.light?.shadow;if(!c)return;const d=i.lightShadow;if(!d)return;const h=i.getRadius(),u=i.sides,p=n/u,g=-i.rotation+a,f=[];for(let t=0;t<u;t++)f.push({x:l.x+h*Math.sin(g+p*t)*1,y:l.y+h*Math.cos(g+p*t)*1});const v=[],y=c.length;for(const t of f){const e=Math.atan2(r.y-t.y,r.x-t.x),o={x:t.x+y*Math.sin(-e-s),y:t.y+y*Math.cos(-e-s)};v.push({end:o,start:t})}const m=(0,t.getStyleFromRgb)(d);for(let t=v.length-1,e=0;t>=0;e=t--)o.beginPath(),o.moveTo(v[t].start.x,v[t].start.y),o.lineTo(v[e].start.x,v[e].start.y),o.lineTo(v[e].end.x,v[e].end.y),o.lineTo(v[t].end.x,v[t].end.y),o.fillStyle=m,o.fill()}(o,i,e,l)}))}isEnabled(e){const o=this.container,i=e.interactivity??o.actualOptions.interactivity,r=o.interactivity.mouse,s=i.events;if(!s.onHover.enable||!r.position)return!1;const n=(0,t.isInArray)(l,s.onHover.mode);if(n&&i.modes.light){const o=i.modes.light.shadow;e.lightShadow=(0,t.rangeColorToRgb)(o.color)}return n}reset(){}}async function f(t,e=!0){await t.addInteractor("externalLight",(t=>Promise.resolve(new p(t))),e),await t.addInteractor("particlesLight",(t=>Promise.resolve(new g(t))),e)}})(),r})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Light Interaction v3.
|
|
1
|
+
/*! tsParticles Light Interaction v3.4.0 by Matteo Bruni */
|
|
@@ -4,7 +4,7 @@ export declare class ExternalLighter extends ExternalInteractorBase<LightContain
|
|
|
4
4
|
constructor(container: LightContainer);
|
|
5
5
|
clear(): void;
|
|
6
6
|
init(): void;
|
|
7
|
-
interact():
|
|
7
|
+
interact(): void;
|
|
8
8
|
isEnabled(particle?: LightParticle): boolean;
|
|
9
9
|
loadModeOptions(options: Modes & LightMode, ...sources: RecursivePartial<(IModes & ILightMode) | undefined>[]): void;
|
|
10
10
|
reset(): void;
|
|
@@ -4,7 +4,7 @@ export declare class ParticlesLighter extends ParticlesInteractorBase<LightConta
|
|
|
4
4
|
constructor(container: LightContainer);
|
|
5
5
|
clear(): void;
|
|
6
6
|
init(): void;
|
|
7
|
-
interact(particle: LightParticle):
|
|
7
|
+
interact(particle: LightParticle): void;
|
|
8
8
|
isEnabled(particle: LightParticle): boolean;
|
|
9
9
|
reset(): void;
|
|
10
10
|
}
|
package/umd/ExternalLighter.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
init() {
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
interact() {
|
|
25
25
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity;
|
|
26
26
|
if (!options.interactivity.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
27
27
|
return;
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
if (!mousePos) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
|
-
container.canvas.draw(
|
|
33
|
+
container.canvas.draw(ctx => {
|
|
34
34
|
(0, Utils_js_1.drawLight)(container, ctx, mousePos);
|
|
35
35
|
});
|
|
36
|
-
await Promise.resolve();
|
|
37
36
|
}
|
|
38
37
|
isEnabled(particle) {
|
|
39
38
|
const container = this.container, mouse = container.interactivity.mouse, interactivity = particle?.interactivity ?? container.actualOptions.interactivity, events = interactivity.events;
|
package/umd/ParticlesLighter.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
}
|
|
21
21
|
init() {
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
interact(particle) {
|
|
24
24
|
const container = this.container, options = container.actualOptions, interactivity = container.interactivity;
|
|
25
25
|
if (!options.interactivity.events.onHover.enable || interactivity.status !== "pointermove") {
|
|
26
26
|
return;
|
|
@@ -29,10 +29,9 @@
|
|
|
29
29
|
if (!mousePos) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
container.canvas.draw(
|
|
32
|
+
container.canvas.draw(ctx => {
|
|
33
33
|
(0, Utils_js_1.drawParticleShadow)(container, ctx, particle, mousePos);
|
|
34
34
|
});
|
|
35
|
-
await Promise.resolve();
|
|
36
35
|
}
|
|
37
36
|
isEnabled(particle) {
|
|
38
37
|
const container = this.container, interactivity = particle.interactivity ?? container.actualOptions.interactivity, mouse = container.interactivity.mouse, events = interactivity.events;
|
package/umd/index.js
CHANGED
|
@@ -9,18 +9,6 @@ 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 (mod) {
|
|
18
|
-
if (mod && mod.__esModule) return mod;
|
|
19
|
-
var result = {};
|
|
20
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
-
__setModuleDefault(result, mod);
|
|
22
|
-
return result;
|
|
23
|
-
};
|
|
24
12
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
25
13
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
26
14
|
};
|
|
@@ -30,21 +18,20 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
30
18
|
if (v !== undefined) module.exports = v;
|
|
31
19
|
}
|
|
32
20
|
else if (typeof define === "function" && define.amd) {
|
|
33
|
-
define(["require", "exports", "./Options/Classes/Light.js", "./Options/Classes/LightArea.js", "./Options/Classes/LightGradient.js", "./Options/Classes/LightShadow.js", "./Options/Interfaces/ILight.js", "./Options/Interfaces/ILightArea.js", "./Options/Interfaces/ILightGradient.js", "./Options/Interfaces/ILightShadow.js"], factory);
|
|
21
|
+
define(["require", "exports", "./ExternalLighter.js", "./ParticlesLighter.js", "./Options/Classes/Light.js", "./Options/Classes/LightArea.js", "./Options/Classes/LightGradient.js", "./Options/Classes/LightShadow.js", "./Options/Interfaces/ILight.js", "./Options/Interfaces/ILightArea.js", "./Options/Interfaces/ILightGradient.js", "./Options/Interfaces/ILightShadow.js"], factory);
|
|
34
22
|
}
|
|
35
23
|
})(function (require, exports) {
|
|
36
24
|
"use strict";
|
|
37
|
-
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
38
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
26
|
exports.loadLightInteraction = void 0;
|
|
27
|
+
const ExternalLighter_js_1 = require("./ExternalLighter.js");
|
|
28
|
+
const ParticlesLighter_js_1 = require("./ParticlesLighter.js");
|
|
40
29
|
async function loadLightInteraction(engine, refresh = true) {
|
|
41
|
-
await engine.addInteractor("externalLight",
|
|
42
|
-
|
|
43
|
-
return new ExternalLighter(container);
|
|
30
|
+
await engine.addInteractor("externalLight", container => {
|
|
31
|
+
return Promise.resolve(new ExternalLighter_js_1.ExternalLighter(container));
|
|
44
32
|
}, refresh);
|
|
45
|
-
await engine.addInteractor("particlesLight",
|
|
46
|
-
|
|
47
|
-
return new ParticlesLighter(container);
|
|
33
|
+
await engine.addInteractor("particlesLight", container => {
|
|
34
|
+
return Promise.resolve(new ParticlesLighter_js_1.ParticlesLighter(container));
|
|
48
35
|
}, refresh);
|
|
49
36
|
}
|
|
50
37
|
exports.loadLightInteraction = loadLightInteraction;
|
package/338.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 338.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_light=this.webpackChunk_tsparticles_interaction_light||[]).push([[338],{338:(t,i,e)=>{e.d(i,{ParticlesLighter:()=>a});var n=e(533),o=e(103);class a extends n.ParticlesInteractorBase{constructor(t){super(t)}clear(){}init(){}async interact(t){const i=this.container,e=i.actualOptions,n=i.interactivity;if(!e.interactivity.events.onHover.enable||"pointermove"!==n.status)return;const a=n.mouse.position;a&&(i.canvas.draw((e=>{(0,o.y_)(i,e,t,a)})),await Promise.resolve())}isEnabled(t){const i=this.container,e=t.interactivity??i.actualOptions.interactivity,a=i.interactivity.mouse,s=e.events;if(!s.onHover.enable||!a.position)return!1;const r=(0,n.isInArray)(o.uh,s.onHover.mode);if(r&&e.modes.light){const i=e.modes.light.shadow;t.lightShadow=(0,n.rangeColorToRgb)(i.color)}return r}reset(){}}},103:(t,i,e)=>{e.d(i,{iZ:()=>h,uh:()=>l,y_:()=>d});var n=e(533);const o={max:1,min:0},a=.5*Math.PI,s=2*Math.PI,r=.25*Math.PI,c=0,l="light";function h(t,i,e){const a=t.actualOptions.interactivity.modes.light?.area;if(!a)return;i.beginPath(),i.arc(e.x,e.y,a.radius,c,s);const r=i.createRadialGradient(e.x,e.y,c,e.x,e.y,a.radius),l=t.canvas.mouseLight;l?.start&&l.stop&&(r.addColorStop(o.min,(0,n.getStyleFromRgb)(l.start)),r.addColorStop(o.max,(0,n.getStyleFromRgb)(l.stop)),i.fillStyle=r,i.fill())}function d(t,i,e,o){const c=e.getPosition(),l=t.actualOptions.interactivity.modes.light?.shadow;if(!l)return;const h=e.lightShadow;if(!h)return;const d=e.getRadius(),y=e.sides,u=s/y,g=-e.rotation+r,p=[];for(let t=0;t<y;t++)p.push({x:c.x+d*Math.sin(g+u*t)*1,y:c.y+d*Math.cos(g+u*t)*1});const v=[],m=l.length;for(const t of p){const i=Math.atan2(o.y-t.y,o.x-t.x),e={x:t.x+m*Math.sin(-i-a),y:t.y+m*Math.cos(-i-a)};v.push({end:e,start:t})}const f=(0,n.getStyleFromRgb)(h);for(let t=v.length-1,e=0;t>=0;e=t--)i.beginPath(),i.moveTo(v[t].start.x,v[t].start.y),i.lineTo(v[e].start.x,v[e].start.y),i.lineTo(v[e].end.x,v[e].end.y),i.lineTo(v[t].end.x,v[t].end.y),i.fillStyle=f,i.fill()}}}]);
|
package/338.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Light Interaction v3.2.2 by Matteo Bruni */
|
package/388.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 388.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_light=this.webpackChunk_tsparticles_interaction_light||[]).push([[388],{388:(t,i,e)=>{e.d(i,{ExternalLighter:()=>s});var n=e(533),o=e(103),a=e(78);class s extends n.ExternalInteractorBase{constructor(t){super(t)}clear(){}init(){}async interact(){const t=this.container,i=t.actualOptions,e=t.interactivity;if(!i.interactivity.events.onHover.enable||"pointermove"!==e.status)return;const n=e.mouse.position;n&&(t.canvas.draw((i=>{(0,o.iZ)(t,i,n)})),await Promise.resolve())}isEnabled(t){const i=this.container,e=i.interactivity.mouse,a=t?.interactivity??i.actualOptions.interactivity,s=a.events;if(!s.onHover.enable||!e.position)return!1;const r=(0,n.isInArray)(o.uh,s.onHover.mode);if(r&&a.modes.light){const t=a.modes.light.area.gradient;i.canvas.mouseLight={start:(0,n.rangeColorToRgb)(t.start),stop:(0,n.rangeColorToRgb)(t.stop)}}return r}loadModeOptions(t,...i){t.light||(t.light=new a._);for(const e of i)t.light.load(e?.light)}reset(){}}},103:(t,i,e)=>{e.d(i,{iZ:()=>h,uh:()=>c,y_:()=>g});var n=e(533);const o={max:1,min:0},a=.5*Math.PI,s=2*Math.PI,r=.25*Math.PI,l=0,c="light";function h(t,i,e){const a=t.actualOptions.interactivity.modes.light?.area;if(!a)return;i.beginPath(),i.arc(e.x,e.y,a.radius,l,s);const r=i.createRadialGradient(e.x,e.y,l,e.x,e.y,a.radius),c=t.canvas.mouseLight;c?.start&&c.stop&&(r.addColorStop(o.min,(0,n.getStyleFromRgb)(c.start)),r.addColorStop(o.max,(0,n.getStyleFromRgb)(c.stop)),i.fillStyle=r,i.fill())}function g(t,i,e,o){const l=e.getPosition(),c=t.actualOptions.interactivity.modes.light?.shadow;if(!c)return;const h=e.lightShadow;if(!h)return;const g=e.getRadius(),d=e.sides,u=s/d,y=-e.rotation+r,p=[];for(let t=0;t<d;t++)p.push({x:l.x+g*Math.sin(y+u*t)*1,y:l.y+g*Math.cos(y+u*t)*1});const v=[],m=c.length;for(const t of p){const i=Math.atan2(o.y-t.y,o.x-t.x),e={x:t.x+m*Math.sin(-i-a),y:t.y+m*Math.cos(-i-a)};v.push({end:e,start:t})}const f=(0,n.getStyleFromRgb)(h);for(let t=v.length-1,e=0;t>=0;e=t--)i.beginPath(),i.moveTo(v[t].start.x,v[t].start.y),i.lineTo(v[e].start.x,v[e].start.y),i.lineTo(v[e].end.x,v[e].end.y),i.lineTo(v[t].end.x,v[t].end.y),i.fillStyle=f,i.fill()}}}]);
|
package/388.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Light Interaction v3.2.2 by Matteo Bruni */
|
|
@@ -1,40 +0,0 @@
|
|
|
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.2.2
|
|
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_interaction_light"] = this["webpackChunk_tsparticles_interaction_light"] || []).push([["dist_browser_ExternalLighter_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/ExternalLighter.js":
|
|
21
|
-
/*!*****************************************!*\
|
|
22
|
-
!*** ./dist/browser/ExternalLighter.js ***!
|
|
23
|
-
\*****************************************/
|
|
24
|
-
/***/ ((__unused_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 */ 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) {\n super(container);\n }\n clear() {}\n init() {}\n async 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 await Promise.resolve();\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)(lightGradient.start),\n stop: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToRgb)(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?");
|
|
27
|
-
|
|
28
|
-
/***/ }),
|
|
29
|
-
|
|
30
|
-
/***/ "./dist/browser/Utils.js":
|
|
31
|
-
/*!*******************************!*\
|
|
32
|
-
!*** ./dist/browser/Utils.js ***!
|
|
33
|
-
\*******************************/
|
|
34
|
-
/***/ ((__unused_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 */ 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?");
|
|
37
|
-
|
|
38
|
-
/***/ })
|
|
39
|
-
|
|
40
|
-
}]);
|
|
@@ -1,40 +0,0 @@
|
|
|
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.2.2
|
|
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_interaction_light"] = this["webpackChunk_tsparticles_interaction_light"] || []).push([["dist_browser_ParticlesLighter_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/ParticlesLighter.js":
|
|
21
|
-
/*!******************************************!*\
|
|
22
|
-
!*** ./dist/browser/ParticlesLighter.js ***!
|
|
23
|
-
\******************************************/
|
|
24
|
-
/***/ ((__unused_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 */ 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) {\n super(container);\n }\n clear() {}\n init() {}\n async 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 await Promise.resolve();\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)(shadowOptions.color);\n }\n return res;\n }\n reset() {}\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/ParticlesLighter.js?");
|
|
27
|
-
|
|
28
|
-
/***/ }),
|
|
29
|
-
|
|
30
|
-
/***/ "./dist/browser/Utils.js":
|
|
31
|
-
/*!*******************************!*\
|
|
32
|
-
!*** ./dist/browser/Utils.js ***!
|
|
33
|
-
\*******************************/
|
|
34
|
-
/***/ ((__unused_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 */ 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?");
|
|
37
|
-
|
|
38
|
-
/***/ })
|
|
39
|
-
|
|
40
|
-
}]);
|