Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lokesh-coder/blobshape

Generate SVG blob shapes
https://github.com/lokesh-coder/blobshape

Last synced: 1 day ago
JSON representation

Generate SVG blob shapes

Awesome Lists containing this project

README

        



Blobs

Generate unique and fixed shape blobs for web apps

 

## Installation

```shell
npm i blobshape
```

## Usage

### Generate random blob

```js
import blobshape from "blobshape";

const { path, seedValue } = blobshape();
const svg = ``;

// seedValue - returns id string, later it can be used to get same shape
```

### Get fixed shape blob

Set `seed` value to get same fixed shape

```js
import blobshape from "blobshape";

const { path } = blobshape({ seed: "6-6-7171" });
const svg = ``;
```

### Config

`growth` - Minimum size of the blob in percentage. More the smaller more the randomness.

`edges` - Total nodes to create a shape. Increasing this value will add complexity to the shape.

`size` - SVG blob path size

```js
import blobshape from "blobshape";

const { path } = blobshape({ size: 300, growth: 6, edges: 6, seed: null });
const svg = ``;
```

## Demo

To see live action of this package check [blobs.app](https://lokesh-coder.github.io/blobs.app) and you can find the source code for that in [github repo](https://github.com/lokesh-coder/blobs.app).

## License

MIT