@tsparticles/interaction-external-bubble 3.1.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/582.min.js +2 -0
- package/582.min.js.LICENSE.txt +1 -0
- package/browser/index.js +4 -2
- package/cjs/index.js +16 -2
- package/dist_browser_Bubbler_js.js +40 -0
- package/esm/index.js +4 -2
- package/package.json +2 -2
- package/report.html +3 -3
- package/tsparticles.interaction.external.bubble.js +271 -439
- package/tsparticles.interaction.external.bubble.min.js +1 -1
- package/tsparticles.interaction.external.bubble.min.js.LICENSE.txt +1 -1
- package/umd/index.js +18 -3
package/582.min.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 582.min.js.LICENSE.txt */
|
|
2
|
+
(this.webpackChunk_tsparticles_interaction_external_bubble=this.webpackChunk_tsparticles_interaction_external_bubble||[]).push([[582],{582:(e,i,t)=>{t.d(i,{Bubbler:()=>a});var o=t(533),b=t(585);function l(e,i,t,b){if(i>=t){const l=e+(i-t)*b;return(0,o.clamp)(l,e,i)}if(i<t){const l=e-(t-i)*b;return(0,o.clamp)(l,i,e)}}const n="bubble";class a extends o.ExternalInteractorBase{constructor(e){super(e),this._clickBubble=()=>{const e=this.container,i=e.actualOptions,t=e.interactivity.mouse.clickPosition,b=i.interactivity.modes.bubble;if(!b||!t)return;e.bubble||(e.bubble={});const l=e.retina.bubbleModeDistance;if(!l||l<0)return;const n=e.particles.quadTree.queryCircle(t,l,(e=>this.isEnabled(e))),{bubble:a}=e;for(const i of n){if(!a.clicking)continue;i.bubble.inRange=!a.durationEnd;const n=i.getPosition(),s=(0,o.getDistance)(n,t),r=((new Date).getTime()-(e.interactivity.mouse.clickTime??0))/o.millisecondsToSeconds;r>b.duration&&(a.durationEnd=!0),r>2*b.duration&&(a.clicking=!1,a.durationEnd=!1);const c={bubbleObj:{optValue:e.retina.bubbleModeSize,value:i.bubble.radius},particlesObj:{optValue:(0,o.getRangeMax)(i.options.size.value)*e.retina.pixelRatio,value:i.size.value},type:"size"};this._process(i,s,r,c);const u={bubbleObj:{optValue:b.opacity,value:i.bubble.opacity},particlesObj:{optValue:(0,o.getRangeMax)(i.options.opacity.value),value:i.opacity?.value??1},type:"opacity"};this._process(i,s,r,u),!a.durationEnd&&s<=l?this._hoverBubbleColor(i,s):delete i.bubble.color}},this._hoverBubble=()=>{const e=this.container,i=e.interactivity.mouse.position,t=e.retina.bubbleModeDistance;if(!t||t<0||!i)return;const b=e.particles.quadTree.queryCircle(i,t,(e=>this.isEnabled(e)));for(const l of b){l.bubble.inRange=!0;const b=l.getPosition(),n=(0,o.getDistance)(b,i),a=1-n/t;n<=t?a>=0&&e.interactivity.status===o.mouseMoveEvent&&(this._hoverBubbleSize(l,a),this._hoverBubbleOpacity(l,a),this._hoverBubbleColor(l,a)):this.reset(l),e.interactivity.status===o.mouseLeaveEvent&&this.reset(l)}},this._hoverBubbleColor=(e,i,t)=>{const b=this.container.actualOptions,l=t??b.interactivity.modes.bubble;if(l){if(!e.bubble.finalColor){const i=l.color;if(!i)return;const t=(0,o.itemFromSingleOrMultiple)(i);e.bubble.finalColor=(0,o.rangeColorToHsl)(t)}if(e.bubble.finalColor)if(l.mix){e.bubble.color=void 0;const t=e.getFillColor();e.bubble.color=t?(0,o.rgbToHsl)((0,o.colorMix)(t,e.bubble.finalColor,1-i,i)):e.bubble.finalColor}else e.bubble.color=e.bubble.finalColor}},this._hoverBubbleOpacity=(e,i,t)=>{const b=this.container.actualOptions,n=t?.opacity??b.interactivity.modes.bubble?.opacity;if(!n)return;const a=e.options.opacity.value,s=l(e.opacity?.value??1,n,(0,o.getRangeMax)(a),i);void 0!==s&&(e.bubble.opacity=s)},this._hoverBubbleSize=(e,i,t)=>{const b=this.container,n=t?.size?t.size*b.retina.pixelRatio:b.retina.bubbleModeSize;if(void 0===n)return;const a=(0,o.getRangeMax)(e.options.size.value)*b.retina.pixelRatio,s=l(e.size.value,n,a,i);void 0!==s&&(e.bubble.radius=s)},this._process=(e,i,t,o)=>{const b=this.container,l=o.bubbleObj.optValue,n=b.actualOptions.interactivity.modes.bubble;if(!n||void 0===l)return;const a=n.duration,s=b.retina.bubbleModeDistance,r=o.particlesObj.optValue,c=o.bubbleObj.value,u=o.particlesObj.value??0,d=o.type;if(s&&!(s<0)&&l!==r)if(b.bubble||(b.bubble={}),b.bubble.durationEnd)c&&("size"===d&&delete e.bubble.radius,"opacity"===d&&delete e.bubble.opacity);else if(i<=s){if((c??u)!==l){const i=u-t*(u-l)/a;"size"===d&&(e.bubble.radius=i),"opacity"===d&&(e.bubble.opacity=i)}}else"size"===d&&delete e.bubble.radius,"opacity"===d&&delete e.bubble.opacity},this._singleSelectorHover=(e,i,t)=>{const b=this.container,l=document.querySelectorAll(i),n=b.actualOptions.interactivity.modes.bubble;n&&l.length&&l.forEach((i=>{const l=i,a=b.retina.pixelRatio,s={x:(l.offsetLeft+.5*l.offsetWidth)*a,y:(l.offsetTop+.5*l.offsetHeight)*a},r=.5*l.offsetWidth*a,c="circle"===t.type?new o.Circle(s.x,s.y,r):new o.Rectangle(l.offsetLeft*a,l.offsetTop*a,l.offsetWidth*a,l.offsetHeight*a),u=b.particles.quadTree.query(c,(e=>this.isEnabled(e)));for(const i of u){if(!c.contains(i.getPosition()))continue;i.bubble.inRange=!0;const t=n.divs,b=(0,o.divMode)(t,l);i.bubble.div&&i.bubble.div===l||(this.clear(i,e,!0),i.bubble.div=l),this._hoverBubbleSize(i,1,b),this._hoverBubbleOpacity(i,1,b),this._hoverBubbleColor(i,1,b)}}))},e.bubble||(e.bubble={}),this.handleClickMode=i=>{i===n&&(e.bubble||(e.bubble={}),e.bubble.clicking=!0)}}clear(e,i,t){e.bubble.inRange&&!t||(delete e.bubble.div,delete e.bubble.opacity,delete e.bubble.radius,delete e.bubble.color)}init(){const e=this.container,i=e.actualOptions.interactivity.modes.bubble;i&&(e.retina.bubbleModeDistance=i.distance*e.retina.pixelRatio,void 0!==i.size&&(e.retina.bubbleModeSize=i.size*e.retina.pixelRatio))}async interact(e){const i=this.container.actualOptions.interactivity.events,t=i.onHover,b=i.onClick,l=t.enable,a=t.mode,s=b.enable,r=b.mode,c=i.onDiv;l&&(0,o.isInArray)(n,a)?this._hoverBubble():s&&(0,o.isInArray)(n,r)?this._clickBubble():(0,o.divModeExecute)(n,c,((i,t)=>this._singleSelectorHover(e,i,t))),await Promise.resolve()}isEnabled(e){const i=this.container,t=i.actualOptions,b=i.interactivity.mouse,l=(e?.interactivity??t.interactivity).events,{onClick:a,onDiv:s,onHover:r}=l,c=(0,o.isDivModeEnabled)(n,s);return!!(c||r.enable&&b.position||a.enable&&b.clickPosition)&&((0,o.isInArray)(n,r.mode)||(0,o.isInArray)(n,a.mode)||c)}loadModeOptions(e,...i){e.bubble||(e.bubble=new b.x);for(const t of i)e.bubble.load(t?.bubble)}reset(e){e.bubble.inRange=!1}}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tsParticles Bubble External Interaction v3.2.1 by Matteo Bruni */
|
package/browser/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Bubbler } from "./Bubbler.js";
|
|
2
1
|
export async function loadExternalBubbleInteraction(engine, refresh = true) {
|
|
3
|
-
await engine.addInteractor("externalBubble", (container) =>
|
|
2
|
+
await engine.addInteractor("externalBubble", async (container) => {
|
|
3
|
+
const { Bubbler } = await import("./Bubbler.js");
|
|
4
|
+
return new Bubbler(container);
|
|
5
|
+
}, refresh);
|
|
4
6
|
}
|
|
5
7
|
export * from "./Options/Classes/BubbleBase.js";
|
|
6
8
|
export * from "./Options/Classes/BubbleDiv.js";
|
package/cjs/index.js
CHANGED
|
@@ -10,14 +10,28 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
13
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
27
|
};
|
|
16
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
29
|
exports.loadExternalBubbleInteraction = void 0;
|
|
18
|
-
const Bubbler_js_1 = require("./Bubbler.js");
|
|
19
30
|
async function loadExternalBubbleInteraction(engine, refresh = true) {
|
|
20
|
-
await engine.addInteractor("externalBubble", (container) =>
|
|
31
|
+
await engine.addInteractor("externalBubble", async (container) => {
|
|
32
|
+
const { Bubbler } = await Promise.resolve().then(() => __importStar(require("./Bubbler.js")));
|
|
33
|
+
return new Bubbler(container);
|
|
34
|
+
}, refresh);
|
|
21
35
|
}
|
|
22
36
|
exports.loadExternalBubbleInteraction = loadExternalBubbleInteraction;
|
|
23
37
|
__exportStar(require("./Options/Classes/BubbleBase.js"), exports);
|
|
@@ -0,0 +1,40 @@
|
|
|
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.2.1
|
|
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_interaction_external_bubble"] = this["webpackChunk_tsparticles_interaction_external_bubble"] || []).push([["dist_browser_Bubbler_js"],{
|
|
19
|
+
|
|
20
|
+
/***/ "./dist/browser/Bubbler.js":
|
|
21
|
+
/*!*********************************!*\
|
|
22
|
+
!*** ./dist/browser/Bubbler.js ***!
|
|
23
|
+
\*********************************/
|
|
24
|
+
/***/ ((__unused_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 */ Bubbler: () => (/* binding */ Bubbler)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Bubble.js */ \"./dist/browser/Options/Classes/Bubble.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\nconst bubbleMode = \"bubble\",\n minDistance = 0,\n defaultClickTime = 0,\n double = 2,\n defaultOpacity = 1,\n ratioOffset = 1,\n defaultBubbleValue = 0,\n minRatio = 0,\n half = 0.5,\n defaultRatio = 1;\nclass Bubbler extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n constructor(container) {\n super(container);\n this._clickBubble = () => {\n const container = this.container,\n options = container.actualOptions,\n mouseClickPos = container.interactivity.mouse.clickPosition,\n bubbleOptions = options.interactivity.modes.bubble;\n if (!bubbleOptions || !mouseClickPos) {\n return;\n }\n if (!container.bubble) {\n container.bubble = {};\n }\n const distance = container.retina.bubbleModeDistance;\n if (!distance || distance < minDistance) {\n return;\n }\n const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, p => this.isEnabled(p)),\n {\n bubble\n } = container;\n for (const particle of query) {\n if (!bubble.clicking) {\n continue;\n }\n particle.bubble.inRange = !bubble.durationEnd;\n const pos = particle.getPosition(),\n distMouse = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos, mouseClickPos),\n timeSpent = (new Date().getTime() - (container.interactivity.mouse.clickTime ?? defaultClickTime)) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n if (timeSpent > bubbleOptions.duration) {\n bubble.durationEnd = true;\n }\n if (timeSpent > bubbleOptions.duration * double) {\n bubble.clicking = false;\n bubble.durationEnd = false;\n }\n const sizeData = {\n bubbleObj: {\n optValue: container.retina.bubbleModeSize,\n value: particle.bubble.radius\n },\n particlesObj: {\n optValue: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particle.options.size.value) * container.retina.pixelRatio,\n value: particle.size.value\n },\n type: \"size\"\n };\n this._process(particle, distMouse, timeSpent, sizeData);\n const opacityData = {\n bubbleObj: {\n optValue: bubbleOptions.opacity,\n value: particle.bubble.opacity\n },\n particlesObj: {\n optValue: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particle.options.opacity.value),\n value: particle.opacity?.value ?? defaultOpacity\n },\n type: \"opacity\"\n };\n this._process(particle, distMouse, timeSpent, opacityData);\n if (!bubble.durationEnd && distMouse <= distance) {\n this._hoverBubbleColor(particle, distMouse);\n } else {\n delete particle.bubble.color;\n }\n }\n };\n this._hoverBubble = () => {\n const container = this.container,\n mousePos = container.interactivity.mouse.position,\n distance = container.retina.bubbleModeDistance;\n if (!distance || distance < minDistance || !mousePos) {\n return;\n }\n const query = container.particles.quadTree.queryCircle(mousePos, distance, p => this.isEnabled(p));\n for (const particle of query) {\n particle.bubble.inRange = true;\n const pos = particle.getPosition(),\n pointDistance = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos, mousePos),\n ratio = ratioOffset - pointDistance / distance;\n if (pointDistance <= distance) {\n if (ratio >= minRatio && container.interactivity.status === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.mouseMoveEvent) {\n this._hoverBubbleSize(particle, ratio);\n this._hoverBubbleOpacity(particle, ratio);\n this._hoverBubbleColor(particle, ratio);\n }\n } else {\n this.reset(particle);\n }\n if (container.interactivity.status === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.mouseLeaveEvent) {\n this.reset(particle);\n }\n }\n };\n this._hoverBubbleColor = (particle, ratio, divBubble) => {\n const options = this.container.actualOptions,\n bubbleOptions = divBubble ?? options.interactivity.modes.bubble;\n if (!bubbleOptions) {\n return;\n }\n if (!particle.bubble.finalColor) {\n const modeColor = bubbleOptions.color;\n if (!modeColor) {\n return;\n }\n const bubbleColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(modeColor);\n particle.bubble.finalColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(bubbleColor);\n }\n if (!particle.bubble.finalColor) {\n return;\n }\n if (bubbleOptions.mix) {\n particle.bubble.color = undefined;\n const pColor = particle.getFillColor();\n particle.bubble.color = pColor ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rgbToHsl)((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.colorMix)(pColor, particle.bubble.finalColor, ratioOffset - ratio, ratio)) : particle.bubble.finalColor;\n } else {\n particle.bubble.color = particle.bubble.finalColor;\n }\n };\n this._hoverBubbleOpacity = (particle, ratio, divBubble) => {\n const container = this.container,\n options = container.actualOptions,\n modeOpacity = divBubble?.opacity ?? options.interactivity.modes.bubble?.opacity;\n if (!modeOpacity) {\n return;\n }\n const optOpacity = particle.options.opacity.value,\n pOpacity = particle.opacity?.value ?? defaultOpacity,\n opacity = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.calculateBubbleValue)(pOpacity, modeOpacity, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(optOpacity), ratio);\n if (opacity !== undefined) {\n particle.bubble.opacity = opacity;\n }\n };\n this._hoverBubbleSize = (particle, ratio, divBubble) => {\n const container = this.container,\n modeSize = divBubble?.size ? divBubble.size * container.retina.pixelRatio : container.retina.bubbleModeSize;\n if (modeSize === undefined) {\n return;\n }\n const optSize = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particle.options.size.value) * container.retina.pixelRatio,\n pSize = particle.size.value,\n size = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_1__.calculateBubbleValue)(pSize, modeSize, optSize, ratio);\n if (size !== undefined) {\n particle.bubble.radius = size;\n }\n };\n this._process = (particle, distMouse, timeSpent, data) => {\n const container = this.container,\n bubbleParam = data.bubbleObj.optValue,\n options = container.actualOptions,\n bubbleOptions = options.interactivity.modes.bubble;\n if (!bubbleOptions || bubbleParam === undefined) {\n return;\n }\n const bubbleDuration = bubbleOptions.duration,\n bubbleDistance = container.retina.bubbleModeDistance,\n particlesParam = data.particlesObj.optValue,\n pObjBubble = data.bubbleObj.value,\n pObj = data.particlesObj.value ?? defaultBubbleValue,\n type = data.type;\n if (!bubbleDistance || bubbleDistance < minDistance || bubbleParam === particlesParam) {\n return;\n }\n if (!container.bubble) {\n container.bubble = {};\n }\n if (container.bubble.durationEnd) {\n if (pObjBubble) {\n if (type === \"size\") {\n delete particle.bubble.radius;\n }\n if (type === \"opacity\") {\n delete particle.bubble.opacity;\n }\n }\n } else {\n if (distMouse <= bubbleDistance) {\n const obj = pObjBubble ?? pObj;\n if (obj !== bubbleParam) {\n const value = pObj - timeSpent * (pObj - bubbleParam) / bubbleDuration;\n if (type === \"size\") {\n particle.bubble.radius = value;\n }\n if (type === \"opacity\") {\n particle.bubble.opacity = value;\n }\n }\n } else {\n if (type === \"size\") {\n delete particle.bubble.radius;\n }\n if (type === \"opacity\") {\n delete particle.bubble.opacity;\n }\n }\n }\n };\n this._singleSelectorHover = (delta, selector, div) => {\n const container = this.container,\n selectors = document.querySelectorAll(selector),\n bubble = container.actualOptions.interactivity.modes.bubble;\n if (!bubble || !selectors.length) {\n return;\n }\n selectors.forEach(item => {\n const elem = item,\n pxRatio = container.retina.pixelRatio,\n pos = {\n x: (elem.offsetLeft + elem.offsetWidth * half) * pxRatio,\n y: (elem.offsetTop + elem.offsetHeight * half) * pxRatio\n },\n repulseRadius = elem.offsetWidth * half * pxRatio,\n area = div.type === \"circle\" ? new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Circle(pos.x, pos.y, repulseRadius) : new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio),\n query = container.particles.quadTree.query(area, p => this.isEnabled(p));\n for (const particle of query) {\n if (!area.contains(particle.getPosition())) {\n continue;\n }\n particle.bubble.inRange = true;\n const divs = bubble.divs,\n divBubble = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.divMode)(divs, elem);\n if (!particle.bubble.div || particle.bubble.div !== elem) {\n this.clear(particle, delta, true);\n particle.bubble.div = elem;\n }\n this._hoverBubbleSize(particle, defaultRatio, divBubble);\n this._hoverBubbleOpacity(particle, defaultRatio, divBubble);\n this._hoverBubbleColor(particle, defaultRatio, divBubble);\n }\n });\n };\n if (!container.bubble) {\n container.bubble = {};\n }\n this.handleClickMode = mode => {\n if (mode !== bubbleMode) {\n return;\n }\n if (!container.bubble) {\n container.bubble = {};\n }\n container.bubble.clicking = true;\n };\n }\n clear(particle, delta, force) {\n if (particle.bubble.inRange && !force) {\n return;\n }\n delete particle.bubble.div;\n delete particle.bubble.opacity;\n delete particle.bubble.radius;\n delete particle.bubble.color;\n }\n init() {\n const container = this.container,\n bubble = container.actualOptions.interactivity.modes.bubble;\n if (!bubble) {\n return;\n }\n container.retina.bubbleModeDistance = bubble.distance * container.retina.pixelRatio;\n if (bubble.size !== undefined) {\n container.retina.bubbleModeSize = bubble.size * container.retina.pixelRatio;\n }\n }\n async interact(delta) {\n const options = this.container.actualOptions,\n events = options.interactivity.events,\n onHover = events.onHover,\n onClick = events.onClick,\n hoverEnabled = onHover.enable,\n hoverMode = onHover.mode,\n clickEnabled = onClick.enable,\n clickMode = onClick.mode,\n divs = events.onDiv;\n if (hoverEnabled && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(bubbleMode, hoverMode)) {\n this._hoverBubble();\n } else if (clickEnabled && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(bubbleMode, clickMode)) {\n this._clickBubble();\n } else {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.divModeExecute)(bubbleMode, divs, (selector, div) => this._singleSelectorHover(delta, selector, div));\n }\n await Promise.resolve();\n }\n isEnabled(particle) {\n const container = this.container,\n options = container.actualOptions,\n mouse = container.interactivity.mouse,\n events = (particle?.interactivity ?? options.interactivity).events,\n {\n onClick,\n onDiv,\n onHover\n } = events,\n divBubble = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isDivModeEnabled)(bubbleMode, onDiv);\n if (!(divBubble || onHover.enable && !!mouse.position || onClick.enable && mouse.clickPosition)) {\n return false;\n }\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(bubbleMode, onHover.mode) || (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(bubbleMode, onClick.mode) || divBubble;\n }\n loadModeOptions(options, ...sources) {\n if (!options.bubble) {\n options.bubble = new _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_2__.Bubble();\n }\n for (const source of sources) {\n options.bubble.load(source?.bubble);\n }\n }\n reset(particle) {\n particle.bubble.inRange = false;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Bubbler.js?");
|
|
27
|
+
|
|
28
|
+
/***/ }),
|
|
29
|
+
|
|
30
|
+
/***/ "./dist/browser/Utils.js":
|
|
31
|
+
/*!*******************************!*\
|
|
32
|
+
!*** ./dist/browser/Utils.js ***!
|
|
33
|
+
\*******************************/
|
|
34
|
+
/***/ ((__unused_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 */ calculateBubbleValue: () => (/* binding */ calculateBubbleValue)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction calculateBubbleValue(particleValue, modeValue, optionsValue, ratio) {\n if (modeValue >= optionsValue) {\n const value = particleValue + (modeValue - optionsValue) * ratio;\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.clamp)(value, particleValue, modeValue);\n } else if (modeValue < optionsValue) {\n const value = particleValue - (optionsValue - modeValue) * ratio;\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.clamp)(value, modeValue, particleValue);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Utils.js?");
|
|
37
|
+
|
|
38
|
+
/***/ })
|
|
39
|
+
|
|
40
|
+
}]);
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Bubbler } from "./Bubbler.js";
|
|
2
1
|
export async function loadExternalBubbleInteraction(engine, refresh = true) {
|
|
3
|
-
await engine.addInteractor("externalBubble", (container) =>
|
|
2
|
+
await engine.addInteractor("externalBubble", async (container) => {
|
|
3
|
+
const { Bubbler } = await import("./Bubbler.js");
|
|
4
|
+
return new Bubbler(container);
|
|
5
|
+
}, refresh);
|
|
4
6
|
}
|
|
5
7
|
export * from "./Options/Classes/BubbleBase.js";
|
|
6
8
|
export * from "./Options/Classes/BubbleDiv.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-bubble",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "tsParticles bubble external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"./package.json": "./package.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tsparticles/engine": "^3.1
|
|
90
|
+
"@tsparticles/engine": "^3.2.1"
|
|
91
91
|
},
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/interaction-external-bubble [
|
|
6
|
+
<title>@tsparticles/interaction-external-bubble [31 Jan 2024 at 09:48]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8sNtTmdDx9/zX6PSjyeaCtd1YnNGX2PuQveCGt95Nls42h8dLlM3F4vBtAAAAM3RSTlMAAyOx0/sKBvik8opWGBMOAe3l1snDm2E9LSb06eHcu5JpHbarfHZCN9CBb08zzkdNS0kYaptYAAAFV0lEQVRYw92X51/aYBDHHS2O2qqttVbrqNq9m+TJIAYIShBkWwqIiCgoWvfeq7Z2/s29hyQNyUcR7LveGwVyXy6XH8/9rqxglLfUPLxVduUor3h0rfp2TYvpivk37929TkG037hffoX0+peVtZQc1589rigVUdXS/ABSAyEmGIO/1XfvldSK8vs3OqB6u3m0nxmIrvgB0dj7rr7Y9IbuF68hnfFaiHA/sxqm0wciIG43P60qKv9WXWc1RXGh/mFESFABTSBi0sNAKzqet17eCtOb3kZIDwxEEU0oAIJGYxNBDhBND29e0rtXXbcpuPmED9IhEAAQ/AXEaF8EPmnrrKsv0LvWR3fg5sWDNAFZOgAgaKvZDogHNU9MFwnnYROkc56RD5CjAbQX9Ow4g7upCsvYu55aSI/Nj0H1akgKQEUM94dwK65hYRmFU9MIcH/fqJYOZYcnuJSU/waKDgTOEVaVKhwrTRP5XzgSpAITYzom7UvkhFX5VutmxeNnWDjjswTKTyfgluNDGbUpWissXhF3s7mlSml+czWkg3D0l1nNjGNjz3myOQOa1KM/jOS6ebdbAVTCi4gljHSFrviza7tOgRWcS0MOUX9zdNgag5w7rRqA44Lzw0hr1WqES36dFliSJFlh2rXIae3FFcDDgKdxrUIDePr8jGcSClV1u7A9xeN0ModY/pHMxmR1EzRh8TJiwqsHmKW0l4FCEZI+jHio+JdPPE9qwQtTRxku2D8sIeRL2LnxWSllANCQGOIiqVHAz2ye2JR0DcH+HoxDkaADLjgxjKQ+AwCX/g0+DNgdG0ukYCONAe+dbc2IAc6fwt1ARoDSezNHxV2Cmzwv3O6lDMV55edBGwGK9n1+x2F8EDfAGCxug8MhpsMEcTEAWf3rx2vZhe/LAmtIn/6apE6PN0ULKgywD9mmdxbmFl3OvD5AS5fW5zLbv/YHmcsBTjf/afDz3MaZTVCfAP9z6/Bw6ycv8EUBWJIn9zYcoAWWlW9+OzO3vkTy8H+RANLmdrpOuYWdZYEXpo+TlCJrW5EARb7fF+bWdqf3hhyZI1nWJQHgznErZhbjoEsWqi8dQNoE294aldzFurwSABL2XXMf9+H1VQGke9exw5P/AnA5Pv5ngMul7LOvO922iwACu8WkCwLCafvM4CeWPxfA8lNHcWZSoi8EwMAIciKX2Z4SWCMAa3snCZ/G4EA8D6CMLNFsGQhkkz/gQNEBbPCbWsxGUpYVu3z8IyNAknwJkfPMEhLyrdi5RTyUVACkw4GSFRNWJNEW+fgPGwHD8/JxnRuLabN4CGNRkAE23na2+VmEAUmrYymSGjMAYqH84YUIyzgzs3XC7gNgH36Vcc4zKY9o9fgPBXUAiHHwVboBHGLiX6Zcjp1f2wu4tvzZKo0ecPnDtQYDQvJXaBeNzce45Fp28ZQLrEZVuFqgBwOalArKXnW1UzlnSusQKJqKYNuz4tOnI6sZG4zanpemv+7ySU2jbA9h6uhcgpfy6G2PahirDZ6zvq6zDduMVFTKvzw8wgyEdelwY9in3XkEPs3osJuwRQ4qTkfzifndg9Gfc4pdsu82+tTnHZTBa2EAMrqr2t43pguc8tNm7JQVQ2S0ukj2d22dhXYP0/veWtwKrCkNoNimAN5+Xr/oLrxswKbVJjteWrX7eR63o4j9q0GxnaBdWgGA5VStpanIjQmEhV0/nVt5VOFUvix6awJhPcAaTEShgrG+iGyvb5a0Ndb1YGHFPEwoqAinoaykaID1o1pdPNu7XsnCKQ3R+hwWIIhGvORcJUBYXe3Xa3vq/mF/N9V13ugufMkfXn+KHsRD0B8AAAAASUVORK5CYII=" type="image/x-icon" />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
<body>
|
|
32
32
|
<div id="app"></div>
|
|
33
33
|
<script>
|
|
34
|
-
window.chartData = [
|
|
35
|
-
window.entrypoints = ["tsparticles.interaction.external.bubble
|
|
34
|
+
window.chartData = [];
|
|
35
|
+
window.entrypoints = ["tsparticles.interaction.external.bubble.min"];
|
|
36
36
|
window.defaultSizes = "parsed";
|
|
37
37
|
</script>
|
|
38
38
|
</body>
|
|
@@ -4,7 +4,15 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v3.1
|
|
7
|
+
* v3.2.1
|
|
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/).
|
|
8
16
|
*/
|
|
9
17
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
18
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -15,15 +23,58 @@
|
|
|
15
23
|
var a = typeof exports === 'object' ? factory(require("@tsparticles/engine")) : factory(root["window"]);
|
|
16
24
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
|
17
25
|
}
|
|
18
|
-
})(this, (
|
|
26
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__) => {
|
|
19
27
|
return /******/ (() => { // webpackBootstrap
|
|
20
28
|
/******/ "use strict";
|
|
21
29
|
/******/ var __webpack_modules__ = ({
|
|
22
30
|
|
|
23
|
-
/***/
|
|
31
|
+
/***/ "./dist/browser/Options/Classes/Bubble.js":
|
|
32
|
+
/*!************************************************!*\
|
|
33
|
+
!*** ./dist/browser/Options/Classes/Bubble.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 */ Bubble: () => (/* binding */ Bubble)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n/* harmony import */ var _BubbleDiv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BubbleDiv.js */ \"./dist/browser/Options/Classes/BubbleDiv.js\");\n\n\n\nclass Bubble extends _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__.BubbleBase {\n load(data) {\n super.load(data);\n if (!data) {\n return;\n }\n this.divs = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.divs, div => {\n const tmp = new _BubbleDiv_js__WEBPACK_IMPORTED_MODULE_2__.BubbleDiv();\n tmp.load(div);\n return tmp;\n });\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/Bubble.js?");
|
|
38
|
+
|
|
39
|
+
/***/ }),
|
|
40
|
+
|
|
41
|
+
/***/ "./dist/browser/Options/Classes/BubbleBase.js":
|
|
42
|
+
/*!****************************************************!*\
|
|
43
|
+
!*** ./dist/browser/Options/Classes/BubbleBase.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 */ BubbleBase: () => (/* binding */ BubbleBase)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass BubbleBase {\n constructor() {\n this.distance = 200;\n this.duration = 0.4;\n this.mix = false;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n if (data.duration !== undefined) {\n this.duration = data.duration;\n }\n if (data.mix !== undefined) {\n this.mix = data.mix;\n }\n if (data.opacity !== undefined) {\n this.opacity = data.opacity;\n }\n if (data.color !== undefined) {\n const sourceColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(this.color) ? undefined : this.color;\n this.color = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.color, color => {\n return _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(sourceColor, color);\n });\n }\n if (data.size !== undefined) {\n this.size = data.size;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/BubbleBase.js?");
|
|
48
|
+
|
|
49
|
+
/***/ }),
|
|
50
|
+
|
|
51
|
+
/***/ "./dist/browser/Options/Classes/BubbleDiv.js":
|
|
52
|
+
/*!***************************************************!*\
|
|
53
|
+
!*** ./dist/browser/Options/Classes/BubbleDiv.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 */ BubbleDiv: () => (/* binding */ BubbleDiv)\n/* harmony export */ });\n/* harmony import */ var _BubbleBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n\nclass BubbleDiv extends _BubbleBase_js__WEBPACK_IMPORTED_MODULE_0__.BubbleBase {\n constructor() {\n super();\n this.selectors = [];\n }\n load(data) {\n super.load(data);\n if (!data) {\n return;\n }\n if (data.selectors !== undefined) {\n this.selectors = data.selectors;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/BubbleDiv.js?");
|
|
58
|
+
|
|
59
|
+
/***/ }),
|
|
60
|
+
|
|
61
|
+
/***/ "./dist/browser/index.js":
|
|
62
|
+
/*!*******************************!*\
|
|
63
|
+
!*** ./dist/browser/index.js ***!
|
|
64
|
+
\*******************************/
|
|
65
|
+
/***/ ((__unused_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 */ Bubble: () => (/* reexport safe */ _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_2__.Bubble),\n/* harmony export */ BubbleBase: () => (/* reexport safe */ _Options_Classes_BubbleBase_js__WEBPACK_IMPORTED_MODULE_0__.BubbleBase),\n/* harmony export */ BubbleDiv: () => (/* reexport safe */ _Options_Classes_BubbleDiv_js__WEBPACK_IMPORTED_MODULE_1__.BubbleDiv),\n/* harmony export */ loadExternalBubbleInteraction: () => (/* binding */ loadExternalBubbleInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_BubbleBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n/* harmony import */ var _Options_Classes_BubbleDiv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/BubbleDiv.js */ \"./dist/browser/Options/Classes/BubbleDiv.js\");\n/* harmony import */ var _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Bubble.js */ \"./dist/browser/Options/Classes/Bubble.js\");\nasync function loadExternalBubbleInteraction(engine, refresh = true) {\n await engine.addInteractor(\"externalBubble\", async container => {\n const {\n Bubbler\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Bubbler_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Bubbler.js */ \"./dist/browser/Bubbler.js\"));\n return new Bubbler(container);\n }, refresh);\n}\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/index.js?");
|
|
68
|
+
|
|
69
|
+
/***/ }),
|
|
70
|
+
|
|
71
|
+
/***/ "@tsparticles/engine":
|
|
72
|
+
/*!*********************************************************************************************************************************!*\
|
|
73
|
+
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
74
|
+
\*********************************************************************************************************************************/
|
|
24
75
|
/***/ ((module) => {
|
|
25
76
|
|
|
26
|
-
module.exports =
|
|
77
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
27
78
|
|
|
28
79
|
/***/ })
|
|
29
80
|
|
|
@@ -53,7 +104,22 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
|
|
|
53
104
|
/******/ return module.exports;
|
|
54
105
|
/******/ }
|
|
55
106
|
/******/
|
|
107
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
108
|
+
/******/ __webpack_require__.m = __webpack_modules__;
|
|
109
|
+
/******/
|
|
56
110
|
/************************************************************************/
|
|
111
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
112
|
+
/******/ (() => {
|
|
113
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
114
|
+
/******/ __webpack_require__.n = (module) => {
|
|
115
|
+
/******/ var getter = module && module.__esModule ?
|
|
116
|
+
/******/ () => (module['default']) :
|
|
117
|
+
/******/ () => (module);
|
|
118
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
119
|
+
/******/ return getter;
|
|
120
|
+
/******/ };
|
|
121
|
+
/******/ })();
|
|
122
|
+
/******/
|
|
57
123
|
/******/ /* webpack/runtime/define property getters */
|
|
58
124
|
/******/ (() => {
|
|
59
125
|
/******/ // define getter functions for harmony exports
|
|
@@ -66,11 +132,91 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
|
|
|
66
132
|
/******/ };
|
|
67
133
|
/******/ })();
|
|
68
134
|
/******/
|
|
135
|
+
/******/ /* webpack/runtime/ensure chunk */
|
|
136
|
+
/******/ (() => {
|
|
137
|
+
/******/ __webpack_require__.f = {};
|
|
138
|
+
/******/ // This file contains only the entry chunk.
|
|
139
|
+
/******/ // The chunk loading function for additional chunks
|
|
140
|
+
/******/ __webpack_require__.e = (chunkId) => {
|
|
141
|
+
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
142
|
+
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
143
|
+
/******/ return promises;
|
|
144
|
+
/******/ }, []));
|
|
145
|
+
/******/ };
|
|
146
|
+
/******/ })();
|
|
147
|
+
/******/
|
|
148
|
+
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
149
|
+
/******/ (() => {
|
|
150
|
+
/******/ // This function allow to reference async chunks
|
|
151
|
+
/******/ __webpack_require__.u = (chunkId) => {
|
|
152
|
+
/******/ // return url for filenames based on template
|
|
153
|
+
/******/ return "" + chunkId + ".js";
|
|
154
|
+
/******/ };
|
|
155
|
+
/******/ })();
|
|
156
|
+
/******/
|
|
157
|
+
/******/ /* webpack/runtime/global */
|
|
158
|
+
/******/ (() => {
|
|
159
|
+
/******/ __webpack_require__.g = (function() {
|
|
160
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
161
|
+
/******/ try {
|
|
162
|
+
/******/ return this || new Function('return this')();
|
|
163
|
+
/******/ } catch (e) {
|
|
164
|
+
/******/ if (typeof window === 'object') return window;
|
|
165
|
+
/******/ }
|
|
166
|
+
/******/ })();
|
|
167
|
+
/******/ })();
|
|
168
|
+
/******/
|
|
69
169
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
70
170
|
/******/ (() => {
|
|
71
171
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
72
172
|
/******/ })();
|
|
73
173
|
/******/
|
|
174
|
+
/******/ /* webpack/runtime/load script */
|
|
175
|
+
/******/ (() => {
|
|
176
|
+
/******/ var inProgress = {};
|
|
177
|
+
/******/ var dataWebpackPrefix = "@tsparticles/interaction-external-bubble:";
|
|
178
|
+
/******/ // loadScript function to load a script via script tag
|
|
179
|
+
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
180
|
+
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
181
|
+
/******/ var script, needAttach;
|
|
182
|
+
/******/ if(key !== undefined) {
|
|
183
|
+
/******/ var scripts = document.getElementsByTagName("script");
|
|
184
|
+
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
185
|
+
/******/ var s = scripts[i];
|
|
186
|
+
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
187
|
+
/******/ }
|
|
188
|
+
/******/ }
|
|
189
|
+
/******/ if(!script) {
|
|
190
|
+
/******/ needAttach = true;
|
|
191
|
+
/******/ script = document.createElement('script');
|
|
192
|
+
/******/
|
|
193
|
+
/******/ script.charset = 'utf-8';
|
|
194
|
+
/******/ script.timeout = 120;
|
|
195
|
+
/******/ if (__webpack_require__.nc) {
|
|
196
|
+
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
197
|
+
/******/ }
|
|
198
|
+
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
199
|
+
/******/
|
|
200
|
+
/******/ script.src = url;
|
|
201
|
+
/******/ }
|
|
202
|
+
/******/ inProgress[url] = [done];
|
|
203
|
+
/******/ var onScriptComplete = (prev, event) => {
|
|
204
|
+
/******/ // avoid mem leaks in IE.
|
|
205
|
+
/******/ script.onerror = script.onload = null;
|
|
206
|
+
/******/ clearTimeout(timeout);
|
|
207
|
+
/******/ var doneFns = inProgress[url];
|
|
208
|
+
/******/ delete inProgress[url];
|
|
209
|
+
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
210
|
+
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
211
|
+
/******/ if(prev) return prev(event);
|
|
212
|
+
/******/ }
|
|
213
|
+
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
214
|
+
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
215
|
+
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
216
|
+
/******/ needAttach && document.head.appendChild(script);
|
|
217
|
+
/******/ };
|
|
218
|
+
/******/ })();
|
|
219
|
+
/******/
|
|
74
220
|
/******/ /* webpack/runtime/make namespace object */
|
|
75
221
|
/******/ (() => {
|
|
76
222
|
/******/ // define __esModule on exports
|
|
@@ -82,442 +228,128 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__533__;
|
|
|
82
228
|
/******/ };
|
|
83
229
|
/******/ })();
|
|
84
230
|
/******/
|
|
231
|
+
/******/ /* webpack/runtime/publicPath */
|
|
232
|
+
/******/ (() => {
|
|
233
|
+
/******/ var scriptUrl;
|
|
234
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
235
|
+
/******/ var document = __webpack_require__.g.document;
|
|
236
|
+
/******/ if (!scriptUrl && document) {
|
|
237
|
+
/******/ if (document.currentScript)
|
|
238
|
+
/******/ scriptUrl = document.currentScript.src;
|
|
239
|
+
/******/ if (!scriptUrl) {
|
|
240
|
+
/******/ var scripts = document.getElementsByTagName("script");
|
|
241
|
+
/******/ if(scripts.length) {
|
|
242
|
+
/******/ var i = scripts.length - 1;
|
|
243
|
+
/******/ while (i > -1 && !scriptUrl) scriptUrl = scripts[i--].src;
|
|
244
|
+
/******/ }
|
|
245
|
+
/******/ }
|
|
246
|
+
/******/ }
|
|
247
|
+
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
248
|
+
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
249
|
+
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
250
|
+
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
251
|
+
/******/ __webpack_require__.p = scriptUrl;
|
|
252
|
+
/******/ })();
|
|
253
|
+
/******/
|
|
254
|
+
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
255
|
+
/******/ (() => {
|
|
256
|
+
/******/ // no baseURI
|
|
257
|
+
/******/
|
|
258
|
+
/******/ // object to store loaded and loading chunks
|
|
259
|
+
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
260
|
+
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
261
|
+
/******/ var installedChunks = {
|
|
262
|
+
/******/ "tsparticles.interaction.external.bubble": 0
|
|
263
|
+
/******/ };
|
|
264
|
+
/******/
|
|
265
|
+
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
266
|
+
/******/ // JSONP chunk loading for javascript
|
|
267
|
+
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
268
|
+
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
269
|
+
/******/
|
|
270
|
+
/******/ // a Promise means "currently loading".
|
|
271
|
+
/******/ if(installedChunkData) {
|
|
272
|
+
/******/ promises.push(installedChunkData[2]);
|
|
273
|
+
/******/ } else {
|
|
274
|
+
/******/ if(true) { // all chunks have JS
|
|
275
|
+
/******/ // setup Promise in chunk cache
|
|
276
|
+
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
277
|
+
/******/ promises.push(installedChunkData[2] = promise);
|
|
278
|
+
/******/
|
|
279
|
+
/******/ // start chunk loading
|
|
280
|
+
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
281
|
+
/******/ // create error before stack unwound to get useful stacktrace later
|
|
282
|
+
/******/ var error = new Error();
|
|
283
|
+
/******/ var loadingEnded = (event) => {
|
|
284
|
+
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
285
|
+
/******/ installedChunkData = installedChunks[chunkId];
|
|
286
|
+
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
287
|
+
/******/ if(installedChunkData) {
|
|
288
|
+
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
289
|
+
/******/ var realSrc = event && event.target && event.target.src;
|
|
290
|
+
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
291
|
+
/******/ error.name = 'ChunkLoadError';
|
|
292
|
+
/******/ error.type = errorType;
|
|
293
|
+
/******/ error.request = realSrc;
|
|
294
|
+
/******/ installedChunkData[1](error);
|
|
295
|
+
/******/ }
|
|
296
|
+
/******/ }
|
|
297
|
+
/******/ };
|
|
298
|
+
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
299
|
+
/******/ }
|
|
300
|
+
/******/ }
|
|
301
|
+
/******/ }
|
|
302
|
+
/******/ };
|
|
303
|
+
/******/
|
|
304
|
+
/******/ // no prefetching
|
|
305
|
+
/******/
|
|
306
|
+
/******/ // no preloaded
|
|
307
|
+
/******/
|
|
308
|
+
/******/ // no HMR
|
|
309
|
+
/******/
|
|
310
|
+
/******/ // no HMR manifest
|
|
311
|
+
/******/
|
|
312
|
+
/******/ // no on chunks loaded
|
|
313
|
+
/******/
|
|
314
|
+
/******/ // install a JSONP callback for chunk loading
|
|
315
|
+
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
316
|
+
/******/ var chunkIds = data[0];
|
|
317
|
+
/******/ var moreModules = data[1];
|
|
318
|
+
/******/ var runtime = data[2];
|
|
319
|
+
/******/ // add "moreModules" to the modules object,
|
|
320
|
+
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
321
|
+
/******/ var moduleId, chunkId, i = 0;
|
|
322
|
+
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
323
|
+
/******/ for(moduleId in moreModules) {
|
|
324
|
+
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
325
|
+
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
326
|
+
/******/ }
|
|
327
|
+
/******/ }
|
|
328
|
+
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
329
|
+
/******/ }
|
|
330
|
+
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
331
|
+
/******/ for(;i < chunkIds.length; i++) {
|
|
332
|
+
/******/ chunkId = chunkIds[i];
|
|
333
|
+
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
334
|
+
/******/ installedChunks[chunkId][0]();
|
|
335
|
+
/******/ }
|
|
336
|
+
/******/ installedChunks[chunkId] = 0;
|
|
337
|
+
/******/ }
|
|
338
|
+
/******/
|
|
339
|
+
/******/ }
|
|
340
|
+
/******/
|
|
341
|
+
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_external_bubble"] = this["webpackChunk_tsparticles_interaction_external_bubble"] || [];
|
|
342
|
+
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
343
|
+
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
344
|
+
/******/ })();
|
|
345
|
+
/******/
|
|
85
346
|
/************************************************************************/
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
|
|
89
|
-
//
|
|
90
|
-
__webpack_require__.
|
|
91
|
-
|
|
92
|
-
// EXPORTS
|
|
93
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
94
|
-
Bubble: () => (/* reexport */ Bubble),
|
|
95
|
-
BubbleBase: () => (/* reexport */ BubbleBase),
|
|
96
|
-
BubbleDiv: () => (/* reexport */ BubbleDiv),
|
|
97
|
-
loadExternalBubbleInteraction: () => (/* binding */ loadExternalBubbleInteraction)
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
// EXTERNAL MODULE: external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"}
|
|
101
|
-
var engine_root_window_ = __webpack_require__(533);
|
|
102
|
-
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/BubbleBase.js
|
|
103
|
-
|
|
104
|
-
class BubbleBase {
|
|
105
|
-
constructor() {
|
|
106
|
-
this.distance = 200;
|
|
107
|
-
this.duration = 0.4;
|
|
108
|
-
this.mix = false;
|
|
109
|
-
}
|
|
110
|
-
load(data) {
|
|
111
|
-
if (!data) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (data.distance !== undefined) {
|
|
115
|
-
this.distance = data.distance;
|
|
116
|
-
}
|
|
117
|
-
if (data.duration !== undefined) {
|
|
118
|
-
this.duration = data.duration;
|
|
119
|
-
}
|
|
120
|
-
if (data.mix !== undefined) {
|
|
121
|
-
this.mix = data.mix;
|
|
122
|
-
}
|
|
123
|
-
if (data.opacity !== undefined) {
|
|
124
|
-
this.opacity = data.opacity;
|
|
125
|
-
}
|
|
126
|
-
if (data.color !== undefined) {
|
|
127
|
-
const sourceColor = (0,engine_root_window_.isArray)(this.color) ? undefined : this.color;
|
|
128
|
-
this.color = (0,engine_root_window_.executeOnSingleOrMultiple)(data.color, color => {
|
|
129
|
-
return engine_root_window_.OptionsColor.create(sourceColor, color);
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
if (data.size !== undefined) {
|
|
133
|
-
this.size = data.size;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/BubbleDiv.js
|
|
138
|
-
|
|
139
|
-
class BubbleDiv extends BubbleBase {
|
|
140
|
-
constructor() {
|
|
141
|
-
super();
|
|
142
|
-
this.selectors = [];
|
|
143
|
-
}
|
|
144
|
-
load(data) {
|
|
145
|
-
super.load(data);
|
|
146
|
-
if (!data) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (data.selectors !== undefined) {
|
|
150
|
-
this.selectors = data.selectors;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
;// CONCATENATED MODULE: ./dist/browser/Options/Classes/Bubble.js
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
class Bubble extends BubbleBase {
|
|
159
|
-
load(data) {
|
|
160
|
-
super.load(data);
|
|
161
|
-
if (!data) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
this.divs = (0,engine_root_window_.executeOnSingleOrMultiple)(data.divs, div => {
|
|
165
|
-
const tmp = new BubbleDiv();
|
|
166
|
-
tmp.load(div);
|
|
167
|
-
return tmp;
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
;// CONCATENATED MODULE: ./dist/browser/Utils.js
|
|
172
|
-
|
|
173
|
-
function calculateBubbleValue(particleValue, modeValue, optionsValue, ratio) {
|
|
174
|
-
if (modeValue >= optionsValue) {
|
|
175
|
-
const value = particleValue + (modeValue - optionsValue) * ratio;
|
|
176
|
-
return (0,engine_root_window_.clamp)(value, particleValue, modeValue);
|
|
177
|
-
} else if (modeValue < optionsValue) {
|
|
178
|
-
const value = particleValue - (optionsValue - modeValue) * ratio;
|
|
179
|
-
return (0,engine_root_window_.clamp)(value, modeValue, particleValue);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
;// CONCATENATED MODULE: ./dist/browser/Bubbler.js
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const bubbleMode = "bubble",
|
|
187
|
-
minDistance = 0,
|
|
188
|
-
defaultClickTime = 0,
|
|
189
|
-
Bubbler_double = 2,
|
|
190
|
-
defaultOpacity = 1,
|
|
191
|
-
ratioOffset = 1,
|
|
192
|
-
defaultBubbleValue = 0,
|
|
193
|
-
minRatio = 0,
|
|
194
|
-
half = 0.5,
|
|
195
|
-
defaultRatio = 1;
|
|
196
|
-
class Bubbler extends engine_root_window_.ExternalInteractorBase {
|
|
197
|
-
constructor(container) {
|
|
198
|
-
super(container);
|
|
199
|
-
this._clickBubble = () => {
|
|
200
|
-
const container = this.container,
|
|
201
|
-
options = container.actualOptions,
|
|
202
|
-
mouseClickPos = container.interactivity.mouse.clickPosition,
|
|
203
|
-
bubbleOptions = options.interactivity.modes.bubble;
|
|
204
|
-
if (!bubbleOptions || !mouseClickPos) {
|
|
205
|
-
return;
|
|
206
|
-
}
|
|
207
|
-
if (!container.bubble) {
|
|
208
|
-
container.bubble = {};
|
|
209
|
-
}
|
|
210
|
-
const distance = container.retina.bubbleModeDistance;
|
|
211
|
-
if (!distance || distance < minDistance) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, p => this.isEnabled(p)),
|
|
215
|
-
{
|
|
216
|
-
bubble
|
|
217
|
-
} = container;
|
|
218
|
-
for (const particle of query) {
|
|
219
|
-
if (!bubble.clicking) {
|
|
220
|
-
continue;
|
|
221
|
-
}
|
|
222
|
-
particle.bubble.inRange = !bubble.durationEnd;
|
|
223
|
-
const pos = particle.getPosition(),
|
|
224
|
-
distMouse = (0,engine_root_window_.getDistance)(pos, mouseClickPos),
|
|
225
|
-
timeSpent = (new Date().getTime() - (container.interactivity.mouse.clickTime ?? defaultClickTime)) / engine_root_window_.millisecondsToSeconds;
|
|
226
|
-
if (timeSpent > bubbleOptions.duration) {
|
|
227
|
-
bubble.durationEnd = true;
|
|
228
|
-
}
|
|
229
|
-
if (timeSpent > bubbleOptions.duration * Bubbler_double) {
|
|
230
|
-
bubble.clicking = false;
|
|
231
|
-
bubble.durationEnd = false;
|
|
232
|
-
}
|
|
233
|
-
const sizeData = {
|
|
234
|
-
bubbleObj: {
|
|
235
|
-
optValue: container.retina.bubbleModeSize,
|
|
236
|
-
value: particle.bubble.radius
|
|
237
|
-
},
|
|
238
|
-
particlesObj: {
|
|
239
|
-
optValue: (0,engine_root_window_.getRangeMax)(particle.options.size.value) * container.retina.pixelRatio,
|
|
240
|
-
value: particle.size.value
|
|
241
|
-
},
|
|
242
|
-
type: "size"
|
|
243
|
-
};
|
|
244
|
-
this._process(particle, distMouse, timeSpent, sizeData);
|
|
245
|
-
const opacityData = {
|
|
246
|
-
bubbleObj: {
|
|
247
|
-
optValue: bubbleOptions.opacity,
|
|
248
|
-
value: particle.bubble.opacity
|
|
249
|
-
},
|
|
250
|
-
particlesObj: {
|
|
251
|
-
optValue: (0,engine_root_window_.getRangeMax)(particle.options.opacity.value),
|
|
252
|
-
value: particle.opacity?.value ?? defaultOpacity
|
|
253
|
-
},
|
|
254
|
-
type: "opacity"
|
|
255
|
-
};
|
|
256
|
-
this._process(particle, distMouse, timeSpent, opacityData);
|
|
257
|
-
if (!bubble.durationEnd && distMouse <= distance) {
|
|
258
|
-
this._hoverBubbleColor(particle, distMouse);
|
|
259
|
-
} else {
|
|
260
|
-
delete particle.bubble.color;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
this._hoverBubble = () => {
|
|
265
|
-
const container = this.container,
|
|
266
|
-
mousePos = container.interactivity.mouse.position,
|
|
267
|
-
distance = container.retina.bubbleModeDistance;
|
|
268
|
-
if (!distance || distance < minDistance || !mousePos) {
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
const query = container.particles.quadTree.queryCircle(mousePos, distance, p => this.isEnabled(p));
|
|
272
|
-
for (const particle of query) {
|
|
273
|
-
particle.bubble.inRange = true;
|
|
274
|
-
const pos = particle.getPosition(),
|
|
275
|
-
pointDistance = (0,engine_root_window_.getDistance)(pos, mousePos),
|
|
276
|
-
ratio = ratioOffset - pointDistance / distance;
|
|
277
|
-
if (pointDistance <= distance) {
|
|
278
|
-
if (ratio >= minRatio && container.interactivity.status === engine_root_window_.mouseMoveEvent) {
|
|
279
|
-
this._hoverBubbleSize(particle, ratio);
|
|
280
|
-
this._hoverBubbleOpacity(particle, ratio);
|
|
281
|
-
this._hoverBubbleColor(particle, ratio);
|
|
282
|
-
}
|
|
283
|
-
} else {
|
|
284
|
-
this.reset(particle);
|
|
285
|
-
}
|
|
286
|
-
if (container.interactivity.status === engine_root_window_.mouseLeaveEvent) {
|
|
287
|
-
this.reset(particle);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
this._hoverBubbleColor = (particle, ratio, divBubble) => {
|
|
292
|
-
const options = this.container.actualOptions,
|
|
293
|
-
bubbleOptions = divBubble ?? options.interactivity.modes.bubble;
|
|
294
|
-
if (!bubbleOptions) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (!particle.bubble.finalColor) {
|
|
298
|
-
const modeColor = bubbleOptions.color;
|
|
299
|
-
if (!modeColor) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
const bubbleColor = (0,engine_root_window_.itemFromSingleOrMultiple)(modeColor);
|
|
303
|
-
particle.bubble.finalColor = (0,engine_root_window_.rangeColorToHsl)(bubbleColor);
|
|
304
|
-
}
|
|
305
|
-
if (!particle.bubble.finalColor) {
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
if (bubbleOptions.mix) {
|
|
309
|
-
particle.bubble.color = undefined;
|
|
310
|
-
const pColor = particle.getFillColor();
|
|
311
|
-
particle.bubble.color = pColor ? (0,engine_root_window_.rgbToHsl)((0,engine_root_window_.colorMix)(pColor, particle.bubble.finalColor, ratioOffset - ratio, ratio)) : particle.bubble.finalColor;
|
|
312
|
-
} else {
|
|
313
|
-
particle.bubble.color = particle.bubble.finalColor;
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
this._hoverBubbleOpacity = (particle, ratio, divBubble) => {
|
|
317
|
-
const container = this.container,
|
|
318
|
-
options = container.actualOptions,
|
|
319
|
-
modeOpacity = divBubble?.opacity ?? options.interactivity.modes.bubble?.opacity;
|
|
320
|
-
if (!modeOpacity) {
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
const optOpacity = particle.options.opacity.value,
|
|
324
|
-
pOpacity = particle.opacity?.value ?? defaultOpacity,
|
|
325
|
-
opacity = calculateBubbleValue(pOpacity, modeOpacity, (0,engine_root_window_.getRangeMax)(optOpacity), ratio);
|
|
326
|
-
if (opacity !== undefined) {
|
|
327
|
-
particle.bubble.opacity = opacity;
|
|
328
|
-
}
|
|
329
|
-
};
|
|
330
|
-
this._hoverBubbleSize = (particle, ratio, divBubble) => {
|
|
331
|
-
const container = this.container,
|
|
332
|
-
modeSize = divBubble?.size ? divBubble.size * container.retina.pixelRatio : container.retina.bubbleModeSize;
|
|
333
|
-
if (modeSize === undefined) {
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
const optSize = (0,engine_root_window_.getRangeMax)(particle.options.size.value) * container.retina.pixelRatio,
|
|
337
|
-
pSize = particle.size.value,
|
|
338
|
-
size = calculateBubbleValue(pSize, modeSize, optSize, ratio);
|
|
339
|
-
if (size !== undefined) {
|
|
340
|
-
particle.bubble.radius = size;
|
|
341
|
-
}
|
|
342
|
-
};
|
|
343
|
-
this._process = (particle, distMouse, timeSpent, data) => {
|
|
344
|
-
const container = this.container,
|
|
345
|
-
bubbleParam = data.bubbleObj.optValue,
|
|
346
|
-
options = container.actualOptions,
|
|
347
|
-
bubbleOptions = options.interactivity.modes.bubble;
|
|
348
|
-
if (!bubbleOptions || bubbleParam === undefined) {
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
const bubbleDuration = bubbleOptions.duration,
|
|
352
|
-
bubbleDistance = container.retina.bubbleModeDistance,
|
|
353
|
-
particlesParam = data.particlesObj.optValue,
|
|
354
|
-
pObjBubble = data.bubbleObj.value,
|
|
355
|
-
pObj = data.particlesObj.value ?? defaultBubbleValue,
|
|
356
|
-
type = data.type;
|
|
357
|
-
if (!bubbleDistance || bubbleDistance < minDistance || bubbleParam === particlesParam) {
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
if (!container.bubble) {
|
|
361
|
-
container.bubble = {};
|
|
362
|
-
}
|
|
363
|
-
if (container.bubble.durationEnd) {
|
|
364
|
-
if (pObjBubble) {
|
|
365
|
-
if (type === "size") {
|
|
366
|
-
delete particle.bubble.radius;
|
|
367
|
-
}
|
|
368
|
-
if (type === "opacity") {
|
|
369
|
-
delete particle.bubble.opacity;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
} else {
|
|
373
|
-
if (distMouse <= bubbleDistance) {
|
|
374
|
-
const obj = pObjBubble ?? pObj;
|
|
375
|
-
if (obj !== bubbleParam) {
|
|
376
|
-
const value = pObj - timeSpent * (pObj - bubbleParam) / bubbleDuration;
|
|
377
|
-
if (type === "size") {
|
|
378
|
-
particle.bubble.radius = value;
|
|
379
|
-
}
|
|
380
|
-
if (type === "opacity") {
|
|
381
|
-
particle.bubble.opacity = value;
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
} else {
|
|
385
|
-
if (type === "size") {
|
|
386
|
-
delete particle.bubble.radius;
|
|
387
|
-
}
|
|
388
|
-
if (type === "opacity") {
|
|
389
|
-
delete particle.bubble.opacity;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
this._singleSelectorHover = (delta, selector, div) => {
|
|
395
|
-
const container = this.container,
|
|
396
|
-
selectors = document.querySelectorAll(selector),
|
|
397
|
-
bubble = container.actualOptions.interactivity.modes.bubble;
|
|
398
|
-
if (!bubble || !selectors.length) {
|
|
399
|
-
return;
|
|
400
|
-
}
|
|
401
|
-
selectors.forEach(item => {
|
|
402
|
-
const elem = item,
|
|
403
|
-
pxRatio = container.retina.pixelRatio,
|
|
404
|
-
pos = {
|
|
405
|
-
x: (elem.offsetLeft + elem.offsetWidth * half) * pxRatio,
|
|
406
|
-
y: (elem.offsetTop + elem.offsetHeight * half) * pxRatio
|
|
407
|
-
},
|
|
408
|
-
repulseRadius = elem.offsetWidth * half * pxRatio,
|
|
409
|
-
area = div.type === "circle" ? new engine_root_window_.Circle(pos.x, pos.y, repulseRadius) : new engine_root_window_.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio),
|
|
410
|
-
query = container.particles.quadTree.query(area, p => this.isEnabled(p));
|
|
411
|
-
for (const particle of query) {
|
|
412
|
-
if (!area.contains(particle.getPosition())) {
|
|
413
|
-
continue;
|
|
414
|
-
}
|
|
415
|
-
particle.bubble.inRange = true;
|
|
416
|
-
const divs = bubble.divs,
|
|
417
|
-
divBubble = (0,engine_root_window_.divMode)(divs, elem);
|
|
418
|
-
if (!particle.bubble.div || particle.bubble.div !== elem) {
|
|
419
|
-
this.clear(particle, delta, true);
|
|
420
|
-
particle.bubble.div = elem;
|
|
421
|
-
}
|
|
422
|
-
this._hoverBubbleSize(particle, defaultRatio, divBubble);
|
|
423
|
-
this._hoverBubbleOpacity(particle, defaultRatio, divBubble);
|
|
424
|
-
this._hoverBubbleColor(particle, defaultRatio, divBubble);
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
};
|
|
428
|
-
if (!container.bubble) {
|
|
429
|
-
container.bubble = {};
|
|
430
|
-
}
|
|
431
|
-
this.handleClickMode = mode => {
|
|
432
|
-
if (mode !== bubbleMode) {
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
if (!container.bubble) {
|
|
436
|
-
container.bubble = {};
|
|
437
|
-
}
|
|
438
|
-
container.bubble.clicking = true;
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
clear(particle, delta, force) {
|
|
442
|
-
if (particle.bubble.inRange && !force) {
|
|
443
|
-
return;
|
|
444
|
-
}
|
|
445
|
-
delete particle.bubble.div;
|
|
446
|
-
delete particle.bubble.opacity;
|
|
447
|
-
delete particle.bubble.radius;
|
|
448
|
-
delete particle.bubble.color;
|
|
449
|
-
}
|
|
450
|
-
init() {
|
|
451
|
-
const container = this.container,
|
|
452
|
-
bubble = container.actualOptions.interactivity.modes.bubble;
|
|
453
|
-
if (!bubble) {
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
container.retina.bubbleModeDistance = bubble.distance * container.retina.pixelRatio;
|
|
457
|
-
if (bubble.size !== undefined) {
|
|
458
|
-
container.retina.bubbleModeSize = bubble.size * container.retina.pixelRatio;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
async interact(delta) {
|
|
462
|
-
const options = this.container.actualOptions,
|
|
463
|
-
events = options.interactivity.events,
|
|
464
|
-
onHover = events.onHover,
|
|
465
|
-
onClick = events.onClick,
|
|
466
|
-
hoverEnabled = onHover.enable,
|
|
467
|
-
hoverMode = onHover.mode,
|
|
468
|
-
clickEnabled = onClick.enable,
|
|
469
|
-
clickMode = onClick.mode,
|
|
470
|
-
divs = events.onDiv;
|
|
471
|
-
if (hoverEnabled && (0,engine_root_window_.isInArray)(bubbleMode, hoverMode)) {
|
|
472
|
-
this._hoverBubble();
|
|
473
|
-
} else if (clickEnabled && (0,engine_root_window_.isInArray)(bubbleMode, clickMode)) {
|
|
474
|
-
this._clickBubble();
|
|
475
|
-
} else {
|
|
476
|
-
(0,engine_root_window_.divModeExecute)(bubbleMode, divs, (selector, div) => this._singleSelectorHover(delta, selector, div));
|
|
477
|
-
}
|
|
478
|
-
await Promise.resolve();
|
|
479
|
-
}
|
|
480
|
-
isEnabled(particle) {
|
|
481
|
-
const container = this.container,
|
|
482
|
-
options = container.actualOptions,
|
|
483
|
-
mouse = container.interactivity.mouse,
|
|
484
|
-
events = (particle?.interactivity ?? options.interactivity).events,
|
|
485
|
-
{
|
|
486
|
-
onClick,
|
|
487
|
-
onDiv,
|
|
488
|
-
onHover
|
|
489
|
-
} = events,
|
|
490
|
-
divBubble = (0,engine_root_window_.isDivModeEnabled)(bubbleMode, onDiv);
|
|
491
|
-
if (!(divBubble || onHover.enable && !!mouse.position || onClick.enable && mouse.clickPosition)) {
|
|
492
|
-
return false;
|
|
493
|
-
}
|
|
494
|
-
return (0,engine_root_window_.isInArray)(bubbleMode, onHover.mode) || (0,engine_root_window_.isInArray)(bubbleMode, onClick.mode) || divBubble;
|
|
495
|
-
}
|
|
496
|
-
loadModeOptions(options, ...sources) {
|
|
497
|
-
if (!options.bubble) {
|
|
498
|
-
options.bubble = new Bubble();
|
|
499
|
-
}
|
|
500
|
-
for (const source of sources) {
|
|
501
|
-
options.bubble.load(source?.bubble);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
reset(particle) {
|
|
505
|
-
particle.bubble.inRange = false;
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
;// CONCATENATED MODULE: ./dist/browser/index.js
|
|
509
|
-
|
|
510
|
-
async function loadExternalBubbleInteraction(engine, refresh = true) {
|
|
511
|
-
await engine.addInteractor("externalBubble", container => new Bubbler(container), refresh);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
})();
|
|
520
|
-
|
|
347
|
+
/******/
|
|
348
|
+
/******/ // startup
|
|
349
|
+
/******/ // Load entry module and return exports
|
|
350
|
+
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
351
|
+
/******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
|
|
352
|
+
/******/
|
|
521
353
|
/******/ return __webpack_exports__;
|
|
522
354
|
/******/ })()
|
|
523
355
|
;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.interaction.external.bubble.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={585:(e,t,r)=>{r.d(t,{x:()=>a});var o=r(533),i=r(543),n=r(450);class a extends i.N{load(e){super.load(e),e&&(this.divs=(0,o.executeOnSingleOrMultiple)(e.divs,(e=>{const t=new n.y;return t.load(e),t})))}}},543:(e,t,r)=>{r.d(t,{N:()=>i});var o=r(533);class i{constructor(){this.distance=200,this.duration=.4,this.mix=!1}load(e){if(e){if(void 0!==e.distance&&(this.distance=e.distance),void 0!==e.duration&&(this.duration=e.duration),void 0!==e.mix&&(this.mix=e.mix),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.color){const t=(0,o.isArray)(this.color)?void 0:this.color;this.color=(0,o.executeOnSingleOrMultiple)(e.color,(e=>o.OptionsColor.create(t,e)))}void 0!==e.size&&(this.size=e.size)}}}},450:(e,t,r)=>{r.d(t,{y:()=>i});var o=r(543);class i extends o.N{constructor(){super(),this.selectors=[]}load(e){super.load(e),e&&void 0!==e.selectors&&(this.selectors=e.selectors)}}},533:t=>{t.exports=e}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/interaction-external-bubble:",n.l=(e,o,i,a)=>{if(t[e])t[e].push(o);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+i){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",r+i),s.src=e),t[e]=[o];var p=(r,o)=>{s.onerror=s.onload=null,clearTimeout(b);var i=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(o))),r)return r(o)},b=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&!e;)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={541:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,i)=>o=e[t]=[r,i]));r.push(o[2]=i);var a=n.p+n.u(t),s=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,a=r[0],s=r[1],l=r[2],c=0;if(a.some((t=>0!==e[t]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(l)l(n)}for(t&&t(r);c<a.length;c++)i=a[c],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_interaction_external_bubble=this.webpackChunk_tsparticles_interaction_external_bubble||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{n.r(a),n.d(a,{Bubble:()=>r.x,BubbleBase:()=>e.N,BubbleDiv:()=>t.y,loadExternalBubbleInteraction:()=>o});var e=n(543),t=n(450),r=n(585);async function o(e,t=!0){await e.addInteractor("externalBubble",(async e=>{const{Bubbler:t}=await n.e(582).then(n.bind(n,582));return new t(e)}),t)}})(),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Bubble External Interaction v3.1
|
|
1
|
+
/*! tsParticles Bubble External Interaction v3.2.1 by Matteo Bruni */
|
package/umd/index.js
CHANGED
|
@@ -9,6 +9,18 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
9
9
|
if (k2 === undefined) k2 = k;
|
|
10
10
|
o[k2] = m[k];
|
|
11
11
|
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
|
+
if (mod && mod.__esModule) return mod;
|
|
19
|
+
var result = {};
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
|
+
__setModuleDefault(result, mod);
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
12
24
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
13
25
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
14
26
|
};
|
|
@@ -18,15 +30,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
30
|
if (v !== undefined) module.exports = v;
|
|
19
31
|
}
|
|
20
32
|
else if (typeof define === "function" && define.amd) {
|
|
21
|
-
define(["require", "exports", "./
|
|
33
|
+
define(["require", "exports", "./Options/Classes/BubbleBase.js", "./Options/Classes/BubbleDiv.js", "./Options/Classes/Bubble.js", "./Options/Interfaces/IBubbleBase.js", "./Options/Interfaces/IBubbleDiv.js", "./Options/Interfaces/IBubble.js"], factory);
|
|
22
34
|
}
|
|
23
35
|
})(function (require, exports) {
|
|
24
36
|
"use strict";
|
|
37
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
25
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
39
|
exports.loadExternalBubbleInteraction = void 0;
|
|
27
|
-
const Bubbler_js_1 = require("./Bubbler.js");
|
|
28
40
|
async function loadExternalBubbleInteraction(engine, refresh = true) {
|
|
29
|
-
await engine.addInteractor("externalBubble", (container) =>
|
|
41
|
+
await engine.addInteractor("externalBubble", async (container) => {
|
|
42
|
+
const { Bubbler } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Bubbler.js"))) : new Promise((resolve_1, reject_1) => { require(["./Bubbler.js"], resolve_1, reject_1); }).then(__importStar));
|
|
43
|
+
return new Bubbler(container);
|
|
44
|
+
}, refresh);
|
|
30
45
|
}
|
|
31
46
|
exports.loadExternalBubbleInteraction = loadExternalBubbleInteraction;
|
|
32
47
|
__exportStar(require("./Options/Classes/BubbleBase.js"), exports);
|