@tsparticles/shape-polygon 4.0.0-beta.11 → 4.0.0-beta.15
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/browser.js +7 -0
- package/browser/index.js +7 -11
- package/browser/index.lazy.js +21 -0
- package/cjs/browser.js +7 -0
- package/cjs/index.js +7 -11
- package/cjs/index.lazy.js +21 -0
- package/esm/browser.js +7 -0
- package/esm/index.js +7 -11
- package/esm/index.lazy.js +21 -0
- package/package.json +9 -2
- package/report.html +4949 -94
- package/tsparticles.shape.polygon.js +112 -310
- package/tsparticles.shape.polygon.min.js +1 -2
- package/types/browser.d.ts +1 -0
- package/types/index.lazy.d.ts +4 -0
- package/138.min.js +0 -1
- package/204.min.js +0 -1
- package/dist_browser_PolygonDrawer_js.js +0 -50
- package/dist_browser_TriangleDrawer_js.js +0 -50
|
@@ -1,317 +1,119 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
/*
|
|
10
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
11
|
-
* This devtool is neither made for production nor for readable output files.
|
|
12
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
13
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
14
|
-
* or disable the default devtool with "devtool: false".
|
|
15
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
16
|
-
*/
|
|
17
|
-
(function webpackUniversalModuleDefinition(root, factory) {
|
|
18
|
-
if(typeof exports === 'object' && typeof module === 'object')
|
|
19
|
-
module.exports = factory(require("@tsparticles/engine"));
|
|
20
|
-
else if(typeof define === 'function' && define.amd)
|
|
21
|
-
define(["@tsparticles/engine"], factory);
|
|
22
|
-
else {
|
|
23
|
-
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
|
|
24
|
-
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
25
|
-
}
|
|
26
|
-
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
|
|
27
|
-
return /******/ (() => { // webpackBootstrap
|
|
28
|
-
/******/ "use strict";
|
|
29
|
-
/******/ var __webpack_modules__ = ({
|
|
1
|
+
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
+
/* Shape v4.0.0-beta.15 */
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.shapes = global.__tsParticlesInternals.shapes || {}, global.__tsParticlesInternals.shapes.polygon = global.__tsParticlesInternals.shapes.polygon || {}), global.__tsParticlesInternals.engine));
|
|
7
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
30
8
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
9
|
+
const polygonCache = new Map(), noOffset = 0;
|
|
10
|
+
function getUnitPolygon(sides) {
|
|
11
|
+
const cached = polygonCache.get(sides);
|
|
12
|
+
if (cached) {
|
|
13
|
+
return cached;
|
|
14
|
+
}
|
|
15
|
+
const step = engine.doublePI / sides, isOdd = !!(sides % engine.double), baseAngle = (-Math.PI + (isOdd ? noOffset : step)) * engine.half, verts = [];
|
|
16
|
+
for (let i = 0; i < sides; i++) {
|
|
17
|
+
const angle = baseAngle + i * step;
|
|
18
|
+
verts[i] = {
|
|
19
|
+
x: Math.cos(angle),
|
|
20
|
+
y: Math.sin(angle),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
polygonCache.set(sides, verts);
|
|
24
|
+
return verts;
|
|
25
|
+
}
|
|
26
|
+
function drawPolygon(data, side) {
|
|
27
|
+
const { context, radius } = data, sides = side.count.numerator / side.count.denominator, verts = getUnitPolygon(sides);
|
|
28
|
+
context.beginPath();
|
|
29
|
+
for (let i = 0; i < verts.length; i++) {
|
|
30
|
+
const vert = verts[i];
|
|
31
|
+
if (!vert) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const x = vert.x * radius, y = vert.y * radius;
|
|
35
|
+
if (i) {
|
|
36
|
+
context.lineTo(x, y);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
context.moveTo(x, y);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
context.closePath();
|
|
43
|
+
}
|
|
36
44
|
|
|
37
|
-
|
|
45
|
+
const defaultSides = 5;
|
|
46
|
+
class PolygonDrawerBase {
|
|
47
|
+
draw(data) {
|
|
48
|
+
const { particle, radius } = data, side = this.getSidesData(particle, radius);
|
|
49
|
+
drawPolygon(data, side);
|
|
50
|
+
}
|
|
51
|
+
getSidesCount(particle) {
|
|
52
|
+
const polygon = particle.shapeData;
|
|
53
|
+
return Math.round(engine.getRangeValue(polygon?.sides ?? defaultSides));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
38
56
|
|
|
39
|
-
|
|
57
|
+
const yFactor$1 = 2.66, sidesFactor$1 = 3;
|
|
58
|
+
class PolygonDrawer extends PolygonDrawerBase {
|
|
59
|
+
getSidesData(particle, radius) {
|
|
60
|
+
const { sides } = particle;
|
|
61
|
+
return {
|
|
62
|
+
count: {
|
|
63
|
+
denominator: 1,
|
|
64
|
+
numerator: sides,
|
|
65
|
+
},
|
|
66
|
+
length: (radius * yFactor$1) / (sides / sidesFactor$1),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
40
70
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
const sides = 3, yFactor = 2.66, sidesFactor = 3;
|
|
72
|
+
class TriangleDrawer extends PolygonDrawerBase {
|
|
73
|
+
getSidesCount() {
|
|
74
|
+
return sides;
|
|
75
|
+
}
|
|
76
|
+
getSidesData(_particle, radius) {
|
|
77
|
+
return {
|
|
78
|
+
count: {
|
|
79
|
+
denominator: 1,
|
|
80
|
+
numerator: sides,
|
|
81
|
+
},
|
|
82
|
+
length: (radius * yFactor) / (sides / sidesFactor),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
46
86
|
|
|
47
|
-
|
|
87
|
+
async function loadGenericPolygonShape(engine) {
|
|
88
|
+
engine.checkVersion("4.0.0-beta.15");
|
|
89
|
+
await engine.pluginManager.register(e => {
|
|
90
|
+
e.pluginManager.addShape(["polygon"], () => Promise.resolve(new PolygonDrawer()));
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async function loadTriangleShape(engine) {
|
|
94
|
+
engine.checkVersion("4.0.0-beta.15");
|
|
95
|
+
await engine.pluginManager.register(e => {
|
|
96
|
+
e.pluginManager.addShape(["triangle"], () => Promise.resolve(new TriangleDrawer()));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async function loadPolygonShape(engine) {
|
|
100
|
+
engine.checkVersion("4.0.0-beta.15");
|
|
101
|
+
await Promise.all([
|
|
102
|
+
loadGenericPolygonShape(engine),
|
|
103
|
+
loadTriangleShape(engine),
|
|
104
|
+
]);
|
|
105
|
+
}
|
|
48
106
|
|
|
49
|
-
|
|
107
|
+
const globalObject = globalThis;
|
|
108
|
+
globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
|
|
109
|
+
globalObject.loadGenericPolygonShape = loadGenericPolygonShape;
|
|
110
|
+
globalObject.loadPolygonShape = loadPolygonShape;
|
|
111
|
+
globalObject.loadTriangleShape = loadTriangleShape;
|
|
50
112
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/******/ // Check if module is in cache
|
|
59
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
60
|
-
/******/ if (cachedModule !== undefined) {
|
|
61
|
-
/******/ return cachedModule.exports;
|
|
62
|
-
/******/ }
|
|
63
|
-
/******/ // Create a new module (and put it into the cache)
|
|
64
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
65
|
-
/******/ // no module.id needed
|
|
66
|
-
/******/ // no module.loaded needed
|
|
67
|
-
/******/ exports: {}
|
|
68
|
-
/******/ };
|
|
69
|
-
/******/
|
|
70
|
-
/******/ // Execute the module function
|
|
71
|
-
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
72
|
-
/******/ delete __webpack_module_cache__[moduleId];
|
|
73
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
74
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
75
|
-
/******/ throw e;
|
|
76
|
-
/******/ }
|
|
77
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
78
|
-
/******/
|
|
79
|
-
/******/ // Return the exports of the module
|
|
80
|
-
/******/ return module.exports;
|
|
81
|
-
/******/ }
|
|
82
|
-
/******/
|
|
83
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
84
|
-
/******/ __webpack_require__.m = __webpack_modules__;
|
|
85
|
-
/******/
|
|
86
|
-
/************************************************************************/
|
|
87
|
-
/******/ /* webpack/runtime/define property getters */
|
|
88
|
-
/******/ (() => {
|
|
89
|
-
/******/ // define getter functions for harmony exports
|
|
90
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
91
|
-
/******/ for(var key in definition) {
|
|
92
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
93
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
94
|
-
/******/ }
|
|
95
|
-
/******/ }
|
|
96
|
-
/******/ };
|
|
97
|
-
/******/ })();
|
|
98
|
-
/******/
|
|
99
|
-
/******/ /* webpack/runtime/ensure chunk */
|
|
100
|
-
/******/ (() => {
|
|
101
|
-
/******/ __webpack_require__.f = {};
|
|
102
|
-
/******/ // This file contains only the entry chunk.
|
|
103
|
-
/******/ // The chunk loading function for additional chunks
|
|
104
|
-
/******/ __webpack_require__.e = (chunkId) => {
|
|
105
|
-
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
106
|
-
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
107
|
-
/******/ return promises;
|
|
108
|
-
/******/ }, []));
|
|
109
|
-
/******/ };
|
|
110
|
-
/******/ })();
|
|
111
|
-
/******/
|
|
112
|
-
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
113
|
-
/******/ (() => {
|
|
114
|
-
/******/ // This function allow to reference async chunks
|
|
115
|
-
/******/ __webpack_require__.u = (chunkId) => {
|
|
116
|
-
/******/ // return url for filenames based on template
|
|
117
|
-
/******/ return "" + chunkId + ".js";
|
|
118
|
-
/******/ };
|
|
119
|
-
/******/ })();
|
|
120
|
-
/******/
|
|
121
|
-
/******/ /* webpack/runtime/global */
|
|
122
|
-
/******/ (() => {
|
|
123
|
-
/******/ __webpack_require__.g = (function() {
|
|
124
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
125
|
-
/******/ try {
|
|
126
|
-
/******/ return this || new Function('return this')();
|
|
127
|
-
/******/ } catch (e) {
|
|
128
|
-
/******/ if (typeof window === 'object') return window;
|
|
129
|
-
/******/ }
|
|
130
|
-
/******/ })();
|
|
131
|
-
/******/ })();
|
|
132
|
-
/******/
|
|
133
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
134
|
-
/******/ (() => {
|
|
135
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
136
|
-
/******/ })();
|
|
137
|
-
/******/
|
|
138
|
-
/******/ /* webpack/runtime/load script */
|
|
139
|
-
/******/ (() => {
|
|
140
|
-
/******/ var inProgress = {};
|
|
141
|
-
/******/ var dataWebpackPrefix = "@tsparticles/shape-polygon:";
|
|
142
|
-
/******/ // loadScript function to load a script via script tag
|
|
143
|
-
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
144
|
-
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
145
|
-
/******/ var script, needAttach;
|
|
146
|
-
/******/ if(key !== undefined) {
|
|
147
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
148
|
-
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
149
|
-
/******/ var s = scripts[i];
|
|
150
|
-
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
151
|
-
/******/ }
|
|
152
|
-
/******/ }
|
|
153
|
-
/******/ if(!script) {
|
|
154
|
-
/******/ needAttach = true;
|
|
155
|
-
/******/ script = document.createElement('script');
|
|
156
|
-
/******/
|
|
157
|
-
/******/ script.charset = 'utf-8';
|
|
158
|
-
/******/ if (__webpack_require__.nc) {
|
|
159
|
-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
160
|
-
/******/ }
|
|
161
|
-
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
162
|
-
/******/
|
|
163
|
-
/******/ script.src = url;
|
|
164
|
-
/******/ }
|
|
165
|
-
/******/ inProgress[url] = [done];
|
|
166
|
-
/******/ var onScriptComplete = (prev, event) => {
|
|
167
|
-
/******/ // avoid mem leaks in IE.
|
|
168
|
-
/******/ script.onerror = script.onload = null;
|
|
169
|
-
/******/ clearTimeout(timeout);
|
|
170
|
-
/******/ var doneFns = inProgress[url];
|
|
171
|
-
/******/ delete inProgress[url];
|
|
172
|
-
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
173
|
-
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
174
|
-
/******/ if(prev) return prev(event);
|
|
175
|
-
/******/ }
|
|
176
|
-
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
177
|
-
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
178
|
-
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
179
|
-
/******/ needAttach && document.head.appendChild(script);
|
|
180
|
-
/******/ };
|
|
181
|
-
/******/ })();
|
|
182
|
-
/******/
|
|
183
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
184
|
-
/******/ (() => {
|
|
185
|
-
/******/ // define __esModule on exports
|
|
186
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
187
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
188
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
189
|
-
/******/ }
|
|
190
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
191
|
-
/******/ };
|
|
192
|
-
/******/ })();
|
|
193
|
-
/******/
|
|
194
|
-
/******/ /* webpack/runtime/publicPath */
|
|
195
|
-
/******/ (() => {
|
|
196
|
-
/******/ var scriptUrl;
|
|
197
|
-
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
198
|
-
/******/ var document = __webpack_require__.g.document;
|
|
199
|
-
/******/ if (!scriptUrl && document) {
|
|
200
|
-
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
201
|
-
/******/ scriptUrl = document.currentScript.src;
|
|
202
|
-
/******/ if (!scriptUrl) {
|
|
203
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
204
|
-
/******/ if(scripts.length) {
|
|
205
|
-
/******/ var i = scripts.length - 1;
|
|
206
|
-
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
|
|
207
|
-
/******/ }
|
|
208
|
-
/******/ }
|
|
209
|
-
/******/ }
|
|
210
|
-
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
211
|
-
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
212
|
-
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
213
|
-
/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
214
|
-
/******/ __webpack_require__.p = scriptUrl;
|
|
215
|
-
/******/ })();
|
|
216
|
-
/******/
|
|
217
|
-
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
218
|
-
/******/ (() => {
|
|
219
|
-
/******/ // no baseURI
|
|
220
|
-
/******/
|
|
221
|
-
/******/ // object to store loaded and loading chunks
|
|
222
|
-
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
223
|
-
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
224
|
-
/******/ var installedChunks = {
|
|
225
|
-
/******/ "tsparticles.shape.polygon": 0
|
|
226
|
-
/******/ };
|
|
227
|
-
/******/
|
|
228
|
-
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
229
|
-
/******/ // JSONP chunk loading for javascript
|
|
230
|
-
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
231
|
-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
232
|
-
/******/
|
|
233
|
-
/******/ // a Promise means "currently loading".
|
|
234
|
-
/******/ if(installedChunkData) {
|
|
235
|
-
/******/ promises.push(installedChunkData[2]);
|
|
236
|
-
/******/ } else {
|
|
237
|
-
/******/ if(true) { // all chunks have JS
|
|
238
|
-
/******/ // setup Promise in chunk cache
|
|
239
|
-
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
240
|
-
/******/ promises.push(installedChunkData[2] = promise);
|
|
241
|
-
/******/
|
|
242
|
-
/******/ // start chunk loading
|
|
243
|
-
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
244
|
-
/******/ // create error before stack unwound to get useful stacktrace later
|
|
245
|
-
/******/ var error = new Error();
|
|
246
|
-
/******/ var loadingEnded = (event) => {
|
|
247
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
248
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
249
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
250
|
-
/******/ if(installedChunkData) {
|
|
251
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
252
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
253
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
254
|
-
/******/ error.name = 'ChunkLoadError';
|
|
255
|
-
/******/ error.type = errorType;
|
|
256
|
-
/******/ error.request = realSrc;
|
|
257
|
-
/******/ installedChunkData[1](error);
|
|
258
|
-
/******/ }
|
|
259
|
-
/******/ }
|
|
260
|
-
/******/ };
|
|
261
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
262
|
-
/******/ }
|
|
263
|
-
/******/ }
|
|
264
|
-
/******/ }
|
|
265
|
-
/******/ };
|
|
266
|
-
/******/
|
|
267
|
-
/******/ // no prefetching
|
|
268
|
-
/******/
|
|
269
|
-
/******/ // no preloaded
|
|
270
|
-
/******/
|
|
271
|
-
/******/ // no HMR
|
|
272
|
-
/******/
|
|
273
|
-
/******/ // no HMR manifest
|
|
274
|
-
/******/
|
|
275
|
-
/******/ // no on chunks loaded
|
|
276
|
-
/******/
|
|
277
|
-
/******/ // install a JSONP callback for chunk loading
|
|
278
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
279
|
-
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
280
|
-
/******/ // add "moreModules" to the modules object,
|
|
281
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
282
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
283
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
284
|
-
/******/ for(moduleId in moreModules) {
|
|
285
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
286
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
287
|
-
/******/ }
|
|
288
|
-
/******/ }
|
|
289
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
290
|
-
/******/ }
|
|
291
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
292
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
293
|
-
/******/ chunkId = chunkIds[i];
|
|
294
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
295
|
-
/******/ installedChunks[chunkId][0]();
|
|
296
|
-
/******/ }
|
|
297
|
-
/******/ installedChunks[chunkId] = 0;
|
|
298
|
-
/******/ }
|
|
299
|
-
/******/
|
|
300
|
-
/******/ }
|
|
301
|
-
/******/
|
|
302
|
-
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_shape_polygon"] = this["webpackChunk_tsparticles_shape_polygon"] || [];
|
|
303
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
304
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
305
|
-
/******/ })();
|
|
306
|
-
/******/
|
|
307
|
-
/************************************************************************/
|
|
308
|
-
/******/
|
|
309
|
-
/******/ // startup
|
|
310
|
-
/******/ // Load entry module and return exports
|
|
311
|
-
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
312
|
-
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
313
|
-
/******/
|
|
314
|
-
/******/ return __webpack_exports__;
|
|
315
|
-
/******/ })()
|
|
316
|
-
;
|
|
317
|
-
});
|
|
113
|
+
exports.loadGenericPolygonShape = loadGenericPolygonShape;
|
|
114
|
+
exports.loadPolygonShape = loadPolygonShape;
|
|
115
|
+
exports.loadTriangleShape = loadTriangleShape;
|
|
116
|
+
|
|
117
|
+
}));
|
|
118
|
+
Object.assign(globalThis.window || globalThis, { loadGenericPolygonShape: (globalThis.__tsParticlesInternals.shapes.polygon || {}).loadGenericPolygonShape, loadPolygonShape: (globalThis.__tsParticlesInternals.shapes.polygon || {}).loadPolygonShape, loadTriangleShape: (globalThis.__tsParticlesInternals.shapes.polygon || {}).loadTriangleShape });
|
|
119
|
+
delete (globalThis.window || globalThis).tsparticlesInternalExports;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
!function(
|
|
2
|
-
(`+n+": "+a+")",s.name="ChunkLoadError",s.type=n,s.request=a,o[1](s)}},"chunk-"+e,e)}},r=(e,r)=>{var o,n,[a,s,p]=r,l=0;if(a.some(e=>0!==t[e])){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);p&&p(i)}for(e&&e(r);l<a.length;l++)n=a[l],i.o(t,n)&&t[n]&&t[n][0](),t[n]=0},(o=this.webpackChunk_tsparticles_shape_polygon=this.webpackChunk_tsparticles_shape_polygon||[]).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.addShape(["polygon"],async()=>{let{PolygonDrawer:e}=await i.e(204).then(i.bind(i,204));return new e})})}async function g(e){e.checkVersion("4.0.0-beta.11"),await e.pluginManager.register(e=>{e.pluginManager.addShape(["triangle"],async()=>{let{TriangleDrawer:e}=await i.e(138).then(i.bind(i,138));return new e})})}async function h(e){e.checkVersion("4.0.0-beta.11"),await Promise.all([f(e),g(e)])}return i.r(d),i.d(d,{loadGenericPolygonShape:()=>f,loadPolygonShape:()=>h,loadTriangleShape:()=>g}),d})());
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.shapes.polygon=t.__tsParticlesInternals.shapes.polygon||{}),t.__tsParticlesInternals.engine)}(this,function(t,s){"use strict";const e=new Map;function n(t,n){const{context:a,radius:l}=t,r=function(t){const n=e.get(t);if(n)return n;const a=s.doublePI/t,l=!!(t%s.double),r=(-Math.PI+(l?0:a))*s.half,i=[];for(let s=0;s<t;s++){const t=r+s*a;i[s]={x:Math.cos(t),y:Math.sin(t)}}return e.set(t,i),i}(n.count.numerator/n.count.denominator);a.beginPath();for(let t=0;t<r.length;t++){const s=r[t];if(!s)continue;const e=s.x*l,n=s.y*l;t?a.lineTo(e,n):a.moveTo(e,n)}a.closePath()}class a{draw(t){const{particle:s,radius:e}=t;n(t,this.getSidesData(s,e))}getSidesCount(t){const e=t.shapeData;return Math.round(s.getRangeValue(e?.sides??5))}}class l extends a{getSidesData(t,s){const{sides:e}=t;return{count:{denominator:1,numerator:e},length:2.66*s/(e/3)}}}class r extends a{getSidesCount(){return 3}getSidesData(t,s){return{count:{denominator:1,numerator:3},length:2.66*s/1}}}async function i(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["polygon"],()=>Promise.resolve(new l))})}async function _(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["triangle"],()=>Promise.resolve(new r))})}async function c(t){t.checkVersion("4.0.0-beta.15"),await Promise.all([i(t),_(t)])}const o=globalThis;o.__tsParticlesInternals=o.__tsParticlesInternals??{},o.loadGenericPolygonShape=i,o.loadPolygonShape=c,o.loadTriangleShape=_,t.loadGenericPolygonShape=i,t.loadPolygonShape=c,t.loadTriangleShape=_}),Object.assign(globalThis.window||globalThis,{loadGenericPolygonShape:(globalThis.__tsParticlesInternals.shapes.polygon||{}).loadGenericPolygonShape,loadPolygonShape:(globalThis.__tsParticlesInternals.shapes.polygon||{}).loadPolygonShape,loadTriangleShape:(globalThis.__tsParticlesInternals.shapes.polygon||{}).loadTriangleShape}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Engine } from "@tsparticles/engine/lazy";
|
|
2
|
+
export declare function loadGenericPolygonShape(engine: Engine): Promise<void>;
|
|
3
|
+
export declare function loadTriangleShape(engine: Engine): Promise<void>;
|
|
4
|
+
export declare function loadPolygonShape(engine: Engine): Promise<void>;
|
package/138.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_shape_polygon=this.webpackChunk_tsparticles_shape_polygon||[]).push([[138],{761(e,t,n){n.d(t,{L:()=>r});var a=n(303);let o=new Map;class r{draw(e){let{particle:t,radius:n}=e;!function(e,t){let{context:n,radius:r}=e,s=function(e){let t=o.get(e);if(t)return t;let n=a.doublePI/e,r=(-Math.PI+(e%a.double?0:n))*a.half,s=[];for(let t=0;t<e;t++){let e=r+t*n;s[t]={x:Math.cos(e),y:Math.sin(e)}}return o.set(e,s),s}(t.count.numerator/t.count.denominator);n.beginPath();for(let e=0;e<s.length;e++){let t=s[e];if(!t)continue;let a=t.x*r,o=t.y*r;e?n.lineTo(a,o):n.moveTo(a,o)}n.closePath()}(e,this.getSidesData(t,n))}getSidesCount(e){let t=e.shapeData;return Math.round((0,a.getRangeValue)(t?.sides??5))}}},138(e,t,n){n.d(t,{TriangleDrawer:()=>o});var a=n(761);class o extends a.L{getSidesCount(){return 3}getSidesData(e,t){return{count:{denominator:1,numerator:3},length:2.66*t/1}}}}}]);
|
package/204.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_shape_polygon=this.webpackChunk_tsparticles_shape_polygon||[]).push([[204],{204(t,e,n){n.d(e,{PolygonDrawer:()=>o});var a=n(761);class o extends a.L{getSidesData(t,e){let{sides:n}=t;return{count:{denominator:1,numerator:n},length:2.66*e/(n/3)}}}},761(t,e,n){n.d(e,{L:()=>l});var a=n(303);let o=new Map;class l{draw(t){let{particle:e,radius:n}=t;!function(t,e){let{context:n,radius:l}=t,s=function(t){let e=o.get(t);if(e)return e;let n=a.doublePI/t,l=(-Math.PI+(t%a.double?0:n))*a.half,s=[];for(let e=0;e<t;e++){let t=l+e*n;s[e]={x:Math.cos(t),y:Math.sin(t)}}return o.set(t,s),s}(e.count.numerator/e.count.denominator);n.beginPath();for(let t=0;t<s.length;t++){let e=s[t];if(!e)continue;let a=e.x*l,o=e.y*l;t?n.lineTo(a,o):n.moveTo(a,o)}n.closePath()}(t,this.getSidesData(e,n))}getSidesCount(t){let e=t.shapeData;return Math.round((0,a.getRangeValue)(e?.sides??5))}}}}]);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-beta.11
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_shape_polygon"] = this["webpackChunk_tsparticles_shape_polygon"] || []).push([["dist_browser_PolygonDrawer_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/PolygonDrawer.js"
|
|
21
|
-
/*!***************************************!*\
|
|
22
|
-
!*** ./dist/browser/PolygonDrawer.js ***!
|
|
23
|
-
\***************************************/
|
|
24
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
|
-
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PolygonDrawer: () => (/* binding */ PolygonDrawer)\n/* harmony export */ });\n/* harmony import */ var _PolygonDrawerBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PolygonDrawerBase.js */ \"./dist/browser/PolygonDrawerBase.js\");\n\nconst yFactor = 2.66, sidesFactor = 3;\nclass PolygonDrawer extends _PolygonDrawerBase_js__WEBPACK_IMPORTED_MODULE_0__.PolygonDrawerBase {\n getSidesData(particle, radius) {\n const { sides } = particle;\n return {\n count: {\n denominator: 1,\n numerator: sides\n },\n length: radius * yFactor / (sides / sidesFactor)\n };\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-polygon/./dist/browser/PolygonDrawer.js?\n}");
|
|
27
|
-
|
|
28
|
-
/***/ },
|
|
29
|
-
|
|
30
|
-
/***/ "./dist/browser/PolygonDrawerBase.js"
|
|
31
|
-
/*!*******************************************!*\
|
|
32
|
-
!*** ./dist/browser/PolygonDrawerBase.js ***!
|
|
33
|
-
\*******************************************/
|
|
34
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
|
-
|
|
36
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PolygonDrawerBase: () => (/* binding */ PolygonDrawerBase)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\nconst defaultSides = 5;\nclass PolygonDrawerBase {\n draw(data) {\n const { particle, radius } = data, side = this.getSidesData(particle, radius);\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawPolygon)(data, side);\n }\n getSidesCount(particle) {\n const polygon = particle.shapeData;\n return Math.round((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(polygon?.sides ?? defaultSides));\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-polygon/./dist/browser/PolygonDrawerBase.js?\n}");
|
|
37
|
-
|
|
38
|
-
/***/ },
|
|
39
|
-
|
|
40
|
-
/***/ "./dist/browser/Utils.js"
|
|
41
|
-
/*!*******************************!*\
|
|
42
|
-
!*** ./dist/browser/Utils.js ***!
|
|
43
|
-
\*******************************/
|
|
44
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
45
|
-
|
|
46
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawPolygon: () => (/* binding */ drawPolygon)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst polygonCache = new Map(), noOffset = 0;\nfunction getUnitPolygon(sides) {\n const cached = polygonCache.get(sides);\n if (cached) {\n return cached;\n }\n const step = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.doublePI / sides, isOdd = !!(sides % _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double), baseAngle = (-Math.PI + (isOdd ? noOffset : step)) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half, verts = [];\n for(let i = 0; i < sides; i++){\n const angle = baseAngle + i * step;\n verts[i] = {\n x: Math.cos(angle),\n y: Math.sin(angle)\n };\n }\n polygonCache.set(sides, verts);\n return verts;\n}\nfunction drawPolygon(data, side) {\n const { context, radius } = data, sides = side.count.numerator / side.count.denominator, verts = getUnitPolygon(sides);\n context.beginPath();\n for(let i = 0; i < verts.length; i++){\n const vert = verts[i];\n if (!vert) {\n continue;\n }\n const x = vert.x * radius, y = vert.y * radius;\n if (i) {\n context.lineTo(x, y);\n } else {\n context.moveTo(x, y);\n }\n }\n context.closePath();\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-polygon/./dist/browser/Utils.js?\n}");
|
|
47
|
-
|
|
48
|
-
/***/ }
|
|
49
|
-
|
|
50
|
-
}]);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Author : Matteo Bruni
|
|
3
|
-
* MIT license: https://opensource.org/licenses/MIT
|
|
4
|
-
* Demo / Generator : https://particles.js.org/
|
|
5
|
-
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
|
-
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-beta.11
|
|
8
|
-
*/
|
|
9
|
-
"use strict";
|
|
10
|
-
/*
|
|
11
|
-
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
12
|
-
* This devtool is neither made for production nor for readable output files.
|
|
13
|
-
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
14
|
-
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
15
|
-
* or disable the default devtool with "devtool: false".
|
|
16
|
-
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
17
|
-
*/
|
|
18
|
-
(this["webpackChunk_tsparticles_shape_polygon"] = this["webpackChunk_tsparticles_shape_polygon"] || []).push([["dist_browser_TriangleDrawer_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/PolygonDrawerBase.js"
|
|
21
|
-
/*!*******************************************!*\
|
|
22
|
-
!*** ./dist/browser/PolygonDrawerBase.js ***!
|
|
23
|
-
\*******************************************/
|
|
24
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
|
-
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PolygonDrawerBase: () => (/* binding */ PolygonDrawerBase)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\nconst defaultSides = 5;\nclass PolygonDrawerBase {\n draw(data) {\n const { particle, radius } = data, side = this.getSidesData(particle, radius);\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawPolygon)(data, side);\n }\n getSidesCount(particle) {\n const polygon = particle.shapeData;\n return Math.round((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeValue)(polygon?.sides ?? defaultSides));\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-polygon/./dist/browser/PolygonDrawerBase.js?\n}");
|
|
27
|
-
|
|
28
|
-
/***/ },
|
|
29
|
-
|
|
30
|
-
/***/ "./dist/browser/TriangleDrawer.js"
|
|
31
|
-
/*!****************************************!*\
|
|
32
|
-
!*** ./dist/browser/TriangleDrawer.js ***!
|
|
33
|
-
\****************************************/
|
|
34
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
35
|
-
|
|
36
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TriangleDrawer: () => (/* binding */ TriangleDrawer)\n/* harmony export */ });\n/* harmony import */ var _PolygonDrawerBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PolygonDrawerBase.js */ \"./dist/browser/PolygonDrawerBase.js\");\n\nconst sides = 3, yFactor = 2.66, sidesFactor = 3;\nclass TriangleDrawer extends _PolygonDrawerBase_js__WEBPACK_IMPORTED_MODULE_0__.PolygonDrawerBase {\n getSidesCount() {\n return sides;\n }\n getSidesData(_particle, radius) {\n return {\n count: {\n denominator: 1,\n numerator: sides\n },\n length: radius * yFactor / (sides / sidesFactor)\n };\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-polygon/./dist/browser/TriangleDrawer.js?\n}");
|
|
37
|
-
|
|
38
|
-
/***/ },
|
|
39
|
-
|
|
40
|
-
/***/ "./dist/browser/Utils.js"
|
|
41
|
-
/*!*******************************!*\
|
|
42
|
-
!*** ./dist/browser/Utils.js ***!
|
|
43
|
-
\*******************************/
|
|
44
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
45
|
-
|
|
46
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawPolygon: () => (/* binding */ drawPolygon)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst polygonCache = new Map(), noOffset = 0;\nfunction getUnitPolygon(sides) {\n const cached = polygonCache.get(sides);\n if (cached) {\n return cached;\n }\n const step = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.doublePI / sides, isOdd = !!(sides % _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double), baseAngle = (-Math.PI + (isOdd ? noOffset : step)) * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half, verts = [];\n for(let i = 0; i < sides; i++){\n const angle = baseAngle + i * step;\n verts[i] = {\n x: Math.cos(angle),\n y: Math.sin(angle)\n };\n }\n polygonCache.set(sides, verts);\n return verts;\n}\nfunction drawPolygon(data, side) {\n const { context, radius } = data, sides = side.count.numerator / side.count.denominator, verts = getUnitPolygon(sides);\n context.beginPath();\n for(let i = 0; i < verts.length; i++){\n const vert = verts[i];\n if (!vert) {\n continue;\n }\n const x = vert.x * radius, y = vert.y * radius;\n if (i) {\n context.lineTo(x, y);\n } else {\n context.moveTo(x, y);\n }\n }\n context.closePath();\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-polygon/./dist/browser/Utils.js?\n}");
|
|
47
|
-
|
|
48
|
-
/***/ }
|
|
49
|
-
|
|
50
|
-
}]);
|