Particle Image

Visually appealing particle animation applied to images as seen on NuxtLabs.com

API

Prop NameTypeDefaultDescription
imageSrcstringnullSource URL for the image to which the particle effect is applied.
classstringnullAdditional CSS classes to apply to the image element.
canvasWidthstringnullWidth of the particle effect canvas.
canvasHeightstringnullHeight of the particle effect canvas.
gravitystringnullGravity force affecting the particle movement.
particleSizestringnullSize of the particles.
particleGapstringnullGap between particles.
mouseForcestringnullForce applied to particles based on mouse movement.
renderer"default" | "webgl"nullThe renderer to use for particle generation, either default or WebGL.
colorstring#FFFHexadecimal color code used for particles. Supports 3 or 6 character hex codes.
colorArrnumber[]nullArray of numbers to define multiple particle colors.
initPosition"random" | "top" | "left" | "bottom" | "right" | "misplaced" | "none"randomInitial position of the particles when the animation starts.
initDirection"random" | "top" | "left" | "bottom" | "right" | "none"randomInitial direction of the particles when the animation starts.
fadePosition"explode" | "top" | "left" | "bottom" | "right" | "random" | "none"nonePosition where the particles fade out.
fadeDirection"random" | "top" | "left" | "bottom" | "right" | "none"noneDirection in which the particles fade out.
noisenumbernullNoise of the particles.
responsiveWidthbooleanfalseShould the canvas be responsive.

Component Code

You can copy and paste the following code to create these components:

ParticleImage.vue
inspiraImageParticles.js
inspiraImageParticles.d.ts

Credits