@tsparticles/updater-orbit 4.0.0-beta.0 → 4.0.0-beta.1
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/889.min.js +1 -0
- package/browser/OrbitUpdater.js +6 -6
- package/browser/Utils.js +3 -3
- package/browser/index.js +4 -4
- package/cjs/OrbitUpdater.js +6 -6
- package/cjs/Utils.js +3 -3
- package/cjs/index.js +4 -4
- package/dist_browser_OrbitUpdater_js.js +3 -3
- package/esm/OrbitUpdater.js +6 -6
- package/esm/Utils.js +3 -3
- package/esm/index.js +4 -4
- package/package.json +2 -2
- package/report.html +84 -29
- package/tsparticles.updater.orbit.js +2 -2
- package/tsparticles.updater.orbit.min.js +2 -2
- package/types/OrbitUpdater.d.ts +3 -3
- package/types/Utils.d.ts +3 -2
- package/umd/OrbitUpdater.js +6 -6
- package/umd/Utils.js +2 -2
- package/umd/index.js +4 -4
- package/319.min.js +0 -1
|
@@ -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.1
|
|
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 */ loadOrbitUpdater: () => (/* binding */ loadOrbitUpdater)\n/* harmony export */ });\nasync function loadOrbitUpdater(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 */ loadOrbitUpdater: () => (/* binding */ loadOrbitUpdater)\n/* harmony export */ });\nasync function loadOrbitUpdater(engine) {\n engine.checkVersion(\"4.0.0-beta.1\");\n await engine.pluginManager.register((e)=>{\n e.pluginManager.addParticleUpdater(\"orbit\", async (container)=>{\n const { OrbitUpdater } = await __webpack_require__.e(/*! import() */ \"dist_browser_OrbitUpdater_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./OrbitUpdater.js */ \"./dist/browser/OrbitUpdater.js\"));\n return new OrbitUpdater(e.pluginManager, container);\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/updater-orbit/./dist/browser/index.js?\n}");
|
|
48
48
|
|
|
49
49
|
/***/ }
|
|
50
50
|
|
|
@@ -1,2 +1,2 @@
|
|
|
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,
|
|
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,
|
|
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,p=document.getElementsByTagName("script"),c=0;c<p.length;c++){var u=p[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")=="@tsparticles/updater-orbit:"+r){i=u;break}}i||(n=!0,(i=document.createElement("script")).charset="utf-8",a.nc&&i.setAttribute("nonce",a.nc),i.setAttribute("data-webpack","@tsparticles/updater-orbit:"+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&&(p=a.g.location+"");var s,p,c=a.g.document;if(!p&&c&&(c.currentScript&&"SCRIPT"===c.currentScript.tagName.toUpperCase()&&(p=c.currentScript.src),!p)){var u=c.getElementsByTagName("script");if(u.length)for(var l=u.length-1;l>-1&&(!p||!/^http(s?):/.test(p));)p=u[l--].src}if(!p)throw Error("Automatic publicPath is not supported in this browser");a.p=p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),t={476: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,p]=r,c=0;if(n.some(e=>0!==t[e])){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);p&&p(a)}for(e&&e(r);c<n.length;c++)i=n[c],a.o(t,i)&&t[i]&&t[i][0](),t[i]=0},(o=this.webpackChunk_tsparticles_updater_orbit=this.webpackChunk_tsparticles_updater_orbit||[]).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.1"),await e.pluginManager.register(e=>{e.pluginManager.addParticleUpdater("orbit",async t=>{let{OrbitUpdater:r}=await a.e(889).then(a.bind(a,889));return new r(e.pluginManager,t)})})}return a.r(d),a.d(d,{loadOrbitUpdater:()=>f}),d})());
|
package/types/OrbitUpdater.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IDelta, type IParticleUpdater, type PluginManager, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { IOrbitParticlesOptions, OrbitContainer, OrbitParticle, OrbitParticlesOptions } from "./Types.js";
|
|
3
3
|
import { OrbitType } from "./Enums.js";
|
|
4
4
|
export declare class OrbitUpdater implements IParticleUpdater {
|
|
5
5
|
private readonly _container;
|
|
6
|
-
private readonly
|
|
7
|
-
constructor(
|
|
6
|
+
private readonly _pluginManager;
|
|
7
|
+
constructor(pluginManager: PluginManager, container: OrbitContainer);
|
|
8
8
|
afterDraw(particle: OrbitParticle): void;
|
|
9
9
|
beforeDraw(particle: OrbitParticle): void;
|
|
10
10
|
drawOrbit(particle: OrbitParticle, type: OrbitType): void;
|
package/types/Utils.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { type IHsl, type Particle } from "@tsparticles/engine";
|
|
2
|
-
|
|
1
|
+
import { type CanvasContextType, type IHsl, type Particle } from "@tsparticles/engine";
|
|
2
|
+
import type { OrbitContainer } from "./Types.js";
|
|
3
|
+
export declare function drawEllipse(container: OrbitContainer, context: CanvasContextType, particle: Particle, fillColorValue: IHsl | undefined, radius: number, opacity: number, width: number, rotation: number, start: number, end: number): void;
|
package/umd/OrbitUpdater.js
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
const defaultOrbitSpeed = 0, halfPI = Math.PI * engine_1.half, piAndAHalf = Math.PI + halfPI, startAngle = 0, defaultWidth = 1, defaultRotation = 0;
|
|
18
18
|
class OrbitUpdater {
|
|
19
19
|
_container;
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
22
|
-
this.
|
|
20
|
+
_pluginManager;
|
|
21
|
+
constructor(pluginManager, container) {
|
|
22
|
+
this._pluginManager = pluginManager;
|
|
23
23
|
this._container = container;
|
|
24
24
|
}
|
|
25
25
|
afterDraw(particle) {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
start = startAngle;
|
|
51
51
|
end = engine_1.doublePI;
|
|
52
52
|
}
|
|
53
|
-
container.canvas.draw(ctx => {
|
|
54
|
-
(0, Utils_js_1.drawEllipse)(ctx, particle, particle.orbitColor ?? particle.getFillColor(), particle.retina.orbitRadius ?? container.retina.orbitRadius ?? particle.getRadius(), particle.orbitOpacity ?? engine_1.defaultOpacity, particle.orbitWidth ?? defaultWidth, (particle.orbitRotation ?? defaultRotation) * container.retina.pixelRatio, start, end);
|
|
53
|
+
container.canvas.render.draw(ctx => {
|
|
54
|
+
(0, Utils_js_1.drawEllipse)(container, ctx, particle, particle.orbitColor ?? particle.getFillColor(), particle.retina.orbitRadius ?? container.retina.orbitRadius ?? particle.getRadius(), particle.orbitOpacity ?? engine_1.defaultOpacity, particle.orbitWidth ?? defaultWidth, (particle.orbitRotation ?? defaultRotation) * container.retina.pixelRatio, start, end);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
init(particle) {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
62
|
particle.orbitRotation = (0, engine_1.getRangeValue)(orbitOptions.rotation.value);
|
|
63
|
-
particle.orbitColor = (0, engine_1.rangeColorToHsl)(this.
|
|
63
|
+
particle.orbitColor = (0, engine_1.rangeColorToHsl)(this._pluginManager, orbitOptions.color);
|
|
64
64
|
particle.retina.orbitRadius =
|
|
65
65
|
orbitOptions.radius !== undefined ? (0, engine_1.getRangeValue)(orbitOptions.radius) * container.retina.pixelRatio : undefined;
|
|
66
66
|
container.retina.orbitRadius = particle.retina.orbitRadius;
|
package/umd/Utils.js
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
exports.drawEllipse = drawEllipse;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const minWidth = 0;
|
|
15
|
-
function drawEllipse(context, particle, fillColorValue, radius, opacity, width, rotation, start, end) {
|
|
15
|
+
function drawEllipse(container, context, particle, fillColorValue, radius, opacity, width, rotation, start, end) {
|
|
16
16
|
if (width <= minWidth) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
const pos = particle.getPosition()
|
|
19
|
+
const pos = particle.getPosition();
|
|
20
20
|
if (fillColorValue) {
|
|
21
21
|
context.strokeStyle = (0, engine_1.getStyleFromHsl)(fillColorValue, container.hdr, opacity);
|
|
22
22
|
}
|
package/umd/index.js
CHANGED
|
@@ -45,11 +45,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.loadOrbitUpdater = loadOrbitUpdater;
|
|
47
47
|
async function loadOrbitUpdater(engine) {
|
|
48
|
-
engine.checkVersion("4.0.0-beta.
|
|
49
|
-
await engine.register(e => {
|
|
50
|
-
e.addParticleUpdater("orbit", async (container) => {
|
|
48
|
+
engine.checkVersion("4.0.0-beta.1");
|
|
49
|
+
await engine.pluginManager.register(e => {
|
|
50
|
+
e.pluginManager.addParticleUpdater("orbit", async (container) => {
|
|
51
51
|
const { OrbitUpdater } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./OrbitUpdater.js"))) : new Promise((resolve_1, reject_1) => { require(["./OrbitUpdater.js"], resolve_1, reject_1); }).then(__importStar));
|
|
52
|
-
return new OrbitUpdater(e, container);
|
|
52
|
+
return new OrbitUpdater(e.pluginManager, container);
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
}
|
package/319.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_updater_orbit=this.webpackChunk_tsparticles_updater_orbit||[]).push([[319],{319(t,i,a){a.d(i,{OrbitUpdater:()=>b});var o,e,r=a(303);class n extends r.ValueWithRandom{constructor(){super(),this.value=45}load(t){(0,r.isNull)(t)||super.load(t)}}class s{animation;color;enable;opacity;radius;rotation;width;constructor(){this.animation=new r.AnimationOptions,this.enable=!1,this.opacity=1,this.rotation=new n,this.width=1}load(t){(0,r.isNull)(t)||(this.animation.load(t.animation),this.rotation.load(t.rotation),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=(0,r.setRangeValue)(t.opacity)),void 0!==t.width&&(this.width=(0,r.setRangeValue)(t.width)),void 0!==t.radius&&(this.radius=(0,r.setRangeValue)(t.radius)),void 0!==t.color&&(this.color=r.OptionsColor.create(this.color,t.color)))}}(o=e||(e={})).front="front",o.back="back";let l=Math.PI*r.half,d=Math.PI+l;class b{_container;_engine;constructor(t,i){this._engine=t,this._container=i}afterDraw(t){let i=t.options.orbit;i?.enable&&this.drawOrbit(t,e.front)}beforeDraw(t){let i=t.options.orbit;i?.enable&&this.drawOrbit(t,e.back)}drawOrbit(t,i){let a,o,n=this._container;switch(i){case e.back:a=l,o=d;break;case e.front:a=d,o=l;break;default:a=0,o=r.doublePI}n.canvas.draw(i=>{!function(t,i,a,o,e,n,s,l,d){if(n<=0)return;let b=i.getPosition(),{container:u}=i;a&&(t.strokeStyle=(0,r.getStyleFromHsl)(a,u.hdr,e)),t.lineWidth=n;let c=(0,r.degToRad)(s);t.beginPath(),t.ellipse(b.x,b.y,o*r.half,o*r.double,c,l,d),t.stroke()}(i,t,t.orbitColor??t.getFillColor(),t.retina.orbitRadius??n.retina.orbitRadius??t.getRadius(),t.orbitOpacity??r.defaultOpacity,t.orbitWidth??1,(t.orbitRotation??0)*n.retina.pixelRatio,a,o)})}init(t){let i=this._container,a=t.options.orbit;a?.enable&&(t.orbitRotation=(0,r.getRangeValue)(a.rotation.value),t.orbitColor=(0,r.rangeColorToHsl)(this._engine,a.color),t.retina.orbitRadius=void 0!==a.radius?(0,r.getRangeValue)(a.radius)*i.retina.pixelRatio:void 0,i.retina.orbitRadius=t.retina.orbitRadius,t.orbitAnimationSpeed=a.animation.enable?(0,r.getRangeValue)(a.animation.speed):0,t.orbitWidth=(0,r.getRangeValue)(a.width),t.orbitOpacity=(0,r.getRangeValue)(a.opacity))}isEnabled(t){let i=t.options.orbit?.animation;return!t.destroyed&&!t.spawning&&!!i?.enable}loadOptions(t,...i){for(let a of(t.orbit??=new s,i))t.orbit.load(a?.orbit)}update(t,i){this.isEnabled(t)&&(t.orbitRotation??=0,t.orbitRotation+=(t.orbitAnimationSpeed??0/r.doublePI)*i.factor)}}}}]);
|