@tsparticles/updater-out-modes 4.0.0-beta.1 → 4.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{244.min.js → 655.min.js} +1 -1
- package/README.md +29 -0
- package/browser/index.js +1 -1
- package/cjs/index.js +1 -1
- package/dist_browser_OutOfCanvasUpdater_js.js +1 -1
- package/esm/index.js +1 -1
- package/package.json +4 -5
- package/report.html +1 -1
- package/tsparticles.updater.out-modes.js +2 -2
- package/tsparticles.updater.out-modes.min.js +1 -1
- package/umd/BounceOutMode.js +0 -48
- package/umd/DestroyOutMode.js +0 -49
- package/umd/IBounceData.js +0 -12
- package/umd/IOutModeManager.js +0 -12
- package/umd/NoneOutMode.js +0 -56
- package/umd/OutOfCanvasUpdater.js +0 -61
- package/umd/OutOutMode.js +0 -125
- package/umd/Utils.js +0 -86
- package/umd/index.js +0 -56
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).push([[655],{655(t,i,e){e.d(i,{OutOfCanvasUpdater:()=>u});var o=e(303);class n{container;modes;_particleBouncePlugins;constructor(t){this.container=t,this.modes=[o.OutMode.bounce,o.OutMode.split],this._particleBouncePlugins=t.plugins.filter(t=>void 0!==t.particleBounce)}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container,r=!1;for(let o of this._particleBouncePlugins)if(r=o.particleBounce?.(t,e,i)??!1)break;if(r)return;let a=t.getPosition(),d=t.offset,u=t.getRadius(),c=(0,o.calculateBounds)(a,u),l=s.canvas.size;!function(t){if(t.outMode!==o.OutMode.bounce&&t.outMode!==o.OutMode.split||t.direction!==o.OutModeDirection.left&&t.direction!==o.OutModeDirection.right)return;t.bounds.right<0&&t.direction===o.OutModeDirection.left?t.particle.position.x=t.size+t.offset.x:t.bounds.left>t.canvasSize.width&&t.direction===o.OutModeDirection.right&&(t.particle.position.x=t.canvasSize.width-t.size-t.offset.x);let i=t.particle.velocity.x,e=!1;if(t.direction===o.OutModeDirection.right&&t.bounds.right>=t.canvasSize.width&&i>0||t.direction===o.OutModeDirection.left&&t.bounds.left<=0&&i<0){let i=(0,o.getRangeValue)(t.particle.options.bounce.horizontal.value);t.particle.velocity.x*=-i,e=!0}if(!e)return;let n=t.offset.x+t.size;t.bounds.right>=t.canvasSize.width&&t.direction===o.OutModeDirection.right?t.particle.position.x=t.canvasSize.width-n:t.bounds.left<=0&&t.direction===o.OutModeDirection.left&&(t.particle.position.x=n),t.outMode===o.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:i,bounds:c,canvasSize:l,offset:d,size:u}),function(t){if(t.outMode!==o.OutMode.bounce&&t.outMode!==o.OutMode.split||t.direction!==o.OutModeDirection.bottom&&t.direction!==o.OutModeDirection.top)return;t.bounds.bottom<0&&t.direction===o.OutModeDirection.top?t.particle.position.y=t.size+t.offset.y:t.bounds.top>t.canvasSize.height&&t.direction===o.OutModeDirection.bottom&&(t.particle.position.y=t.canvasSize.height-t.size-t.offset.y);let i=t.particle.velocity.y,e=!1;if(t.direction===o.OutModeDirection.bottom&&t.bounds.bottom>=t.canvasSize.height&&i>0||t.direction===o.OutModeDirection.top&&t.bounds.top<=0&&i<0){let i=(0,o.getRangeValue)(t.particle.options.bounce.vertical.value);t.particle.velocity.y*=-i,e=!0}if(!e)return;let n=t.offset.y+t.size;t.bounds.bottom>=t.canvasSize.height&&t.direction===o.OutModeDirection.bottom?t.particle.position.y=t.canvasSize.height-n:t.bounds.top<=0&&t.direction===o.OutModeDirection.top&&(t.particle.position.y=n),t.outMode===o.OutMode.split&&t.particle.destroy()}({particle:t,outMode:n,direction:i,bounds:c,canvasSize:l,offset:d,size:u})}}class s{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.destroy]}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container;switch(t.outType){case o.ParticleOutType.normal:case o.ParticleOutType.outside:if((0,o.isPointInside)(t.position,s.canvas.size,o.originPoint,t.getRadius(),i))return;break;case o.ParticleOutType.inside:{let{dx:i,dy:e}=(0,o.getDistances)(t.position,t.moveCenter),{x:n,y:s}=t.velocity;if(n<0&&i>t.moveCenter.radius||s<0&&e>t.moveCenter.radius||n>=0&&i<-t.moveCenter.radius||s>=0&&e<-t.moveCenter.radius)return}}t.destroy(!0)}}class r{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.none]}update(t,i,e,n){if(!this.modes.includes(n)||((t.options.move.distance.horizontal&&(i===o.OutModeDirection.left||i===o.OutModeDirection.right))??(t.options.move.distance.vertical&&(i===o.OutModeDirection.top||i===o.OutModeDirection.bottom))))return;let s=t.options.move.gravity,r=this.container,a=r.canvas.size,d=t.getRadius();if(s.enable){let e=t.position;(!s.inverse&&e.y>a.height+d&&i===o.OutModeDirection.bottom||s.inverse&&e.y<-d&&i===o.OutModeDirection.top)&&t.destroy()}else{if(t.velocity.y>0&&t.position.y<=a.height+d||t.velocity.y<0&&t.position.y>=-d||t.velocity.x>0&&t.position.x<=a.width+d||t.velocity.x<0&&t.position.x>=-d)return;(0,o.isPointInside)(t.position,r.canvas.size,o.originPoint,d,i)||t.destroy()}}}let a=o.Vector.origin;class d{container;modes;constructor(t){this.container=t,this.modes=[o.OutMode.out]}update(t,i,e,n){if(!this.modes.includes(n))return;let s=this.container;if(t.outType===o.ParticleOutType.inside){let{x:i,y:e}=t.velocity;a.setTo(o.originPoint),a.length=t.moveCenter.radius,a.angle=t.velocity.angle+Math.PI,a.addTo(t.moveCenter);let{dx:n,dy:r}=(0,o.getDistances)(t.position,a);if(i<=0&&n>=0||e<=0&&r>=0||i>=0&&n<=0||e>=0&&r<=0)return;t.position.x=Math.floor((0,o.randomInRangeValue)({min:0,max:s.canvas.size.width})),t.position.y=Math.floor((0,o.randomInRangeValue)({min:0,max:s.canvas.size.height}));let{dx:d,dy:u}=(0,o.getDistances)(t.position,t.moveCenter);t.direction=Math.atan2(-u,-d),t.velocity.angle=t.direction}else{if((0,o.isPointInside)(t.position,s.canvas.size,o.originPoint,t.getRadius(),i))return;switch(t.outType){case o.ParticleOutType.outside:{t.position.x=Math.floor((0,o.randomInRangeValue)({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor((0,o.randomInRangeValue)({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;let{dx:i,dy:e}=(0,o.getDistances)(t.position,t.moveCenter);t.moveCenter.radius&&(t.direction=Math.atan2(e,i),t.velocity.angle=t.direction);break}case o.ParticleOutType.normal:{let e=t.options.move.warp,n=s.canvas.size,r={bottom:n.height+t.getRadius()+t.offset.y,left:-t.getRadius()-t.offset.x,right:n.width+t.getRadius()+t.offset.x,top:-t.getRadius()-t.offset.y},a=t.getRadius(),d=(0,o.calculateBounds)(t.position,a);i===o.OutModeDirection.right&&d.left>n.width+t.offset.x?(t.position.x=r.left,t.initialPosition.x=t.position.x,e||(t.position.y=(0,o.getRandom)()*n.height,t.initialPosition.y=t.position.y)):i===o.OutModeDirection.left&&d.right<-t.offset.x&&(t.position.x=r.right,t.initialPosition.x=t.position.x,e||(t.position.y=(0,o.getRandom)()*n.height,t.initialPosition.y=t.position.y)),i===o.OutModeDirection.bottom&&d.top>n.height+t.offset.y?(e||(t.position.x=(0,o.getRandom)()*n.width,t.initialPosition.x=t.position.x),t.position.y=r.top,t.initialPosition.y=t.position.y):i===o.OutModeDirection.top&&d.bottom<-t.offset.y&&(e||(t.position.x=(0,o.getRandom)()*n.width,t.initialPosition.x=t.position.x),t.position.y=r.bottom,t.initialPosition.y=t.position.y)}}}}}class u{updaters;container;constructor(t){this.container=t,this.updaters=new Map}init(t){this._addUpdaterIfMissing(t,o.OutMode.bounce,t=>new n(t)),this._addUpdaterIfMissing(t,o.OutMode.out,t=>new d(t)),this._addUpdaterIfMissing(t,o.OutMode.destroy,t=>new s(t)),this._addUpdaterIfMissing(t,o.OutMode.none,t=>new r(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(t,i){let e=t.options.move.outModes;this._updateOutMode(t,i,e.bottom??e.default,o.OutModeDirection.bottom),this._updateOutMode(t,i,e.left??e.default,o.OutModeDirection.left),this._updateOutMode(t,i,e.right??e.default,o.OutModeDirection.right),this._updateOutMode(t,i,e.top??e.default,o.OutModeDirection.top)}_addUpdaterIfMissing=(t,i,e)=>{let o=t.options.move.outModes;this.updaters.has(i)||o.default!==i&&o.bottom!==i&&o.left!==i&&o.right!==i&&o.top!==i||this.updaters.set(i,e(this.container))};_updateOutMode=(t,i,e,o)=>{for(let n of this.updaters.values())n.update(t,o,i,e)}}}}]);
|
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
[tsParticles](https://github.com/tsparticles/tsparticles) updater plugin for out modes animations.
|
|
10
10
|
|
|
11
|
+
## Quick checklist
|
|
12
|
+
|
|
13
|
+
1. Install `@tsparticles/engine` (or use the CDN bundle below)
|
|
14
|
+
2. Call the package loader function(s) before `tsParticles.load(...)`
|
|
15
|
+
3. Apply the package options in your `tsParticles.load(...)` config
|
|
16
|
+
|
|
11
17
|
## How to use it
|
|
12
18
|
|
|
13
19
|
### CDN / Vanilla JS / jQuery
|
|
@@ -72,3 +78,26 @@ import { loadOutModesUpdater } from "@tsparticles/updater-out-modes";
|
|
|
72
78
|
await loadOutModesUpdater(tsParticles);
|
|
73
79
|
})();
|
|
74
80
|
```
|
|
81
|
+
|
|
82
|
+
## Option mapping
|
|
83
|
+
|
|
84
|
+
- Primary options key: `particles.move.outModes`
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"particles": {
|
|
89
|
+
"move.outModes": {}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Common pitfalls
|
|
95
|
+
|
|
96
|
+
- Calling `tsParticles.load(...)` before `loadOutModesUpdater(...)`
|
|
97
|
+
- Verify required peer packages before enabling advanced options
|
|
98
|
+
- Change one option group at a time to isolate regressions quickly
|
|
99
|
+
|
|
100
|
+
## Related docs
|
|
101
|
+
|
|
102
|
+
- All packages catalog: <https://github.com/tsparticles/tsparticles>
|
|
103
|
+
- Main docs: <https://particles.js.org/docs/>
|
package/browser/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
2
|
+
engine.checkVersion("4.0.0-beta.11");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("outModes", async (container) => {
|
|
5
5
|
const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
2
|
+
engine.checkVersion("4.0.0-beta.11");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("outModes", async (container) => {
|
|
5
5
|
const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function loadOutModesUpdater(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
2
|
+
engine.checkVersion("4.0.0-beta.11");
|
|
3
3
|
await engine.pluginManager.register(e => {
|
|
4
4
|
e.pluginManager.addParticleUpdater("outModes", async (container) => {
|
|
5
5
|
const { OutOfCanvasUpdater } = await import("./OutOfCanvasUpdater.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/updater-out-modes",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.11",
|
|
4
4
|
"description": "tsParticles particles out modes updater",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -81,13 +81,12 @@
|
|
|
81
81
|
"browser": "./browser/index.js",
|
|
82
82
|
"import": "./esm/index.js",
|
|
83
83
|
"require": "./cjs/index.js",
|
|
84
|
-
"
|
|
85
|
-
"default": "./cjs/index.js"
|
|
84
|
+
"default": "./esm/index.js"
|
|
86
85
|
},
|
|
87
86
|
"./package.json": "./package.json"
|
|
88
87
|
},
|
|
89
|
-
"
|
|
90
|
-
"@tsparticles/engine": "4.0.0-beta.
|
|
88
|
+
"peerDependencies": {
|
|
89
|
+
"@tsparticles/engine": "4.0.0-beta.11"
|
|
91
90
|
},
|
|
92
91
|
"publishConfig": {
|
|
93
92
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
-
<title>@tsparticles/updater-out-modes [
|
|
6
|
+
<title>@tsparticles/updater-out-modes [8 Apr 2026 at 17:10]</title>
|
|
7
7
|
<link
|
|
8
8
|
rel="shortcut icon"
|
|
9
9
|
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII="
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-beta.
|
|
7
|
+
* v4.0.0-beta.11
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -44,7 +44,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
44
44
|
\*******************************/
|
|
45
45
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
46
46
|
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadOutModesUpdater: () => (/* binding */ loadOutModesUpdater)\n/* harmony export */ });\nasync function loadOutModesUpdater(engine) {\n engine.checkVersion(\"4.0.0-beta.
|
|
47
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadOutModesUpdater: () => (/* binding */ loadOutModesUpdater)\n/* harmony export */ });\nasync function loadOutModesUpdater(engine) {\n engine.checkVersion(\"4.0.0-beta.11\");\n await engine.pluginManager.register((e)=>{\n e.pluginManager.addParticleUpdater(\"outModes\", async (container)=>{\n const { OutOfCanvasUpdater } = await __webpack_require__.e(/*! import() */ \"dist_browser_OutOfCanvasUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./OutOfCanvasUpdater.js */ \"./dist/browser/OutOfCanvasUpdater.js\"));\n return new OutOfCanvasUpdater(container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-out-modes/./dist/browser/index.js?\n}");
|
|
48
48
|
|
|
49
49
|
/***/ }
|
|
50
50
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
!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=>(()=>{"use strict";var t,r,o,i={303(t){t.exports=e}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return i[e](r,r.exports,a),r.exports}a.m=i,a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,r)=>(a.f[r](e,t),t),[])),a.u=e=>""+e+".min.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},a.l=(e,t,r,o)=>{if(s[e])return void s[e].push(t);if(void 0!==r)for(var i,n,u=document.getElementsByTagName("script"),p=0;p<u.length;p++){var c=u[p];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")=="@tsparticles/updater-out-modes:"+r){i=c;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",a.nc&&i.setAttribute("nonce",a.nc),i.setAttribute("data-webpack","@tsparticles/updater-out-modes:"+r),i.src=e),s[e]=[t];var l=(t,r)=>{i.onerror=i.onload=null,clearTimeout(d);var o=s[e];if(delete s[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(e=>e(r)),t)return t(r)},d=setTimeout(l.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),n&&document.head.appendChild(i)},a.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.g.importScripts&&(u=a.g.location+"");var s,u,p=a.g.document;if(!u&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(u=p.currentScript.src),!u)){var c=p.getElementsByTagName("script");if(c.length)for(var l=c.length-1;l>-1&&(!u||!/^http(s?):/.test(u));)u=c[l--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");a.p=u=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={427:0},a.f.j=(e,r)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise((r,i)=>o=t[e]=[r,i]);r.push(o[2]=i);var n=a.p+a.u(e),s=Error();a.l(n,r=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),n=r&&r.target&&r.target.src;s.message="Loading chunk "+e+` failed.
|
|
2
|
-
(`+i+": "+n+")",s.name="ChunkLoadError",s.type=i,s.request=n,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,i,[n,s,u]=r,p=0;if(n.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);u&&u(a)}for(e&&e(r);p<n.length;p++)i=n[p],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},(o=this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-beta.
|
|
2
|
+
(`+i+": "+n+")",s.name="ChunkLoadError",s.type=i,s.request=n,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,i,[n,s,u]=r,p=0;if(n.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);u&&u(a)}for(e&&e(r);p<n.length;p++)i=n[p],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},(o=this.webpackChunk_tsparticles_updater_out_modes=this.webpackChunk_tsparticles_updater_out_modes||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o));var d={};async function f(e){e.checkVersion("4.0.0-beta.11"),await e.pluginManager.register(e=>{e.pluginManager.addParticleUpdater("outModes",async e=>{let{OutOfCanvasUpdater:t}=await a.e(655).then(a.bind(a,655));return new t(e)})})}return a.r(d),a.d(d,{loadOutModesUpdater:()=>f}),d})());
|
package/umd/BounceOutMode.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./Utils.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.BounceOutMode = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const Utils_js_1 = require("./Utils.js");
|
|
15
|
-
class BounceOutMode {
|
|
16
|
-
container;
|
|
17
|
-
modes;
|
|
18
|
-
_particleBouncePlugins;
|
|
19
|
-
constructor(container) {
|
|
20
|
-
this.container = container;
|
|
21
|
-
this.modes = [
|
|
22
|
-
engine_1.OutMode.bounce,
|
|
23
|
-
engine_1.OutMode.split,
|
|
24
|
-
];
|
|
25
|
-
this._particleBouncePlugins = container.plugins.filter(p => p.particleBounce !== undefined);
|
|
26
|
-
}
|
|
27
|
-
update(particle, direction, delta, outMode) {
|
|
28
|
-
if (!this.modes.includes(outMode)) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const container = this.container;
|
|
32
|
-
let handled = false;
|
|
33
|
-
for (const plugin of this._particleBouncePlugins) {
|
|
34
|
-
handled = plugin.particleBounce?.(particle, delta, direction) ?? false;
|
|
35
|
-
if (handled) {
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (handled) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const pos = particle.getPosition(), offset = particle.offset, size = particle.getRadius(), bounds = (0, engine_1.calculateBounds)(pos, size), canvasSize = container.canvas.size;
|
|
43
|
-
(0, Utils_js_1.bounceHorizontal)({ particle, outMode, direction, bounds, canvasSize, offset, size });
|
|
44
|
-
(0, Utils_js_1.bounceVertical)({ particle, outMode, direction, bounds, canvasSize, offset, size });
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.BounceOutMode = BounceOutMode;
|
|
48
|
-
});
|
package/umd/DestroyOutMode.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DestroyOutMode = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const minVelocity = 0;
|
|
15
|
-
class DestroyOutMode {
|
|
16
|
-
container;
|
|
17
|
-
modes;
|
|
18
|
-
constructor(container) {
|
|
19
|
-
this.container = container;
|
|
20
|
-
this.modes = [engine_1.OutMode.destroy];
|
|
21
|
-
}
|
|
22
|
-
update(particle, direction, _delta, outMode) {
|
|
23
|
-
if (!this.modes.includes(outMode)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const container = this.container;
|
|
27
|
-
switch (particle.outType) {
|
|
28
|
-
case engine_1.ParticleOutType.normal:
|
|
29
|
-
case engine_1.ParticleOutType.outside:
|
|
30
|
-
if ((0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.originPoint, particle.getRadius(), direction)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
break;
|
|
34
|
-
case engine_1.ParticleOutType.inside: {
|
|
35
|
-
const { dx, dy } = (0, engine_1.getDistances)(particle.position, particle.moveCenter), { x: vx, y: vy } = particle.velocity;
|
|
36
|
-
if ((vx < minVelocity && dx > particle.moveCenter.radius) ||
|
|
37
|
-
(vy < minVelocity && dy > particle.moveCenter.radius) ||
|
|
38
|
-
(vx >= minVelocity && dx < -particle.moveCenter.radius) ||
|
|
39
|
-
(vy >= minVelocity && dy < -particle.moveCenter.radius)) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
particle.destroy(true);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.DestroyOutMode = DestroyOutMode;
|
|
49
|
-
});
|
package/umd/IBounceData.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
package/umd/IOutModeManager.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
});
|
package/umd/NoneOutMode.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.NoneOutMode = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const minVelocity = 0;
|
|
15
|
-
class NoneOutMode {
|
|
16
|
-
container;
|
|
17
|
-
modes;
|
|
18
|
-
constructor(container) {
|
|
19
|
-
this.container = container;
|
|
20
|
-
this.modes = [engine_1.OutMode.none];
|
|
21
|
-
}
|
|
22
|
-
update(particle, direction, _delta, outMode) {
|
|
23
|
-
if (!this.modes.includes(outMode)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if ((particle.options.move.distance.horizontal &&
|
|
27
|
-
(direction === engine_1.OutModeDirection.left || direction === engine_1.OutModeDirection.right)) ??
|
|
28
|
-
(particle.options.move.distance.vertical &&
|
|
29
|
-
(direction === engine_1.OutModeDirection.top || direction === engine_1.OutModeDirection.bottom))) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const gravityOptions = particle.options.move.gravity, container = this.container, canvasSize = container.canvas.size, pRadius = particle.getRadius();
|
|
33
|
-
if (!gravityOptions.enable) {
|
|
34
|
-
if ((particle.velocity.y > minVelocity && particle.position.y <= canvasSize.height + pRadius) ||
|
|
35
|
-
(particle.velocity.y < minVelocity && particle.position.y >= -pRadius) ||
|
|
36
|
-
(particle.velocity.x > minVelocity && particle.position.x <= canvasSize.width + pRadius) ||
|
|
37
|
-
(particle.velocity.x < minVelocity && particle.position.x >= -pRadius)) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
if (!(0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.originPoint, pRadius, direction)) {
|
|
41
|
-
particle.destroy();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
const position = particle.position;
|
|
46
|
-
if ((!gravityOptions.inverse &&
|
|
47
|
-
position.y > canvasSize.height + pRadius &&
|
|
48
|
-
direction === engine_1.OutModeDirection.bottom) ||
|
|
49
|
-
(gravityOptions.inverse && position.y < -pRadius && direction === engine_1.OutModeDirection.top)) {
|
|
50
|
-
particle.destroy();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.NoneOutMode = NoneOutMode;
|
|
56
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./BounceOutMode.js", "./DestroyOutMode.js", "./NoneOutMode.js", "./OutOutMode.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.OutOfCanvasUpdater = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const BounceOutMode_js_1 = require("./BounceOutMode.js");
|
|
15
|
-
const DestroyOutMode_js_1 = require("./DestroyOutMode.js");
|
|
16
|
-
const NoneOutMode_js_1 = require("./NoneOutMode.js");
|
|
17
|
-
const OutOutMode_js_1 = require("./OutOutMode.js");
|
|
18
|
-
const checkOutMode = (outModes, outMode) => {
|
|
19
|
-
return (outModes.default === outMode ||
|
|
20
|
-
outModes.bottom === outMode ||
|
|
21
|
-
outModes.left === outMode ||
|
|
22
|
-
outModes.right === outMode ||
|
|
23
|
-
outModes.top === outMode);
|
|
24
|
-
};
|
|
25
|
-
class OutOfCanvasUpdater {
|
|
26
|
-
updaters;
|
|
27
|
-
container;
|
|
28
|
-
constructor(container) {
|
|
29
|
-
this.container = container;
|
|
30
|
-
this.updaters = new Map();
|
|
31
|
-
}
|
|
32
|
-
init(particle) {
|
|
33
|
-
this._addUpdaterIfMissing(particle, engine_1.OutMode.bounce, container => new BounceOutMode_js_1.BounceOutMode(container));
|
|
34
|
-
this._addUpdaterIfMissing(particle, engine_1.OutMode.out, container => new OutOutMode_js_1.OutOutMode(container));
|
|
35
|
-
this._addUpdaterIfMissing(particle, engine_1.OutMode.destroy, container => new DestroyOutMode_js_1.DestroyOutMode(container));
|
|
36
|
-
this._addUpdaterIfMissing(particle, engine_1.OutMode.none, container => new NoneOutMode_js_1.NoneOutMode(container));
|
|
37
|
-
}
|
|
38
|
-
isEnabled(particle) {
|
|
39
|
-
return !particle.destroyed && !particle.spawning;
|
|
40
|
-
}
|
|
41
|
-
update(particle, delta) {
|
|
42
|
-
const outModes = particle.options.move.outModes;
|
|
43
|
-
this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, engine_1.OutModeDirection.bottom);
|
|
44
|
-
this._updateOutMode(particle, delta, outModes.left ?? outModes.default, engine_1.OutModeDirection.left);
|
|
45
|
-
this._updateOutMode(particle, delta, outModes.right ?? outModes.default, engine_1.OutModeDirection.right);
|
|
46
|
-
this._updateOutMode(particle, delta, outModes.top ?? outModes.default, engine_1.OutModeDirection.top);
|
|
47
|
-
}
|
|
48
|
-
_addUpdaterIfMissing = (particle, outMode, getUpdater) => {
|
|
49
|
-
const outModes = particle.options.move.outModes;
|
|
50
|
-
if (!this.updaters.has(outMode) && checkOutMode(outModes, outMode)) {
|
|
51
|
-
this.updaters.set(outMode, getUpdater(this.container));
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
_updateOutMode = (particle, delta, outMode, direction) => {
|
|
55
|
-
for (const updater of this.updaters.values()) {
|
|
56
|
-
updater.update(particle, direction, delta, outMode);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
exports.OutOfCanvasUpdater = OutOfCanvasUpdater;
|
|
61
|
-
});
|
package/umd/OutOutMode.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.OutOutMode = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const minVelocity = 0, minDistance = 0, updateVector = engine_1.Vector.origin;
|
|
15
|
-
class OutOutMode {
|
|
16
|
-
container;
|
|
17
|
-
modes;
|
|
18
|
-
constructor(container) {
|
|
19
|
-
this.container = container;
|
|
20
|
-
this.modes = [engine_1.OutMode.out];
|
|
21
|
-
}
|
|
22
|
-
update(particle, direction, _delta, outMode) {
|
|
23
|
-
if (!this.modes.includes(outMode)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const container = this.container;
|
|
27
|
-
switch (particle.outType) {
|
|
28
|
-
case engine_1.ParticleOutType.inside: {
|
|
29
|
-
const { x: vx, y: vy } = particle.velocity;
|
|
30
|
-
updateVector.setTo(engine_1.originPoint);
|
|
31
|
-
updateVector.length = particle.moveCenter.radius;
|
|
32
|
-
updateVector.angle = particle.velocity.angle + Math.PI;
|
|
33
|
-
updateVector.addTo(particle.moveCenter);
|
|
34
|
-
const { dx, dy } = (0, engine_1.getDistances)(particle.position, updateVector);
|
|
35
|
-
if ((vx <= minVelocity && dx >= minDistance) ||
|
|
36
|
-
(vy <= minVelocity && dy >= minDistance) ||
|
|
37
|
-
(vx >= minVelocity && dx <= minDistance) ||
|
|
38
|
-
(vy >= minVelocity && dy <= minDistance)) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
particle.position.x = Math.floor((0, engine_1.randomInRangeValue)({
|
|
42
|
-
min: 0,
|
|
43
|
-
max: container.canvas.size.width,
|
|
44
|
-
}));
|
|
45
|
-
particle.position.y = Math.floor((0, engine_1.randomInRangeValue)({
|
|
46
|
-
min: 0,
|
|
47
|
-
max: container.canvas.size.height,
|
|
48
|
-
}));
|
|
49
|
-
const { dx: newDx, dy: newDy } = (0, engine_1.getDistances)(particle.position, particle.moveCenter);
|
|
50
|
-
particle.direction = Math.atan2(-newDy, -newDx);
|
|
51
|
-
particle.velocity.angle = particle.direction;
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
default: {
|
|
55
|
-
if ((0, engine_1.isPointInside)(particle.position, container.canvas.size, engine_1.originPoint, particle.getRadius(), direction)) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
switch (particle.outType) {
|
|
59
|
-
case engine_1.ParticleOutType.outside: {
|
|
60
|
-
particle.position.x =
|
|
61
|
-
Math.floor((0, engine_1.randomInRangeValue)({
|
|
62
|
-
min: -particle.moveCenter.radius,
|
|
63
|
-
max: particle.moveCenter.radius,
|
|
64
|
-
})) + particle.moveCenter.x;
|
|
65
|
-
particle.position.y =
|
|
66
|
-
Math.floor((0, engine_1.randomInRangeValue)({
|
|
67
|
-
min: -particle.moveCenter.radius,
|
|
68
|
-
max: particle.moveCenter.radius,
|
|
69
|
-
})) + particle.moveCenter.y;
|
|
70
|
-
const { dx, dy } = (0, engine_1.getDistances)(particle.position, particle.moveCenter);
|
|
71
|
-
if (particle.moveCenter.radius) {
|
|
72
|
-
particle.direction = Math.atan2(dy, dx);
|
|
73
|
-
particle.velocity.angle = particle.direction;
|
|
74
|
-
}
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
case engine_1.ParticleOutType.normal: {
|
|
78
|
-
const warp = particle.options.move.warp, canvasSize = container.canvas.size, newPos = {
|
|
79
|
-
bottom: canvasSize.height + particle.getRadius() + particle.offset.y,
|
|
80
|
-
left: -particle.getRadius() - particle.offset.x,
|
|
81
|
-
right: canvasSize.width + particle.getRadius() + particle.offset.x,
|
|
82
|
-
top: -particle.getRadius() - particle.offset.y,
|
|
83
|
-
}, sizeValue = particle.getRadius(), nextBounds = (0, engine_1.calculateBounds)(particle.position, sizeValue);
|
|
84
|
-
if (direction === engine_1.OutModeDirection.right && nextBounds.left > canvasSize.width + particle.offset.x) {
|
|
85
|
-
particle.position.x = newPos.left;
|
|
86
|
-
particle.initialPosition.x = particle.position.x;
|
|
87
|
-
if (!warp) {
|
|
88
|
-
particle.position.y = (0, engine_1.getRandom)() * canvasSize.height;
|
|
89
|
-
particle.initialPosition.y = particle.position.y;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
else if (direction === engine_1.OutModeDirection.left && nextBounds.right < -particle.offset.x) {
|
|
93
|
-
particle.position.x = newPos.right;
|
|
94
|
-
particle.initialPosition.x = particle.position.x;
|
|
95
|
-
if (!warp) {
|
|
96
|
-
particle.position.y = (0, engine_1.getRandom)() * canvasSize.height;
|
|
97
|
-
particle.initialPosition.y = particle.position.y;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (direction === engine_1.OutModeDirection.bottom && nextBounds.top > canvasSize.height + particle.offset.y) {
|
|
101
|
-
if (!warp) {
|
|
102
|
-
particle.position.x = (0, engine_1.getRandom)() * canvasSize.width;
|
|
103
|
-
particle.initialPosition.x = particle.position.x;
|
|
104
|
-
}
|
|
105
|
-
particle.position.y = newPos.top;
|
|
106
|
-
particle.initialPosition.y = particle.position.y;
|
|
107
|
-
}
|
|
108
|
-
else if (direction === engine_1.OutModeDirection.top && nextBounds.bottom < -particle.offset.y) {
|
|
109
|
-
if (!warp) {
|
|
110
|
-
particle.position.x = (0, engine_1.getRandom)() * canvasSize.width;
|
|
111
|
-
particle.initialPosition.x = particle.position.x;
|
|
112
|
-
}
|
|
113
|
-
particle.position.y = newPos.bottom;
|
|
114
|
-
particle.initialPosition.y = particle.position.y;
|
|
115
|
-
}
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
exports.OutOutMode = OutOutMode;
|
|
125
|
-
});
|
package/umd/Utils.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
(function (factory) {
|
|
2
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
-
var v = factory(require, exports);
|
|
4
|
-
if (v !== undefined) module.exports = v;
|
|
5
|
-
}
|
|
6
|
-
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.bounceHorizontal = bounceHorizontal;
|
|
13
|
-
exports.bounceVertical = bounceVertical;
|
|
14
|
-
const engine_1 = require("@tsparticles/engine");
|
|
15
|
-
const minVelocity = 0, boundsMin = 0;
|
|
16
|
-
function bounceHorizontal(data) {
|
|
17
|
-
if ((data.outMode !== engine_1.OutMode.bounce && data.outMode !== engine_1.OutMode.split) ||
|
|
18
|
-
(data.direction !== engine_1.OutModeDirection.left && data.direction !== engine_1.OutModeDirection.right)) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (data.bounds.right < boundsMin && data.direction === engine_1.OutModeDirection.left) {
|
|
22
|
-
data.particle.position.x = data.size + data.offset.x;
|
|
23
|
-
}
|
|
24
|
-
else if (data.bounds.left > data.canvasSize.width && data.direction === engine_1.OutModeDirection.right) {
|
|
25
|
-
data.particle.position.x = data.canvasSize.width - data.size - data.offset.x;
|
|
26
|
-
}
|
|
27
|
-
const velocity = data.particle.velocity.x;
|
|
28
|
-
let bounced = false;
|
|
29
|
-
if ((data.direction === engine_1.OutModeDirection.right &&
|
|
30
|
-
data.bounds.right >= data.canvasSize.width &&
|
|
31
|
-
velocity > minVelocity) ||
|
|
32
|
-
(data.direction === engine_1.OutModeDirection.left && data.bounds.left <= boundsMin && velocity < minVelocity)) {
|
|
33
|
-
const newVelocity = (0, engine_1.getRangeValue)(data.particle.options.bounce.horizontal.value);
|
|
34
|
-
data.particle.velocity.x *= -newVelocity;
|
|
35
|
-
bounced = true;
|
|
36
|
-
}
|
|
37
|
-
if (!bounced) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const minPos = data.offset.x + data.size;
|
|
41
|
-
if (data.bounds.right >= data.canvasSize.width && data.direction === engine_1.OutModeDirection.right) {
|
|
42
|
-
data.particle.position.x = data.canvasSize.width - minPos;
|
|
43
|
-
}
|
|
44
|
-
else if (data.bounds.left <= boundsMin && data.direction === engine_1.OutModeDirection.left) {
|
|
45
|
-
data.particle.position.x = minPos;
|
|
46
|
-
}
|
|
47
|
-
if (data.outMode === engine_1.OutMode.split) {
|
|
48
|
-
data.particle.destroy();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function bounceVertical(data) {
|
|
52
|
-
if ((data.outMode !== engine_1.OutMode.bounce && data.outMode !== engine_1.OutMode.split) ||
|
|
53
|
-
(data.direction !== engine_1.OutModeDirection.bottom && data.direction !== engine_1.OutModeDirection.top)) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (data.bounds.bottom < boundsMin && data.direction === engine_1.OutModeDirection.top) {
|
|
57
|
-
data.particle.position.y = data.size + data.offset.y;
|
|
58
|
-
}
|
|
59
|
-
else if (data.bounds.top > data.canvasSize.height && data.direction === engine_1.OutModeDirection.bottom) {
|
|
60
|
-
data.particle.position.y = data.canvasSize.height - data.size - data.offset.y;
|
|
61
|
-
}
|
|
62
|
-
const velocity = data.particle.velocity.y;
|
|
63
|
-
let bounced = false;
|
|
64
|
-
if ((data.direction === engine_1.OutModeDirection.bottom &&
|
|
65
|
-
data.bounds.bottom >= data.canvasSize.height &&
|
|
66
|
-
velocity > minVelocity) ||
|
|
67
|
-
(data.direction === engine_1.OutModeDirection.top && data.bounds.top <= boundsMin && velocity < minVelocity)) {
|
|
68
|
-
const newVelocity = (0, engine_1.getRangeValue)(data.particle.options.bounce.vertical.value);
|
|
69
|
-
data.particle.velocity.y *= -newVelocity;
|
|
70
|
-
bounced = true;
|
|
71
|
-
}
|
|
72
|
-
if (!bounced) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const minPos = data.offset.y + data.size;
|
|
76
|
-
if (data.bounds.bottom >= data.canvasSize.height && data.direction === engine_1.OutModeDirection.bottom) {
|
|
77
|
-
data.particle.position.y = data.canvasSize.height - minPos;
|
|
78
|
-
}
|
|
79
|
-
else if (data.bounds.top <= boundsMin && data.direction === engine_1.OutModeDirection.top) {
|
|
80
|
-
data.particle.position.y = minPos;
|
|
81
|
-
}
|
|
82
|
-
if (data.outMode === engine_1.OutMode.split) {
|
|
83
|
-
data.particle.destroy();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
package/umd/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
-
}) : function(o, v) {
|
|
15
|
-
o["default"] = v;
|
|
16
|
-
});
|
|
17
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
18
|
-
var ownKeys = function(o) {
|
|
19
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
20
|
-
var ar = [];
|
|
21
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
22
|
-
return ar;
|
|
23
|
-
};
|
|
24
|
-
return ownKeys(o);
|
|
25
|
-
};
|
|
26
|
-
return function (mod) {
|
|
27
|
-
if (mod && mod.__esModule) return mod;
|
|
28
|
-
var result = {};
|
|
29
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
30
|
-
__setModuleDefault(result, mod);
|
|
31
|
-
return result;
|
|
32
|
-
};
|
|
33
|
-
})();
|
|
34
|
-
(function (factory) {
|
|
35
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
36
|
-
var v = factory(require, exports);
|
|
37
|
-
if (v !== undefined) module.exports = v;
|
|
38
|
-
}
|
|
39
|
-
else if (typeof define === "function" && define.amd) {
|
|
40
|
-
define(["require", "exports"], factory);
|
|
41
|
-
}
|
|
42
|
-
})(function (require, exports) {
|
|
43
|
-
"use strict";
|
|
44
|
-
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.loadOutModesUpdater = loadOutModesUpdater;
|
|
47
|
-
async function loadOutModesUpdater(engine) {
|
|
48
|
-
engine.checkVersion("4.0.0-beta.1");
|
|
49
|
-
await engine.pluginManager.register(e => {
|
|
50
|
-
e.pluginManager.addParticleUpdater("outModes", async (container) => {
|
|
51
|
-
const { OutOfCanvasUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./OutOfCanvasUpdater.js"))) : new Promise((resolve_1, reject_1) => { require(["./OutOfCanvasUpdater.js"], resolve_1, reject_1); }).then(__importStar));
|
|
52
|
-
return new OutOfCanvasUpdater(container);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
});
|