tsparticles-interaction-external-push
Advanced tools
Comparing version 2.0.0-beta.2 to 2.0.0-beta.3
{ | ||
"name": "tsparticles-interaction-external-push", | ||
"version": "2.0.0-beta.2", | ||
"version": "2.0.0-beta.3", | ||
"description": "tsParticles push external interaction", | ||
@@ -65,4 +65,4 @@ "homepage": "https://particles.js.org/", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.0.0-beta.1" | ||
"tsparticles-engine": "^2.0.0-beta.2" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ExternalInteractorBase, ClickMode, } from "tsparticles-engine"; | ||
import { ExternalInteractorBase, ClickMode } from "tsparticles-engine"; | ||
import { itemFromArray } from "tsparticles-engine"; | ||
@@ -3,0 +3,0 @@ export class Pusher extends ExternalInteractorBase { |
[![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org) | ||
# tsparticles-interaction-particles-push | ||
# tsParticles External Push Interaction | ||
tsParticles interaction particles push | ||
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-interaction-external-push/badge)](https://www.jsdelivr.com/package/npm/tsparticles-interaction-external-push) | ||
[![npmjs](https://badge.fury.io/js/tsparticles-interaction-external-push.svg)](https://www.npmjs.com/package/tsparticles-interaction-external-push) | ||
[![npmjs](https://img.shields.io/npm/dt/tsparticles-interaction-external-push)](https://www.npmjs.com/package/tsparticles-interaction-external-push) | ||
[tsParticles](https://github.com/matteobruni/tsparticles) interaction plugin for push effect around mouse or HTML | ||
elements. | ||
## How to use it | ||
### CDN / Vanilla JS / jQuery | ||
The CDN/Vanilla version JS has one required file in vanilla configuration: | ||
Including the `tsparticles.interaction.external.push.min.js` file will export the function to load the interaction | ||
plugin: | ||
```javascript | ||
loadExternalPushInteraction; | ||
``` | ||
### Usage | ||
Once the scripts are loaded you can set up `tsParticles` and the interaction plugin like this: | ||
```javascript | ||
loadExternalPushInteraction(tsParticles); | ||
tsParticles.load("tsparticles", { | ||
/* options */ | ||
}); | ||
``` | ||
### ESM / CommonJS | ||
This package is compatible also with ES or CommonJS modules, firstly this needs to be installed, like this: | ||
```shell | ||
$ npm install tsparticles-interaction-external-push | ||
``` | ||
or | ||
```shell | ||
$ yarn add tsparticles-interaction-external-push | ||
``` | ||
Then you need to import it in the app, like this: | ||
```javascript | ||
const { tsParticles } = require("tsparticles-engine"); | ||
const { loadExternalPushInteraction } = require("tsparticles-interaction-external-push"); | ||
loadExternalPushInteraction(tsParticles); | ||
``` | ||
or | ||
```javascript | ||
import { tsParticles } from "tsparticles-engine"; | ||
import { loadExternalPushInteraction } from "tsparticles-interaction-external-push"; | ||
loadExternalPushInteraction(tsParticles); | ||
``` |
@@ -7,3 +7,3 @@ /*! | ||
* How to use? : Check the GitHub README | ||
* v2.0.0-beta.2 | ||
* v2.0.0-beta.3 | ||
*/ | ||
@@ -10,0 +10,0 @@ (function webpackUniversalModuleDefinition(root, factory) { |
@@ -1,2 +0,2 @@ | ||
/*! tsParticles Push External Interaction v2.0.0-beta.2 by Matteo Bruni */ | ||
/*! tsParticles Push External Interaction v2.0.0-beta.3 by Matteo Bruni */ | ||
!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,(function(e){return(()=>{"use strict";var t={818:t=>{t.exports=e}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{loadExternalPushInteraction:()=>r});var e=o(818);class t extends e.ExternalInteractorBase{constructor(t){super(t),this.handleClickMode=t=>{if(t!==e.ClickMode.push)return;const r=this.container,o=r.actualOptions,n=o.interactivity.modes.push.quantity;if(n<=0)return;const i=o.interactivity.modes.push,s=(0,e.itemFromArray)([void 0,...i.groups]),a=void 0!==s?r.actualOptions.particles.groups[s]:void 0;r.particles.push(n,r.interactivity.mouse,a,s)}}isEnabled(){return!0}reset(){}interact(){}}function r(e){e.addInteractor("externalPush",(e=>new t(e)))}})(),n})()})); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
290084
68