Skip to content

vvanghelue/github-like-avatar-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github-like random avatar generator

Example :

alt text

https://codesandbox.io/s/generate-random-avatar-9mqum?file=/src/index.js

npm i --save github-like-avatar-generator
import generateAvatar from "github-like-avatar-generator";

// directly get svg DOM element
let avatar = generateAvatar({
  blocks: 6, // must be multiple of two
  width: 100
});
document.querySelector("#app").appendChild(avatar.svgElement);


// or base64 fashion way
avatar = generateAvatar({
  blocks: 6, // must be multiple of two
  width: 100
});
const image = document.createElement("img");
image.src = avatar.base64;
document.querySelector("#app").appendChild(image);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published