1.0.10 • Published 5 years ago
floaty_bg v1.0.10
Floaty
A floating particle background pacakge made with PIXI.js.
Installation
npm install floaty_bg
Issues and suggestions
In case you notice any issues or have an idea how to make the library better feel free to open an issue on gitlab and describe the bug or suggestion in detail.
If you wish you're welcome to contribute to the project and open a merge/pull request. :)
Usage
import {init} from 'floatybg';
init('.cover', {
backgroundColor: 0xFFFFFF,
element: {
maxCount: 50,
color: 0x202B33,
},
spawnSpeed: 0.97,
rotationSpeed: { max: 0.05, min: 0.01 },
radius: { max: 10, min: 1 },
speed: { max: 2, min: 0.5 },
dimensions: {
width: { max: 20, min: 5 },
height: { max: 20, min: 5 }
},
blur: { probability: 0.5, max: 5, min: 1 },
shapes: ['rectangle', 'circle']
});
Options
options = {
backgroundColor: hex,
element: {
maxCount: int,
color: hex,
},
spawnSpeed: float,
rotationSpeed: {
max: float,
min: float
},
speed: {
max: float,
min: float
},
radius: {
max: int,
min: int
},
dimensions: {
width: {
max: int,
min: int
},
height: {
max: int,
min: int
}
},
blur: {
probability: float from 0 to 1,
max: int,
min: int
}
}