HB0N0 / AvataaarsJs

A vanilla javascript library to generate Avataaars on the client or server side!
MIT License
41 stars 11 forks source link

Question: Changing Avatar #1

Closed oleteacher closed 3 years ago

oleteacher commented 3 years ago

Really like what you got going here:)

I can see kids in classroom loving this. How can I change the default avatar person?

Just can't seem to grasp that...

Thanks!

HB0N0 commented 3 years ago

If you want to change the default avatar appearance simply modify the defaultOptions parameter of the Avataaars object. The defaultOptions can contain every option availible also in the avatars.create() method.

// Run this prior to creating your first avatar
Avataaars.defaultOptions = {
    style: 'circle',
    eyes: 'happy',
    mouth: 'smile',
    /*  ...  */
};

Alternatively you could also modify the defaultOptions object directly in the library (line 2) which may be easier for educational purposes if you want to hand this library out to your students and keep the usage simple.

Let me know if I could help you 😃

oleteacher commented 3 years ago

Sometime one cannot see the forest because the trees are blocking their view :)

I was thinking there were different background avatar models (male, female, etc.) when in fact there are only accessories and expressions.

Working great, thank you!