# react-glitch

> Glitch images. This modules is based on https://github.com/snorpey/glitch-canvas

Latest version **0.1.3** (published 2017-03-12) · 0 weekly downloads

## Install

```sh
npm install react-glitch
pnpm add react-glitch
yarn add react-glitch
bun add react-glitch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2017-03-12 |
| First published | 2017-03-10 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | chuson1996 |

## Links

- npm: https://www.npmjs.com/package/react-glitch
- Homepage: http://chuson1996.github.io/react-glitch
- npm.io page: https://npm.io/package/react-glitch

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^15.4.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [react-dom](https://npm.io/package/react-dom.md) ^15.4.2

## Recent versions

- 0.1.3 (latest) — 2017-03-12
- 0.1.2 — 2017-03-12
- 0.1.1 — 2017-03-12
- 0.1.0 — 2017-03-10

## README

# React-glitch

Glitch images. This modules is based on https://github.com/snorpey/glitch-canvas

**Note: Install glitch-canvas as it is a peer dependency of react-glitch. I can't bundle glitch-canvas into react-glitch for some problem.**

[Demo](https://chuson1996.github.io/react-glitch/)

Install: `npm install --save glitch-canvas react-glitch`

Example: 
```javascript
import ReactGlitch from 'react-glitch';
//...
// Use it like a normal <img/> tag, except that it has 3 additional required props.
<ReactGlitch
  style={{ width: 400, height: 400 }}
  src={require('./assets/codeeveryday.jpg')} // (Required)
  glitching={true} // (Required)
  glitchOptions={{ // (Required)
    seed: [0, 60], // Number or Array[Number]
    quality: 99, // Number or Array[Number]
    amount: 0, // Number or Array[Number]
    iterations: [1, 5, 10, 20] // Number or Array[Number]
  }}
  speed={[100, 1000, 1000]} // (Required)
/>
```

Props:
1. speed: Array. The time difference between each glitch will be picked randomly from the array after every glitch.

2. glitching: Boolean. If glitching is false, it will just display the original image.

3. glitchOptions: Object. Specifying the props as array will create different variations of options of the glitch.

---
_Source: https://npm.io/package/react-glitch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
