tsparticles-updater-out-modes
Advanced tools
Comparing version 2.0.0-alpha.6 to 2.0.0-alpha.7
{ | ||
"name": "tsparticles-updater-out-modes", | ||
"version": "2.0.0-alpha.6", | ||
"version": "2.0.0-alpha.7", | ||
"description": "tsParticles particles out modes updater", | ||
@@ -65,4 +65,4 @@ "homepage": "https://particles.js.org/", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.0.0-alpha.6" | ||
"tsparticles-engine": "^2.0.0-alpha.7" | ||
} | ||
} |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.0.0-alpha.6 | ||
* v2.0.0-alpha.7 | ||
*/ | ||
@@ -24,5 +24,68 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
/***/ 825: | ||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | ||
/***/ 414: | ||
/***/ ((module) => { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__414__; | ||
/***/ }) | ||
/******/ }); | ||
/************************************************************************/ | ||
/******/ // The module cache | ||
/******/ var __webpack_module_cache__ = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ // Check if module is in cache | ||
/******/ var cachedModule = __webpack_module_cache__[moduleId]; | ||
/******/ if (cachedModule !== undefined) { | ||
/******/ return cachedModule.exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = __webpack_module_cache__[moduleId] = { | ||
/******/ // no module.id needed | ||
/******/ // no module.loaded needed | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/************************************************************************/ | ||
/******/ /* webpack/runtime/define property getters */ | ||
/******/ (() => { | ||
/******/ // define getter functions for harmony exports | ||
/******/ __webpack_require__.d = (exports, definition) => { | ||
/******/ for(var key in definition) { | ||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | ||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | ||
/******/ } | ||
/******/ } | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/hasOwnProperty shorthand */ | ||
/******/ (() => { | ||
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/make namespace object */ | ||
/******/ (() => { | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = (exports) => { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/************************************************************************/ | ||
var __webpack_exports__ = {}; | ||
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. | ||
(() => { | ||
// ESM COMPAT FLAG | ||
@@ -33,3 +96,3 @@ __webpack_require__.r(__webpack_exports__); | ||
__webpack_require__.d(__webpack_exports__, { | ||
"loadOutModesUpdater": () => /* binding */ loadOutModesUpdater | ||
"loadOutModesUpdater": () => (/* binding */ loadOutModesUpdater) | ||
}); | ||
@@ -281,73 +344,7 @@ | ||
} | ||
})(); | ||
/***/ }), | ||
/***/ 414: | ||
/***/ ((module) => { | ||
module.exports = __WEBPACK_EXTERNAL_MODULE__414__; | ||
/***/ }) | ||
/******/ }); | ||
/************************************************************************/ | ||
/******/ // The module cache | ||
/******/ var __webpack_module_cache__ = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ // Check if module is in cache | ||
/******/ if(__webpack_module_cache__[moduleId]) { | ||
/******/ return __webpack_module_cache__[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = __webpack_module_cache__[moduleId] = { | ||
/******/ // no module.id needed | ||
/******/ // no module.loaded needed | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/************************************************************************/ | ||
/******/ /* webpack/runtime/define property getters */ | ||
/******/ (() => { | ||
/******/ // define getter functions for harmony exports | ||
/******/ __webpack_require__.d = (exports, definition) => { | ||
/******/ for(var key in definition) { | ||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | ||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | ||
/******/ } | ||
/******/ } | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/hasOwnProperty shorthand */ | ||
/******/ (() => { | ||
/******/ __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) | ||
/******/ })(); | ||
/******/ | ||
/******/ /* webpack/runtime/make namespace object */ | ||
/******/ (() => { | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = (exports) => { | ||
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | ||
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
/******/ } | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ })(); | ||
/******/ | ||
/************************************************************************/ | ||
/******/ // module exports must be returned from runtime so entry inlining is disabled | ||
/******/ // startup | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(825); | ||
/******/ return __webpack_exports__; | ||
/******/ })() | ||
; | ||
}); |
@@ -1,2 +0,2 @@ | ||
/*! tsParticles Out Modes Updater v2.0.0-alpha.6 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)})()})); | ||
/*! tsParticles Out Modes Updater v2.0.0-alpha.7 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={414: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(414);class o{constructor(t){this.container=t}isEnabled(t){return!t.destroyed&&!t.spawning}update(o,e){var i,n,s,a;const r=o.options.move.outModes;this.updateOutMode(o,e,null!==(i=r.bottom)&&void 0!==i?i:r.default,t.OutModeDirection.bottom),this.updateOutMode(o,e,null!==(n=r.left)&&void 0!==n?n:r.default,t.OutModeDirection.left),this.updateOutMode(o,e,null!==(s=r.right)&&void 0!==s?s:r.default,t.OutModeDirection.right),this.updateOutMode(o,e,null!==(a=r.top)&&void 0!==a?a:r.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: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,a={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},r=o.getRadius(),c=(0,t.calculateBounds)(o.position,r);e===t.OutModeDirection.right&&c.left>s.width-o.offset.x?(o.position.x=a.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=a.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=a.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=a.bottom,o.initialPosition.y=o.position.y)}bounce(o,e,i,n){const s=this.container;let a=!1;for(const[,t]of s.plugins)if(void 0!==t.particleBounce&&(a=t.particleBounce(o,e,i)),a)break;if(a)return;const r=o.getPosition(),c=o.offset,u=o.getRadius(),d=(0,t.calculateBounds)(r,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)return;const i=o.options.move.gravity,n=this.container;if(i.enable){const s=o.position;(i.acceleration>=0&&s.y>n.canvas.size.height&&e===t.OutModeDirection.bottom||i.acceleration<0&&s.y<0&&e===t.OutModeDirection.top)&&n.particles.remove(o)}else(0,t.isPointInside)(o.position,n.canvas.size,o.getRadius(),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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
315509
717