@tsparticles/plugin-canvas-mask 4.0.0-beta.1 → 4.0.0-beta.2
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/browser/CanvasMaskPlugin.js +1 -0
- package/browser/index.js +2 -1
- package/cjs/CanvasMaskPlugin.js +1 -0
- package/cjs/index.js +2 -1
- package/dist_browser_CanvasMaskPluginInstance_js.js +1 -1
- package/dist_browser_CanvasMaskPlugin_js.js +2 -2
- package/esm/CanvasMaskPlugin.js +1 -0
- package/esm/index.js +2 -1
- package/package.json +3 -4
- package/report.html +1 -1
- package/tsparticles.plugin.canvas-mask.js +6 -6
- package/tsparticles.plugin.canvas-mask.min.js +2 -2
- package/umd/CanvasMaskPlugin.js +0 -69
- package/umd/CanvasMaskPluginInstance.js +0 -61
- package/umd/Options/Classes/CanvasMask.js +0 -73
- package/umd/Options/Classes/CanvasMaskOverride.js +0 -34
- package/umd/Options/Classes/CanvasMaskPixels.js +0 -45
- package/umd/Options/Classes/FontTextMask.js +0 -49
- package/umd/Options/Classes/ImageMask.js +0 -29
- package/umd/Options/Classes/TextMask.js +0 -47
- package/umd/Options/Classes/TextMaskLine.js +0 -34
- package/umd/Options/Interfaces/ICanvasMask.js +0 -12
- package/umd/Options/Interfaces/ICanvasMaskOverride.js +0 -12
- package/umd/Options/Interfaces/ICanvasMaskPixels.js +0 -12
- package/umd/Options/Interfaces/IFontTextMask.js +0 -12
- package/umd/Options/Interfaces/IImageMask.js +0 -12
- package/umd/Options/Interfaces/ITextMask.js +0 -12
- package/umd/Options/Interfaces/ITextMaskLine.js +0 -12
- package/umd/index.js +0 -54
- package/umd/types.js +0 -12
- package/umd/utils.js +0 -74
package/browser/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadCanvasMaskPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
3
4
|
await engine.pluginManager.register(async (e) => {
|
|
4
5
|
const { CanvasMaskPlugin } = await import("./CanvasMaskPlugin.js");
|
|
5
6
|
e.pluginManager.addPlugin(new CanvasMaskPlugin());
|
package/cjs/CanvasMaskPlugin.js
CHANGED
package/cjs/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadCanvasMaskPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
3
4
|
await engine.pluginManager.register(async (e) => {
|
|
4
5
|
const { CanvasMaskPlugin } = await import("./CanvasMaskPlugin.js");
|
|
5
6
|
e.pluginManager.addPlugin(new CanvasMaskPlugin());
|
|
@@ -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.2
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\******************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CanvasMaskPlugin: () => (/* binding */ CanvasMaskPlugin)\n/* harmony export */ });\n/* harmony import */ var
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CanvasMaskPlugin: () => (/* binding */ CanvasMaskPlugin)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Options_Classes_CanvasMask_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/CanvasMask.js */ \"./dist/browser/Options/Classes/CanvasMask.js\");\n\n\nclass CanvasMaskPlugin {\n id = \"canvas-mask\";\n async getPlugin(container) {\n const { CanvasMaskPluginInstance } = await __webpack_require__.e(/*! import() */ \"dist_browser_CanvasMaskPluginInstance_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./CanvasMaskPluginInstance.js */ \"./dist/browser/CanvasMaskPluginInstance.js\"));\n return new CanvasMaskPluginInstance(container);\n }\n loadOptions(_container, options, source) {\n if (!this.needsPlugin(options) && !this.needsPlugin(source)) {\n return;\n }\n let canvasMaskOptions = options.canvasMask;\n if (canvasMaskOptions?.load === undefined) {\n options.canvasMask = canvasMaskOptions = new _Options_Classes_CanvasMask_js__WEBPACK_IMPORTED_MODULE_1__.CanvasMask();\n }\n canvasMaskOptions.load(source?.canvasMask);\n }\n needsPlugin(options) {\n return options?.canvasMask?.enable ?? false;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-canvas-mask/./dist/browser/CanvasMaskPlugin.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ },
|
|
29
29
|
|
package/esm/CanvasMaskPlugin.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import {} from "@tsparticles/engine";
|
|
1
2
|
export async function loadCanvasMaskPlugin(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
+
engine.checkVersion("4.0.0-beta.2");
|
|
3
4
|
await engine.pluginManager.register(async (e) => {
|
|
4
5
|
const { CanvasMaskPlugin } = await import("./CanvasMaskPlugin.js");
|
|
5
6
|
e.pluginManager.addPlugin(new CanvasMaskPlugin());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/plugin-canvas-mask",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
4
4
|
"description": "tsParticles canvas mask plugin",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -80,12 +80,11 @@
|
|
|
80
80
|
"browser": "./browser/index.js",
|
|
81
81
|
"import": "./esm/index.js",
|
|
82
82
|
"require": "./cjs/index.js",
|
|
83
|
-
"
|
|
84
|
-
"default": "./cjs/index.js"
|
|
83
|
+
"default": "./esm/index.js"
|
|
85
84
|
},
|
|
86
85
|
"./package.json": "./package.json"
|
|
87
86
|
},
|
|
88
|
-
"
|
|
87
|
+
"peerDependencies": {
|
|
89
88
|
"@tsparticles/canvas-utils": "4.0.0-beta.1",
|
|
90
89
|
"@tsparticles/engine": "4.0.0-beta.1"
|
|
91
90
|
},
|
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/plugin-canvas-mask [
|
|
6
|
+
<title>@tsparticles/plugin-canvas-mask [2 Apr 2026 at 07:40]</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.2
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
*/
|
|
17
17
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
18
18
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
19
|
-
module.exports = factory(require("@tsparticles/
|
|
19
|
+
module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/canvas-utils"));
|
|
20
20
|
else if(typeof define === 'function' && define.amd)
|
|
21
|
-
define(["@tsparticles/
|
|
21
|
+
define(["@tsparticles/engine", "@tsparticles/canvas-utils"], factory);
|
|
22
22
|
else {
|
|
23
|
-
var a = typeof exports === 'object' ? factory(require("@tsparticles/
|
|
23
|
+
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/canvas-utils")) : factory(root["window"], root["window"]);
|
|
24
24
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
25
25
|
}
|
|
26
|
-
})(this, (
|
|
26
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_canvas_utils__) => {
|
|
27
27
|
return /******/ (() => { // webpackBootstrap
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
@@ -54,7 +54,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
54
54
|
\*******************************/
|
|
55
55
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
56
56
|
|
|
57
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadCanvasMaskPlugin: () => (/* binding */ loadCanvasMaskPlugin)\n/* harmony export */ });\nasync function loadCanvasMaskPlugin(engine) {\n engine.checkVersion(\"4.0.0-beta.
|
|
57
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadCanvasMaskPlugin: () => (/* binding */ loadCanvasMaskPlugin)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nasync function loadCanvasMaskPlugin(engine) {\n engine.checkVersion(\"4.0.0-beta.2\");\n await engine.pluginManager.register(async (e)=>{\n const { CanvasMaskPlugin } = await __webpack_require__.e(/*! import() */ \"dist_browser_CanvasMaskPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./CanvasMaskPlugin.js */ \"./dist/browser/CanvasMaskPlugin.js\"));\n e.pluginManager.addPlugin(new CanvasMaskPlugin());\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/plugin-canvas-mask/./dist/browser/index.js?\n}");
|
|
58
58
|
|
|
59
59
|
/***/ }
|
|
60
60
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/
|
|
2
|
-
(`+n+": "+a+")",o.name="ChunkLoadError",o.type=n,o.request=a,i[1](o)}},"chunk-"+e,e)}},i=(e,t)=>{var i,n,[a,o,c]=t,l=0;if(a.some(e=>0!==r[e])){for(i in o)s.o(o,i)&&(s.m[i]=o[i]);c&&c(s)}for(e&&e(t);l<a.length;l++)n=a[l],s.o(r,n)&&r[n]&&r[n][0](),r[n]=0},(n=this.webpackChunk_tsparticles_plugin_canvas_mask=this.webpackChunk_tsparticles_plugin_canvas_mask||[]).forEach(i.bind(null,0)),n.push=i.bind(null,n.push.bind(n));var f={};async function g(e){e.checkVersion("4.0.0-beta.
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("@tsparticles/canvas-utils"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","@tsparticles/canvas-utils"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine"),require("@tsparticles/canvas-utils")):t(e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,(e,t)=>(()=>{"use strict";var r,i,n,a={425(e){e.exports=t},303(t){t.exports=e}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var r=o[e]={exports:{}};return a[e](r,r.exports,s),r.exports}s.m=a,s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,r)=>(s.f[r](e,t),t),[])),s.u=e=>""+e+".min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c={},s.l=(e,t,r,i)=>{if(c[e])return void c[e].push(t);if(void 0!==r)for(var n,a,o=document.getElementsByTagName("script"),l=0;l<o.length;l++){var p=o[l];if(p.getAttribute("src")==e||p.getAttribute("data-webpack")=="@tsparticles/plugin-canvas-mask:"+r){n=p;break}}n||(a=!0,(n=document.createElement("script")).charset="utf-8",s.nc&&n.setAttribute("nonce",s.nc),n.setAttribute("data-webpack","@tsparticles/plugin-canvas-mask:"+r),n.src=e),c[e]=[t];var u=(t,r)=>{n.onerror=n.onload=null,clearTimeout(d);var i=c[e];if(delete c[e],n.parentNode&&n.parentNode.removeChild(n),i&&i.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=u.bind(null,n.onerror),n.onload=u.bind(null,n.onload),a&&document.head.appendChild(n)},s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(l=s.g.location+"");var c,l,p=s.g.document;if(!l&&p&&(p.currentScript&&"SCRIPT"===p.currentScript.tagName.toUpperCase()&&(l=p.currentScript.src),!l)){var u=p.getElementsByTagName("script");if(u.length)for(var d=u.length-1;d>-1&&(!l||!/^http(s?):/.test(l));)l=u[d--].src}if(!l)throw Error("Automatic publicPath is not supported in this browser");s.p=l=l.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r={837:0},s.f.j=(e,t)=>{var i=s.o(r,e)?r[e]:void 0;if(0!==i)if(i)t.push(i[2]);else{var n=new Promise((t,n)=>i=r[e]=[t,n]);t.push(i[2]=n);var a=s.p+s.u(e),o=Error();s.l(a,t=>{if(s.o(r,e)&&(0!==(i=r[e])&&(r[e]=void 0),i)){var n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;o.message="Loading chunk "+e+` failed.
|
|
2
|
+
(`+n+": "+a+")",o.name="ChunkLoadError",o.type=n,o.request=a,i[1](o)}},"chunk-"+e,e)}},i=(e,t)=>{var i,n,[a,o,c]=t,l=0;if(a.some(e=>0!==r[e])){for(i in o)s.o(o,i)&&(s.m[i]=o[i]);c&&c(s)}for(e&&e(t);l<a.length;l++)n=a[l],s.o(r,n)&&r[n]&&r[n][0](),r[n]=0},(n=this.webpackChunk_tsparticles_plugin_canvas_mask=this.webpackChunk_tsparticles_plugin_canvas_mask||[]).forEach(i.bind(null,0)),n.push=i.bind(null,n.push.bind(n));var f={};async function g(e){e.checkVersion("4.0.0-beta.2"),await e.pluginManager.register(async e=>{let{CanvasMaskPlugin:t}=await s.e(556).then(s.bind(s,556));e.pluginManager.addPlugin(new t)})}return s.r(f),s.d(f,{loadCanvasMaskPlugin:()=>g}),s(303),f})());
|
package/umd/CanvasMaskPlugin.js
DELETED
|
@@ -1,69 +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", "./Options/Classes/CanvasMask.js"], 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.CanvasMaskPlugin = void 0;
|
|
47
|
-
const CanvasMask_js_1 = require("./Options/Classes/CanvasMask.js");
|
|
48
|
-
class CanvasMaskPlugin {
|
|
49
|
-
id = "canvas-mask";
|
|
50
|
-
async getPlugin(container) {
|
|
51
|
-
const { CanvasMaskPluginInstance } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./CanvasMaskPluginInstance.js"))) : new Promise((resolve_1, reject_1) => { require(["./CanvasMaskPluginInstance.js"], resolve_1, reject_1); }).then(__importStar));
|
|
52
|
-
return new CanvasMaskPluginInstance(container);
|
|
53
|
-
}
|
|
54
|
-
loadOptions(_container, options, source) {
|
|
55
|
-
if (!this.needsPlugin(options) && !this.needsPlugin(source)) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
let canvasMaskOptions = options.canvasMask;
|
|
59
|
-
if (canvasMaskOptions?.load === undefined) {
|
|
60
|
-
options.canvasMask = canvasMaskOptions = new CanvasMask_js_1.CanvasMask();
|
|
61
|
-
}
|
|
62
|
-
canvasMaskOptions.load(source?.canvasMask);
|
|
63
|
-
}
|
|
64
|
-
needsPlugin(options) {
|
|
65
|
-
return options?.canvasMask?.enable ?? false;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.CanvasMaskPlugin = CanvasMaskPlugin;
|
|
69
|
-
});
|
|
@@ -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/canvas-utils", "@tsparticles/engine", "./utils.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CanvasMaskPluginInstance = void 0;
|
|
13
|
-
const canvas_utils_1 = require("@tsparticles/canvas-utils");
|
|
14
|
-
const engine_1 = require("@tsparticles/engine");
|
|
15
|
-
const utils_js_1 = require("./utils.js");
|
|
16
|
-
class CanvasMaskPluginInstance {
|
|
17
|
-
_container;
|
|
18
|
-
constructor(container) {
|
|
19
|
-
this._container = container;
|
|
20
|
-
}
|
|
21
|
-
async init() {
|
|
22
|
-
const container = this._container, options = container.actualOptions.canvasMask;
|
|
23
|
-
if (!options?.enable) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
let pixelData = {
|
|
27
|
-
pixels: [],
|
|
28
|
-
height: 0,
|
|
29
|
-
width: 0,
|
|
30
|
-
};
|
|
31
|
-
const offset = options.pixels.offset;
|
|
32
|
-
if (options.image) {
|
|
33
|
-
const url = options.image.src;
|
|
34
|
-
if (!url) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
pixelData = await (0, canvas_utils_1.getImageData)(url, offset, container.canvas.render.settings);
|
|
38
|
-
}
|
|
39
|
-
else if (options.text) {
|
|
40
|
-
const textOptions = options.text, data = (0, canvas_utils_1.getTextData)(textOptions, offset, textOptions.fill, container.canvas.render.settings);
|
|
41
|
-
if ((0, engine_1.isNull)(data)) {
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
pixelData = data;
|
|
45
|
-
}
|
|
46
|
-
else if (options.element ?? options.selector) {
|
|
47
|
-
const canvas = options.element ?? (options.selector && (0, engine_1.safeDocument)().querySelector(options.selector));
|
|
48
|
-
if (!canvas) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const context = canvas.getContext("2d", container.canvas.render.settings);
|
|
52
|
-
if (!context) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
pixelData = (0, canvas_utils_1.getCanvasImageData)(context, canvas, offset);
|
|
56
|
-
}
|
|
57
|
-
(0, utils_js_1.addParticlesFromCanvasPixels)(container, pixelData, options.position, options.scale, options.override, options.pixels.filter);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.CanvasMaskPluginInstance = CanvasMaskPluginInstance;
|
|
61
|
-
});
|
|
@@ -1,73 +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", "./CanvasMaskOverride.js", "./CanvasMaskPixels.js", "./ImageMask.js", "./TextMask.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CanvasMask = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const CanvasMaskOverride_js_1 = require("./CanvasMaskOverride.js");
|
|
15
|
-
const CanvasMaskPixels_js_1 = require("./CanvasMaskPixels.js");
|
|
16
|
-
const ImageMask_js_1 = require("./ImageMask.js");
|
|
17
|
-
const TextMask_js_1 = require("./TextMask.js");
|
|
18
|
-
class CanvasMask {
|
|
19
|
-
element;
|
|
20
|
-
enable;
|
|
21
|
-
image;
|
|
22
|
-
override;
|
|
23
|
-
pixels;
|
|
24
|
-
position;
|
|
25
|
-
scale;
|
|
26
|
-
selector;
|
|
27
|
-
text;
|
|
28
|
-
constructor() {
|
|
29
|
-
this.enable = false;
|
|
30
|
-
this.override = new CanvasMaskOverride_js_1.CanvasMaskOverride();
|
|
31
|
-
this.pixels = new CanvasMaskPixels_js_1.CanvasMaskPixels();
|
|
32
|
-
this.position = {
|
|
33
|
-
x: 50,
|
|
34
|
-
y: 50,
|
|
35
|
-
};
|
|
36
|
-
this.scale = 1;
|
|
37
|
-
}
|
|
38
|
-
load(data) {
|
|
39
|
-
if ((0, engine_1.isNull)(data)) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (data.element !== undefined && data.element instanceof HTMLCanvasElement) {
|
|
43
|
-
this.element = data.element;
|
|
44
|
-
}
|
|
45
|
-
if (data.enable !== undefined) {
|
|
46
|
-
this.enable = data.enable;
|
|
47
|
-
}
|
|
48
|
-
if (data.image) {
|
|
49
|
-
this.image ??= new ImageMask_js_1.ImageMask();
|
|
50
|
-
this.image.load(data.image);
|
|
51
|
-
}
|
|
52
|
-
this.pixels.load(data.pixels);
|
|
53
|
-
if (data.position) {
|
|
54
|
-
this.position = {
|
|
55
|
-
x: data.position.x ?? this.position.x,
|
|
56
|
-
y: data.position.y ?? this.position.y,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
this.override.load(data.override);
|
|
60
|
-
if (data.scale !== undefined) {
|
|
61
|
-
this.scale = data.scale;
|
|
62
|
-
}
|
|
63
|
-
if (data.selector !== undefined) {
|
|
64
|
-
this.selector = data.selector;
|
|
65
|
-
}
|
|
66
|
-
if (data.text) {
|
|
67
|
-
this.text ??= new TextMask_js_1.TextMask();
|
|
68
|
-
this.text.load(data.text);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.CanvasMask = CanvasMask;
|
|
73
|
-
});
|
|
@@ -1,34 +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.CanvasMaskOverride = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
class CanvasMaskOverride {
|
|
15
|
-
color;
|
|
16
|
-
opacity;
|
|
17
|
-
constructor() {
|
|
18
|
-
this.color = true;
|
|
19
|
-
this.opacity = false;
|
|
20
|
-
}
|
|
21
|
-
load(data) {
|
|
22
|
-
if ((0, engine_1.isNull)(data)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (data.color !== undefined) {
|
|
26
|
-
this.color = data.color;
|
|
27
|
-
}
|
|
28
|
-
if (data.opacity !== undefined) {
|
|
29
|
-
this.opacity = data.opacity;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.CanvasMaskOverride = CanvasMaskOverride;
|
|
34
|
-
});
|
|
@@ -1,45 +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.CanvasMaskPixels = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const minAlpha = 0;
|
|
15
|
-
class CanvasMaskPixels {
|
|
16
|
-
filter;
|
|
17
|
-
offset;
|
|
18
|
-
constructor() {
|
|
19
|
-
this.filter = (pixel) => pixel.a > minAlpha;
|
|
20
|
-
this.offset = 4;
|
|
21
|
-
}
|
|
22
|
-
load(data) {
|
|
23
|
-
if ((0, engine_1.isNull)(data)) {
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (data.filter !== undefined) {
|
|
27
|
-
if ((0, engine_1.isString)(data.filter)) {
|
|
28
|
-
if (data.filter in globalThis) {
|
|
29
|
-
const filter = globalThis[data.filter];
|
|
30
|
-
if ((0, engine_1.isFunction)(filter)) {
|
|
31
|
-
this.filter = filter;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
this.filter = data.filter;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
if (data.offset !== undefined) {
|
|
40
|
-
this.offset = data.offset;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.CanvasMaskPixels = CanvasMaskPixels;
|
|
45
|
-
});
|
|
@@ -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.FontTextMask = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
class FontTextMask {
|
|
15
|
-
family;
|
|
16
|
-
size;
|
|
17
|
-
style;
|
|
18
|
-
variant;
|
|
19
|
-
weight;
|
|
20
|
-
constructor() {
|
|
21
|
-
this.family = "sans-serif";
|
|
22
|
-
this.size = 100;
|
|
23
|
-
this.style = "";
|
|
24
|
-
this.variant = "";
|
|
25
|
-
this.weight = "";
|
|
26
|
-
}
|
|
27
|
-
load(data) {
|
|
28
|
-
if ((0, engine_1.isNull)(data)) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (data.family !== undefined) {
|
|
32
|
-
this.family = data.family;
|
|
33
|
-
}
|
|
34
|
-
if (data.size !== undefined) {
|
|
35
|
-
this.size = data.size;
|
|
36
|
-
}
|
|
37
|
-
if (data.style !== undefined) {
|
|
38
|
-
this.style = data.style;
|
|
39
|
-
}
|
|
40
|
-
if (data.variant !== undefined) {
|
|
41
|
-
this.variant = data.variant;
|
|
42
|
-
}
|
|
43
|
-
if (data.weight !== undefined) {
|
|
44
|
-
this.weight = data.weight;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.FontTextMask = FontTextMask;
|
|
49
|
-
});
|
|
@@ -1,29 +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.ImageMask = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
class ImageMask {
|
|
15
|
-
src;
|
|
16
|
-
constructor() {
|
|
17
|
-
this.src = "";
|
|
18
|
-
}
|
|
19
|
-
load(data) {
|
|
20
|
-
if ((0, engine_1.isNull)(data)) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (data.src !== undefined) {
|
|
24
|
-
this.src = data.src;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.ImageMask = ImageMask;
|
|
29
|
-
});
|
|
@@ -1,47 +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", "./FontTextMask.js", "./TextMaskLine.js"], factory);
|
|
8
|
-
}
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TextMask = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const FontTextMask_js_1 = require("./FontTextMask.js");
|
|
15
|
-
const TextMaskLine_js_1 = require("./TextMaskLine.js");
|
|
16
|
-
class TextMask {
|
|
17
|
-
color;
|
|
18
|
-
fill;
|
|
19
|
-
font;
|
|
20
|
-
lines;
|
|
21
|
-
text;
|
|
22
|
-
constructor() {
|
|
23
|
-
this.color = "#000000";
|
|
24
|
-
this.fill = true;
|
|
25
|
-
this.font = new FontTextMask_js_1.FontTextMask();
|
|
26
|
-
this.lines = new TextMaskLine_js_1.TextMaskLine();
|
|
27
|
-
this.text = "";
|
|
28
|
-
}
|
|
29
|
-
load(data) {
|
|
30
|
-
if ((0, engine_1.isNull)(data)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (data.color !== undefined) {
|
|
34
|
-
this.color = data.color;
|
|
35
|
-
}
|
|
36
|
-
if (data.fill !== undefined) {
|
|
37
|
-
this.fill = data.fill;
|
|
38
|
-
}
|
|
39
|
-
this.font.load(data.font);
|
|
40
|
-
this.lines.load(data.lines);
|
|
41
|
-
if (data.text !== undefined) {
|
|
42
|
-
this.text = data.text;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.TextMask = TextMask;
|
|
47
|
-
});
|
|
@@ -1,34 +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.TextMaskLine = void 0;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
class TextMaskLine {
|
|
15
|
-
separator;
|
|
16
|
-
spacing;
|
|
17
|
-
constructor() {
|
|
18
|
-
this.separator = "\n";
|
|
19
|
-
this.spacing = 10;
|
|
20
|
-
}
|
|
21
|
-
load(data) {
|
|
22
|
-
if ((0, engine_1.isNull)(data)) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (data.separator !== undefined) {
|
|
26
|
-
this.separator = data.separator;
|
|
27
|
-
}
|
|
28
|
-
if (data.spacing !== undefined) {
|
|
29
|
-
this.spacing = data.spacing;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.TextMaskLine = TextMaskLine;
|
|
34
|
-
});
|
|
@@ -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
|
-
});
|
|
@@ -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
|
-
});
|
|
@@ -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
|
-
});
|
|
@@ -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
|
-
});
|
|
@@ -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
|
-
});
|
|
@@ -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
|
-
});
|
|
@@ -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/index.js
DELETED
|
@@ -1,54 +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.loadCanvasMaskPlugin = loadCanvasMaskPlugin;
|
|
47
|
-
async function loadCanvasMaskPlugin(engine) {
|
|
48
|
-
engine.checkVersion("4.0.0-beta.1");
|
|
49
|
-
await engine.pluginManager.register(async (e) => {
|
|
50
|
-
const { CanvasMaskPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./CanvasMaskPlugin.js"))) : new Promise((resolve_1, reject_1) => { require(["./CanvasMaskPlugin.js"], resolve_1, reject_1); }).then(__importStar));
|
|
51
|
-
e.pluginManager.addPlugin(new CanvasMaskPlugin());
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
});
|
package/umd/types.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/utils.js
DELETED
|
@@ -1,74 +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.addParticlesFromCanvasPixels = addParticlesFromCanvasPixels;
|
|
13
|
-
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
function addParticlesFromCanvasPixels(container, data, position, scale, override, filter) {
|
|
15
|
-
const { height, width } = data, numPixels = height * width, indexArray = shuffle(range(numPixels)), maxParticles = Math.min(numPixels, container.actualOptions.particles.number.value), canvasSize = container.canvas.size;
|
|
16
|
-
let selectedPixels = 0;
|
|
17
|
-
const positionOffset = {
|
|
18
|
-
x: (canvasSize.width * position.x) / engine_1.percentDenominator - width * scale * engine_1.half,
|
|
19
|
-
y: (canvasSize.height * position.y) / engine_1.percentDenominator - height * scale * engine_1.half,
|
|
20
|
-
};
|
|
21
|
-
while (selectedPixels < maxParticles && indexArray.length) {
|
|
22
|
-
const defaultIndex = 0, nextIndex = indexArray.pop() ?? defaultIndex, pixelPos = {
|
|
23
|
-
x: nextIndex % width,
|
|
24
|
-
y: Math.floor(nextIndex / width),
|
|
25
|
-
}, row = data.pixels[pixelPos.y];
|
|
26
|
-
if (!row) {
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
const pixel = row[pixelPos.x];
|
|
30
|
-
if (!pixel) {
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
const shouldCreateParticle = filter(pixel);
|
|
34
|
-
if (!shouldCreateParticle) {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
const pos = {
|
|
38
|
-
x: pixelPos.x * scale + positionOffset.x,
|
|
39
|
-
y: pixelPos.y * scale + positionOffset.y,
|
|
40
|
-
}, pOptions = {};
|
|
41
|
-
if (override.color) {
|
|
42
|
-
pOptions.fill = {
|
|
43
|
-
color: {
|
|
44
|
-
value: pixel,
|
|
45
|
-
},
|
|
46
|
-
enable: true,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
if (override.opacity) {
|
|
50
|
-
pOptions.opacity = {
|
|
51
|
-
value: pixel.a,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
container.particles.addParticle(pos, pOptions);
|
|
55
|
-
selectedPixels++;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function shuffle(array) {
|
|
59
|
-
const lengthOffset = 1, minIndex = 0;
|
|
60
|
-
for (let currentIndex = array.length - lengthOffset; currentIndex >= minIndex; currentIndex--) {
|
|
61
|
-
const randomIndex = Math.floor((0, engine_1.getRandom)() * currentIndex), currentItem = array[currentIndex], randomItem = array[randomIndex];
|
|
62
|
-
if (randomItem === currentItem) {
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
if (randomItem === undefined || currentItem === undefined) {
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
array[currentIndex] = randomItem;
|
|
69
|
-
array[randomIndex] = currentItem;
|
|
70
|
-
}
|
|
71
|
-
return array;
|
|
72
|
-
}
|
|
73
|
-
const range = (n) => [...Array(n).keys()];
|
|
74
|
-
});
|