0.1.6 • Published 3 years ago

react-liquid-image v0.1.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

react-liquid-image

An aesthetic component that turns an image into a particlized version with an interactive liquid effect on mouseOver. Inspired and adapted from the homepage of https://frontendexpert.io/.

Supports customization such as

  1. Particle size
  2. Particle gap
  3. Particle shape (square, circle)
  4. Noise (particle resting movement)
  5. Push magnitude (on mouseOver)

Usage

  1. npm install react-liquid-image
  2. import { LiquidImage } from react-liquid-image
  3. use with <LiquidImage /> in your React app

Demo

Coming soon

Props

Prop NameDescriptionTypeDefault
imgImage sourcestringnull
widthWidth of resulting particlized image that is drawnNumber500
heightWidth of resulting particlized image that is drawnNumber300
canvasWidthWidth of the canvas to draw the particlized image onNumber800
canvasHeightWidth of the canvas to draw the particlized image onNumber400
noiseHow much each particle jiggles when resting (set to 0 for stationary particles at rest)Number0.8
gapGap between each particleNumber5
particleTypeShape of each particle"square" \| "circle""square"
particleSizeSize of each particleNumber3
thresholdRGB values of pixels to not consider when particlizing the image. 0 will include all pixels, 256 will exclude all pixelsNumber60
pushAmount that each particle is pushed aside on mouseOverNumber1/60

FAQ

Q. My image is very slow

A: Reduce the number of particles being rendered on the canvas. This can be done through some combination of increasing threshold, gap, particleSize, or decreasing width, height

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago