cd server
npm install
npm run start
Here is the simplest exemple http://localhost:3030/avatar?skin=tone1
Query args | Type | Values |
---|---|---|
eyes_style | string | undefined, "brush" |
right_accessories | string | undefined, "phone", "nabaztag", "pipe" |
hair_style | string | undefined, "long_falling", "native_coiff", "top_notch", "short_bushy","long_curly", "short_curly" |
face_decoration | string | undefined, "mustach", "beard" |
clothes | string | undefined, "dress_decoltee", "native_tunique", "wooly_jumper", "suit", "gentle_dress", "gentle_jumper" |
eyes | string | undefined, "dark", "brown", "green", "blue" |
skin | string | undefined, "tone1", "tone2", "tone3", "tone4" |
Those values are defined by the layers names contained in the /server/public/images/avatarComposition.svg file. This file must be edited with Inkscape. Each layer correspond to a 'feature'. Each nested layer correspond to a 'version' of that feature.
Eg: You will find a layer named 'eyes' that groups nested layers "dark", "brown", "green", "blue".
A more complete example http://localhost:3030/avatar?skin=tone1&eyes=dark&clothes=native_tunique&face_decoration=mustach&hair_style=native_coiff
For extending the possibilities, you need to:
- Open server/public/images/avatarComposition.svg with Inkscape.
- Add a new layer : . A top-level layer will represent a new feature . A layer nested under a top-level layer will represent a new version of the feature.
- Rename the layer with a plain text identifier (must be unique across all the layers).
- Draw the additionnal version.
If you add a ne feature, then open /server/routes/avatar.js and add an entry in the features
array declaration that check the query parameter for using the plain text identifier to set a version (string value or undefined).
cd client
npm install