Socket
Socket
Sign inDemoInstall

@tsparticles/plugin-motion

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsparticles/plugin-motion - npm Package Compare versions

Comparing version 3.3.0 to 3.4.0

2

browser/index.js

@@ -0,4 +1,4 @@

import { MotionPlugin } from "./MotionPlugin.js";
export async function loadMotionPlugin(engine, refresh = true) {
const { MotionPlugin } = await import("./MotionPlugin.js");
await engine.addPlugin(new MotionPlugin(engine), refresh);
}

@@ -5,3 +5,3 @@ import { safeMatchMedia } from "@tsparticles/engine";

constructor(container, engine) {
this._handleMotionChange = (mediaQuery) => {
this._handleMotionChange = mediaQuery => {
const container = this._container, motion = container.actualOptions.motion;

@@ -8,0 +8,0 @@ if (!motion) {

import { Motion } from "./Options/Classes/Motion.js";
import { MotionInstance } from "./MotionInstance.js";
export class MotionPlugin {

@@ -7,5 +8,4 @@ constructor(engine) {

}
async getPlugin(container) {
const { MotionInstance } = await import("./MotionInstance.js");
return new MotionInstance(container, this._engine);
getPlugin(container) {
return Promise.resolve(new MotionInstance(container, this._engine));
}

@@ -12,0 +12,0 @@ loadOptions(options, source) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadMotionPlugin = void 0;
const MotionPlugin_js_1 = require("./MotionPlugin.js");
async function loadMotionPlugin(engine, refresh = true) {
const { MotionPlugin } = await import("./MotionPlugin.js");
await engine.addPlugin(new MotionPlugin(engine), refresh);
await engine.addPlugin(new MotionPlugin_js_1.MotionPlugin(engine), refresh);
}
exports.loadMotionPlugin = loadMotionPlugin;

@@ -8,3 +8,3 @@ "use strict";

constructor(container, engine) {
this._handleMotionChange = (mediaQuery) => {
this._handleMotionChange = mediaQuery => {
const container = this._container, motion = container.actualOptions.motion;

@@ -11,0 +11,0 @@ if (!motion) {

@@ -5,2 +5,3 @@ "use strict";

const Motion_js_1 = require("./Options/Classes/Motion.js");
const MotionInstance_js_1 = require("./MotionInstance.js");
class MotionPlugin {

@@ -11,5 +12,4 @@ constructor(engine) {

}
async getPlugin(container) {
const { MotionInstance } = await import("./MotionInstance.js");
return new MotionInstance(container, this._engine);
getPlugin(container) {
return Promise.resolve(new MotionInstance_js_1.MotionInstance(container, this._engine));
}

@@ -16,0 +16,0 @@ loadOptions(options, source) {

@@ -0,4 +1,4 @@

import { MotionPlugin } from "./MotionPlugin.js";
export async function loadMotionPlugin(engine, refresh = true) {
const { MotionPlugin } = await import("./MotionPlugin.js");
await engine.addPlugin(new MotionPlugin(engine), refresh);
}

@@ -5,3 +5,3 @@ import { safeMatchMedia } from "@tsparticles/engine";

constructor(container, engine) {
this._handleMotionChange = (mediaQuery) => {
this._handleMotionChange = mediaQuery => {
const container = this._container, motion = container.actualOptions.motion;

@@ -8,0 +8,0 @@ if (!motion) {

import { Motion } from "./Options/Classes/Motion.js";
import { MotionInstance } from "./MotionInstance.js";
export class MotionPlugin {

@@ -7,5 +8,4 @@ constructor(engine) {

}
async getPlugin(container) {
const { MotionInstance } = await import("./MotionInstance.js");
return new MotionInstance(container, this._engine);
getPlugin(container) {
return Promise.resolve(new MotionInstance(container, this._engine));
}

@@ -12,0 +12,0 @@ loadOptions(options, source) {

{
"name": "@tsparticles/plugin-motion",
"version": "3.3.0",
"version": "3.4.0",
"description": "tsParticles motion sickness plugin",

@@ -89,3 +89,3 @@ "homepage": "https://particles.js.org",

"dependencies": {
"@tsparticles/engine": "^3.3.0"
"@tsparticles/engine": "^3.4.0"
},

@@ -92,0 +92,0 @@ "publishConfig": {

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v3.3.0
* v3.4.0
*/

@@ -32,2 +32,42 @@ /*

/***/ "./dist/browser/MotionInstance.js":
/*!****************************************!*\
!*** ./dist/browser/MotionInstance.js ***!
\****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MotionInstance: () => (/* binding */ MotionInstance)\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 defaultFactor = 1,\n defaultReduce = 0,\n identity = 1;\nclass MotionInstance {\n constructor(container, engine) {\n this._handleMotionChange = mediaQuery => {\n const container = this._container,\n motion = container.actualOptions.motion;\n if (!motion) {\n return;\n }\n if (mediaQuery.matches) {\n if (motion.disable) {\n container.retina.reduceFactor = defaultReduce;\n } else {\n container.retina.reduceFactor = motion.reduce.value ? identity / motion.reduce.factor : defaultFactor;\n }\n } else {\n container.retina.reduceFactor = 1;\n }\n };\n this._container = container;\n this._engine = engine;\n }\n async init() {\n const container = this._container,\n options = container.actualOptions.motion;\n if (!(options && (options.disable || options.reduce.value))) {\n container.retina.reduceFactor = 1;\n return;\n }\n const mediaQuery = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.safeMatchMedia)(\"(prefers-reduced-motion: reduce)\");\n if (!mediaQuery) {\n container.retina.reduceFactor = defaultFactor;\n return;\n }\n this._handleMotionChange(mediaQuery);\n const handleChange = () => {\n void (async () => {\n this._handleMotionChange(mediaQuery);\n try {\n await container.refresh();\n } catch {}\n })();\n };\n if (mediaQuery.addEventListener !== undefined) {\n mediaQuery.addEventListener(\"change\", handleChange);\n } else if (mediaQuery.addListener !== undefined) {\n mediaQuery.addListener(handleChange);\n }\n await Promise.resolve();\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-motion/./dist/browser/MotionInstance.js?");
/***/ }),
/***/ "./dist/browser/MotionPlugin.js":
/*!**************************************!*\
!*** ./dist/browser/MotionPlugin.js ***!
\**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MotionPlugin: () => (/* binding */ MotionPlugin)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Motion_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/Motion.js */ \"./dist/browser/Options/Classes/Motion.js\");\n/* harmony import */ var _MotionInstance_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MotionInstance.js */ \"./dist/browser/MotionInstance.js\");\n\n\nclass MotionPlugin {\n constructor(engine) {\n this.id = \"motion\";\n this._engine = engine;\n }\n getPlugin(container) {\n return Promise.resolve(new _MotionInstance_js__WEBPACK_IMPORTED_MODULE_0__.MotionInstance(container, this._engine));\n }\n loadOptions(options, source) {\n if (!this.needsPlugin()) {\n return;\n }\n let motionOptions = options.motion;\n if (!motionOptions?.load) {\n options.motion = motionOptions = new _Options_Classes_Motion_js__WEBPACK_IMPORTED_MODULE_1__.Motion();\n }\n motionOptions.load(source?.motion);\n }\n needsPlugin() {\n return true;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-motion/./dist/browser/MotionPlugin.js?");
/***/ }),
/***/ "./dist/browser/Options/Classes/Motion.js":
/*!************************************************!*\
!*** ./dist/browser/Options/Classes/Motion.js ***!
\************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Motion: () => (/* binding */ Motion)\n/* harmony export */ });\n/* harmony import */ var _MotionReduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MotionReduce.js */ \"./dist/browser/Options/Classes/MotionReduce.js\");\n\nclass Motion {\n constructor() {\n this.disable = false;\n this.reduce = new _MotionReduce_js__WEBPACK_IMPORTED_MODULE_0__.MotionReduce();\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.disable !== undefined) {\n this.disable = data.disable;\n }\n this.reduce.load(data.reduce);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-motion/./dist/browser/Options/Classes/Motion.js?");
/***/ }),
/***/ "./dist/browser/Options/Classes/MotionReduce.js":
/*!******************************************************!*\
!*** ./dist/browser/Options/Classes/MotionReduce.js ***!
\******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ MotionReduce: () => (/* binding */ MotionReduce)\n/* harmony export */ });\nclass MotionReduce {\n constructor() {\n this.factor = 4;\n this.value = true;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.factor !== undefined) {\n this.factor = data.factor;\n }\n if (data.value !== undefined) {\n this.value = data.value;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-motion/./dist/browser/Options/Classes/MotionReduce.js?");
/***/ }),
/***/ "./dist/browser/index.js":

@@ -39,3 +79,3 @@ /*!*******************************!*\

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadMotionPlugin: () => (/* binding */ loadMotionPlugin)\n/* harmony export */ });\nasync function loadMotionPlugin(engine, refresh = true) {\n const {\n MotionPlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_MotionPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./MotionPlugin.js */ \"./dist/browser/MotionPlugin.js\"));\n await engine.addPlugin(new MotionPlugin(engine), refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-motion/./dist/browser/index.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadMotionPlugin: () => (/* binding */ loadMotionPlugin)\n/* harmony export */ });\n/* harmony import */ var _MotionPlugin_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MotionPlugin.js */ \"./dist/browser/MotionPlugin.js\");\n\nasync function loadMotionPlugin(engine, refresh = true) {\n await engine.addPlugin(new _MotionPlugin_js__WEBPACK_IMPORTED_MODULE_0__.MotionPlugin(engine), refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-motion/./dist/browser/index.js?");

@@ -80,5 +120,2 @@ /***/ }),

/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/

@@ -109,36 +146,2 @@ /******/ /* webpack/runtime/compat get default export */

/******/
/******/ /* webpack/runtime/ensure chunk */
/******/ (() => {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + ".js";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */

@@ -149,48 +152,2 @@ /******/ (() => {

/******/
/******/ /* webpack/runtime/load script */
/******/ (() => {
/******/ var inProgress = {};
/******/ var dataWebpackPrefix = "@tsparticles/plugin-motion:";
/******/ // loadScript function to load a script via script tag
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
/******/ var script, needAttach;
/******/ if(key !== undefined) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ for(var i = 0; i < scripts.length; i++) {
/******/ var s = scripts[i];
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
/******/ }
/******/ }
/******/ if(!script) {
/******/ needAttach = true;
/******/ script = document.createElement('script');
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
/******/
/******/ script.src = url;
/******/ }
/******/ inProgress[url] = [done];
/******/ var onScriptComplete = (prev, event) => {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var doneFns = inProgress[url];
/******/ delete inProgress[url];
/******/ script.parentNode && script.parentNode.removeChild(script);
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
/******/ needAttach && document.head.appendChild(script);
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */

@@ -207,117 +164,2 @@ /******/ (() => {

/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ var scriptUrl;
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
/******/ var document = __webpack_require__.g.document;
/******/ if (!scriptUrl && document) {
/******/ if (document.currentScript)
/******/ scriptUrl = document.currentScript.src;
/******/ if (!scriptUrl) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ if(scripts.length) {
/******/ var i = scripts.length - 1;
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
/******/ }
/******/ }
/******/ }
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ __webpack_require__.p = scriptUrl;
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "tsparticles.plugin.motion": 0
/******/ };
/******/
/******/ __webpack_require__.f.j = (chunkId, promises) => {
/******/ // JSONP chunk loading for javascript
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ if(true) { // all chunks have JS
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ var loadingEnded = (event) => {
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
/******/ installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
/******/ if(installedChunkData) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ installedChunkData[1](error);
/******/ }
/******/ }
/******/ };
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
/******/ }
/******/ }
/******/ }
/******/ };
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ // no on chunks loaded
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ for(moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) var result = runtime(__webpack_require__);
/******/ }
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
/******/
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_motion"] = this["webpackChunk_tsparticles_plugin_motion"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
/******/
/************************************************************************/

@@ -324,0 +166,0 @@ /******/

/*! For license information please see tsparticles.plugin.motion.min.js.LICENSE.txt */
!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,r,o={303:t=>{t.exports=e}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,r)=>(i.f[r](e,t),t)),[])),i.u=e=>e+".min.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/plugin-motion:",i.l=(e,o,n,a)=>{if(t[e])t[e].push(o);else{var s,l;if(void 0!==n)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var p=u[c];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")==r+n){s=p;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",r+n),s.src=e),t[e]=[o];var d=(r,o)=>{s.onerror=s.onload=null,clearTimeout(f);var n=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),l&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={414:0};i.f.j=(t,r)=>{var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var n=new Promise(((r,n)=>o=e[t]=[r,n]));r.push(o[2]=n);var a=i.p+i.u(t),s=new Error;i.l(a,(r=>{if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",s.name="ChunkLoadError",s.type=n,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,n,a=r[0],s=r[1],l=r[2],u=0;if(a.some((t=>0!==e[t]))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(l)l(i)}for(t&&t(r);u<a.length;u++)n=a[u],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0},r=this.webpackChunk_tsparticles_plugin_motion=this.webpackChunk_tsparticles_plugin_motion||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{async function e(e,t=!0){const{MotionPlugin:r}=await i.e(99).then(i.bind(i,99));await e.addPlugin(new r(e),t)}i.r(a),i.d(a,{loadMotionPlugin:()=>e})})(),a})()));
!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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var r in o)("object"==typeof exports?exports:e)[r]=o[r]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},o={};function r(e){var i=o[e];if(void 0!==i)return i.exports;var n=o[e]={exports:{}};return t[e](n,n.exports,r),n.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{r.r(i),r.d(i,{loadMotionPlugin:()=>s});class e{constructor(){this.factor=4,this.value=!0}load(e){e&&(void 0!==e.factor&&(this.factor=e.factor),void 0!==e.value&&(this.value=e.value))}}class t{constructor(){this.disable=!1,this.reduce=new e}load(e){e&&(void 0!==e.disable&&(this.disable=e.disable),this.reduce.load(e.reduce))}}var o=r(303);class n{constructor(e,t){this._handleMotionChange=e=>{const t=this._container,o=t.actualOptions.motion;o&&(e.matches?o.disable?t.retina.reduceFactor=0:t.retina.reduceFactor=o.reduce.value?1/o.reduce.factor:1:t.retina.reduceFactor=1)},this._container=e,this._engine=t}async init(){const e=this._container,t=e.actualOptions.motion;if(!t||!t.disable&&!t.reduce.value)return void(e.retina.reduceFactor=1);const r=(0,o.safeMatchMedia)("(prefers-reduced-motion: reduce)");if(!r)return void(e.retina.reduceFactor=1);this._handleMotionChange(r);const i=()=>{(async()=>{this._handleMotionChange(r);try{await e.refresh()}catch{}})()};void 0!==r.addEventListener?r.addEventListener("change",i):void 0!==r.addListener&&r.addListener(i),await Promise.resolve()}}class a{constructor(e){this.id="motion",this._engine=e}getPlugin(e){return Promise.resolve(new n(e,this._engine))}loadOptions(e,o){if(!this.needsPlugin())return;let r=e.motion;r?.load||(e.motion=r=new t),r.load(o?.motion)}needsPlugin(){return!0}}async function s(e,t=!0){await e.addPlugin(new a(e),t)}})(),i})()));

@@ -1,1 +0,1 @@

/*! tsParticles Motion Plugin v3.3.0 by Matteo Bruni */
/*! tsParticles Motion Plugin v3.4.0 by Matteo Bruni */
import type { Container, Engine, IPlugin, RecursivePartial } from "@tsparticles/engine";
import type { IMotionOptions, MotionOptions } from "./types.js";
import type { MotionInstance } from "./MotionInstance.js";
import { MotionInstance } from "./MotionInstance.js";
export declare class MotionPlugin implements IPlugin {

@@ -5,0 +5,0 @@ readonly id: string;

@@ -1,24 +0,1 @@

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
(function (factory) {

@@ -30,14 +7,13 @@ if (typeof module === "object" && typeof module.exports === "object") {

else if (typeof define === "function" && define.amd) {
define(["require", "exports"], factory);
define(["require", "exports", "./MotionPlugin.js"], factory);
}
})(function (require, exports) {
"use strict";
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadMotionPlugin = void 0;
const MotionPlugin_js_1 = require("./MotionPlugin.js");
async function loadMotionPlugin(engine, refresh = true) {
const { MotionPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./MotionPlugin.js"))) : new Promise((resolve_1, reject_1) => { require(["./MotionPlugin.js"], resolve_1, reject_1); }).then(__importStar));
await engine.addPlugin(new MotionPlugin(engine), refresh);
await engine.addPlugin(new MotionPlugin_js_1.MotionPlugin(engine), refresh);
}
exports.loadMotionPlugin = loadMotionPlugin;
});

@@ -17,3 +17,3 @@ (function (factory) {

constructor(container, engine) {
this._handleMotionChange = (mediaQuery) => {
this._handleMotionChange = mediaQuery => {
const container = this._container, motion = container.actualOptions.motion;

@@ -20,0 +20,0 @@ if (!motion) {

@@ -1,24 +0,1 @@

var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
(function (factory) {

@@ -30,10 +7,10 @@ if (typeof module === "object" && typeof module.exports === "object") {

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "./Options/Classes/Motion.js"], factory);
define(["require", "exports", "./Options/Classes/Motion.js", "./MotionInstance.js"], factory);
}
})(function (require, exports) {
"use strict";
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MotionPlugin = void 0;
const Motion_js_1 = require("./Options/Classes/Motion.js");
const MotionInstance_js_1 = require("./MotionInstance.js");
class MotionPlugin {

@@ -44,5 +21,4 @@ constructor(engine) {

}
async getPlugin(container) {
const { MotionInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./MotionInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./MotionInstance.js"], resolve_1, reject_1); }).then(__importStar));
return new MotionInstance(container, this._engine);
getPlugin(container) {
return Promise.resolve(new MotionInstance_js_1.MotionInstance(container, this._engine));
}

@@ -49,0 +25,0 @@ loadOptions(options, source) {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc