Necessitates Proper Modularity

@dicebear/avatars-male-sprites

1.0.4 • Public • Published

Male sprite sollection for DiceBear Avatars

license npm

Usage

HTTP-API (recommended)

Our free HTTP-API is the easiest way to use this sprite collection. Just use the following URL as image source.

https://avatars.dicebear.com/v2/male/:seed.svg

The value of :seed can be anything you like - but don't use any sensitive or personal data here!

CDN

You also can use this sprite collection with a CDN.

Add the following line to the end of the document body.

<script type="text/javascript" src="https://unpkg.com/@dicebear/avatars@2.0.0/dist/avatars.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/@dicebear/avatars-male-sprites@1.0.0/dist/sprites.min.js"></script>

Now you are ready to create your first Avatar.

var avatars = new Avatars(Avatars.sprites.male);
var svg = avatars.create('custom-seed');

NPM

Choose NPM if you want to use Avatars server-side or with webpack.

Install the Avatars and this sprite collection with the following command.

npm install --save @dicebear/avatars @dicebear/avatars-male-sprites

Now you are ready to create your first Avatar.

const Avatars = require('@dicebear/avatars').default;
const SpriteCollection = require('@dicebear/avatars-male-sprites').default;
 
let avatars = new Avatars(Sprites);
let svg = avatars.create('custom-seed');

Or with ES6-Modules:

import Avatars from '@dicebear/avatars';
import SpriteCollection from '@dicebear/avatars-male-sprites';
 
let avatars = new Avatars(SpriteCollection);
let svg = avatars.create('custom-seed');

Further informations

You can find the DiceBear Avatars documentation at avatars.dicebear.com


Inspired by 8biticon (Copyright 2012 Plastic Jam - MIT Licensed)

install

npm i @dicebear/avatars-male-sprites

Downloadsweekly downloads

124

version

1.0.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability