# water-animation-2d

> 2D animation of water with canvas

Latest version **0.3.3** (published 2022-12-25) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install water-animation-2d
pnpm add water-animation-2d
yarn add water-animation-2d
bun add water-animation-2d
```

## 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.3.3 |
| Published | 2022-12-25 |
| First published | 2021-10-17 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 79.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vladislav Nikolaev |
| Maintainers | vladisnotlove |
| Keywords | 2d, animation, water-animation, water-animation-2d, canvas |

## Links

- npm: https://www.npmjs.com/package/water-animation-2d
- Repository: https://github.com/vladisnotlove/water-animation-2d
- Homepage: https://github.com/vladisnotlove/water-animation-2d#readme
- Issues: https://github.com/vladisnotlove/water-animation-2d/issues
- npm.io page: https://npm.io/package/water-animation-2d

## 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.3.3 (latest) — 2022-12-25
- 0.3.2 — 2022-02-11
- 0.3.1 — 2022-02-08
- 0.3.0 — 2022-02-08
- 0.2.2 — 2021-12-20
- 0.2.1 — 2021-12-19
- 0.2.0 — 2021-12-19
- 0.1.5 — 2021-12-19
- 0.1.4 — 2021-11-17
- 0.1.3 — 2021-11-17
- 0.1.2 — 2021-10-17
- 0.1.1 — 2021-10-17
- 0.1.0 — 2021-10-17

## README

# water-animation-2d

Library for adding simple 2d water animation by a canvas

<img src="https://drive.google.com/uc?export=view&id=1OymyLfbJfDvWJoJjXwOTxC6Wy31ITlS_">

## Install

```console
npm i water-animation-2d
```

## How to use

1. Add canvas on html

```html
<DOCTYPE html />
<html>
    ...
    <canvas id="canvas" width="200px" height="200px">
    </canvas>
    ...
</html>
```

2. Create waterAnimation2d

```js
const canvas = document.getElementById("canvas");
const waterAnim = new WaterAnimation2d(canvas);
```

3. Run animation

```js
waterAnim.run();
```

4. Apply force

```js
const canvasRect = canvas.getBoundingClientRect();

// applying force downward into the center
const forceId = waterAnim.applyForce(canvasRect.width * 0.5, {
  x: 0,
  y: 500
});
```

5. Cancel force

```js
setTimeout(() => {
  waterAnim.cancelForce(forceId)
}, 200)
```

## Example projects

<a href="https://github.com/vladisnotlove/water-animation-2d-example">
water-animation-2d-example
</a>

## Author

Vladislav Nikolaev, *react frontend developer*

vladisnotlove@gmail.com<br/>
<a href="https://t.me/vladisnotlove">telegram</a> |
<a href="https://gitlab.com/vladisnotlove">gitlab</a> |
<a href="https://github.com/vladisnotlove">github</a>

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