net-art-uchicago / collaborative-artware

an experimental online drawing application by Media Art and Design students at the University of Chicago.
https://net-art-uchicago.github.io/collaborative-artware/
GNU General Public License v3.0
1 stars 16 forks source link

adding avatar generator #63

Closed jwschroeder21 closed 3 years ago

jwschroeder21 commented 3 years ago

adding all files to create avatar!! hope you like them!

nbriz commented 3 years ago

these avatars look soooooo rad!!! && the generator works great!! couple of edits && this should be good to merge:

directory structure

let's reorganize the files, place all the images into an "images" subfolder (ie. public/avatar-generator/images), u could even put the diff types in diff subfolders (ie. 'images/heads', 'images/ears', etc). this will mean u also need to edit the paths in ur code, from this:

var neckname="neck" + necknum + ".png";

to something like this:

var neckname="images/neck" + necknum + ".png";
// or
var neckname="images/necks/neck" + necknum + ".png";

also worth noting here is that there's a new way to write JavaScript strings designed for passing variables into strings, called template literals, u could rewrite ur code using those into something like:

var neckname = `images/necks/neck${necknum}.png`

(although to conform to our code style, we should be using const here instead of var)

move js code into it's own file (conform to StandardJS)

though the JS code u wrote technically works great, there are lots of "linting" errors, b/c u're breaking a lot of StandardJS coding style rules. the best way to address these would be to install a StandardJS linter plugin in ur code editor && seperate ur JS code out into it's own file (something like public/avatar-generator/main.js which u then link to in ur HTML <script src="main.js"></script>) this way the linter will identify all ur errors in the editor && u can correct them.