Current collected state Current
Observed since 20 Oct, 19:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
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.
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 19:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:c8bed5758cdf1df7b0474d964d84af42febf9024a7324a5ffb6d39f595a297dd