Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tsparticles/plugin-motion

Package Overview
Dependencies
Maintainers
0
Versions
21
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.4.0 to 3.5.0

3

cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadMotionPlugin = void 0;
exports.loadMotionPlugin = loadMotionPlugin;
const MotionPlugin_js_1 = require("./MotionPlugin.js");

@@ -8,2 +8,1 @@ async function loadMotionPlugin(engine, refresh = true) {

}
exports.loadMotionPlugin = loadMotionPlugin;
{
"name": "@tsparticles/plugin-motion",
"version": "3.4.0",
"version": "3.5.0",
"description": "tsParticles motion sickness plugin",

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

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

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

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

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

@@ -10,0 +10,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 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})()));
!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={};r.r(i),r.d(i,{loadMotionPlugin:()=>l});class n{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 a{constructor(){this.disable=!1,this.reduce=new n}load(e){e&&(void 0!==e.disable&&(this.disable=e.disable),this.reduce.load(e.reduce))}}var s=r(303);class c{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 o=(0,s.safeMatchMedia)("(prefers-reduced-motion: reduce)");if(!o)return void(e.retina.reduceFactor=1);this._handleMotionChange(o);const r=()=>{(async()=>{this._handleMotionChange(o);try{await e.refresh()}catch{}})()};void 0!==o.addEventListener?o.addEventListener("change",r):void 0!==o.addListener&&o.addListener(r),await Promise.resolve()}}class d{constructor(e){this.id="motion",this._engine=e}getPlugin(e){return Promise.resolve(new c(e,this._engine))}loadOptions(e,t){if(!this.needsPlugin())return;let o=e.motion;o?.load||(e.motion=o=new a),o.load(t?.motion)}needsPlugin(){return!0}}async function l(e,t=!0){await e.addPlugin(new d(e),t)}return i})()));

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

/*! tsParticles Motion Plugin v3.4.0 by Matteo Bruni */
/*! tsParticles Motion Plugin v3.5.0 by Matteo Bruni */

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.loadMotionPlugin = void 0;
exports.loadMotionPlugin = loadMotionPlugin;
const MotionPlugin_js_1 = require("./MotionPlugin.js");

@@ -18,3 +18,2 @@ async function loadMotionPlugin(engine, refresh = true) {

}
exports.loadMotionPlugin = loadMotionPlugin;
});

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