@tsparticles/move-parallax 3.9.0 → 4.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.9.0
7
+ * v4.0.0-alpha.0
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -16,47 +16,27 @@
16
16
  */
17
17
  (function webpackUniversalModuleDefinition(root, factory) {
18
18
  if(typeof exports === 'object' && typeof module === 'object')
19
- module.exports = factory(require("@tsparticles/engine"));
19
+ module.exports = factory();
20
20
  else if(typeof define === 'function' && define.amd)
21
- define(["@tsparticles/engine"], factory);
21
+ define([], factory);
22
22
  else {
23
- var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
23
+ var a = factory();
24
24
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
25
25
  }
26
- })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
26
+ })(this, () => {
27
27
  return /******/ (() => { // webpackBootstrap
28
28
  /******/ "use strict";
29
29
  /******/ var __webpack_modules__ = ({
30
30
 
31
- /***/ "./dist/browser/ParallaxMover.js":
32
- /*!***************************************!*\
33
- !*** ./dist/browser/ParallaxMover.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 */ ParallaxMover: () => (/* binding */ ParallaxMover)\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 half = 0.5;\nclass ParallaxMover {\n init() {}\n isEnabled(particle) {\n return !(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isSsr)() && !particle.destroyed && particle.container.actualOptions.interactivity.events.onHover.parallax.enable;\n }\n move(particle) {\n const container = particle.container,\n options = container.actualOptions,\n parallaxOptions = options.interactivity.events.onHover.parallax;\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isSsr)() || !parallaxOptions.enable) {\n return;\n }\n const parallaxForce = parallaxOptions.force,\n mousePos = container.interactivity.mouse.position;\n if (!mousePos) {\n return;\n }\n const canvasSize = container.canvas.size,\n canvasCenter = {\n x: canvasSize.width * half,\n y: canvasSize.height * half\n },\n parallaxSmooth = parallaxOptions.smooth,\n factor = particle.getRadius() / parallaxForce,\n centerDistance = {\n x: (mousePos.x - canvasCenter.x) * factor,\n y: (mousePos.y - canvasCenter.y) * factor\n },\n {\n offset\n } = particle;\n offset.x += (centerDistance.x - offset.x) / parallaxSmooth;\n offset.y += (centerDistance.y - offset.y) / parallaxSmooth;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/move-parallax/./dist/browser/ParallaxMover.js?\n}");
38
-
39
- /***/ }),
40
-
41
- /***/ "./dist/browser/index.js":
31
+ /***/ "./dist/browser/index.js"
42
32
  /*!*******************************!*\
43
33
  !*** ./dist/browser/index.js ***!
44
34
  \*******************************/
45
- /***/ ((__unused_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 */ loadParallaxMover: () => (/* binding */ loadParallaxMover)\n/* harmony export */ });\n/* harmony import */ var _ParallaxMover_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ParallaxMover.js */ \"./dist/browser/ParallaxMover.js\");\n\nasync function loadParallaxMover(engine, refresh = true) {\n engine.checkVersion(\"3.9.0\");\n await engine.addMover(\"parallax\", () => {\n return Promise.resolve(new _ParallaxMover_js__WEBPACK_IMPORTED_MODULE_0__.ParallaxMover());\n }, refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/move-parallax/./dist/browser/index.js?\n}");
35
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
48
36
 
49
- /***/ }),
37
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadParallaxMover: () => (/* binding */ loadParallaxMover)\n/* harmony export */ });\nfunction loadParallaxMover(engine) {\n engine.checkVersion(\"4.0.0-alpha.0\");\n engine.register(e => {\n e.addMover(\"parallax\", async () => {\n const {\n ParallaxMover\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_ParallaxMover_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ParallaxMover.js */ \"./dist/browser/ParallaxMover.js\"));\n return new ParallaxMover();\n });\n });\n}\n\n//# sourceURL=webpack://@tsparticles/move-parallax/./dist/browser/index.js?\n}");
50
38
 
51
- /***/ "@tsparticles/engine":
52
- /*!*********************************************************************************************************************************!*\
53
- !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
54
- \*********************************************************************************************************************************/
55
- /***/ ((module) => {
56
-
57
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
58
-
59
- /***/ })
39
+ /***/ }
60
40
 
61
41
  /******/ });
62
42
  /************************************************************************/
@@ -70,6 +50,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
70
50
  /******/ if (cachedModule !== undefined) {
71
51
  /******/ return cachedModule.exports;
72
52
  /******/ }
53
+ /******/ // Check if module exists (development only)
54
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
55
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
56
+ /******/ e.code = 'MODULE_NOT_FOUND';
57
+ /******/ throw e;
58
+ /******/ }
73
59
  /******/ // Create a new module (and put it into the cache)
74
60
  /******/ var module = __webpack_module_cache__[moduleId] = {
75
61
  /******/ // no module.id needed
@@ -84,19 +70,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
84
70
  /******/ return module.exports;
85
71
  /******/ }
86
72
  /******/
87
- /************************************************************************/
88
- /******/ /* webpack/runtime/compat get default export */
89
- /******/ (() => {
90
- /******/ // getDefaultExport function for compatibility with non-harmony modules
91
- /******/ __webpack_require__.n = (module) => {
92
- /******/ var getter = module && module.__esModule ?
93
- /******/ () => (module['default']) :
94
- /******/ () => (module);
95
- /******/ __webpack_require__.d(getter, { a: getter });
96
- /******/ return getter;
97
- /******/ };
98
- /******/ })();
73
+ /******/ // expose the modules object (__webpack_modules__)
74
+ /******/ __webpack_require__.m = __webpack_modules__;
99
75
  /******/
76
+ /************************************************************************/
100
77
  /******/ /* webpack/runtime/define property getters */
101
78
  /******/ (() => {
102
79
  /******/ // define getter functions for harmony exports
@@ -109,11 +86,90 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
109
86
  /******/ };
110
87
  /******/ })();
111
88
  /******/
89
+ /******/ /* webpack/runtime/ensure chunk */
90
+ /******/ (() => {
91
+ /******/ __webpack_require__.f = {};
92
+ /******/ // This file contains only the entry chunk.
93
+ /******/ // The chunk loading function for additional chunks
94
+ /******/ __webpack_require__.e = (chunkId) => {
95
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
96
+ /******/ __webpack_require__.f[key](chunkId, promises);
97
+ /******/ return promises;
98
+ /******/ }, []));
99
+ /******/ };
100
+ /******/ })();
101
+ /******/
102
+ /******/ /* webpack/runtime/get javascript chunk filename */
103
+ /******/ (() => {
104
+ /******/ // This function allow to reference async chunks
105
+ /******/ __webpack_require__.u = (chunkId) => {
106
+ /******/ // return url for filenames based on template
107
+ /******/ return "" + chunkId + ".js";
108
+ /******/ };
109
+ /******/ })();
110
+ /******/
111
+ /******/ /* webpack/runtime/global */
112
+ /******/ (() => {
113
+ /******/ __webpack_require__.g = (function() {
114
+ /******/ if (typeof globalThis === 'object') return globalThis;
115
+ /******/ try {
116
+ /******/ return this || new Function('return this')();
117
+ /******/ } catch (e) {
118
+ /******/ if (typeof window === 'object') return window;
119
+ /******/ }
120
+ /******/ })();
121
+ /******/ })();
122
+ /******/
112
123
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
113
124
  /******/ (() => {
114
125
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
115
126
  /******/ })();
116
127
  /******/
128
+ /******/ /* webpack/runtime/load script */
129
+ /******/ (() => {
130
+ /******/ var inProgress = {};
131
+ /******/ var dataWebpackPrefix = "@tsparticles/move-parallax:";
132
+ /******/ // loadScript function to load a script via script tag
133
+ /******/ __webpack_require__.l = (url, done, key, chunkId) => {
134
+ /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
135
+ /******/ var script, needAttach;
136
+ /******/ if(key !== undefined) {
137
+ /******/ var scripts = document.getElementsByTagName("script");
138
+ /******/ for(var i = 0; i < scripts.length; i++) {
139
+ /******/ var s = scripts[i];
140
+ /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
141
+ /******/ }
142
+ /******/ }
143
+ /******/ if(!script) {
144
+ /******/ needAttach = true;
145
+ /******/ script = document.createElement('script');
146
+ /******/
147
+ /******/ script.charset = 'utf-8';
148
+ /******/ if (__webpack_require__.nc) {
149
+ /******/ script.setAttribute("nonce", __webpack_require__.nc);
150
+ /******/ }
151
+ /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
152
+ /******/
153
+ /******/ script.src = url;
154
+ /******/ }
155
+ /******/ inProgress[url] = [done];
156
+ /******/ var onScriptComplete = (prev, event) => {
157
+ /******/ // avoid mem leaks in IE.
158
+ /******/ script.onerror = script.onload = null;
159
+ /******/ clearTimeout(timeout);
160
+ /******/ var doneFns = inProgress[url];
161
+ /******/ delete inProgress[url];
162
+ /******/ script.parentNode && script.parentNode.removeChild(script);
163
+ /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
164
+ /******/ if(prev) return prev(event);
165
+ /******/ }
166
+ /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
167
+ /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
168
+ /******/ script.onload = onScriptComplete.bind(null, script.onload);
169
+ /******/ needAttach && document.head.appendChild(script);
170
+ /******/ };
171
+ /******/ })();
172
+ /******/
117
173
  /******/ /* webpack/runtime/make namespace object */
118
174
  /******/ (() => {
119
175
  /******/ // define __esModule on exports
@@ -125,6 +181,119 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
125
181
  /******/ };
126
182
  /******/ })();
127
183
  /******/
184
+ /******/ /* webpack/runtime/publicPath */
185
+ /******/ (() => {
186
+ /******/ var scriptUrl;
187
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
188
+ /******/ var document = __webpack_require__.g.document;
189
+ /******/ if (!scriptUrl && document) {
190
+ /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
191
+ /******/ scriptUrl = document.currentScript.src;
192
+ /******/ if (!scriptUrl) {
193
+ /******/ var scripts = document.getElementsByTagName("script");
194
+ /******/ if(scripts.length) {
195
+ /******/ var i = scripts.length - 1;
196
+ /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
197
+ /******/ }
198
+ /******/ }
199
+ /******/ }
200
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
201
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
202
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
203
+ /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
204
+ /******/ __webpack_require__.p = scriptUrl;
205
+ /******/ })();
206
+ /******/
207
+ /******/ /* webpack/runtime/jsonp chunk loading */
208
+ /******/ (() => {
209
+ /******/ // no baseURI
210
+ /******/
211
+ /******/ // object to store loaded and loading chunks
212
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
213
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
214
+ /******/ var installedChunks = {
215
+ /******/ "tsparticles.move.parallax": 0
216
+ /******/ };
217
+ /******/
218
+ /******/ __webpack_require__.f.j = (chunkId, promises) => {
219
+ /******/ // JSONP chunk loading for javascript
220
+ /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
221
+ /******/ if(installedChunkData !== 0) { // 0 means "already installed".
222
+ /******/
223
+ /******/ // a Promise means "currently loading".
224
+ /******/ if(installedChunkData) {
225
+ /******/ promises.push(installedChunkData[2]);
226
+ /******/ } else {
227
+ /******/ if(true) { // all chunks have JS
228
+ /******/ // setup Promise in chunk cache
229
+ /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
230
+ /******/ promises.push(installedChunkData[2] = promise);
231
+ /******/
232
+ /******/ // start chunk loading
233
+ /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
234
+ /******/ // create error before stack unwound to get useful stacktrace later
235
+ /******/ var error = new Error();
236
+ /******/ var loadingEnded = (event) => {
237
+ /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
238
+ /******/ installedChunkData = installedChunks[chunkId];
239
+ /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
240
+ /******/ if(installedChunkData) {
241
+ /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
242
+ /******/ var realSrc = event && event.target && event.target.src;
243
+ /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
244
+ /******/ error.name = 'ChunkLoadError';
245
+ /******/ error.type = errorType;
246
+ /******/ error.request = realSrc;
247
+ /******/ installedChunkData[1](error);
248
+ /******/ }
249
+ /******/ }
250
+ /******/ };
251
+ /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
252
+ /******/ }
253
+ /******/ }
254
+ /******/ }
255
+ /******/ };
256
+ /******/
257
+ /******/ // no prefetching
258
+ /******/
259
+ /******/ // no preloaded
260
+ /******/
261
+ /******/ // no HMR
262
+ /******/
263
+ /******/ // no HMR manifest
264
+ /******/
265
+ /******/ // no on chunks loaded
266
+ /******/
267
+ /******/ // install a JSONP callback for chunk loading
268
+ /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
269
+ /******/ var [chunkIds, moreModules, runtime] = data;
270
+ /******/ // add "moreModules" to the modules object,
271
+ /******/ // then flag all "chunkIds" as loaded and fire callback
272
+ /******/ var moduleId, chunkId, i = 0;
273
+ /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
274
+ /******/ for(moduleId in moreModules) {
275
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
276
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
277
+ /******/ }
278
+ /******/ }
279
+ /******/ if(runtime) var result = runtime(__webpack_require__);
280
+ /******/ }
281
+ /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
282
+ /******/ for(;i < chunkIds.length; i++) {
283
+ /******/ chunkId = chunkIds[i];
284
+ /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
285
+ /******/ installedChunks[chunkId][0]();
286
+ /******/ }
287
+ /******/ installedChunks[chunkId] = 0;
288
+ /******/ }
289
+ /******/
290
+ /******/ }
291
+ /******/
292
+ /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_move_parallax"] = this["webpackChunk_tsparticles_move_parallax"] || [];
293
+ /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
294
+ /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
295
+ /******/ })();
296
+ /******/
128
297
  /************************************************************************/
129
298
  /******/
130
299
  /******/ // startup
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.move.parallax.min.js.LICENSE.txt */
2
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{loadParallaxMover:()=>s});var i=o(303);class a{init(){}isEnabled(e){return!(0,i.isSsr)()&&!e.destroyed&&e.container.actualOptions.interactivity.events.onHover.parallax.enable}move(e){const t=e.container,r=t.actualOptions.interactivity.events.onHover.parallax;if((0,i.isSsr)()||!r.enable)return;const o=r.force,n=t.interactivity.mouse.position;if(!n)return;const a=t.canvas.size,s=.5*a.width,l=.5*a.height,c=r.smooth,p=e.getRadius()/o,f=(n.x-s)*p,d=(n.y-l)*p,{offset:u}=e;u.x+=(f-u.x)/c,u.y+=(d-u.y)/c}}async function s(e,t=!0){e.checkVersion("3.9.0"),await e.addMover("parallax",(()=>Promise.resolve(new a)),t)}return n})()));
2
+ !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var t=r();for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,(()=>(()=>{var e,r,t={},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,a),n.exports}a.m=t,a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce(((r,t)=>(a.f[t](e,r),r)),[])),a.u=e=>e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),e={},r="@tsparticles/move-parallax:",a.l=(t,o,n,i)=>{if(e[t])e[t].push(o);else{var l,s;if(void 0!==n)for(var c=document.getElementsByTagName("script"),p=0;p<c.length;p++){var u=c[p];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==r+n){l=u;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",a.nc&&l.setAttribute("nonce",a.nc),l.setAttribute("data-webpack",r+n),l.src=t),e[t]=[o];var d=(r,o)=>{l.onerror=l.onload=null,clearTimeout(f);var a=e[t];if(delete e[t],l.parentNode&&l.parentNode.removeChild(l),a&&a.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=d.bind(null,l.onerror),l.onload=d.bind(null,l.onload),s&&document.head.appendChild(l)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={55:0};a.f.j=(r,t)=>{var o=a.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else{var n=new Promise(((t,a)=>o=e[r]=[t,a]));t.push(o[2]=n);var i=a.p+a.u(r),l=new Error;a.l(i,(t=>{if(a.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var n=t&&("load"===t.type?"missing":t.type),i=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+n+": "+i+")",l.name="ChunkLoadError",l.type=n,l.request=i,o[1](l)}}),"chunk-"+r,r)}};var r=(r,t)=>{var o,n,[i,l,s]=t,c=0;if(i.some((r=>0!==e[r]))){for(o in l)a.o(l,o)&&(a.m[o]=l[o]);if(s)s(a)}for(r&&r(t);c<i.length;c++)n=i[c],a.o(e,n)&&e[n]&&e[n][0](),e[n]=0},t=this.webpackChunk_tsparticles_move_parallax=this.webpackChunk_tsparticles_move_parallax||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var n={};function i(e){e.checkVersion("4.0.0-alpha.0"),e.register((e=>{e.addMover("parallax",(async()=>{const{ParallaxMover:e}=await a.e(189).then(a.bind(a,189));return new e}))}))}return a.r(n),a.d(n,{loadParallaxMover:()=>i}),n})()));
@@ -1 +1 @@
1
- /*! tsParticles Parallax Move v3.9.0 by Matteo Bruni */
1
+ /*! tsParticles Parallax Move v4.0.0-alpha.0 by Matteo Bruni */
package/types/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  import { type Engine } from "@tsparticles/engine";
2
- export declare function loadParallaxMover(engine: Engine, refresh?: boolean): Promise<void>;
2
+ export declare function loadParallaxMover(engine: Engine): void;
@@ -4,25 +4,22 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "@tsparticles/engine"], factory);
7
+ define(["require", "exports"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ParallaxMover = void 0;
13
- const engine_1 = require("@tsparticles/engine");
14
13
  const half = 0.5;
15
14
  class ParallaxMover {
16
15
  init() {
17
16
  }
18
17
  isEnabled(particle) {
19
- return (!(0, engine_1.isSsr)() &&
20
- !particle.destroyed &&
21
- particle.container.actualOptions.interactivity.events.onHover.parallax.enable);
18
+ return !particle.destroyed && particle.container.actualOptions.interactivity.events.onHover.parallax.enable;
22
19
  }
23
20
  move(particle) {
24
21
  const container = particle.container, options = container.actualOptions, parallaxOptions = options.interactivity.events.onHover.parallax;
25
- if ((0, engine_1.isSsr)() || !parallaxOptions.enable) {
22
+ if (!parallaxOptions.enable) {
26
23
  return;
27
24
  }
28
25
  const parallaxForce = parallaxOptions.force, mousePos = container.interactivity.mouse.position;
package/umd/index.js CHANGED
@@ -1,20 +1,56 @@
1
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
+ if (k2 === undefined) k2 = k;
3
+ var desc = Object.getOwnPropertyDescriptor(m, k);
4
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
5
+ desc = { enumerable: true, get: function() { return m[k]; } };
6
+ }
7
+ Object.defineProperty(o, k2, desc);
8
+ }) : (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ o[k2] = m[k];
11
+ }));
12
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
13
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
14
+ }) : function(o, v) {
15
+ o["default"] = v;
16
+ });
17
+ var __importStar = (this && this.__importStar) || (function () {
18
+ var ownKeys = function(o) {
19
+ ownKeys = Object.getOwnPropertyNames || function (o) {
20
+ var ar = [];
21
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
22
+ return ar;
23
+ };
24
+ return ownKeys(o);
25
+ };
26
+ return function (mod) {
27
+ if (mod && mod.__esModule) return mod;
28
+ var result = {};
29
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
30
+ __setModuleDefault(result, mod);
31
+ return result;
32
+ };
33
+ })();
1
34
  (function (factory) {
2
35
  if (typeof module === "object" && typeof module.exports === "object") {
3
36
  var v = factory(require, exports);
4
37
  if (v !== undefined) module.exports = v;
5
38
  }
6
39
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./ParallaxMover.js"], factory);
40
+ define(["require", "exports"], factory);
8
41
  }
9
42
  })(function (require, exports) {
10
43
  "use strict";
44
+ var __syncRequire = typeof module === "object" && typeof module.exports === "object";
11
45
  Object.defineProperty(exports, "__esModule", { value: true });
12
46
  exports.loadParallaxMover = loadParallaxMover;
13
- const ParallaxMover_js_1 = require("./ParallaxMover.js");
14
- async function loadParallaxMover(engine, refresh = true) {
15
- engine.checkVersion("3.9.0");
16
- await engine.addMover("parallax", () => {
17
- return Promise.resolve(new ParallaxMover_js_1.ParallaxMover());
18
- }, refresh);
47
+ function loadParallaxMover(engine) {
48
+ engine.checkVersion("4.0.0-alpha.0");
49
+ engine.register(e => {
50
+ e.addMover("parallax", async () => {
51
+ const { ParallaxMover } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./ParallaxMover.js"))) : new Promise((resolve_1, reject_1) => { require(["./ParallaxMover.js"], resolve_1, reject_1); }).then(__importStar));
52
+ return new ParallaxMover();
53
+ });
54
+ });
19
55
  }
20
56
  });