1.3.0 • Published 5 days ago

react-glitch-image v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

React Glitch Image

Allows display images with a glitch effect

    <GlitchImage image="image.jpg"/>

Very simple!

npm.io

Parameters to get complicated (props)!

namedefaultdescription
width20Width (used in the styled in rem)
splitSize8Number of divisions
animationInterval4000Time interval to repeat animation (measured in ms)
animationDuration400I really have to describe this (measured in ms)
variations3, 5Intensity of the effect of each layer
insidefalseDefines if the effect is seen outside the container
activeFxOnIntervaltrueActivate the glitch effect in the animationInterval
activeFxOnHovertrueactivate the glitch effect on hover
useCanvastruelayers split by canvas, false to layers repeat by img position
layerColorsfalsealternate colors in layer 2, better explained below
opacity0.3layer 2 opacity
filtertrueActivate aleatory hue-rotate filter value and brightness in layer 2
brightness2Brightness filter intensity
customFilternullDeactivate the previous filter for a more personalized filter

customFilter

This property receives normal filters for css property, however, you can specify a random value for each filter. using $<number> you can indicate the maximum value that will be generated randomly.

Example 1:

  • customFilter="invert($20%)"
  • Generates a random value from 0 to 20

Example 2:

  • customFilter=invert($100%) saturate(100%) hue-rotate($200deg) brightness(2)
  • This generates random values from 0 to 100 for invert, and from 0 to 200 for hue-rotate

Note:

Every time the filter is activated using activeFxOnInterval, this again generates random values for the customFilter, each layer generate a different random

layerColors:

  • Receives an array of colors to alternate on each of the layers 2. Uses true, to set the default color array ["rgba(255,0,0,0.04)", "rgba(0,0,255,0.04)"]

  • This will create a sublayer of the color specified in layer 2, it is recommended to deactivate filter or use a customFilter to get a better and more personalized result.

  • EXAMPLE

    <GlitchImage
        image="image.jpg"
        customFilter={"invert($20%) saturate($30%)"}
        layerColors={["rgba(0,0,180,0.05)", "rgba(200,0,0,0.05)"]}
    />

npm.io

1.4.0-beta.2

5 days ago

1.4.0-beta.1

6 days ago

1.3.0

5 months ago

1.3.0-beta.0

5 months ago

1.2.3-beta.1

5 months ago

1.2.3-beta.0

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.1-beta.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.0-beta.3

2 years ago

1.1.0-beta.2

2 years ago

1.1.0-beta.1

2 years ago

1.1.0-beta.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago