Pixel-Art Avatar Generator In JavaScript

Avatars is a JavaScript library to dynamically generate Github-like, SVG based pixel-art avatars for both browser and node.js environment.

How to use it:

Install the Avatars with NPM.

## NPM
$ npm install @dicebear/avatars --save

Install a sprite collection of your choice.

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

## female
$ npm install @dicebear/avatars-female-sprites --save

## identicon
$ npm install @dicebear/avatars-identicon-sprites --save

## initials
$ npm install @dicebear/avatars-initials-sprites --save

## bottts
$ npm install @dicebear/avatars-bottts-sprites --save

## gridy
$ npm install @dicebear/avatars-gridy-sprites --save

## avataaars
$ npm install @dicebear/avatars-avataaars-sprites --save

## jdenticon
$ npm install @dicebear/avatars-jdenticon-sprites --save

Import Avatars and a sprite collection of your choice.

import Avatars from '@dicebear/avatars';
import SpriteCollection from '@dicebear/avatars-male-sprites';

let avatars = new Avatars(SpriteCollection);
let svg = avatars.create('custom-seed');

Generate an avatar.

let options = {};
let avatars = new Avatars(sprites(options));
let svg = avatars.create('custom-seed');

male-sprites & female-sprites options.

male female sprites

let options = {
    mood: ['happy', 'sad', 'surprised']
};

identicon-sprites options.

avatars-identicon-sprites

let options = {

    // Distance to the edge of the image
    padding: 0,

    // Background color
    background: #FFF 

};

bottts-sprites options.

avatars-bottts-sprites

let options = {

    // Possible values: amber, blue, blueGrey, brown, cyan, deepOrange, deepPurple, agreenmber, grey, indigo, lightBlue, lightGreen, lime, orange, pink, purple, red, teal, yellow
    colors: [], 

    // Possible values: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900
    primaryColorLevel: 600,

    // Possible values: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900
    secondaryColorLevel: 400,

    // in percent
    colorful: 100,
    mouthChance: 100,
    sidesChance: 100,
    textureChance: 50,
    topChange: 100,

};

avataaars-sprites options.

avatars-avataaars-sprites

let options = {

    // transparent, circle
    style: 'transparent' 

    // include or exclude passed options.
    mode: 'include',

    // Possible values: longHair, shortHair, eyepatch, hat, hijab, turban
    top: [],

    // in percent
    topChance: 100,

    // Possible values: black, blue, gray, heather, pastel, pink, red, white
    hatColor: [],

    // Possible values: auburn, black, blonde, brown, pastel, platinum, red, gray
    hairColor: [],

    // Possible values: kurt, prescription01, prescription02, round, sunglasses, wayfarers
    accessories: [],

    // in percent
    accessoriesChance: 10,

    // Possible values: medium, light, magestic, fancy, magnum
    facialHair: null,

    // in percent
    facialHairChance: 10,

    // Possible values: auburn, black, blonde, brown, platinum, red
    facialHairColor: [],

    // Possible values: blazer, sweater, shirt, hoodie, overall
    clothes: [],

    // Possible values: black, blue, gray, heather, pastel, pink, red, white
    clothesColor: [],

    // Possible values: close, cry, default, dizzy, roll, happy, hearts, side, squint, surprised, wink, winkWacky
    eyes: [],

    // Possible values: angry, default, flat, raised, sad, unibrow, up
    eyebrow: [],

    // Possible values: concerned, default, disbelief, eating, grimace, sad, scream, serious, smile, tongue, twinkle, vomit
    mouth: [],

    Possible values: tanned, yellow, pale, light, brown, darkBrown, black
    skin: []

};

jdenticon-sprites options.

jdenticon-sprites

let options = {

    // an array of numbers between 0 and 360
    hue: [],

    // Distance to the edge of the image
    padding: 0,

    // an array of numbers between 0 and 1
    colorLightness: [],

    // an array of numbers between 0 and 1
    grayscaleLightness: [],

    // an array of numbers between 0 and 1
    colorSaturation: [],

    // an array of numbers between 0 and 1
    grayscaleSaturation: [],

    // Any valid color identifier
    background: null  

};

gridy-sprites options.

gridy-sprites

let options = {

    // Use different colors for eyes and mouth
    colorful: false 

};

initials-sprites options.

initials-sprites

let options = {

    // amber, blue, blueGrey, brown, cyan, deepOrange, deepPurple, agreenmber, grey, indigo, lightBlue, lightGreen, lime, orange, pink, purple, red, teal, yellow
    backgroundColors: [],

    // background color
    // Possible values: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900
    backgroundColorLevel: 600,

    // font size
    // Number between 1 and 100
    fontSize: 50,

    // Number between 0 and 2
    chars: 2,

    // bold?
    bold: false

};

Changelog:

v4.3.0 (11/07/2020)

  • Fixed: Text position was wrong in @dicebear/avatars-initials-sprites when a font size was specified.
  • Code sprites are no longer supported. Too CPU intensive for the HTTP API and does not fit into the future vision of the next major release. Use qr-image directly instead.

v4.2.4/5 (07/23/2020)

  • Fixed Types for array options in avatars-avataaars-sprites

v4.2.2/3 (07/22/2020)

  • bugfix

v4.2.1 (06/21/2020)

  • updated package

v4.2.0 (05/26/2020)

  • Update seedrandom package

v4.1.1 (05/14/2020)

  • Update

v4.1.0 (05/09/2020)

  • Added Aliases for width, height, radius, background and margin, to keep the URLs of the HTTP API shorter
  • Added deterministic for gridy avatars
  • Changed Parameter key for the HTTP API flattened. It is now no longer necessary to nest the values in an options object
  • Update topChange to topChance, clarify some documentation
  • Configurator now always generates the smallest possible HTTP-API URL.
  • Reorganized dependencies in the repository.
  • Stackpath CDN configured for HTTP API. Saves 90% traffic to Cloudflare Workers and therefore also unnecessary costs. Unfortunately makes the initial call a bit slower.
  • Fixed: initial avatars were displayed incorrectly in Firefox. Same solution implemented for all browsers.
  • Fixed: Value 0 did not work for chance options in bottts.

04/09/2020

  • v4.0.8

03/22/2020

  • v4.0.5

03/06/2020

  • v4.0.3

08/02/2019

  • avatar packages updated

06/25/2019

  • v3.2.0

06/22/2019

  • Add: identicon color & gravatar options

05/22/2019

  • 3.0.7

v2.0.4 (11/06/2018)

  • Fix: Color modification

Download Details:

Author: DiceBear

Demo: https://avatars.dicebear.com/

Source Code: https://github.com/DiceBear/avatars

#javascript

What is GEEK

Buddha Community

Pixel-Art Avatar Generator In JavaScript
anita maity

anita maity

1619614811

Random Password Generator Using JavaScript, HTML & CSS

Random Password Generator is a program that automatically generates a password randomly. Those generated passwords are mix with numbers, alphabets, symbols, and punctuations. This type of program helps the user to create a strong password.

Step By Step Tutorial :https://cutt.ly/ZbiDeyL

#password generator #random password generator #python password generator #random password generator javascript #html #javascript

Vincent Lab

Vincent Lab

1605177756

JavaScript Password Generator

In this video, I will be showing you how to build a password generator in JavaScript.

#password generator #random password generator #password #javascript #javascript project #javascript fun project

Vincent Lab

Vincent Lab

1605099909

JavaScript Password Generator - Part 2

In this video, I will be showing you how to build a password generator in JavaScript

#password generator #random password generator #javascript #js #javascript fun project #javascript project

Rahul Jangid

1622207074

What is JavaScript - Stackfindover - Blog

Who invented JavaScript, how it works, as we have given information about Programming language in our previous article ( What is PHP ), but today we will talk about what is JavaScript, why JavaScript is used The Answers to all such questions and much other information about JavaScript, you are going to get here today. Hope this information will work for you.

Who invented JavaScript?

JavaScript language was invented by Brendan Eich in 1995. JavaScript is inspired by Java Programming Language. The first name of JavaScript was Mocha which was named by Marc Andreessen, Marc Andreessen is the founder of Netscape and in the same year Mocha was renamed LiveScript, and later in December 1995, it was renamed JavaScript which is still in trend.

What is JavaScript?

JavaScript is a client-side scripting language used with HTML (Hypertext Markup Language). JavaScript is an Interpreted / Oriented language called JS in programming language JavaScript code can be run on any normal web browser. To run the code of JavaScript, we have to enable JavaScript of Web Browser. But some web browsers already have JavaScript enabled.

Today almost all websites are using it as web technology, mind is that there is maximum scope in JavaScript in the coming time, so if you want to become a programmer, then you can be very beneficial to learn JavaScript.

JavaScript Hello World Program

In JavaScript, ‘document.write‘ is used to represent a string on a browser.

<script type="text/javascript">
	document.write("Hello World!");
</script>

How to comment JavaScript code?

  • For single line comment in JavaScript we have to use // (double slashes)
  • For multiple line comments we have to use / * – – * /
<script type="text/javascript">

//single line comment

/* document.write("Hello"); */

</script>

Advantages and Disadvantages of JavaScript

#javascript #javascript code #javascript hello world #what is javascript #who invented javascript

Hire Dedicated JavaScript Developers -Hire JavaScript Developers

It is said that a digital resource a business has must be interactive in nature, so the website or the business app should be interactive. How do you make the app interactive? With the use of JavaScript.

Does your business need an interactive website or app?

Hire Dedicated JavaScript Developer from WebClues Infotech as the developer we offer is highly skilled and expert in what they do. Our developers are collaborative in nature and work with complete transparency with the customers.

The technology used to develop the overall app by the developers from WebClues Infotech is at par with the latest available technology.

Get your business app with JavaScript

For more inquiry click here https://bit.ly/31eZyDZ

Book Free Interview: https://bit.ly/3dDShFg

#hire dedicated javascript developers #hire javascript developers #top javascript developers for hire #hire javascript developer #hire a freelancer for javascript developer #hire the best javascript developers