Socket
Socket
Sign inDemoInstall

tsparticles-updater-out-modes

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsparticles-updater-out-modes - npm Package Compare versions

Comparing version 2.0.0-beta.1 to 2.0.0-beta.2

4

package.json
{
"name": "tsparticles-updater-out-modes",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"description": "tsParticles particles out modes updater",

@@ -48,4 +48,4 @@ "homepage": "https://particles.js.org/",

"dependencies": {
"tsparticles-engine": "^2.0.0-beta.0"
"tsparticles-engine": "^2.0.0-beta.1"
}
}

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

* How to use? : Check the GitHub README
* v2.0.0-beta.1
* v2.0.0-beta.2
*/

@@ -10,0 +10,0 @@ (function webpackUniversalModuleDefinition(root, factory) {

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

/*! tsParticles Out Modes Updater v2.0.0-beta.1 by Matteo Bruni */
/*! tsParticles Out Modes Updater v2.0.0-beta.2 by Matteo Bruni */
!function(t,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("tsparticles-engine"));else if("function"==typeof define&&define.amd)define(["tsparticles-engine"],o);else{var e="object"==typeof exports?o(require("tsparticles-engine")):o(t.window);for(var i in e)("object"==typeof exports?exports:t)[i]=e[i]}}(this,(function(t){return(()=>{"use strict";var o={818:o=>{o.exports=t}},e={};function i(t){var n=e[t];if(void 0!==n)return n.exports;var s=e[t]={exports:{}};return o[t](s,s.exports,i),s.exports}i.d=(t,o)=>{for(var e in o)i.o(o,e)&&!i.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:o[e]})},i.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{i.r(n),i.d(n,{loadOutModesUpdater:()=>e});var t=i(818);class o{constructor(t){this.container=t}init(){}isEnabled(t){return!t.destroyed&&!t.spawning}update(o,e){var i,n,s,r;const a=o.options.move.outModes;this.updateOutMode(o,e,null!==(i=a.bottom)&&void 0!==i?i:a.default,t.OutModeDirection.bottom),this.updateOutMode(o,e,null!==(n=a.left)&&void 0!==n?n:a.default,t.OutModeDirection.left),this.updateOutMode(o,e,null!==(s=a.right)&&void 0!==s?s:a.default,t.OutModeDirection.right),this.updateOutMode(o,e,null!==(r=a.top)&&void 0!==r?r:a.default,t.OutModeDirection.top)}updateOutMode(o,e,i,n){switch(i){case t.OutMode.bounce:case t.OutMode.bounceVertical:case t.OutMode.bounceHorizontal:case"bounceVertical":case"bounceHorizontal":case t.OutMode.split:this.bounce(o,e,n,i);break;case t.OutMode.destroy:this.destroy(o,n);break;case t.OutMode.out:this.out(o,n);break;case t.OutMode.none:default:this.none(o,n)}}destroy(o,e){const i=this.container;(0,t.isPointInside)(o.position,i.canvas.size,o.getRadius(),e)||i.particles.remove(o,void 0,!0)}out(o,e){const i=this.container;if((0,t.isPointInside)(o.position,i.canvas.size,o.getRadius(),e))return;const n=o.options.move.warp,s=i.canvas.size,r={bottom:s.height+o.getRadius()+o.offset.y,left:-o.getRadius()-o.offset.x,right:s.width+o.getRadius()+o.offset.x,top:-o.getRadius()-o.offset.y},a=o.getRadius(),c=(0,t.calculateBounds)(o.position,a);e===t.OutModeDirection.right&&c.left>s.width+o.offset.x?(o.position.x=r.left,o.initialPosition.x=o.position.x,n||(o.position.y=Math.random()*s.height,o.initialPosition.y=o.position.y)):e===t.OutModeDirection.left&&c.right<-o.offset.x&&(o.position.x=r.right,o.initialPosition.x=o.position.x,n||(o.position.y=Math.random()*s.height,o.initialPosition.y=o.position.y)),e===t.OutModeDirection.bottom&&c.top>s.height+o.offset.y?(n||(o.position.x=Math.random()*s.width,o.initialPosition.x=o.position.x),o.position.y=r.top,o.initialPosition.y=o.position.y):e===t.OutModeDirection.top&&c.bottom<-o.offset.y&&(n||(o.position.x=Math.random()*s.width,o.initialPosition.x=o.position.x),o.position.y=r.bottom,o.initialPosition.y=o.position.y)}bounce(o,e,i,n){const s=this.container;let r=!1;for(const[,t]of s.plugins)if(void 0!==t.particleBounce&&(r=t.particleBounce(o,e,i)),r)break;if(r)return;const a=o.getPosition(),c=o.offset,u=o.getRadius(),d=(0,t.calculateBounds)(a,u),l=s.canvas.size;!function(o){if(o.outMode!==t.OutMode.bounce&&o.outMode!==t.OutMode.bounceHorizontal&&"bounceHorizontal"!==o.outMode&&o.outMode!==t.OutMode.split)return;const e=o.particle.velocity.x;let i=!1;if(o.direction===t.OutModeDirection.right&&o.bounds.right>=o.canvasSize.width&&e>0||o.direction===t.OutModeDirection.left&&o.bounds.left<=0&&e<0){const e=(0,t.getRangeValue)(o.particle.options.bounce.horizontal.value);o.particle.velocity.x*=-e,i=!0}if(!i)return;const n=o.offset.x+o.size;o.bounds.right>=o.canvasSize.width?o.particle.position.x=o.canvasSize.width-n:o.bounds.left<=0&&(o.particle.position.x=n),o.outMode===t.OutMode.split&&o.particle.destroy()}({particle:o,outMode:n,direction:i,bounds:d,canvasSize:l,offset:c,size:u}),function(o){if(o.outMode===t.OutMode.bounce||o.outMode===t.OutMode.bounceVertical||"bounceVertical"===o.outMode||o.outMode===t.OutMode.split){const e=o.particle.velocity.y;let i=!1;if(o.direction===t.OutModeDirection.bottom&&o.bounds.bottom>=o.canvasSize.height&&e>0||o.direction===t.OutModeDirection.top&&o.bounds.top<=0&&e<0){const e=(0,t.getRangeValue)(o.particle.options.bounce.vertical.value);o.particle.velocity.y*=-e,i=!0}if(!i)return;const n=o.offset.y+o.size;o.bounds.bottom>=o.canvasSize.height?o.particle.position.y=o.canvasSize.height-n:o.bounds.top<=0&&(o.particle.position.y=n),o.outMode===t.OutMode.split&&o.particle.destroy()}}({particle:o,outMode:n,direction:i,bounds:d,canvasSize:l,offset:c,size:u})}none(o,e){if(o.options.move.distance.horizontal&&(e===t.OutModeDirection.left||e===t.OutModeDirection.right)||o.options.move.distance.vertical&&(e===t.OutModeDirection.top||e===t.OutModeDirection.bottom))return;const i=o.options.move.gravity,n=this.container,s=n.canvas.size,r=o.getRadius();if(i.enable){const a=o.position;(!i.inverse&&a.y>s.height+r&&e===t.OutModeDirection.bottom||i.inverse&&a.y<-r&&e===t.OutModeDirection.top)&&n.particles.remove(o)}else{if(o.velocity.y>0&&o.position.y<=s.height+r||o.velocity.y<0&&o.position.y>=-r||o.velocity.x>0&&o.position.x<=s.width+r||o.velocity.x<0&&o.position.x>=-r)return;(0,t.isPointInside)(o.position,n.canvas.size,r,e)||n.particles.remove(o)}}}function e(t){t.addParticleUpdater("outModes",(t=>new o(t)))}})(),n})()}));

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