Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: first version of image mask plugin, needs refactoring but works
- Loading branch information
1 parent
d78892e
commit fd8a142
Showing
32 changed files
with
871 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"interactivity": { | ||
"events": { | ||
"onHover": { | ||
"enable": true, | ||
"mode": "bubble", | ||
"parallax": { | ||
"enable": false, | ||
"force": 2, | ||
"smooth": 10 | ||
} | ||
} | ||
}, | ||
"modes": { | ||
"bubble": { | ||
"distance": 40, | ||
"duration": 2, | ||
"opacity": 8, | ||
"size": 10 | ||
} | ||
} | ||
}, | ||
"particles": { | ||
"color": { | ||
"value": "#ffffff" | ||
}, | ||
"move": { | ||
"direction": "none", | ||
"distance": 5, | ||
"enable": true, | ||
"outModes": "bounce", | ||
"speed": 1 | ||
}, | ||
"number": { | ||
"value": 800 | ||
}, | ||
"opacity": { | ||
"animation": { | ||
"enable": true, | ||
"speed": 2, | ||
"sync": false | ||
}, | ||
"value": { | ||
"min": 0.05, | ||
"max": 0.4 | ||
} | ||
}, | ||
"shape": { | ||
"type": "circle" | ||
}, | ||
"size": { | ||
"value": { | ||
"min": 1, | ||
"max": 3 | ||
} | ||
} | ||
}, | ||
"image": { | ||
"enable": true, | ||
"src": "https://particles.js.org/images/amongus_cyan.png", | ||
"scale": 5 | ||
}, | ||
"background": { | ||
"color": "#000000", | ||
"image": "", | ||
"position": "50% 50%", | ||
"repeat": "no-repeat", | ||
"size": "cover" | ||
} | ||
} |
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,3 @@ | ||
dist | ||
node_modules | ||
src/pathseg.* |
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,67 @@ | ||
[![banner](https://particles.js.org/images/banner2.png)](https://particles.js.org) | ||
|
||
# tsParticles Image Mask Plugin | ||
|
||
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/tsparticles-plugin-image-mask/badge)](https://www.jsdelivr.com/package/npm/tsparticles-plugin-image-mask) | ||
[![npmjs](https://badge.fury.io/js/tsparticles-plugin-image-mask.svg)](https://www.npmjs.com/package/tsparticles-plugin-image-mask) | ||
[![npmjs](https://img.shields.io/npm/dt/tsparticles-plugin-image-mask)](https://www.npmjs.com/package/tsparticles-plugin-image-mask) [![GitHub Sponsors](https://img.shields.io/github/sponsors/matteobruni)](https://github.com/sponsors/matteobruni) | ||
|
||
[tsParticles](https://github.com/matteobruni/tsparticles) plugin for particles image mask 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.image-mask.min.js` file will export the function to load the plugin: | ||
|
||
```javascript | ||
loadImageMaskPlugin; | ||
``` | ||
|
||
### Usage | ||
|
||
Once the scripts are loaded you can set up `tsParticles` and the plugin like this: | ||
|
||
```javascript | ||
(async () => { | ||
await loadImageMaskPlugin(tsParticles); | ||
|
||
await 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-plugin-image-mask | ||
``` | ||
|
||
or | ||
|
||
```shell | ||
$ yarn add tsparticles-plugin-image-mask | ||
``` | ||
|
||
Then you need to import it in the app, like this: | ||
|
||
```javascript | ||
const { tsParticles } = require("tsparticles-engine"); | ||
const { loadImageMaskPlugin } = require("tsparticles-plugin-image-mask"); | ||
|
||
loadImageMaskPlugin(tsParticles); // awaitable | ||
``` | ||
|
||
or | ||
|
||
```javascript | ||
import { tsParticles } from "tsparticles-engine"; | ||
import { loadImageMaskPlugin } from "tsparticles-plugin-image-mask"; | ||
|
||
loadImageMaskPlugin(tsParticles); // awaitable | ||
``` |
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,81 @@ | ||
{ | ||
"name": "tsparticles-plugin-image-mask", | ||
"version": "2.2.4", | ||
"description": "tsParticles image mask plugin", | ||
"homepage": "https://particles.js.org", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/matteobruni/tsparticles.git", | ||
"directory": "plugins/imageMask" | ||
}, | ||
"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" | ||
], | ||
"publishConfig": { | ||
"directory": "dist" | ||
}, | ||
"author": "Matteo Bruni <matteo.bruni@me.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/matteobruni/tsparticles/issues" | ||
}, | ||
"main": "cjs/index.js", | ||
"jsdelivr": "tsparticles.plugin.image-mask.min.js", | ||
"unpkg": "tsparticles.plugin.image-mask.min.js", | ||
"module": "esm/index.js", | ||
"types": "types/index.d.ts", | ||
"dependencies": { | ||
"tsparticles-engine": "^2.2.4" | ||
} | ||
} |
Oops, something went wrong.