# react-scatter-graphy

> Image src based retro typography with scattering animation

Latest version **0.4.3** (published 2023-05-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-scatter-graphy
pnpm add react-scatter-graphy
yarn add react-scatter-graphy
bun add react-scatter-graphy
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2023-05-29 |
| First published | 2023-04-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 53.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Geonyeol Ryu |
| Maintainers | geonyeol_ryu |
| Keywords | typography, scattering, scattered typography, animated typography, animated image, scatterd image, image |

## Links

- npm: https://www.npmjs.com/package/react-scatter-graphy
- Repository: https://github.com/rjsduf0503/react-scatter-graphy
- Homepage: https://644d201da19496e3a4f1541a-knlbzxsouv.chromatic.com/
- Issues: https://github.com/rjsduf0503/react-scatter-graphy/issues
- npm.io page: https://npm.io/package/react-scatter-graphy

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.10.6
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.10.6

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.4.3 (latest) — 2023-05-29
- 0.4.1 — 2023-05-28
- 0.4.0 — 2023-05-16
- 0.3.8 — 2023-05-09
- 0.3.7 — 2023-05-09
- 0.3.6 — 2023-05-02
- 0.3.4 — 2023-05-01
- 0.3.3 — 2023-04-26
- 0.3.2 — 2023-04-26
- 0.3.0 — 2023-04-25
- 0.2.0 — 2023-04-25
- 0.1.2 — 2023-04-24
- 0.0.12 — 2023-04-19
- 0.0.6 — 2023-04-13
- 0.0.5 — 2023-04-13
- … 4 more at https://npm.io/package/react-scatter-graphy/versions

## README

# react-scatter-graphy

Image src based retro typography with scattering animation.

When you `hover` the mouse cursor over the `scattered pixels`, it is animated as the original image.

> You can also use react-scatter-graphy not only typography image but also normal image
>
> Currently, PNG formats are more effective than JPEG formats.

<p align="center">
  <img width='400' src="https://user-images.githubusercontent.com/34560965/234566023-9e365576-1c97-4513-9115-8f4d96134873.gif" alt="example-instagram" />
  <br />
  <br />
  <img width='600' src="https://user-images.githubusercontent.com/34560965/234566012-8ebca599-80ea-42a5-9e13-53ea92d25fe1.gif" alt="example-kakao" />
</p>

## Features

- Convert images to pixels
- Automated optimization for large number of pixels
- Automated pixel color
- Automated resize
- Supports JPEG, PNG images format

## Installing

Using npm:

```bash
$ npm install react-scatter-graphy
```

Using yarn:

```bash
$ yarn add react-scatter-graphy
```

## Example

```javascript
import { ScatterGraphy } from 'react-scatter-graphy';

function App() {
  return (
    <div style={{ width: '50%' }}>
      <ScatterGraphy
        src={yourImage}
        size={pixelSize}
        shape={pixelShape}
        duration={animationDuration}
        color={pixelColor}
        resizeDelay={delayWhenResize}
      />
    </div>
  );
}

export default App;
```

## Props

| Prop          | Type               |      Default      | Required | Description                                                                                   |
| :------------ | :----------------- | :---------------: | :------: | :-------------------------------------------------------------------------------------------- |
| `src`         | string             |                   |    ✓     | Image src.                                                                                    |
| `size`        | number             |         1         |          | Number to multiply automatically calculated pixel size. In most cases, 1 is the optimal size. |
| `shape`       | 'circle \| square' |      square       |          | Pixel shape.                                                                                  |
| `duration`    | number             |        500        |          | Pixel animation duration.                                                                     |
| `color`       | color              | Image pixel color |          | Image pixel color. The default value is set to the pixel color of the image.                  |
| `resizeDelay` | number             |        500        |          | Delay when screen resize event occurs.                                                        |

## Development

```shell
$ yarn
$ yarn storybook
```

## Cautions

If you are using `vite`, you have to remove below code in `vite.config.js`.

```js
define: {
  global: 'window',
},
```

## Maintainers

This project is maintained by Geonyeol Ryu.

- [Github](https://github.com/rjsduf0503)
- rjsduf0503@gmail.com

## License

MIT © react-scatter-graphy. See [LICENSE](./LICENSE) for details.

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