@tsparticles/shape-infinity 3.4.0
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/LICENSE +21 -0
- package/README.md +75 -0
- package/browser/InfinityDrawer.js +9 -0
- package/browser/Utils.js +11 -0
- package/browser/index.js +4 -0
- package/browser/package.json +1 -0
- package/cjs/InfinityDrawer.js +13 -0
- package/cjs/Utils.js +15 -0
- package/cjs/index.js +8 -0
- package/cjs/package.json +1 -0
- package/esm/InfinityDrawer.js +9 -0
- package/esm/Utils.js +11 -0
- package/esm/index.js +4 -0
- package/esm/package.json +1 -0
- package/package.json +108 -0
- package/report.html +39 -0
- package/tsparticles.shape.infinity.js +126 -0
- package/tsparticles.shape.infinity.min.js +2 -0
- package/tsparticles.shape.infinity.min.js.LICENSE.txt +1 -0
- package/types/InfinityDrawer.d.ts +5 -0
- package/types/Utils.d.ts +2 -0
- package/types/index.d.ts +2 -0
- package/umd/InfinityDrawer.js +23 -0
- package/umd/Utils.js +25 -0
- package/umd/index.js +18 -0
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
* v3.4.0
|
|
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();
|
|
20
|
+
else if(typeof define === 'function' && define.amd)
|
|
21
|
+
define([], factory);
|
|
22
|
+
else {
|
|
23
|
+
var a = factory();
|
|
24
|
+
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
25
|
+
}
|
|
26
|
+
})(this, () => {
|
|
27
|
+
return /******/ (() => { // webpackBootstrap
|
|
28
|
+
/******/ "use strict";
|
|
29
|
+
/******/ var __webpack_modules__ = ({
|
|
30
|
+
|
|
31
|
+
/***/ "./dist/browser/InfinityDrawer.js":
|
|
32
|
+
/*!****************************************!*\
|
|
33
|
+
!*** ./dist/browser/InfinityDrawer.js ***!
|
|
34
|
+
\****************************************/
|
|
35
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
36
|
+
|
|
37
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ InfinityDrawer: () => (/* binding */ InfinityDrawer)\n/* harmony export */ });\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\nclass InfinityDrawer {\n constructor() {\n this.validTypes = [\"infinity\"];\n }\n draw(data) {\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__.drawInfinity)(data);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/shape-infinity/./dist/browser/InfinityDrawer.js?");
|
|
38
|
+
|
|
39
|
+
/***/ }),
|
|
40
|
+
|
|
41
|
+
/***/ "./dist/browser/Utils.js":
|
|
42
|
+
/*!*******************************!*\
|
|
43
|
+
!*** ./dist/browser/Utils.js ***!
|
|
44
|
+
\*******************************/
|
|
45
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
46
|
+
|
|
47
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawInfinity: () => (/* binding */ drawInfinity)\n/* harmony export */ });\nconst origin = {\n x: 0,\n y: 0\n },\n loopSizeFactor = 0.55;\nfunction drawInfinity(data) {\n const {\n context,\n radius\n } = data,\n loopControl = radius * loopSizeFactor;\n context.moveTo(origin.x, origin.y);\n context.bezierCurveTo(loopControl, -radius, loopControl, radius, origin.x, origin.y);\n context.moveTo(origin.x, origin.y);\n context.bezierCurveTo(-loopControl, -radius, origin.x - loopControl, radius, origin.x, origin.y);\n}\n\n//# sourceURL=webpack://@tsparticles/shape-infinity/./dist/browser/Utils.js?");
|
|
48
|
+
|
|
49
|
+
/***/ }),
|
|
50
|
+
|
|
51
|
+
/***/ "./dist/browser/index.js":
|
|
52
|
+
/*!*******************************!*\
|
|
53
|
+
!*** ./dist/browser/index.js ***!
|
|
54
|
+
\*******************************/
|
|
55
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
56
|
+
|
|
57
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadInfinityShape: () => (/* binding */ loadInfinityShape)\n/* harmony export */ });\n/* harmony import */ var _InfinityDrawer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./InfinityDrawer.js */ \"./dist/browser/InfinityDrawer.js\");\n\nasync function loadInfinityShape(engine, refresh = true) {\n await engine.addShape(new _InfinityDrawer_js__WEBPACK_IMPORTED_MODULE_0__.InfinityDrawer(), refresh);\n}\n\n//# sourceURL=webpack://@tsparticles/shape-infinity/./dist/browser/index.js?");
|
|
58
|
+
|
|
59
|
+
/***/ })
|
|
60
|
+
|
|
61
|
+
/******/ });
|
|
62
|
+
/************************************************************************/
|
|
63
|
+
/******/ // The module cache
|
|
64
|
+
/******/ var __webpack_module_cache__ = {};
|
|
65
|
+
/******/
|
|
66
|
+
/******/ // The require function
|
|
67
|
+
/******/ function __webpack_require__(moduleId) {
|
|
68
|
+
/******/ // Check if module is in cache
|
|
69
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
70
|
+
/******/ if (cachedModule !== undefined) {
|
|
71
|
+
/******/ return cachedModule.exports;
|
|
72
|
+
/******/ }
|
|
73
|
+
/******/ // Create a new module (and put it into the cache)
|
|
74
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
75
|
+
/******/ // no module.id needed
|
|
76
|
+
/******/ // no module.loaded needed
|
|
77
|
+
/******/ exports: {}
|
|
78
|
+
/******/ };
|
|
79
|
+
/******/
|
|
80
|
+
/******/ // Execute the module function
|
|
81
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
82
|
+
/******/
|
|
83
|
+
/******/ // Return the exports of the module
|
|
84
|
+
/******/ return module.exports;
|
|
85
|
+
/******/ }
|
|
86
|
+
/******/
|
|
87
|
+
/************************************************************************/
|
|
88
|
+
/******/ /* webpack/runtime/define property getters */
|
|
89
|
+
/******/ (() => {
|
|
90
|
+
/******/ // define getter functions for harmony exports
|
|
91
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
92
|
+
/******/ for(var key in definition) {
|
|
93
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
94
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
95
|
+
/******/ }
|
|
96
|
+
/******/ }
|
|
97
|
+
/******/ };
|
|
98
|
+
/******/ })();
|
|
99
|
+
/******/
|
|
100
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
101
|
+
/******/ (() => {
|
|
102
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
103
|
+
/******/ })();
|
|
104
|
+
/******/
|
|
105
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
106
|
+
/******/ (() => {
|
|
107
|
+
/******/ // define __esModule on exports
|
|
108
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
109
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
110
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
111
|
+
/******/ }
|
|
112
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
113
|
+
/******/ };
|
|
114
|
+
/******/ })();
|
|
115
|
+
/******/
|
|
116
|
+
/************************************************************************/
|
|
117
|
+
/******/
|
|
118
|
+
/******/ // startup
|
|
119
|
+
/******/ // Load entry module and return exports
|
|
120
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
121
|
+
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
122
|
+
/******/
|
|
123
|
+
/******/ return __webpack_exports__;
|
|
124
|
+
/******/ })()
|
|
125
|
+
;
|
|
126
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see tsparticles.shape.infinity.min.js.LICENSE.txt */
|
|
2
|
+
!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o();else if("function"==typeof define&&define.amd)define([],o);else{var t=o();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(this,(()=>(()=>{var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{loadInfinityShape:()=>i});const t=0,r=0;class n{constructor(){this.validTypes=["infinity"]}draw(e){!function(e){const{context:o,radius:n}=e,i=.55*n;o.moveTo(t,r),o.bezierCurveTo(i,-n,i,n,t,r),o.moveTo(t,r),o.bezierCurveTo(-i,-n,t-i,n,t,r)}(e)}}async function i(e,o=!0){await e.addShape(new n,o)}return o})()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Infinity Shape v3.4.0 by Matteo Bruni */
|
package/types/Utils.d.ts
ADDED
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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", "./Utils.js"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InfinityDrawer = void 0;
|
|
13
|
+
const Utils_js_1 = require("./Utils.js");
|
|
14
|
+
class InfinityDrawer {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.validTypes = ["infinity"];
|
|
17
|
+
}
|
|
18
|
+
draw(data) {
|
|
19
|
+
(0, Utils_js_1.drawInfinity)(data);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.InfinityDrawer = InfinityDrawer;
|
|
23
|
+
});
|
package/umd/Utils.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
exports.drawInfinity = void 0;
|
|
13
|
+
const origin = {
|
|
14
|
+
x: 0,
|
|
15
|
+
y: 0,
|
|
16
|
+
}, loopSizeFactor = 0.55;
|
|
17
|
+
function drawInfinity(data) {
|
|
18
|
+
const { context, radius } = data, loopControl = radius * loopSizeFactor;
|
|
19
|
+
context.moveTo(origin.x, origin.y);
|
|
20
|
+
context.bezierCurveTo(loopControl, -radius, loopControl, radius, origin.x, origin.y);
|
|
21
|
+
context.moveTo(origin.x, origin.y);
|
|
22
|
+
context.bezierCurveTo(-loopControl, -radius, origin.x - loopControl, radius, origin.x, origin.y);
|
|
23
|
+
}
|
|
24
|
+
exports.drawInfinity = drawInfinity;
|
|
25
|
+
});
|
package/umd/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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", "./InfinityDrawer.js"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.loadInfinityShape = void 0;
|
|
13
|
+
const InfinityDrawer_js_1 = require("./InfinityDrawer.js");
|
|
14
|
+
async function loadInfinityShape(engine, refresh = true) {
|
|
15
|
+
await engine.addShape(new InfinityDrawer_js_1.InfinityDrawer(), refresh);
|
|
16
|
+
}
|
|
17
|
+
exports.loadInfinityShape = loadInfinityShape;
|
|
18
|
+
});
|