@tsparticles/interaction-external-parallax 4.0.0-alpha.8 → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/927.min.js +1 -0
- package/README.md +5 -0
- package/browser/Options/Classes/Parallax.js +2 -0
- package/browser/Parallaxer.js +1 -0
- package/browser/index.js +3 -3
- package/cjs/Options/Classes/Parallax.js +2 -0
- package/cjs/Parallaxer.js +1 -0
- package/cjs/index.js +3 -3
- package/dist_browser_Parallaxer_js.js +2 -2
- package/esm/Options/Classes/Parallax.js +2 -0
- package/esm/Parallaxer.js +1 -0
- package/esm/index.js +3 -3
- package/package.json +3 -3
- package/report.html +1 -1
- package/tsparticles.interaction.external.parallax.js +41 -29
- package/tsparticles.interaction.external.parallax.min.js +2 -2
- package/types/Parallaxer.d.ts +1 -0
- package/umd/Options/Classes/Parallax.js +2 -0
- package/umd/Parallaxer.js +1 -0
- package/umd/index.js +3 -3
- package/411.min.js +0 -2
- package/411.min.js.LICENSE.txt +0 -1
- package/tsparticles.interaction.external.parallax.min.js.LICENSE.txt +0 -1
package/927.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_interaction_external_parallax=this.webpackChunk_tsparticles_interaction_external_parallax||[]).push([[927],{927(a,t,e){e.d(t,{Parallaxer:()=>n});var r=e(702),i=e(303),l=e(946);class n extends r.ExternalInteractorBase{maxDistance=0;constructor(a){super(a)}clear(){}init(){}interact(a){for(let t of this.container.particles.filter(t=>this.isEnabled(a,t)))this._parallaxInteract(a,t)}isEnabled(a,t){let e=this.container,r=a.mouse,l=(t?.interactivity??e.actualOptions.interactivity)?.events;return!!l?.onHover.enable&&!!r.position&&(0,i.isInArray)("parallax",l.onHover.mode)}loadModeOptions(a,...t){for(let e of(a.parallax??=new l.k,t))a.parallax.load(e?.parallax)}reset(){}_parallaxInteract(a,t){if(!this.isEnabled(a,t))return;let e=this.container,r=e.actualOptions,l=r.interactivity?.modes.parallax;if(!l)return;let n=l.force,s=a.mouse.position;if(!s)return;let o=e.canvas.size,c={x:o.width*i.half,y:o.height*i.half},x=l.smooth,p=t.getRadius()/n,h={x:(s.x-c.x)*p,y:(s.y-c.y)*p},{offset:u}=t;u.x+=(h.x-u.x)/x,u.y+=(h.y-u.y)/x}}}}]);
|
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Once the scripts are loaded you can set up `tsParticles` and the interaction plu
|
|
|
28
28
|
|
|
29
29
|
```javascript
|
|
30
30
|
(async () => {
|
|
31
|
+
await loadInteractivityPlugin(tsParticles);
|
|
31
32
|
await loadExternalParallaxInteraction(tsParticles);
|
|
32
33
|
|
|
33
34
|
await tsParticles.load({
|
|
@@ -57,9 +58,11 @@ Then you need to import it in the app, like this:
|
|
|
57
58
|
|
|
58
59
|
```javascript
|
|
59
60
|
const { tsParticles } = require("@tsparticles/engine");
|
|
61
|
+
const { loadInteractivityPlugin } = require("@tsparticles/plugin-interactivity");
|
|
60
62
|
const { loadExternalParallaxInteraction } = require("@tsparticles/interaction-external-parallax");
|
|
61
63
|
|
|
62
64
|
(async () => {
|
|
65
|
+
await loadInteractivityPlugin(tsParticles);
|
|
63
66
|
await loadExternalParallaxInteraction(tsParticles);
|
|
64
67
|
})();
|
|
65
68
|
```
|
|
@@ -68,9 +71,11 @@ or
|
|
|
68
71
|
|
|
69
72
|
```javascript
|
|
70
73
|
import { tsParticles } from "@tsparticles/engine";
|
|
74
|
+
import { loadInteractivityPlugin } from "@tsparticles/plugin-interactivity";
|
|
71
75
|
import { loadExternalParallaxInteraction } from "@tsparticles/interaction-external-parallax";
|
|
72
76
|
|
|
73
77
|
(async () => {
|
|
78
|
+
await loadInteractivityPlugin(tsParticles);
|
|
74
79
|
await loadExternalParallaxInteraction(tsParticles);
|
|
75
80
|
})();
|
|
76
81
|
```
|
package/browser/Parallaxer.js
CHANGED
|
@@ -3,6 +3,7 @@ import { half, isInArray } from "@tsparticles/engine";
|
|
|
3
3
|
import { Parallax } from "./Options/Classes/Parallax.js";
|
|
4
4
|
const parallaxMode = "parallax";
|
|
5
5
|
export class Parallaxer extends ExternalInteractorBase {
|
|
6
|
+
maxDistance = 0;
|
|
6
7
|
constructor(container) {
|
|
7
8
|
super(container);
|
|
8
9
|
}
|
package/browser/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalParallaxInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalParallax", async (container) => {
|
|
7
7
|
const { Parallaxer } = await import("./Parallaxer.js");
|
|
8
8
|
return new Parallaxer(container);
|
package/cjs/Parallaxer.js
CHANGED
|
@@ -3,6 +3,7 @@ import { half, isInArray } from "@tsparticles/engine";
|
|
|
3
3
|
import { Parallax } from "./Options/Classes/Parallax.js";
|
|
4
4
|
const parallaxMode = "parallax";
|
|
5
5
|
export class Parallaxer extends ExternalInteractorBase {
|
|
6
|
+
maxDistance = 0;
|
|
6
7
|
constructor(container) {
|
|
7
8
|
super(container);
|
|
8
9
|
}
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalParallaxInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalParallax", async (container) => {
|
|
7
7
|
const { Parallaxer } = await import("./Parallaxer.js");
|
|
8
8
|
return new Parallaxer(container);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Parallaxer: () => (/* binding */ Parallaxer)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Parallax_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Parallax.js */ \"./dist/browser/Options/Classes/Parallax.js\");\n\n\n\nconst parallaxMode = \"parallax\";\nclass Parallaxer extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Parallaxer: () => (/* binding */ Parallaxer)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_Parallax_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Parallax.js */ \"./dist/browser/Options/Classes/Parallax.js\");\n\n\n\nconst parallaxMode = \"parallax\";\nclass Parallaxer extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n maxDistance = 0;\n constructor(container){\n super(container);\n }\n clear() {}\n init() {}\n interact(interactivityData) {\n for (const particle of this.container.particles.filter((p)=>this.isEnabled(interactivityData, p))){\n this._parallaxInteract(interactivityData, particle);\n }\n }\n isEnabled(interactivityData, particle) {\n const container = this.container, mouse = interactivityData.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity)?.events;\n return !!events?.onHover.enable && !!mouse.position && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.isInArray)(parallaxMode, events.onHover.mode);\n }\n loadModeOptions(options, ...sources) {\n options.parallax ??= new _Options_Classes_Parallax_js__WEBPACK_IMPORTED_MODULE_2__.Parallax();\n for (const source of sources){\n options.parallax.load(source?.parallax);\n }\n }\n reset() {}\n _parallaxInteract(interactivityData, particle) {\n if (!this.isEnabled(interactivityData, particle)) {\n return;\n }\n const container = this.container, options = container.actualOptions, parallaxOptions = options.interactivity?.modes.parallax;\n if (!parallaxOptions) {\n return;\n }\n const parallaxForce = parallaxOptions.force, mousePos = interactivityData.mouse.position;\n if (!mousePos) {\n return;\n }\n const canvasSize = container.canvas.size, canvasCenter = {\n x: canvasSize.width * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.half,\n y: canvasSize.height * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_1__.half\n }, parallaxSmooth = parallaxOptions.smooth, factor = particle.getRadius() / parallaxForce, centerDistance = {\n x: (mousePos.x - canvasCenter.x) * factor,\n y: (mousePos.y - canvasCenter.y) * factor\n }, { offset } = particle;\n offset.x += (centerDistance.x - offset.x) / parallaxSmooth;\n offset.y += (centerDistance.y - offset.y) / parallaxSmooth;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-parallax/./dist/browser/Parallaxer.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/Parallaxer.js
CHANGED
|
@@ -3,6 +3,7 @@ import { half, isInArray } from "@tsparticles/engine";
|
|
|
3
3
|
import { Parallax } from "./Options/Classes/Parallax.js";
|
|
4
4
|
const parallaxMode = "parallax";
|
|
5
5
|
export class Parallaxer extends ExternalInteractorBase {
|
|
6
|
+
maxDistance = 0;
|
|
6
7
|
constructor(container) {
|
|
7
8
|
super(container);
|
|
8
9
|
}
|
package/esm/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export async function loadExternalParallaxInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-
|
|
2
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
3
3
|
await engine.register(async (e) => {
|
|
4
|
-
const {
|
|
5
|
-
|
|
4
|
+
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
|
+
ensureInteractivityPluginLoaded(e);
|
|
6
6
|
e.addInteractor?.("externalParallax", async (container) => {
|
|
7
7
|
const { Parallaxer } = await import("./Parallaxer.js");
|
|
8
8
|
return new Parallaxer(container);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-parallax",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta.0",
|
|
4
4
|
"description": "tsParticles parallax external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "4.0.0-
|
|
91
|
-
"@tsparticles/plugin-interactivity": "4.0.0-
|
|
90
|
+
"@tsparticles/engine": "4.0.0-beta.0",
|
|
91
|
+
"@tsparticles/plugin-interactivity": "4.0.0-beta.0"
|
|
92
92
|
},
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"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-external-parallax [
|
|
6
|
+
<title>@tsparticles/interaction-external-parallax [19 Mar 2026 at 13:59]</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
|
-
* v4.0.0-
|
|
7
|
+
* v4.0.0-beta.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,26 +28,6 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
-
/***/ "./dist/browser/Options/Classes/Parallax.js"
|
|
32
|
-
/*!**************************************************!*\
|
|
33
|
-
!*** ./dist/browser/Options/Classes/Parallax.js ***!
|
|
34
|
-
\**************************************************/
|
|
35
|
-
(__unused_webpack___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 */ Parallax: () => (/* binding */ Parallax)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass Parallax {\n constructor() {\n this.force = 2;\n this.smooth = 10;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.force !== undefined) {\n this.force = data.force;\n }\n if (data.smooth !== undefined) {\n this.smooth = data.smooth;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-parallax/./dist/browser/Options/Classes/Parallax.js?\n}");
|
|
38
|
-
|
|
39
|
-
/***/ },
|
|
40
|
-
|
|
41
|
-
/***/ "./dist/browser/index.js"
|
|
42
|
-
/*!*******************************!*\
|
|
43
|
-
!*** ./dist/browser/index.js ***!
|
|
44
|
-
\*******************************/
|
|
45
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
|
-
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Parallax: () => (/* reexport safe */ _Options_Classes_Parallax_js__WEBPACK_IMPORTED_MODULE_0__.Parallax),\n/* harmony export */ loadExternalParallaxInteraction: () => (/* binding */ loadExternalParallaxInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Parallax_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Parallax.js */ \"./dist/browser/Options/Classes/Parallax.js\");\nasync function loadExternalParallaxInteraction(engine) {\n engine.checkVersion(\"4.0.0-alpha.8\");\n await engine.register(async e => {\n const {\n loadInteractivityPlugin\n } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n await loadInteractivityPlugin(e);\n e.addInteractor?.(\"externalParallax\", async container => {\n const {\n Parallaxer\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Parallaxer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Parallaxer.js */ \"./dist/browser/Parallaxer.js\"));\n return new Parallaxer(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-parallax/./dist/browser/index.js?\n}");
|
|
48
|
-
|
|
49
|
-
/***/ },
|
|
50
|
-
|
|
51
31
|
/***/ "@tsparticles/engine"
|
|
52
32
|
/*!*********************************************************************************************************************************!*\
|
|
53
33
|
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
@@ -66,6 +46,26 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
66
46
|
|
|
67
47
|
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
68
48
|
|
|
49
|
+
/***/ },
|
|
50
|
+
|
|
51
|
+
/***/ "./dist/browser/Options/Classes/Parallax.js"
|
|
52
|
+
/*!**************************************************!*\
|
|
53
|
+
!*** ./dist/browser/Options/Classes/Parallax.js ***!
|
|
54
|
+
\**************************************************/
|
|
55
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
|
+
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Parallax: () => (/* binding */ Parallax)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass Parallax {\n force;\n smooth;\n constructor(){\n this.force = 2;\n this.smooth = 10;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.force !== undefined) {\n this.force = data.force;\n }\n if (data.smooth !== undefined) {\n this.smooth = data.smooth;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-parallax/./dist/browser/Options/Classes/Parallax.js?\n}");
|
|
58
|
+
|
|
59
|
+
/***/ },
|
|
60
|
+
|
|
61
|
+
/***/ "./dist/browser/index.js"
|
|
62
|
+
/*!*******************************!*\
|
|
63
|
+
!*** ./dist/browser/index.js ***!
|
|
64
|
+
\*******************************/
|
|
65
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
66
|
+
|
|
67
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Parallax: () => (/* reexport safe */ _Options_Classes_Parallax_js__WEBPACK_IMPORTED_MODULE_0__.Parallax),\n/* harmony export */ loadExternalParallaxInteraction: () => (/* binding */ loadExternalParallaxInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Parallax_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Parallax.js */ \"./dist/browser/Options/Classes/Parallax.js\");\nasync function loadExternalParallaxInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.0\");\n await engine.register(async (e)=>{\n const { ensureInteractivityPluginLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n ensureInteractivityPluginLoaded(e);\n e.addInteractor?.(\"externalParallax\", async (container)=>{\n const { Parallaxer } = await __webpack_require__.e(/*! import() */ \"dist_browser_Parallaxer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Parallaxer.js */ \"./dist/browser/Parallaxer.js\"));\n return new Parallaxer(container);\n });\n });\n}\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-parallax/./dist/browser/index.js?\n}");
|
|
68
|
+
|
|
69
69
|
/***/ }
|
|
70
70
|
|
|
71
71
|
/******/ });
|
|
@@ -80,12 +80,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
80
80
|
/******/ if (cachedModule !== undefined) {
|
|
81
81
|
/******/ return cachedModule.exports;
|
|
82
82
|
/******/ }
|
|
83
|
-
/******/ // Check if module exists (development only)
|
|
84
|
-
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
85
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
86
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
87
|
-
/******/ throw e;
|
|
88
|
-
/******/ }
|
|
89
83
|
/******/ // Create a new module (and put it into the cache)
|
|
90
84
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
91
85
|
/******/ // no module.id needed
|
|
@@ -94,6 +88,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
94
88
|
/******/ };
|
|
95
89
|
/******/
|
|
96
90
|
/******/ // Execute the module function
|
|
91
|
+
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
92
|
+
/******/ delete __webpack_module_cache__[moduleId];
|
|
93
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
94
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
95
|
+
/******/ throw e;
|
|
96
|
+
/******/ }
|
|
97
97
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
98
98
|
/******/
|
|
99
99
|
/******/ // Return the exports of the module
|
|
@@ -168,6 +168,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
168
168
|
/******/ };
|
|
169
169
|
/******/ })();
|
|
170
170
|
/******/
|
|
171
|
+
/******/ /* webpack/runtime/global */
|
|
172
|
+
/******/ (() => {
|
|
173
|
+
/******/ __webpack_require__.g = (function() {
|
|
174
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
175
|
+
/******/ try {
|
|
176
|
+
/******/ return this || new Function('return this')();
|
|
177
|
+
/******/ } catch (e) {
|
|
178
|
+
/******/ if (typeof window === 'object') return window;
|
|
179
|
+
/******/ }
|
|
180
|
+
/******/ })();
|
|
181
|
+
/******/ })();
|
|
182
|
+
/******/
|
|
171
183
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
172
184
|
/******/ (() => {
|
|
173
185
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
@@ -232,8 +244,8 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
|
|
|
232
244
|
/******/ /* webpack/runtime/publicPath */
|
|
233
245
|
/******/ (() => {
|
|
234
246
|
/******/ var scriptUrl;
|
|
235
|
-
/******/ if (
|
|
236
|
-
/******/ var document =
|
|
247
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
248
|
+
/******/ var document = __webpack_require__.g.document;
|
|
237
249
|
/******/ if (!scriptUrl && document) {
|
|
238
250
|
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
239
251
|
/******/ scriptUrl = document.currentScript.src;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/plugin-interactivity"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/plugin-interactivity")):t(e.window,e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e,t)=>(()=>{"use strict";var r,o,i,a={303(t){t.exports=e},702(e){e.exports=t},946(e,t,r){r.d(t,{k:()=>i});var o=r(303);class i{force;smooth;constructor(){this.force=2,this.smooth=10}load(e){(0,o.isNull)(e)||(void 0!==e.force&&(this.force=e.force),void 0!==e.smooth&&(this.smooth=e.smooth))}}}},n={};function c(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return a[e](r,r.exports,c),r.exports}c.m=a,s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var r=Object.create(null);c.r(r);var o={};l=l||[null,s({}),s([]),s(s)];for(var i=2&t&&e;("object"==typeof i||"function"==typeof i)&&!~l.indexOf(i);i=s(i))Object.getOwnPropertyNames(i).forEach(t=>o[t]=()=>e[t]);return o.default=()=>e,c.d(r,o),r},c.d=(e,t)=>{for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.f={},c.e=e=>Promise.all(Object.keys(c.f).reduce((t,r)=>(c.f[r](e,t),t),[])),c.u=e=>""+e+".min.js",c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),p={},c.l=(e,t,r,o)=>{if(p[e])return void p[e].push(t);if(void 0!==r)for(var i,a,n=document.getElementsByTagName("script"),l=0;l<n.length;l++){var s=n[l];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")=="@tsparticles/interaction-external-parallax:"+r){i=s;break}}i||(a=!0,(i=document.createElement("script")).charset="utf-8",c.nc&&i.setAttribute("nonce",c.nc),i.setAttribute("data-webpack","@tsparticles/interaction-external-parallax:"+r),i.src=e),p[e]=[t];var u=(t,r)=>{i.onerror=i.onload=null,clearTimeout(f);var o=p[e];if(delete p[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),a&&document.head.appendChild(i)},c.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(u=c.g.location+"");var l,s,p,u,f=c.g.document;if(!u&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(u=f.currentScript.src),!u)){var d=f.getElementsByTagName("script");if(d.length)for(var h=d.length-1;h>-1&&(!u||!/^http(s?):/.test(u));)u=d[h--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");c.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={207:0},c.f.j=(e,t)=>{var o=c.o(r,e)?r[e]:void 0;if(0!==o)if(o)t.push(o[2]);else{var i=new Promise((t,i)=>o=r[e]=[t,i]);t.push(o[2]=i);var a=c.p+c.u(e),n=Error();c.l(a,t=>{if(c.o(r,e)&&(0!==(o=r[e])&&(r[e]=void 0),o)){var i=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;n.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+i+": "+a+")",n.name="ChunkLoadError",n.type=i,n.request=a,o[1](n)}},"chunk-"+e,e)}},o=(e,t)=>{var o,i,[a,n,l]=t,s=0;if(a.some(e=>0!==r[e])){for(o in n)c.o(n,o)&&(c.m[o]=n[o]);l&&l(c)}for(e&&e(t);s<a.length;s++)i=a[s],c.o(r,i)&&r[i]&&r[i][0](),r[i]=0},(i=this.webpackChunk_tsparticles_interaction_external_parallax=this.webpackChunk_tsparticles_interaction_external_parallax||[]).forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var b={};c.r(b),c.d(b,{Parallax:()=>m.k,loadExternalParallaxInteraction:()=>v});var m=c(946);async function v(e){e.checkVersion("4.0.0-beta.0"),await e.register(async e=>{let{ensureInteractivityPluginLoaded:t}=await Promise.resolve().then(c.t.bind(c,702,19));t(e),e.addInteractor?.("externalParallax",async e=>{let{Parallaxer:t}=await c.e(927).then(c.bind(c,927));return new t(e)})})}return b})());
|
package/types/Parallaxer.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ExternalInteractorBase, type IInteractivityData, type IModes, type Inte
|
|
|
2
2
|
import type { IParallaxMode, ParallaxContainer, ParallaxMode } from "./Types.js";
|
|
3
3
|
import { type RecursivePartial } from "@tsparticles/engine";
|
|
4
4
|
export declare class Parallaxer extends ExternalInteractorBase<ParallaxContainer> {
|
|
5
|
+
readonly maxDistance = 0;
|
|
5
6
|
constructor(container: ParallaxContainer);
|
|
6
7
|
clear(): void;
|
|
7
8
|
init(): void;
|
package/umd/Parallaxer.js
CHANGED
package/umd/index.js
CHANGED
|
@@ -48,10 +48,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
48
48
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
49
|
exports.loadExternalParallaxInteraction = loadExternalParallaxInteraction;
|
|
50
50
|
async function loadExternalParallaxInteraction(engine) {
|
|
51
|
-
engine.checkVersion("4.0.0-
|
|
51
|
+
engine.checkVersion("4.0.0-beta.0");
|
|
52
52
|
await engine.register(async (e) => {
|
|
53
|
-
const {
|
|
54
|
-
|
|
53
|
+
const { ensureInteractivityPluginLoaded } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("@tsparticles/plugin-interactivity"))) : new Promise((resolve_1, reject_1) => { require(["@tsparticles/plugin-interactivity"], resolve_1, reject_1); }).then(__importStar));
|
|
54
|
+
ensureInteractivityPluginLoaded(e);
|
|
55
55
|
e.addInteractor?.("externalParallax", async (container) => {
|
|
56
56
|
const { Parallaxer } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Parallaxer.js"))) : new Promise((resolve_2, reject_2) => { require(["./Parallaxer.js"], resolve_2, reject_2); }).then(__importStar));
|
|
57
57
|
return new Parallaxer(container);
|
package/411.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 411.min.js.LICENSE.txt */
|
|
2
|
-
(this.webpackChunk_tsparticles_interaction_external_parallax=this.webpackChunk_tsparticles_interaction_external_parallax||[]).push([[411],{411(a,t,e){e.d(t,{Parallaxer:()=>s});var r=e(702),n=e(303),i=e(950);class s extends r.ExternalInteractorBase{constructor(a){super(a)}clear(){}init(){}interact(a){for(const t of this.container.particles.filter((t=>this.isEnabled(a,t))))this._parallaxInteract(a,t)}isEnabled(a,t){const e=this.container,r=a.mouse,i=(t?.interactivity??e.actualOptions.interactivity)?.events;return!!i?.onHover.enable&&!!r.position&&(0,n.isInArray)("parallax",i.onHover.mode)}loadModeOptions(a,...t){a.parallax??=new i.k;for(const e of t)a.parallax.load(e?.parallax)}reset(){}_parallaxInteract(a,t){if(!this.isEnabled(a,t))return;const e=this.container,r=e.actualOptions,i=r.interactivity?.modes.parallax;if(!i)return;const s=i.force,o=a.mouse.position;if(!o)return;const l=e.canvas.size,c=l.width*n.half,p=l.height*n.half,h=i.smooth,x=t.getRadius()/s,u=(o.x-c)*x,f=(o.y-p)*x,{offset:d}=t;d.x+=(u-d.x)/h,d.y+=(f-d.y)/h}}}}]);
|
package/411.min.js.LICENSE.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Parallax External Interaction v4.0.0-alpha.8 by Matteo Bruni */
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! tsParticles Parallax External Interaction v4.0.0-alpha.8 by Matteo Bruni */
|