@tsparticles/shape-emoji 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 +5 -0
- package/browser/index.js +3 -5
- package/browser/index.lazy.js +8 -0
- package/cjs/browser.js +5 -0
- package/cjs/index.js +3 -5
- package/cjs/index.lazy.js +8 -0
- package/esm/browser.js +5 -0
- package/esm/index.js +3 -5
- package/esm/index.lazy.js +8 -0
- package/package.json +10 -3
- package/report.html +4949 -94
- package/tsparticles.shape.emoji.js +115 -331
- package/tsparticles.shape.emoji.min.js +1 -2
- package/types/browser.d.ts +1 -0
- package/types/index.lazy.d.ts +2 -0
- package/20.min.js +0 -1
- package/dist_browser_EmojiDrawer_js.js +0 -30
|
@@ -1,337 +1,121 @@
|
|
|
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"), require("@tsparticles/canvas-utils"));
|
|
20
|
-
else if(typeof define === 'function' && define.amd)
|
|
21
|
-
define(["@tsparticles/engine", "@tsparticles/canvas-utils"], factory);
|
|
22
|
-
else {
|
|
23
|
-
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/canvas-utils")) : factory(root["window"], root["window"]);
|
|
24
|
-
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
25
|
-
}
|
|
26
|
-
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_canvas_utils__) => {
|
|
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'), require('@tsparticles/canvas-utils')) :
|
|
5
|
+
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/canvas-utils'], factory) :
|
|
6
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.shapes = global.__tsParticlesInternals.shapes || {}, global.__tsParticlesInternals.shapes.emoji = global.__tsParticlesInternals.shapes.emoji || {}), global.__tsParticlesInternals.engine, global.__tsParticlesInternals.canvas.utils));
|
|
7
|
+
})(this, (function (exports, engine, canvasUtils) { 'use strict';
|
|
30
8
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(
|
|
9
|
+
const validTypes = ["emoji"];
|
|
10
|
+
function drawEmoji(data, image) {
|
|
11
|
+
const { context, opacity } = data, previousAlpha = context.globalAlpha, diameter = image.width, radius = diameter * engine.half;
|
|
12
|
+
context.globalAlpha = opacity;
|
|
13
|
+
context.drawImage(image, -radius, -radius, diameter, diameter);
|
|
14
|
+
context.globalAlpha = previousAlpha;
|
|
15
|
+
}
|
|
36
16
|
|
|
37
|
-
|
|
17
|
+
const defaultFont = '"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif', noPadding = 0, firstItem = 0;
|
|
18
|
+
class EmojiDrawer {
|
|
19
|
+
_emojiShapeDict = new Map();
|
|
20
|
+
destroy() {
|
|
21
|
+
for (const [key, data] of this._emojiShapeDict) {
|
|
22
|
+
if (data instanceof ImageBitmap) {
|
|
23
|
+
data.close();
|
|
24
|
+
}
|
|
25
|
+
this._emojiShapeDict.delete(key);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
draw(data) {
|
|
29
|
+
const key = data.particle.emojiDataKey;
|
|
30
|
+
if (!key) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const image = this._emojiShapeDict.get(key);
|
|
34
|
+
if (!image) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
drawEmoji(data, image);
|
|
38
|
+
}
|
|
39
|
+
async init(container) {
|
|
40
|
+
const options = container.actualOptions, shapeData = options.particles.shape;
|
|
41
|
+
if (!validTypes.some(t => engine.isInArray(t, shapeData.type))) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const promises = [canvasUtils.loadFont(defaultFont)], shapeOptions = validTypes.map(t => shapeData.options[t])[firstItem];
|
|
45
|
+
engine.executeOnSingleOrMultiple(shapeOptions, shape => {
|
|
46
|
+
if (shape.font) {
|
|
47
|
+
promises.push(canvasUtils.loadFont(shape.font));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
await Promise.all(promises);
|
|
51
|
+
}
|
|
52
|
+
particleDestroy(particle) {
|
|
53
|
+
particle.emojiDataKey = undefined;
|
|
54
|
+
}
|
|
55
|
+
particleInit(container, particle) {
|
|
56
|
+
const shapeData = particle.shapeData;
|
|
57
|
+
if (!shapeData.value) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const emoji = engine.itemFromSingleOrMultiple(shapeData.value, particle.randomIndexData);
|
|
61
|
+
if (!emoji) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const emojiOptions = typeof emoji === "string"
|
|
65
|
+
? {
|
|
66
|
+
font: shapeData.font ?? defaultFont,
|
|
67
|
+
padding: shapeData.padding ?? noPadding,
|
|
68
|
+
value: emoji,
|
|
69
|
+
}
|
|
70
|
+
: {
|
|
71
|
+
font: defaultFont,
|
|
72
|
+
padding: noPadding,
|
|
73
|
+
...shapeData,
|
|
74
|
+
...emoji,
|
|
75
|
+
}, font = emojiOptions.font, value = emojiOptions.value, cacheKey = `${value}_${font}`;
|
|
76
|
+
if (this._emojiShapeDict.has(cacheKey)) {
|
|
77
|
+
particle.emojiDataKey = cacheKey;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const padding = emojiOptions.padding * engine.double, maxSize = engine.getRangeMax(particle.size.value), fullSize = maxSize + padding, canvasSize = fullSize * engine.double;
|
|
81
|
+
let cacheCanvas, context;
|
|
82
|
+
if (typeof OffscreenCanvas === "undefined") {
|
|
83
|
+
const canvas = engine.safeDocument().createElement("canvas");
|
|
84
|
+
canvas.width = canvasSize;
|
|
85
|
+
canvas.height = canvasSize;
|
|
86
|
+
context = canvas.getContext("2d", container.canvas.render.settings);
|
|
87
|
+
cacheCanvas = canvas;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
cacheCanvas = new OffscreenCanvas(canvasSize, canvasSize);
|
|
91
|
+
context = cacheCanvas.getContext("2d", container.canvas.render.settings);
|
|
92
|
+
}
|
|
93
|
+
if (!context) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
context.font = `400 ${(maxSize * engine.double).toString()}px ${font}`;
|
|
97
|
+
context.textBaseline = "middle";
|
|
98
|
+
context.textAlign = "center";
|
|
99
|
+
context.fillText(value, fullSize, fullSize);
|
|
100
|
+
const image = cacheCanvas instanceof HTMLCanvasElement ? cacheCanvas : cacheCanvas.transferToImageBitmap();
|
|
101
|
+
this._emojiShapeDict.set(cacheKey, image);
|
|
102
|
+
particle.emojiDataKey = cacheKey;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
38
105
|
|
|
39
|
-
|
|
106
|
+
async function loadEmojiShape(engine) {
|
|
107
|
+
engine.checkVersion("4.0.0-beta.15");
|
|
108
|
+
await engine.pluginManager.register(e => {
|
|
109
|
+
e.pluginManager.addShape(validTypes, () => Promise.resolve(new EmojiDrawer()));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
40
112
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
\*********************************************************************************************************************************/
|
|
45
|
-
(module) {
|
|
113
|
+
const globalObject = globalThis;
|
|
114
|
+
globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
|
|
115
|
+
globalObject.loadEmojiShape = loadEmojiShape;
|
|
46
116
|
|
|
47
|
-
|
|
117
|
+
exports.loadEmojiShape = loadEmojiShape;
|
|
48
118
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/*!*******************************!*\
|
|
53
|
-
!*** ./dist/browser/Utils.js ***!
|
|
54
|
-
\*******************************/
|
|
55
|
-
(__unused_webpack___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 */ drawEmoji: () => (/* binding */ drawEmoji),\n/* harmony export */ validTypes: () => (/* binding */ validTypes)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nconst validTypes = [\n \"emoji\"\n];\nfunction drawEmoji(data, image) {\n const { context, opacity } = data, previousAlpha = context.globalAlpha, diameter = image.width, radius = diameter * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.half;\n context.globalAlpha = opacity;\n context.drawImage(image, -radius, -radius, diameter, diameter);\n context.globalAlpha = previousAlpha;\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-emoji/./dist/browser/Utils.js?\n}");
|
|
58
|
-
|
|
59
|
-
/***/ },
|
|
60
|
-
|
|
61
|
-
/***/ "./dist/browser/index.js"
|
|
62
|
-
/*!*******************************!*\
|
|
63
|
-
!*** ./dist/browser/index.js ***!
|
|
64
|
-
\*******************************/
|
|
65
|
-
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
66
|
-
|
|
67
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadEmojiShape: () => (/* binding */ loadEmojiShape)\n/* harmony export */ });\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\nasync function loadEmojiShape(engine) {\n engine.checkVersion(\"4.0.0-beta.11\");\n await engine.pluginManager.register((e)=>{\n e.pluginManager.addShape(_Utils_js__WEBPACK_IMPORTED_MODULE_0__.validTypes, async ()=>{\n const { EmojiDrawer } = await __webpack_require__.e(/*! import() */ \"dist_browser_EmojiDrawer_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./EmojiDrawer.js */ \"./dist/browser/EmojiDrawer.js\"));\n return new EmojiDrawer();\n });\n });\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-emoji/./dist/browser/index.js?\n}");
|
|
68
|
-
|
|
69
|
-
/***/ }
|
|
70
|
-
|
|
71
|
-
/******/ });
|
|
72
|
-
/************************************************************************/
|
|
73
|
-
/******/ // The module cache
|
|
74
|
-
/******/ var __webpack_module_cache__ = {};
|
|
75
|
-
/******/
|
|
76
|
-
/******/ // The require function
|
|
77
|
-
/******/ function __webpack_require__(moduleId) {
|
|
78
|
-
/******/ // Check if module is in cache
|
|
79
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
80
|
-
/******/ if (cachedModule !== undefined) {
|
|
81
|
-
/******/ return cachedModule.exports;
|
|
82
|
-
/******/ }
|
|
83
|
-
/******/ // Create a new module (and put it into the cache)
|
|
84
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
85
|
-
/******/ // no module.id needed
|
|
86
|
-
/******/ // no module.loaded needed
|
|
87
|
-
/******/ exports: {}
|
|
88
|
-
/******/ };
|
|
89
|
-
/******/
|
|
90
|
-
/******/ // Execute the module function
|
|
91
|
-
/******/ if (!(moduleId in __webpack_modules__)) {
|
|
92
|
-
/******/ delete __webpack_module_cache__[moduleId];
|
|
93
|
-
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
94
|
-
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
95
|
-
/******/ throw e;
|
|
96
|
-
/******/ }
|
|
97
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
98
|
-
/******/
|
|
99
|
-
/******/ // Return the exports of the module
|
|
100
|
-
/******/ return module.exports;
|
|
101
|
-
/******/ }
|
|
102
|
-
/******/
|
|
103
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
104
|
-
/******/ __webpack_require__.m = __webpack_modules__;
|
|
105
|
-
/******/
|
|
106
|
-
/************************************************************************/
|
|
107
|
-
/******/ /* webpack/runtime/define property getters */
|
|
108
|
-
/******/ (() => {
|
|
109
|
-
/******/ // define getter functions for harmony exports
|
|
110
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
111
|
-
/******/ for(var key in definition) {
|
|
112
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
113
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
114
|
-
/******/ }
|
|
115
|
-
/******/ }
|
|
116
|
-
/******/ };
|
|
117
|
-
/******/ })();
|
|
118
|
-
/******/
|
|
119
|
-
/******/ /* webpack/runtime/ensure chunk */
|
|
120
|
-
/******/ (() => {
|
|
121
|
-
/******/ __webpack_require__.f = {};
|
|
122
|
-
/******/ // This file contains only the entry chunk.
|
|
123
|
-
/******/ // The chunk loading function for additional chunks
|
|
124
|
-
/******/ __webpack_require__.e = (chunkId) => {
|
|
125
|
-
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
126
|
-
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
127
|
-
/******/ return promises;
|
|
128
|
-
/******/ }, []));
|
|
129
|
-
/******/ };
|
|
130
|
-
/******/ })();
|
|
131
|
-
/******/
|
|
132
|
-
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
133
|
-
/******/ (() => {
|
|
134
|
-
/******/ // This function allow to reference async chunks
|
|
135
|
-
/******/ __webpack_require__.u = (chunkId) => {
|
|
136
|
-
/******/ // return url for filenames based on template
|
|
137
|
-
/******/ return "" + chunkId + ".js";
|
|
138
|
-
/******/ };
|
|
139
|
-
/******/ })();
|
|
140
|
-
/******/
|
|
141
|
-
/******/ /* webpack/runtime/global */
|
|
142
|
-
/******/ (() => {
|
|
143
|
-
/******/ __webpack_require__.g = (function() {
|
|
144
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
145
|
-
/******/ try {
|
|
146
|
-
/******/ return this || new Function('return this')();
|
|
147
|
-
/******/ } catch (e) {
|
|
148
|
-
/******/ if (typeof window === 'object') return window;
|
|
149
|
-
/******/ }
|
|
150
|
-
/******/ })();
|
|
151
|
-
/******/ })();
|
|
152
|
-
/******/
|
|
153
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
154
|
-
/******/ (() => {
|
|
155
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
156
|
-
/******/ })();
|
|
157
|
-
/******/
|
|
158
|
-
/******/ /* webpack/runtime/load script */
|
|
159
|
-
/******/ (() => {
|
|
160
|
-
/******/ var inProgress = {};
|
|
161
|
-
/******/ var dataWebpackPrefix = "@tsparticles/shape-emoji:";
|
|
162
|
-
/******/ // loadScript function to load a script via script tag
|
|
163
|
-
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
164
|
-
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
165
|
-
/******/ var script, needAttach;
|
|
166
|
-
/******/ if(key !== undefined) {
|
|
167
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
168
|
-
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
169
|
-
/******/ var s = scripts[i];
|
|
170
|
-
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
171
|
-
/******/ }
|
|
172
|
-
/******/ }
|
|
173
|
-
/******/ if(!script) {
|
|
174
|
-
/******/ needAttach = true;
|
|
175
|
-
/******/ script = document.createElement('script');
|
|
176
|
-
/******/
|
|
177
|
-
/******/ script.charset = 'utf-8';
|
|
178
|
-
/******/ if (__webpack_require__.nc) {
|
|
179
|
-
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
180
|
-
/******/ }
|
|
181
|
-
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
182
|
-
/******/
|
|
183
|
-
/******/ script.src = url;
|
|
184
|
-
/******/ }
|
|
185
|
-
/******/ inProgress[url] = [done];
|
|
186
|
-
/******/ var onScriptComplete = (prev, event) => {
|
|
187
|
-
/******/ // avoid mem leaks in IE.
|
|
188
|
-
/******/ script.onerror = script.onload = null;
|
|
189
|
-
/******/ clearTimeout(timeout);
|
|
190
|
-
/******/ var doneFns = inProgress[url];
|
|
191
|
-
/******/ delete inProgress[url];
|
|
192
|
-
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
193
|
-
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
194
|
-
/******/ if(prev) return prev(event);
|
|
195
|
-
/******/ }
|
|
196
|
-
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
197
|
-
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
198
|
-
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
199
|
-
/******/ needAttach && document.head.appendChild(script);
|
|
200
|
-
/******/ };
|
|
201
|
-
/******/ })();
|
|
202
|
-
/******/
|
|
203
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
204
|
-
/******/ (() => {
|
|
205
|
-
/******/ // define __esModule on exports
|
|
206
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
207
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
208
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
209
|
-
/******/ }
|
|
210
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
211
|
-
/******/ };
|
|
212
|
-
/******/ })();
|
|
213
|
-
/******/
|
|
214
|
-
/******/ /* webpack/runtime/publicPath */
|
|
215
|
-
/******/ (() => {
|
|
216
|
-
/******/ var scriptUrl;
|
|
217
|
-
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
218
|
-
/******/ var document = __webpack_require__.g.document;
|
|
219
|
-
/******/ if (!scriptUrl && document) {
|
|
220
|
-
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
221
|
-
/******/ scriptUrl = document.currentScript.src;
|
|
222
|
-
/******/ if (!scriptUrl) {
|
|
223
|
-
/******/ var scripts = document.getElementsByTagName("script");
|
|
224
|
-
/******/ if(scripts.length) {
|
|
225
|
-
/******/ var i = scripts.length - 1;
|
|
226
|
-
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
|
|
227
|
-
/******/ }
|
|
228
|
-
/******/ }
|
|
229
|
-
/******/ }
|
|
230
|
-
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
231
|
-
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
232
|
-
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
233
|
-
/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
234
|
-
/******/ __webpack_require__.p = scriptUrl;
|
|
235
|
-
/******/ })();
|
|
236
|
-
/******/
|
|
237
|
-
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
238
|
-
/******/ (() => {
|
|
239
|
-
/******/ // no baseURI
|
|
240
|
-
/******/
|
|
241
|
-
/******/ // object to store loaded and loading chunks
|
|
242
|
-
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
243
|
-
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
244
|
-
/******/ var installedChunks = {
|
|
245
|
-
/******/ "tsparticles.shape.emoji": 0
|
|
246
|
-
/******/ };
|
|
247
|
-
/******/
|
|
248
|
-
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
249
|
-
/******/ // JSONP chunk loading for javascript
|
|
250
|
-
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
251
|
-
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
252
|
-
/******/
|
|
253
|
-
/******/ // a Promise means "currently loading".
|
|
254
|
-
/******/ if(installedChunkData) {
|
|
255
|
-
/******/ promises.push(installedChunkData[2]);
|
|
256
|
-
/******/ } else {
|
|
257
|
-
/******/ if(true) { // all chunks have JS
|
|
258
|
-
/******/ // setup Promise in chunk cache
|
|
259
|
-
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
260
|
-
/******/ promises.push(installedChunkData[2] = promise);
|
|
261
|
-
/******/
|
|
262
|
-
/******/ // start chunk loading
|
|
263
|
-
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
264
|
-
/******/ // create error before stack unwound to get useful stacktrace later
|
|
265
|
-
/******/ var error = new Error();
|
|
266
|
-
/******/ var loadingEnded = (event) => {
|
|
267
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
268
|
-
/******/ installedChunkData = installedChunks[chunkId];
|
|
269
|
-
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
270
|
-
/******/ if(installedChunkData) {
|
|
271
|
-
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
272
|
-
/******/ var realSrc = event && event.target && event.target.src;
|
|
273
|
-
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
274
|
-
/******/ error.name = 'ChunkLoadError';
|
|
275
|
-
/******/ error.type = errorType;
|
|
276
|
-
/******/ error.request = realSrc;
|
|
277
|
-
/******/ installedChunkData[1](error);
|
|
278
|
-
/******/ }
|
|
279
|
-
/******/ }
|
|
280
|
-
/******/ };
|
|
281
|
-
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
282
|
-
/******/ }
|
|
283
|
-
/******/ }
|
|
284
|
-
/******/ }
|
|
285
|
-
/******/ };
|
|
286
|
-
/******/
|
|
287
|
-
/******/ // no prefetching
|
|
288
|
-
/******/
|
|
289
|
-
/******/ // no preloaded
|
|
290
|
-
/******/
|
|
291
|
-
/******/ // no HMR
|
|
292
|
-
/******/
|
|
293
|
-
/******/ // no HMR manifest
|
|
294
|
-
/******/
|
|
295
|
-
/******/ // no on chunks loaded
|
|
296
|
-
/******/
|
|
297
|
-
/******/ // install a JSONP callback for chunk loading
|
|
298
|
-
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
299
|
-
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
300
|
-
/******/ // add "moreModules" to the modules object,
|
|
301
|
-
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
302
|
-
/******/ var moduleId, chunkId, i = 0;
|
|
303
|
-
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
304
|
-
/******/ for(moduleId in moreModules) {
|
|
305
|
-
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
306
|
-
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
307
|
-
/******/ }
|
|
308
|
-
/******/ }
|
|
309
|
-
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
310
|
-
/******/ }
|
|
311
|
-
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
312
|
-
/******/ for(;i < chunkIds.length; i++) {
|
|
313
|
-
/******/ chunkId = chunkIds[i];
|
|
314
|
-
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
315
|
-
/******/ installedChunks[chunkId][0]();
|
|
316
|
-
/******/ }
|
|
317
|
-
/******/ installedChunks[chunkId] = 0;
|
|
318
|
-
/******/ }
|
|
319
|
-
/******/
|
|
320
|
-
/******/ }
|
|
321
|
-
/******/
|
|
322
|
-
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_shape_emoji"] = this["webpackChunk_tsparticles_shape_emoji"] || [];
|
|
323
|
-
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
324
|
-
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
325
|
-
/******/ })();
|
|
326
|
-
/******/
|
|
327
|
-
/************************************************************************/
|
|
328
|
-
/******/
|
|
329
|
-
/******/ // startup
|
|
330
|
-
/******/ // Load entry module and return exports
|
|
331
|
-
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
332
|
-
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
333
|
-
/******/
|
|
334
|
-
/******/ return __webpack_exports__;
|
|
335
|
-
/******/ })()
|
|
336
|
-
;
|
|
337
|
-
});
|
|
119
|
+
}));
|
|
120
|
+
Object.assign(globalThis.window || globalThis, { loadEmojiShape: (globalThis.__tsParticlesInternals.shapes.emoji || {}).loadEmojiShape });
|
|
121
|
+
delete (globalThis.window || globalThis).tsparticlesInternalExports;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
!function(
|
|
2
|
-
(`+i+": "+a+")",n.name="ChunkLoadError",n.type=i,n.request=a,o[1](n)}},"chunk-"+e,e)}},o=(e,t)=>{var o,i,[a,n,l]=t,p=0;if(a.some(e=>0!==r[e])){for(o in n)s.o(n,o)&&(s.m[o]=n[o]);l&&l(s)}for(e&&e(t);p<a.length;p++)i=a[p],s.o(r,i)&&r[i]&&r[i][0](),r[i]=0},(i=this.webpackChunk_tsparticles_shape_emoji=this.webpackChunk_tsparticles_shape_emoji||[]).forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var f={};s.r(f),s.d(f,{loadEmojiShape:()=>b});var h=s(206);async function b(e){e.checkVersion("4.0.0-beta.11"),await e.pluginManager.register(e=>{e.pluginManager.addShape(h.u,async()=>{let{EmojiDrawer:e}=await s.e(20).then(s.bind(s,20));return new e})})}return f})());
|
|
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"),require("@tsparticles/canvas-utils")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/canvas-utils"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.shapes.emoji=t.__tsParticlesInternals.shapes.emoji||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.canvas.utils)}(this,function(t,s,e){"use strict";const a=["emoji"];const n='"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif';class l{_emojiShapeDict=new Map;destroy(){for(const[t,s]of this._emojiShapeDict)s instanceof ImageBitmap&&s.close(),this._emojiShapeDict.delete(t)}draw(t){const e=t.particle.emojiDataKey;if(!e)return;const a=this._emojiShapeDict.get(e);a&&function(t,e){const{context:a,opacity:n}=t,l=a.globalAlpha,r=e.width,i=r*s.half;a.globalAlpha=n,a.drawImage(e,-i,-i,r,r),a.globalAlpha=l}(t,a)}async init(t){const l=t.actualOptions.particles.shape;if(!a.some(t=>s.isInArray(t,l.type)))return;const r=[e.loadFont(n)],i=a.map(t=>l.options[t])[0];s.executeOnSingleOrMultiple(i,t=>{t.font&&r.push(e.loadFont(t.font))}),await Promise.all(r)}particleDestroy(t){t.emojiDataKey=void 0}particleInit(t,e){const a=e.shapeData;if(!a.value)return;const l=s.itemFromSingleOrMultiple(a.value,e.randomIndexData);if(!l)return;const r="string"==typeof l?{font:a.font??n,padding:a.padding??0,value:l}:{font:n,padding:0,...a,...l},i=r.font,_=r.value,c=`${_}_${i}`;if(this._emojiShapeDict.has(c))return void(e.emojiDataKey=c);const o=r.padding*s.double,p=s.getRangeMax(e.size.value),I=p+o,P=I*s.double;let u,h;if("undefined"==typeof OffscreenCanvas){const e=s.safeDocument().createElement("canvas");e.width=P,e.height=P,h=e.getContext("2d",t.canvas.render.settings),u=e}else u=new OffscreenCanvas(P,P),h=u.getContext("2d",t.canvas.render.settings);if(!h)return;h.font=`400 ${(p*s.double).toString()}px ${i}`,h.textBaseline="middle",h.textAlign="center",h.fillText(_,I,I);const d=u instanceof HTMLCanvasElement?u:u.transferToImageBitmap();this._emojiShapeDict.set(c,d),e.emojiDataKey=c}}async function r(t){t.checkVersion("4.0.0-beta.15"),await t.pluginManager.register(t=>{t.pluginManager.addShape(a,()=>Promise.resolve(new l))})}const i=globalThis;i.__tsParticlesInternals=i.__tsParticlesInternals??{},i.loadEmojiShape=r,t.loadEmojiShape=r}),Object.assign(globalThis.window||globalThis,{loadEmojiShape:(globalThis.__tsParticlesInternals.shapes.emoji||{}).loadEmojiShape}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index.js";
|
package/20.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(this.webpackChunk_tsparticles_shape_emoji=this.webpackChunk_tsparticles_shape_emoji||[]).push([[20],{20(e,t,a){a.d(t,{EmojiDrawer:()=>l});var i=a(303),n=a(206),o=a(425);let s='"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif';class l{_emojiShapeDict=new Map;destroy(){for(let[e,t]of this._emojiShapeDict)t instanceof ImageBitmap&&t.close(),this._emojiShapeDict.delete(e)}draw(e){let t=e.particle.emojiDataKey;if(!t)return;let a=this._emojiShapeDict.get(t);a&&(0,n.j)(e,a)}async init(e){let t=e.actualOptions.particles.shape;if(!n.u.some(e=>(0,i.isInArray)(e,t.type)))return;let a=[(0,o.loadFont)(s)],l=n.u.map(e=>t.options[e])[0];(0,i.executeOnSingleOrMultiple)(l,e=>{e.font&&a.push((0,o.loadFont)(e.font))}),await Promise.all(a)}particleDestroy(e){e.emojiDataKey=void 0}particleInit(e,t){let a,n,o=t.shapeData;if(!o.value)return;let l=(0,i.itemFromSingleOrMultiple)(o.value,t.randomIndexData);if(!l)return;let r="string"==typeof l?{font:o.font??s,padding:o.padding??0,value:l}:{font:s,padding:0,...o,...l},p=r.font,c=r.value,m=`${c}_${p}`;if(this._emojiShapeDict.has(m)){t.emojiDataKey=m;return}let f=r.padding*i.double,d=(0,i.getRangeMax)(t.size.value),u=d+f,h=u*i.double;if("u"<typeof OffscreenCanvas){let t=(0,i.safeDocument)().createElement("canvas");t.width=h,t.height=h,n=t.getContext("2d",e.canvas.render.settings),a=t}else n=(a=new OffscreenCanvas(h,h)).getContext("2d",e.canvas.render.settings);if(!n)return;n.font=`400 ${(d*i.double).toString()}px ${p}`,n.textBaseline="middle",n.textAlign="center",n.fillText(c,u,u);let g=a instanceof HTMLCanvasElement?a:a.transferToImageBitmap();this._emojiShapeDict.set(m,g),t.emojiDataKey=m}}}}]);
|
|
@@ -1,30 +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_emoji"] = this["webpackChunk_tsparticles_shape_emoji"] || []).push([["dist_browser_EmojiDrawer_js"],{
|
|
19
|
-
|
|
20
|
-
/***/ "./dist/browser/EmojiDrawer.js"
|
|
21
|
-
/*!*************************************!*\
|
|
22
|
-
!*** ./dist/browser/EmojiDrawer.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 */ EmojiDrawer: () => (/* binding */ EmojiDrawer)\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/* harmony import */ var _tsparticles_canvas_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tsparticles/canvas-utils */ \"@tsparticles/canvas-utils\");\n\n\n\nconst defaultFont = '\"Apple Color Emoji\", \"Segoe UI Emoji\", \"Noto Color Emoji\", sans-serif', noPadding = 0, firstItem = 0;\nclass EmojiDrawer {\n _emojiShapeDict = new Map();\n destroy() {\n for (const [key, data] of this._emojiShapeDict){\n if (data instanceof ImageBitmap) {\n data.close();\n }\n this._emojiShapeDict.delete(key);\n }\n }\n draw(data) {\n const key = data.particle.emojiDataKey;\n if (!key) {\n return;\n }\n const image = this._emojiShapeDict.get(key);\n if (!image) {\n return;\n }\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.drawEmoji)(data, image);\n }\n async init(container) {\n const options = container.actualOptions, shapeData = options.particles.shape;\n if (!_Utils_js__WEBPACK_IMPORTED_MODULE_1__.validTypes.some((t)=>(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(t, shapeData.type))) {\n return;\n }\n const promises = [\n (0,_tsparticles_canvas_utils__WEBPACK_IMPORTED_MODULE_2__.loadFont)(defaultFont)\n ], shapeOptions = _Utils_js__WEBPACK_IMPORTED_MODULE_1__.validTypes.map((t)=>shapeData.options[t])[firstItem];\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(shapeOptions, (shape)=>{\n if (shape.font) {\n promises.push((0,_tsparticles_canvas_utils__WEBPACK_IMPORTED_MODULE_2__.loadFont)(shape.font));\n }\n });\n await Promise.all(promises);\n }\n particleDestroy(particle) {\n particle.emojiDataKey = undefined;\n }\n particleInit(container, particle) {\n const shapeData = particle.shapeData;\n if (!shapeData.value) {\n return;\n }\n const emoji = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(shapeData.value, particle.randomIndexData);\n if (!emoji) {\n return;\n }\n const emojiOptions = typeof emoji === \"string\" ? {\n font: shapeData.font ?? defaultFont,\n padding: shapeData.padding ?? noPadding,\n value: emoji\n } : {\n font: defaultFont,\n padding: noPadding,\n ...shapeData,\n ...emoji\n }, font = emojiOptions.font, value = emojiOptions.value, cacheKey = `${value}_${font}`;\n if (this._emojiShapeDict.has(cacheKey)) {\n particle.emojiDataKey = cacheKey;\n return;\n }\n const padding = emojiOptions.padding * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double, maxSize = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particle.size.value), fullSize = maxSize + padding, canvasSize = fullSize * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double;\n let cacheCanvas, context;\n if (typeof OffscreenCanvas === \"undefined\") {\n const canvas = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.safeDocument)().createElement(\"canvas\");\n canvas.width = canvasSize;\n canvas.height = canvasSize;\n context = canvas.getContext(\"2d\", container.canvas.render.settings);\n cacheCanvas = canvas;\n } else {\n cacheCanvas = new OffscreenCanvas(canvasSize, canvasSize);\n context = cacheCanvas.getContext(\"2d\", container.canvas.render.settings);\n }\n if (!context) {\n return;\n }\n context.font = `400 ${(maxSize * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.double).toString()}px ${font}`;\n context.textBaseline = \"middle\";\n context.textAlign = \"center\";\n context.fillText(value, fullSize, fullSize);\n const image = cacheCanvas instanceof HTMLCanvasElement ? cacheCanvas : cacheCanvas.transferToImageBitmap();\n this._emojiShapeDict.set(cacheKey, image);\n particle.emojiDataKey = cacheKey;\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/shape-emoji/./dist/browser/EmojiDrawer.js?\n}");
|
|
27
|
-
|
|
28
|
-
/***/ }
|
|
29
|
-
|
|
30
|
-
}]);
|