@tsparticles/interaction-external-bounce
Advanced tools
Comparing version 3.6.0-beta.1 to 3.6.0
@@ -0,1 +1,2 @@ | ||
import { isNull } from "@tsparticles/engine"; | ||
export class Bounce { | ||
@@ -6,3 +7,3 @@ constructor() { | ||
load(data) { | ||
if (!data) { | ||
if (isNull(data)) { | ||
return; | ||
@@ -9,0 +10,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Bounce = void 0; | ||
const engine_1 = require("@tsparticles/engine"); | ||
class Bounce { | ||
@@ -9,3 +10,3 @@ constructor() { | ||
load(data) { | ||
if (!data) { | ||
if ((0, engine_1.isNull)(data)) { | ||
return; | ||
@@ -12,0 +13,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { isNull } from "@tsparticles/engine"; | ||
export class Bounce { | ||
@@ -6,3 +7,3 @@ constructor() { | ||
load(data) { | ||
if (!data) { | ||
if (isNull(data)) { | ||
return; | ||
@@ -9,0 +10,0 @@ } |
{ | ||
"name": "@tsparticles/interaction-external-bounce", | ||
"version": "3.6.0-beta.1", | ||
"version": "3.6.0", | ||
"description": "tsParticles bounce external interaction", | ||
@@ -90,3 +90,3 @@ "homepage": "https://particles.js.org", | ||
"dependencies": { | ||
"@tsparticles/engine": "^3.6.0-beta.1" | ||
"@tsparticles/engine": "^3.6.0" | ||
}, | ||
@@ -93,0 +93,0 @@ "publishConfig": { |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v3.6.0-beta.1 | ||
* v3.6.0 | ||
*/ | ||
@@ -48,3 +48,3 @@ /* | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Bounce: () => (/* binding */ Bounce)\n/* harmony export */ });\nclass Bounce {\n constructor() {\n this.distance = 200;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bounce/./dist/browser/Options/Classes/Bounce.js?"); | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Bounce: () => (/* binding */ Bounce)\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 Bounce {\n constructor() {\n this.distance = 200;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bounce/./dist/browser/Options/Classes/Bounce.js?"); | ||
@@ -51,0 +51,0 @@ /***/ }), |
/*! For license information please see tsparticles.interaction.external.bounce.min.js.LICENSE.txt */ | ||
!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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},o={};function n(e){var i=o[e];if(void 0!==i)return i.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{Bounce:()=>p,loadExternalBounceInteraction:()=>b});var r=n(303);const c=2,s=.5,a=Math.PI*s,l=2,f=10;function u(e,t,o,n,i){const s=e.particles.quadTree.query(n,i);for(const e of s)n instanceof r.Circle?(0,r.circleBounce)((0,r.circleBounceDataFromParticle)(e),{position:t,radius:o,mass:o**c*a,velocity:r.Vector.origin,factor:r.Vector.origin}):n instanceof r.Rectangle&&(0,r.rectBounce)(e,(0,r.calculateBounds)(t,o))}function d(e,t,o,n){(0,r.divModeExecute)(o,t,((t,o)=>function(e,t,o,n){const i=document.querySelectorAll(t);i.length&&i.forEach((t=>{const i=t,c=e.retina.pixelRatio,a={x:(i.offsetLeft+i.offsetWidth*s)*c,y:(i.offsetTop+i.offsetHeight*s)*c},u=i.offsetWidth*s*c,d=f*c,p=o.type===r.DivType.circle?new r.Circle(a.x,a.y,u+d):new r.Rectangle(i.offsetLeft*c-d,i.offsetTop*c-d,i.offsetWidth*c+d*l,i.offsetHeight*c+d*l);n(a,u,p)}))}(e,t,o,((t,o,i)=>u(e,t,o,i,n)))))}class p{constructor(){this.distance=200}load(e){e&&void 0!==e.distance&&(this.distance=e.distance)}}const v="bounce";class y extends r.ExternalInteractorBase{constructor(e){super(e)}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bounce;t&&(e.retina.bounceModeDistance=t.distance*e.retina.pixelRatio)}interact(){const e=this.container,t=e.actualOptions.interactivity.events,o=e.interactivity.status===r.mouseMoveEvent,n=t.onHover.enable,i=t.onHover.mode,c=t.onDiv;o&&n&&(0,r.isInArray)(v,i)?function(e,t){const o=e.retina.pixelRatio,n=f*o,i=e.interactivity.mouse.position,c=e.retina.bounceModeDistance;!c||c<0||!i||u(e,i,c,new r.Circle(i.x,i.y,c+n),t)}(this.container,(e=>this.isEnabled(e))):d(this.container,c,v,(e=>this.isEnabled(e)))}isEnabled(e){const t=this.container,o=t.actualOptions,n=t.interactivity.mouse,i=(e?.interactivity??o.interactivity).events,c=i.onDiv;return!!n.position&&i.onHover.enable&&(0,r.isInArray)(v,i.onHover.mode)||(0,r.isDivModeEnabled)(v,c)}loadModeOptions(e,...t){e.bounce||(e.bounce=new p);for(const o of t)e.bounce.load(o?.bounce)}reset(){}}async function b(e,t=!0){await e.addInteractor("externalBounce",(e=>Promise.resolve(new y(e))),t)}return i})())); | ||
!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 o="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},o={};function n(e){var i=o[e];if(void 0!==i)return i.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};n.r(i),n.d(i,{Bounce:()=>p,loadExternalBounceInteraction:()=>b});var r=n(303);const c=2,s=.5,a=Math.PI*s,l=2,u=10;function f(e,t,o,n,i){const s=e.particles.quadTree.query(n,i);for(const e of s)n instanceof r.Circle?(0,r.circleBounce)((0,r.circleBounceDataFromParticle)(e),{position:t,radius:o,mass:o**c*a,velocity:r.Vector.origin,factor:r.Vector.origin}):n instanceof r.Rectangle&&(0,r.rectBounce)(e,(0,r.calculateBounds)(t,o))}function d(e,t,o,n){(0,r.divModeExecute)(o,t,((t,o)=>function(e,t,o,n){const i=document.querySelectorAll(t);i.length&&i.forEach((t=>{const i=t,c=e.retina.pixelRatio,a={x:(i.offsetLeft+i.offsetWidth*s)*c,y:(i.offsetTop+i.offsetHeight*s)*c},f=i.offsetWidth*s*c,d=u*c,p=o.type===r.DivType.circle?new r.Circle(a.x,a.y,f+d):new r.Rectangle(i.offsetLeft*c-d,i.offsetTop*c-d,i.offsetWidth*c+d*l,i.offsetHeight*c+d*l);n(a,f,p)}))}(e,t,o,((t,o,i)=>f(e,t,o,i,n)))))}class p{constructor(){this.distance=200}load(e){(0,r.isNull)(e)||void 0!==e.distance&&(this.distance=e.distance)}}const v="bounce";class y extends r.ExternalInteractorBase{constructor(e){super(e)}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bounce;t&&(e.retina.bounceModeDistance=t.distance*e.retina.pixelRatio)}interact(){const e=this.container,t=e.actualOptions.interactivity.events,o=e.interactivity.status===r.mouseMoveEvent,n=t.onHover.enable,i=t.onHover.mode,c=t.onDiv;o&&n&&(0,r.isInArray)(v,i)?function(e,t){const o=e.retina.pixelRatio,n=u*o,i=e.interactivity.mouse.position,c=e.retina.bounceModeDistance;!c||c<0||!i||f(e,i,c,new r.Circle(i.x,i.y,c+n),t)}(this.container,(e=>this.isEnabled(e))):d(this.container,c,v,(e=>this.isEnabled(e)))}isEnabled(e){const t=this.container,o=t.actualOptions,n=t.interactivity.mouse,i=(e?.interactivity??o.interactivity).events,c=i.onDiv;return!!n.position&&i.onHover.enable&&(0,r.isInArray)(v,i.onHover.mode)||(0,r.isDivModeEnabled)(v,c)}loadModeOptions(e,...t){e.bounce||(e.bounce=new p);for(const o of t)e.bounce.load(o?.bounce)}reset(){}}async function b(e,t=!0){await e.addInteractor("externalBounce",(e=>Promise.resolve(new y(e))),t)}return i})())); |
@@ -1,1 +0,1 @@ | ||
/*! tsParticles Bounce External Interaction v3.6.0-beta.1 by Matteo Bruni */ | ||
/*! tsParticles Bounce External Interaction v3.6.0 by Matteo Bruni */ |
@@ -1,2 +0,2 @@ | ||
import type { IOptionLoader, RecursivePartial } from "@tsparticles/engine"; | ||
import { type IOptionLoader, type RecursivePartial } from "@tsparticles/engine"; | ||
import type { IBounce } from "../Interfaces/IBounce.js"; | ||
@@ -3,0 +3,0 @@ export declare class Bounce implements IBounce, IOptionLoader<IBounce> { |
@@ -7,3 +7,3 @@ (function (factory) { | ||
else if (typeof define === "function" && define.amd) { | ||
define(["require", "exports"], factory); | ||
define(["require", "exports", "@tsparticles/engine"], factory); | ||
} | ||
@@ -14,2 +14,3 @@ })(function (require, exports) { | ||
exports.Bounce = void 0; | ||
const engine_1 = require("@tsparticles/engine"); | ||
class Bounce { | ||
@@ -20,3 +21,3 @@ constructor() { | ||
load(data) { | ||
if (!data) { | ||
if ((0, engine_1.isNull)(data)) { | ||
return; | ||
@@ -23,0 +24,0 @@ } |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
326432
800
1
Updated@tsparticles/engine@^3.6.0