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-alpha.4 to 2.0.0-alpha.5

ts3.4/IBounceData.d.ts

29

package.json
{
"name": "tsparticles-updater-out-modes",
"version": "2.0.0-alpha.4",
"version": "2.0.0-alpha.5",
"description": "tsParticles particles out modes updater",

@@ -41,11 +41,28 @@ "homepage": "https://particles.js.org/",

},
"main": "updater.js",
"main": "index.js",
"jsdelivr": "tsparticles.updater.out.modes.min.js",
"unpkg": "tsparticles.updater.out.modes.min.js",
"browser": "updater.js",
"module": "updater.js",
"types": "updater.d.ts",
"browser": "index.js",
"module": "index.js",
"types": "index.d.ts",
"typesVersions": {
">=4.0 <4.1": {
"*": [
"dist/ts4.0"
]
},
">=3.8 <4.0": {
"*": [
"dist/ts3.8"
]
},
"<3.8": {
"*": [
"dist/ts3.4"
]
}
},
"dependencies": {
"tsparticles-engine": "^2.0.0-alpha.4"
"tsparticles-engine": "^2.0.0-alpha.5"
}
}

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

* How to use? : Check the GitHub README
* v2.0.0-alpha.4
* v2.0.0-alpha.5
*/

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

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

/*! tsParticles Out Modes Updater v2.0.0-alpha.4 by Matteo Bruni */
/*! tsParticles Out Modes Updater v2.0.0-alpha.5 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={825:(t,o,e)=>{e.r(o),e.d(o,{loadOutModesUpdater:()=>s});var i=e(414);class n{constructor(t){this.container=t}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,o){var e,n,s,a;const r=t.options.move.outModes;this.updateOutMode(t,o,null!==(e=r.bottom)&&void 0!==e?e:r.default,i.OutModeDirection.bottom),this.updateOutMode(t,o,null!==(n=r.left)&&void 0!==n?n:r.default,i.OutModeDirection.left),this.updateOutMode(t,o,null!==(s=r.right)&&void 0!==s?s:r.default,i.OutModeDirection.right),this.updateOutMode(t,o,null!==(a=r.top)&&void 0!==a?a:r.default,i.OutModeDirection.top)}updateOutMode(t,o,e,n){switch(e){case i.OutMode.bounce:case i.OutMode.bounceVertical:case i.OutMode.bounceHorizontal:case"bounceVertical":case"bounceHorizontal":case i.OutMode.split:this.bounce(t,o,n,e);break;case i.OutMode.destroy:this.destroy(t,n);break;case i.OutMode.out:this.out(t,n);break;case i.OutMode.none:this.none(t,n)}}destroy(t,o){const e=this.container;(0,i.isPointInside)(t.position,e.canvas.size,t.getRadius(),o)||e.particles.remove(t,void 0,!0)}out(t,o){const e=this.container;if((0,i.isPointInside)(t.position,e.canvas.size,t.getRadius(),o))return;const n=t.options.move.warp,s=e.canvas.size,a={bottom:s.height+t.getRadius()-t.offset.y,left:-t.getRadius()-t.offset.x,right:s.width+t.getRadius()+t.offset.x,top:-t.getRadius()-t.offset.y},r=t.getRadius(),c=(0,i.calculateBounds)(t.position,r);o===i.OutModeDirection.right&&c.left>s.width-t.offset.x?(t.position.x=a.left,t.initialPosition.x=t.position.x,n||(t.position.y=Math.random()*s.height,t.initialPosition.y=t.position.y)):o===i.OutModeDirection.left&&c.right<-t.offset.x&&(t.position.x=a.right,t.initialPosition.x=t.position.x,n||(t.position.y=Math.random()*s.height,t.initialPosition.y=t.position.y)),o===i.OutModeDirection.bottom&&c.top>s.height-t.offset.y?(n||(t.position.x=Math.random()*s.width,t.initialPosition.x=t.position.x),t.position.y=a.top,t.initialPosition.y=t.position.y):o===i.OutModeDirection.top&&c.bottom<-t.offset.y&&(n||(t.position.x=Math.random()*s.width,t.initialPosition.x=t.position.x),t.position.y=a.bottom,t.initialPosition.y=t.position.y)}bounce(t,o,e,n){const s=this.container;let a=!1;for(const[,i]of s.plugins)if(void 0!==i.particleBounce&&(a=i.particleBounce(t,o,e)),a)break;if(a)return;const r=t.getPosition(),c=t.offset,u=t.getRadius(),d=(0,i.calculateBounds)(r,u),l=s.canvas.size;!function(t){if(t.outMode!==i.OutMode.bounce&&t.outMode!==i.OutMode.bounceHorizontal&&"bounceHorizontal"!==t.outMode&&t.outMode!==i.OutMode.split)return;const o=t.particle.velocity.x;let e=!1;if(t.direction===i.OutModeDirection.right&&t.bounds.right>=t.canvasSize.width&&o>0||t.direction===i.OutModeDirection.left&&t.bounds.left<=0&&o<0){const o=(0,i.getRangeValue)(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-o,e=!0}if(!e)return;const n=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width?t.particle.position.x=t.canvasSize.width-n:t.bounds.left<=0&&(t.particle.position.x=n),t.outMode===i.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:e,bounds:d,canvasSize:l,offset:c,size:u}),function(t){if(t.outMode===i.OutMode.bounce||t.outMode===i.OutMode.bounceVertical||"bounceVertical"===t.outMode||t.outMode===i.OutMode.split){const o=t.particle.velocity.y;let e=!1;if(t.direction===i.OutModeDirection.bottom&&t.bounds.bottom>=t.canvasSize.height&&o>0||t.direction===i.OutModeDirection.top&&t.bounds.top<=0&&o<0){const o=(0,i.getRangeValue)(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-o,e=!0}if(!e)return;const n=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height?t.particle.position.y=t.canvasSize.height-n:t.bounds.top<=0&&(t.particle.position.y=n),t.outMode===i.OutMode.split&&t.particle.destroy()}}({particle:t,outMode:n,direction:e,bounds:d,canvasSize:l,offset:c,size:u})}none(t,o){if(t.options.move.distance)return;const e=t.options.move.gravity,n=this.container;if(e.enable){const s=t.position;(e.acceleration>=0&&s.y>n.canvas.size.height&&o===i.OutModeDirection.bottom||e.acceleration<0&&s.y<0&&o===i.OutModeDirection.top)&&n.particles.remove(t)}else(0,i.isPointInside)(t.position,n.canvas.size,t.getRadius(),o)||n.particles.remove(t)}}function s(t){t.addParticleUpdater("outModes",(t=>new n(t)))}},414:o=>{o.exports=t}},e={};function i(t){if(e[t])return e[t].exports;var n=e[t]={exports:{}};return o[t](n,n.exports,i),n.exports}return 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})},i(825)})()}));

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