1.0.4 • Published 6 years ago

ucavatar v1.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Ucavatar.js

version-badge npm-downloads license-badge

Unique avatars for your users. No dependencies. 1.6KB gzipped.

Preview of Ucavatar

Installation

From NPM

npm install --save ucavatar
var Ucavatar = require('ucavatar');

Or you can copy it into your project and use a script tag

<script src='ucavatar.js'></script>

Also you can use CDN:

<script src='https://unpkg.com/ucavatar/ucavatar.js'></script>

Examples

At first, you need a canvas:

<canvas id='avatar'></canvas>

You can generate an avatar with the following code:

Ucavatar('#avatar', 'name, nickname or email')

Or pass canvas itself:

Ucavatar(document.querySelector('#avatar'), 'name')

By default size of an avatar is 64x64, but you can specify a custom one:

Ucavatar('#avatar', 'name', 128)

Enjoy it!

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago