-
-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added poisson disc plugin for better particles initial positions
- Loading branch information
1 parent
de1fbc2
commit 405f1df
Showing
32 changed files
with
917 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
since 2019 | ||
not dead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
extends: [ | ||
"@tsparticles/eslint-config", | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
report.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Matteo Bruni | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org) | ||
|
||
# tsParticles Poisson Disc Plugin | ||
|
||
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/@tsparticles/plugin-poisson/badge)](https://www.jsdelivr.com/package/npm/@tsparticles/plugin-poisson) | ||
[![npmjs](https://badge.fury.io/js/@tsparticles/plugin-poisson.svg)](https://www.npmjs.com/package/@tsparticles/plugin-poisson) | ||
[![npmjs](https://img.shields.io/npm/dt/@tsparticles/plugin-poisson)](https://www.npmjs.com/package/@tsparticles/plugin-poisson) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni) | ||
|
||
[tsParticles](https://github.com/tsparticles/tsparticles) plugin for particles poisson disc effect. | ||
|
||
## How to use it | ||
|
||
### CDN / Vanilla JS / jQuery | ||
|
||
The CDN/Vanilla version JS has one required file in vanilla configuration: | ||
|
||
Including the `tsparticles.plugin.poisson.min.js` file will export the function to load the plugin: | ||
|
||
```javascript | ||
loadPoissonDiscPlugin; | ||
``` | ||
|
||
### Usage | ||
|
||
Once the scripts are loaded you can set up `tsParticles` and the plugin like this: | ||
|
||
```javascript | ||
(async () => { | ||
await loadPoissonDiscPlugin(tsParticles); | ||
|
||
await tsParticles.load({ | ||
id: "tsparticles", | ||
options: { | ||
/* 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/plugin-poisson | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
$ yarn add @tsparticles/plugin-poisson | ||
``` | ||
|
||
Then you need to import it in the app, like this: | ||
|
||
```javascript | ||
const { tsParticles } = require("@tsparticles/engine"); | ||
const { loadPoissonDiscPlugin } = require("@tsparticles/plugin-poisson"); | ||
|
||
(async () => { | ||
await loadPoissonDiscPlugin(tsParticles); | ||
})(); | ||
``` | ||
|
||
or | ||
|
||
```javascript | ||
import { tsParticles } from "@tsparticles/engine"; | ||
import { loadPoissonDiscPlugin } from "@tsparticles/plugin-poisson"; | ||
|
||
(async () => { | ||
await loadPoissonDiscPlugin(tsParticles); | ||
})(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"name": "@tsparticles/plugin-poisson-disc", | ||
"version": "3.0.3", | ||
"description": "tsParticles poisson disc plugin", | ||
"homepage": "https://particles.js.org", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tsparticles/tsparticles.git", | ||
"directory": "plugins/poisson" | ||
}, | ||
"keywords": [ | ||
"front-end", | ||
"frontend", | ||
"tsparticles", | ||
"particles.js", | ||
"particlesjs", | ||
"particles", | ||
"particle", | ||
"canvas", | ||
"jsparticles", | ||
"xparticles", | ||
"particles-js", | ||
"particles-bg", | ||
"particles-bg-vue", | ||
"particles-ts", | ||
"particles.ts", | ||
"react-particles-js", | ||
"react-particles.js", | ||
"react-particles", | ||
"react", | ||
"reactjs", | ||
"vue-particles", | ||
"ngx-particles", | ||
"angular-particles", | ||
"particleground", | ||
"vue", | ||
"vuejs", | ||
"preact", | ||
"preactjs", | ||
"jquery", | ||
"angularjs", | ||
"angular", | ||
"typescript", | ||
"javascript", | ||
"animation", | ||
"web", | ||
"html5", | ||
"web-design", | ||
"webdesign", | ||
"css", | ||
"html", | ||
"css3", | ||
"animated", | ||
"background", | ||
"confetti", | ||
"canvas", | ||
"fireworks", | ||
"fireworks-js", | ||
"confetti-js", | ||
"confettijs", | ||
"fireworksjs", | ||
"canvas-confetti", | ||
"tsparticles-plugin" | ||
], | ||
"author": "Matteo Bruni <matteo.bruni@me.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/tsparticles/tsparticles/issues" | ||
}, | ||
"jsdelivr": "tsparticles.plugin.poisson.min.js", | ||
"unpkg": "tsparticles.plugin.poisson.min.js", | ||
"browser": "browser/index.js", | ||
"main": "cjs/index.js", | ||
"module": "esm/index.js", | ||
"types": "types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"types": "./types/index.d.ts", | ||
"browser": "./browser/index.js", | ||
"import": "./esm/index.js", | ||
"require": "./cjs/index.js", | ||
"umd": "./umd/index.js", | ||
"default": "./cjs/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"dependencies": { | ||
"@tsparticles/engine": "^3.0.3" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"name": "@tsparticles/plugin-poisson-disc", | ||
"version": "3.0.3", | ||
"description": "tsParticles poisson disc plugin", | ||
"homepage": "https://particles.js.org", | ||
"scripts": { | ||
"build": "tsparticles-cli build", | ||
"build:ci": "tsparticles-cli build --ci", | ||
"version": "tsparticles-cli build -d && git add package.dist.json", | ||
"prepack": "pnpm run build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tsparticles/tsparticles.git", | ||
"directory": "plugins/poisson" | ||
}, | ||
"keywords": [ | ||
"front-end", | ||
"frontend", | ||
"tsparticles", | ||
"particles.js", | ||
"particlesjs", | ||
"particles", | ||
"particle", | ||
"canvas", | ||
"jsparticles", | ||
"xparticles", | ||
"particles-js", | ||
"particles-bg", | ||
"particles-bg-vue", | ||
"particles-ts", | ||
"particles.ts", | ||
"react-particles-js", | ||
"react-particles.js", | ||
"react-particles", | ||
"react", | ||
"reactjs", | ||
"vue-particles", | ||
"ngx-particles", | ||
"angular-particles", | ||
"particleground", | ||
"vue", | ||
"vuejs", | ||
"preact", | ||
"preactjs", | ||
"jquery", | ||
"angularjs", | ||
"angular", | ||
"typescript", | ||
"javascript", | ||
"animation", | ||
"web", | ||
"html5", | ||
"web-design", | ||
"webdesign", | ||
"css", | ||
"html", | ||
"css3", | ||
"animated", | ||
"background", | ||
"confetti", | ||
"canvas", | ||
"fireworks", | ||
"fireworks-js", | ||
"confetti-js", | ||
"confettijs", | ||
"fireworksjs", | ||
"canvas-confetti", | ||
"tsparticles-plugin" | ||
], | ||
"author": "Matteo Bruni <matteo.bruni@me.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/tsparticles/tsparticles/issues" | ||
}, | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"prettier": "@tsparticles/prettier-config", | ||
"dependencies": { | ||
"@tsparticles/engine": "^3.0.3" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"directory": "dist", | ||
"linkDirectory": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { ICoordinates } from "@tsparticles/engine"; | ||
|
||
export interface IPoissonPoint { | ||
gridPosition: ICoordinates; | ||
position: ICoordinates; | ||
} |
Oops, something went wrong.