Current collected state Current
Observed since 20 Oct, 19:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
2d-canvas-image-particles
A simple lightweight 2D particle system using Canvas.
A simple lightweight 2D particle system using Canvas.
new ParticleSystem(canvas_id, image_path, options);<canvas id="js-canvas"></canvas>
<script src="dist/2d-canvas-image-particles.min.js"></script>
<script>
new ParticleSystem('js-canvas', 'images/default-particle.png', {
cursorMode: CursorMode.Zoom
});
</script>
You can check the demo page's sources for more examples. You can also use an HTMLCanvasElement instead of an id.
npm install 2d-canvas-image-particles or yarn add 2d-canvas-image-particles.
Then you can import it and use it
import '2d-canvas-image-particles';
// ...
new ParticleSystem('id', 'images/default-particle.png', {
cursorMode: CursorMode.Zoom
});
You will need to specify your own images.
{
maxParticles: number,
velocityAngle: [min, max],
speed: [min, max],
rotationStartAngle: [min, max],
cursorMode: CursorMode, // (CursorMode.Bounce, CursorMode.Zoom, CursorMode.Light, CursorMode.Follow),
rotationMode: RotationMode, // (RotationMode.None, RotationMode.Random, RotationMode.FollowVelocity)
rotationSpeed: [min, max],
rotationSpeedSizeScale: number
minimumRotationSpeed: number // if min is negative and max is positive
tints: [new Tint('#hexColor', opacity)],
width: [min, max],
height: [min, max],
addOnClickNb: number,
density: number,
cursorRadius: number
}
npm installnpm run buildDownload counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
ts-loaderEnvironment{
"local_name": "ts-loader",
"alias": false,
"peer_metadata": null
} | ^0.9.4 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^2.0.3 | development |
typingsEnvironment{
"local_name": "typings",
"alias": false,
"peer_metadata": null
} | ^1.4.0 | development |
webpackEnvironment{
"local_name": "webpack",
"alias": false,
"peer_metadata": null
} | ^1.13.2 | development |
Source distribution
{
"integrity": "sha512-86vc13+34ys9bd5blTdfCB2MPGnfKuLRSIiBklSlwEI4+6pl9UXNFcDXpPqlQqWz5vep3S2ZuobAJSeEPx8Fyw==",
"shasum": "15c31f5660bb16116e8044f989abaca6e2ad626b",
"tarball": "https://registry.npmjs.org/2d-canvas-image-particles/-/2d-canvas-image-particles-1.0.6.tgz",
"fileCount": 24,
"unpackedSize": 57554,
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQDPM32mgApKEiuQcB4fRdiVMcAqYJv4UtluBp2vm4u2lwIgf9WIfxdYAQxg3MeTMKFcwq0Z0V5sLgQIuPiIumekItE="
}
]
}Shared repository data · GitHub
Observed since 20 Oct, 19:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:afcbe09cbbcb6dffc814a2ebaffa52707122395cea837be9cd563f96c0c2b248