1834,6,154,17,533,26,201,32,235,40,782,40,315,40,315,36,1029,24,213,22,107,20,543,20,281,22,336,28,808,25,1256,24,615,27,397,24,142,26,268,22,3718,22,6543,22,3166,38,1994,36,2830,26,1051,27,1741,22,3525,22,3925,22,4123,36,1755,34,2503,27,625,27,1695,27,1846,27,1774,27,1727,27,1821,27,1281,27,1957,27,688,28,884,8,147,35,655,47,431,54,270,33,3850,20,110,30,433,30,313,32,654,33,654,32,401,28,522,28,504,32,433,32,275,32,766,33,741,32,504,29,309,29,717,30,424,30,629,30,165,30,840,30,470,29,247,29,68,33,504,22,412,25,1741,21,5381,21,882,27,655,27,624,27,611,27,840,27,1659,27,1700,25,474,25,615,29,1697,29,1111,29,3021,29,2908,25,2703,25,2795,25,1999,25,2337,25,2456,25,1667,29,576,29,988,29,380,27,380,29,2965,29,3119,29,3673,29,2219,29,2172,29,3255,29,6100,29,3119,29,2826,29,3567,26,1283,31,1724,26,860,31,718,26,789,31,759,26,1348,31,4882,26,4939,31,726,26,2080,31,839,26,791,26,2655,26,1016,26,2192,31,1256,26,1004,26,1150,26,2094,31,2951,26,1208,26,1836,26,2807,27,3221,27,1081,27,2952,27,627,27,507,27,696,27,751,27,731,27,2445,27,923,27,1001,27,1767,27,1032,24,3391,28,1311,30,654,30,1516,31,692,30,654,28,569,34,654,36,494,30,654,28,1164,32,1109,24,252,27,299,23,3237,23,622,27,374,27,1533,27,1655,27,1798,27,1652,27,1321,27,858,27,477,27,473,27,477,27,448,27,1256,27,392,27,1134,27,1193,27,448,28,880,28,779,28,845,28,1393,28,813,28,1033,28,716,28,1073,28,3613,28,1239,28,1137,28,685,28,1088,28,1066,28,1420,28,771,28,1115,28,817,28,1842,28,1390,28,945,28,1419,28,1335,27,1274,27,1004,27,1776,27,38502,32,1228,32,773,32,935,32,371,32,547,27,846,27,1453,27,668,27,1216,27,550,27,946,27,407,27,650,27,1430,27,648,27,761,27,646,27,541,29,5038,29,2658,29,2831,29,2680,29,5587,29,1894,29,2790,29,2742,29,8643,29,2564,29,3278,29,1476,29,3170,29,1536,29,1686,29,1692,29,1241,29,2540,29,3127,29,2370,29,1287,29,3102,29,6173,27,2790 _info {"project":"lsg-avatar","branch":"master","version":71,"versionDate":"2024-05-23T08:08:36.000Z","fromVersion":0,"reset":true,"checksumDocs":"242-405406"} avatar/avatar.ls (function(){ return { toLSG: include('toLSG/toLSG'), toLS: include('toLS/toLS'), toJS: include('toJS/toJS'), toIMG: include('toIMG/toIMG'), validate: include('validate/validate'), random: include('random/random'), definition: include('definition/definition'), 'default': include('default/default'), getOptionColor: include('getOptionColor/getOptionColor'), getOptionSvg: include('getOptionSvg/getOptionSvg'), getOptionLabel: include('getOptionLabel/getOptionLabel'), getCategorySvg: include('getCategorySvg/getCategorySvg') }; })(); avatar/default/default.ls (function(){ return function(set){ var def; def = include("/sets/" + set + "/default"); if (!def) { return console.error("lsg-avatar default: could not find '" + set + "' set"); } return def; }; })(); avatar/definition/definition.ls (function(){ return function(set){ var definition; definition = include("/sets/" + set + "/definition"); if (!definition) { return console.error("lsg-avatar definition: could not find '" + set + "' set"); } return definition; }; })(); avatar/getCategorySvg/getCategorySvg.ls (function(){ return function(o, cat){ var set, def, category, svg, colors, opt, ref$, id, color; set = o.set; def = include("/sets/" + o.set + "/definition"); if (!def) { return console.info("lsg-avatar getCategorySvg: no set '" + set + "'"); } if (!def[o.set].categories[cat]) { return console.info("lsg-avatar getCategorySvg: no cat '" + cat + "'"); } category = def[o.set].categories[cat]; svg = null; colors = null; for (opt in ref$ = o[cat]) { id = ref$[opt]; color = Avatar.getOptionColor(set, cat, opt, id); if (color) { if (!colors) { colors = []; } colors.push(color); } } for (opt in ref$ = o[cat]) { id = ref$[opt]; if (Avatar.getOptionSvg(set, cat, opt, id, colors)) { svg = Avatar.getOptionSvg(set, cat, opt, id, colors); } } if (!svg) {} else { return svg; } }; })(); avatar/getOptionColor/getOptionColor.ls (function(){ return function(set, cat, opt, id){ var def, ref$; def = include("/sets/" + set + "/definition"); if (!def) { return console.info("lsg-avatar getOptionColor: no set '" + set + "'"); } return (ref$ = _.find(def[set].categories[cat].options[opt].ids, { id: id })) != null ? ref$.color : void 8; }; })(); avatar/getOptionLabel/getOptionLabel.ls (function(){ return function(set, cat, opt, id){ var def, ref$; def = include("/sets/" + set + "/definition"); if (!def) { return console.info("lsg-avatar getOptionLabel: no set '" + set + "'"); } return (ref$ = _.find(def[set].categories[cat].options[opt].ids, { id: id })) != null ? ref$.label : void 8; }; })(); avatar/getOptionSvg/getOptionSvg.ls (function(){ return function(set, cat, opt, id, colors){ var def, ref$, svg, $svg, i$, len$, i, color, div; def = include("/sets/" + set + "/definition"); if (!def) { return console.info("lsg-avatar getOptionSvg: no set '" + set + "'"); } colors = colors || [Color.black, Color.grey[500]]; if (!_.isArray(colors)) { colors = [colors]; } id = _.find((ref$ = def[set].categories[cat].options[opt]) != null ? ref$.ids : void 8, { id: id }); if (!(id.svg || id.front || id.back)) { return null; } if (id.back) { svg = include("/sets/" + set + "/svg/" + id.back.svg + ".svg"); } else if (id.front) { svg = include("/sets/" + set + "/svg/" + id.front.svg + ".svg"); } else { svg = include("/sets/" + set + "/svg/" + id.svg + ".svg"); } $svg = $(svg); $svg.css({ width: '100%', height: '100%' }); if (colors != null && colors.length) { for (i$ = 0, len$ = colors.length; i$ < len$; ++i$) { i = i$; color = colors[i$]; id = "#color" + (i + 1); $svg.find(id).attr({ fill: color }); } } div = $('
').append($svg); return div; }; })(); avatar/random/random.ls (function(){ return function(set){ var random; random = include("/sets/" + set + "/random")(); if (!random) { return console.error("lsg-avatar random: could not find '" + set + "' set"); } return random; }; })(); avatar/toIMG/toIMG.ls (function(){ return function(avatar){ return include("/lib/util/avatarWithCache/avatar")(avatar); }; })(); avatar/toJS/toJS.ls (function(){ return function(string){ var error, js; try { string = Livescript.compile(string, { bare: true }).replace('// Generated by LiveScript 1.4.0\n', ''); } catch (e$) { error = e$; setTimeout(function(){ return helpers.errorHandler(error, '/../lsg-avatar/avatar/toJS/toJS/'); }); } try { js = eval(string); } catch (e$) { error = e$; setTimeout(function(){ return helpers.errorHandler(error, '/../lsg-avatar/avatar/toJS/toJS/'); }); } if (!js) { return; } if (!_.isArray(js.objects)) { js.objects = [js.objects]; } return js; }; })(); avatar/toLS/toLS.ls (function(){ return function(o){ var errors, ls, k, v, k2, v2; errors = []; ls = ''; for (k in o) { v = o[k]; if (_.isString(v)) { ls += k + ": '" + v + "'\n"; } else { ls += k + ": "; for (k2 in v) { v2 = v[k2]; ls += k2 + ": '" + v2 + "' "; } ls += '\n'; } } return ls; }; })(); avatar/toLSG/toLSG.ls (function(){ return function(avatar){ var set, parser, lsg; set = avatar.set; parser = set === 'human' ? include("/sets/human/parser") : set === 'monster' ? include("/sets/monster/parser") : void 8; if (!parser) { return console.error("lsg-avatar parser: could not find '" + set + "' set"); } lsg = parser(avatar); return lsg; }; })(); avatar/validate/validate.ls (function(){ return function(o){ var set, def, d, o2, errors, catId, ref$, cat, optId, ref1$, opt, id, ref2$; o = o || {}; set = o.set || "human"; def = include("/sets/" + set + "/definition"); if (!def) { return console.info("lsg-avatar validate: no def '" + set + "'"); } d = include("/sets/" + set + "/default"); o2 = { set: set }; errors = []; for (catId in ref$ = def[set].categories) { cat = ref$[catId]; o2[catId] = {}; for (optId in ref1$ = cat.options) { opt = ref1$[optId]; id = _.find(opt.ids, { id: (ref2$ = o[catId]) != null ? ref2$[optId] : void 8 }); if (!id) { errors.push(catId + "/" + optId); id = _.find(opt.ids, { id: d[catId][optId] }); } o2[catId][optId] = id.id; } } if (_.isEqual(o, o2)) { return { avatar: o }; } else { return { error: true, errors: errors, avatar: o2 }; } }; })(); avatarTalk/avatarTalk.ls (function(){ return function(o){ var ref$, ref1$, interval, active, update, reset, setSize, stop, start, toggle, div, mouth; o = o || {}; o.size = o.size || "2.5em"; o.type = (ref$ = o.type) === "m1" || ref$ === "m2" || ref$ === "m3" || ref$ === "f1" || ref$ === "f2" || ref$ === "f3" ? o.type : ((ref$ = o.type) != null ? ref$.indexOf("m") : void 8) === 0 ? "m2" : ((ref1$ = o.type) != null ? ref1$.indexOf("f") : void 8) === 0 ? "f1" : "m1"; interval = null; active = false; update = include("update/update")(o); reset = function(){ return update(null, null, 0); }; setSize = function(s){ o.size = s; return div.css({ width: o.size, height: o.size }); }; stop = function(){ active = false; clearInterval(interval); return reset(); }; start = function(){ active = true; clearInterval(interval); return interval = setInterval(update, 100); }; toggle = function(){ active = !active; if (active) { return start(); } else { return stop(); } }; div = Div().addClass("avatar avatarTalk").css({ width: o.size, height: o.size }).append(include("face/face")(o), include("eyes/eyes")(o), mouth = include("mouth/mouth")(o)); div.update = update; div.reset = reset; div.setSize = setSize; div.start = start; div.stop = stop; div.toggle = toggle; return div; }; })(); avatarTalk/eyes/eyes.ls (function(){ return function(o){ var svg, last, getDuration, duration, blink; svg = null; last = new Date(); getDuration = function(){ return Math.round(Math.random() * 10000 + 2000); }; duration = getDuration(); blink = function(){ return requestAnimationFrame(function(){ var t; if (!svg.isVisible()) { return; } t = new Date(); if (t - last > duration) { last = t; duration = getDuration(); svg.replaceWith(svg = include("svg/svg")(o, true)); setTimeout(function(){ return svg.replaceWith(svg = include("svg/svg")(o)); }, 100); } return blink(); }); }; svg = include("svg/svg")(o); blink(); return svg; }; })(); avatarTalk/eyes/svg/svg.ls (function(){ return function(o, closed){ return SvgIcon({ svg: o.gender === "f" && closed ? path("/avatarTalk/svg/female-eyes-closed.svg") : o.gender === "f" ? path("/avatarTalk/svg/female-eyes-open.svg") : closed ? path("/avatarTalk/svg/male-eyes-closed.svg") : path("/avatarTalk/svg/male-eyes-open.svg"), width: "100%", height: "100%" }).css({ position: "absolute", top: 0, left: 0 }); }; })(); avatarTalk/face/face.ls (function(){ return function(o){ return SvgIcon({ svg: path("/avatarTalk/svg/" + o.type + ".svg"), width: "100%", height: "100%" }); }; })(); avatarTalk/mouth/mouth.ls (function(){ return function(o){ o.currentMouth = o.currentMouth || "x"; o.mouthSvg = SvgIcon({ svg: path("/avatarTalk/svg/mouth-" + o.currentMouth + ".svg"), width: "100%", height: "100%" }).css({ position: "absolute", top: 0, left: 0 }); return o.mouthSvg; }; })(); avatarTalk/svg/f1.svg avatarTalk/svg/f2.svg avatarTalk/svg/f3.svg avatarTalk/svg/female-eyes-closed.svg avatarTalk/svg/female-eyes-open.svg avatarTalk/svg/hair-o.svg avatarTalk/svg/headset.svg avatarTalk/svg/m1.svg avatarTalk/svg/m2.svg avatarTalk/svg/m3.svg avatarTalk/svg/male-eyes-closed.svg avatarTalk/svg/male-eyes-open.svg avatarTalk/svg/mouth-a.svg avatarTalk/svg/mouth-b.svg avatarTalk/svg/mouth-c.svg avatarTalk/svg/mouth-d.svg avatarTalk/svg/mouth-e.svg avatarTalk/svg/mouth-f.svg avatarTalk/svg/mouth-g.svg avatarTalk/svg/mouth-h.svg avatarTalk/svg/mouth-x.svg avatarTalk/update/update.ls (function(){ return function(o){ var mouths, setMouth, getDuration, lastFrameAt, frameDuration, update; mouths = ["x", "a", "b", "c", "d", "e", "f", "g", "h"]; setMouth = function(mouth){ var nextMouth; nextMouth = mouth || _.sample(mouths); if (nextMouth !== o.currentMouth) { o.currentMouth = nextMouth; return o.mouthSvg.replaceWith(o.mouthSvg = include("../mouth/mouth")(o)); } }; getDuration = function(){ return Math.round(Math.random() * 50 + 50); }; lastFrameAt = null; frameDuration = getDuration(); update = function(p, d, a){ var talking, t; talking = p != null && d != null && p === d ? false : a == null || (a != null ? a.vol : void 8) > 0.7 ? true : void 8; t = new Date(); if (!talking) { return setMouth("x"); } else if (!lastFrameAt || t - lastFrameAt > frameDuration) { frameDuration = getDuration(); lastFrameAt = t; return setMouth(); } }; return update; }; })(); init.ls (function(){ return function(){ if (typeof Avatar == 'undefined' || Avatar === null) { return window.Avatar = include('avatar/avatar'); } }; })(); lib/util/avatarWithCache/avatar.ls (function(){ var cached, timeout; cached = {}; timeout = undefined; return function(avatar){ var cacheId, src, noCache, lsg, svg, image; cacheId = include("/lib/util/md5/md5")(JSON.stringify(avatar)); src = cached[cacheId]; if (!src) { noCache = true; lsg = include("/avatar/toLSG/toLSG")(avatar); svg = LSG2.toSVG(lsg).outerHTML; src = include("convertToImageSrc/convert")(svg); cached[cacheId] = src; } image = document.createElement("img").addClass("avatar").attr({ src: src }).css({ display: "inline-block", width: "2.5em", height: "2.5em" }); requestAnimationFrame(function(){ return include("cleanupCache/cache")(cached); }); return image; }; })(); lib/util/avatarWithCache/cleanupCache/cache.ls (function(){ var timeout; timeout = undefined; return function(cached){ var max, delay, onTimeout; max = 200; delay = 2000; onTimeout = function(){ var i, x, n, results$ = []; timeout = undefined; i = 0; x = _.keys(cached).length - max; for (n in cached) { i++; delete cached[n]; if (i >= x) { break; } } return results$; }; if (!timeout && _.keys(cached).length >= max) { return timeout = setTimeout(onTimeout, delay); } }; })(); lib/util/avatarWithCache/convertToImageSrc/convert.ls (function(){ return function(svg){ var src; if (!_.startsWith(svg, ">16)+(t>>16)+(r>>16);return e<<16|65535&r}function r(n,t){return n<>>32-t}function e(n,e,o,u,c,f){return t(r(t(t(e,n),t(u,f)),c),o)}function o(n,t,r,o,u,c,f){return e(t&r|~t&o,n,t,u,c,f)}function u(n,t,r,o,u,c,f){return e(t&o|r&~o,n,t,u,c,f)}function c(n,t,r,o,u,c,f){return e(t^r^o,n,t,u,c,f)}function f(n,t,r,o,u,c,f){return e(r^(t|~o),n,t,u,c,f)}function i(n,r){n[r>>5]|=128<>>9<<4)+14]=r;var e,i,a,h,d,l=1732584193,g=-271733879,v=-1732584194,m=271733878;for(e=0;e>5]>>>t%32&255);return r}function h(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t>5]|=(255&n.charCodeAt(t/8))<16&&(o=i(o,8*n.length)),r=0;r<16;r+=1)u[r]=909522486^o[r],c[r]=1549556828^o[r];return e=i(u.concat(h(t)),512+8*t.length),a(i(c.concat(e),640))}function g(n){var t,r,e="0123456789abcdef",o="";for(r=0;r>>4&15)+e.charAt(15&t);return o}function v(n){return unescape(encodeURIComponent(n))}function m(n){return d(v(n))}function p(n){return g(m(n))}function s(n,t){return l(v(n),v(t))}function C(n,t){return g(s(n,t))}function A(n,t,r){return t?r?s(t,n):C(t,n):r?m(n):p(n)}"function"==typeof define&&define.amd?define(function(){return A}):"object"==typeof module&&module.exports?module.exports=A:n.md5=A}(this); lib/util/md5/md5.ls (function(){ return function(s){ if (!window.md5) { include("external/md5.min.js"); } return md5(s); }; })(); sets/human/cat/beard/color.ls (function(){ return [ { id: 'a', color: '#FFE89E' }, { id: 'b', color: '#FFCC84' }, { id: 'c', color: '#E4C5AF' }, { id: 'd', color: '#E3B99B' }, { id: 'e', color: '#B3825D' }, { id: 'f', color: '#C97E58' }, { id: 'g', color: '#C4722F' }, { id: 'h', color: '#9A6842' }, { id: 'i', color: '#744136' }, { id: 'j', color: '#5C2D24' }, { id: 'k', color: '#452314' }, { id: 'l', color: '#393635' }, { id: 'm', color: '#1D0C05' } ]; })(); sets/human/cat/beard/style.ls (function(){ return [ { id: 'none' }, { id: 'a', svg: 'beard-a', x: 84, y: 135 }, { id: 'b', svg: 'beard-b', x: 80, y: 122 }, { id: 'c', svg: 'beard-c', x: 118, y: 144 }, { id: 'd', svg: 'beard-d', x: 112, y: 175 }, { id: 'e', svg: 'beard-e', x: 86, y: 149 }, { id: 'f', svg: 'beard-f', x: 111, y: 148 } ]; })(); sets/human/cat/earring/color.ls (function(){ return [ { id: 'a', color: Color.red.A700 }, { id: 'b', color: Color.pink.A700 }, { id: 'c', color: Color.purple.A700 }, { id: 'd', color: Color.deepPurple.A700 }, { id: 'e', color: Color.indigo.A700 }, { id: 'f', color: Color.blue.A700 }, { id: 'g', color: Color.lightBlue.A700 }, { id: 'h', color: Color.cyan.A700 }, { id: 'i', color: Color.teal.A700 }, { id: 'j', color: Color.green.A700 }, { id: 'k', color: Color.lightGreen.A700 }, { id: 'l', color: Color.lime.A700 }, { id: 'm', color: Color.yellow.A700 }, { id: 'n', color: Color.amber.A700 }, { id: 'o', color: Color.orange.A700 }, { id: 'p', color: Color.deepOrange.A700 } ]; })(); sets/human/cat/earring/color2.ls (function(){ return [ { id: 'a', color: Color.red.A400 }, { id: 'b', color: Color.pink.A400 }, { id: 'c', color: Color.purple.A400 }, { id: 'd', color: Color.deepPurple.A400 }, { id: 'e', color: Color.indigo.A400 }, { id: 'f', color: Color.blue.A400 }, { id: 'g', color: Color.lightBlue.A400 }, { id: 'h', color: Color.cyan.A400 }, { id: 'i', color: Color.teal.A400 }, { id: 'j', color: Color.green.A400 }, { id: 'k', color: Color.lightGreen.A400 }, { id: 'l', color: Color.lime.A400 }, { id: 'm', color: Color.yellow.A400 }, { id: 'n', color: Color.amber.A400 }, { id: 'o', color: Color.orange.A400 }, { id: 'p', color: Color.deepOrange.A400 } ]; })(); sets/human/cat/earring/style.ls (function(){ return [ { id: 'none' }, { id: 'a', svg: 'earring-a', left: { x: 64, y: 133 }, right: { x: 185, y: 133 } }, { id: 'b', svg: 'earring-b', left: { x: 64, y: 130, rotate: -7 }, right: { x: 185, y: 130, rotate: 3 } }, { id: 'c', svg: 'earring-c', left: { x: 69, y: 138 }, right: { x: 188, y: 138 } }, { id: 'd', svg: 'earring-d', left: { x: 67, y: 139 }, right: { x: 186, y: 139 } } ]; })(); sets/human/cat/eye/color.ls (function(){ return [ { id: 'a', color: Color.lightGreen[500] }, { id: 'b', color: Color.lightGreen[700] }, { id: 'c', color: Color.lightGreen[900] }, { id: 'd', color: Color.lightBlue[500] }, { id: 'e', color: Color.lightBlue[700] }, { id: 'f', color: Color.lightBlue[900] }, { id: 'g', color: Color.brown[500] }, { id: 'h', color: Color.brown[700] }, { id: 'i', color: Color.brown[900] }, { id: 'j', color: Color.blueGrey[500] }, { id: 'k', color: Color.blueGrey[700] }, { id: 'l', color: Color.blueGrey[900] } ]; })(); sets/human/cat/eye/style.ls (function(){ return [ { id: 'a', svg: 'eye-a', left: { x: 88, y: 111 }, right: { x: 151, y: 111 } }, { id: 'b', svg: 'eye-b', left: { x: 86, y: 114 }, right: { x: 150, y: 114 } }, { id: 'c', svg: 'eye-c', left: { x: 86, y: 115 }, right: { x: 150, y: 115 } }, { id: 'd', svg: 'eye-d', left: { x: 95, y: 112 }, right: { x: 153, y: 112 } }, { id: 'e', svg: 'eye-e', left: { x: 92, y: 113 }, right: { x: 149, y: 113 } }, { id: 'f', svg: 'eye-f', left: { x: 92, y: 115 }, right: { x: 149, y: 115 } } ]; })(); sets/human/cat/eyebrow/color.ls (function(){ return [ { id: 'a', color: '#FFE89E' }, { id: 'b', color: '#FFCC84' }, { id: 'c', color: '#E4C5AF' }, { id: 'd', color: '#E3B99B' }, { id: 'e', color: '#B3825D' }, { id: 'f', color: '#C97E58' }, { id: 'g', color: '#C4722F' }, { id: 'h', color: '#9A6842' }, { id: 'i', color: '#744136' }, { id: 'j', color: '#5C2D24' }, { id: 'k', color: '#452314' }, { id: 'l', color: '#393635' }, { id: 'm', color: '#1D0C05' } ]; })(); sets/human/cat/eyebrow/style.ls (function(){ return [ { id: 'a', svg: 'eyebrow-a', left: { x: 90, y: 94 }, right: { x: 156, y: 94 } }, { id: 'b', svg: 'eyebrow-b', left: { x: 91, y: 96 }, right: { x: 155, y: 96 } }, { id: 'c', svg: 'eyebrow-c', left: { x: 93, y: 102 }, right: { x: 157, y: 102 } } ]; })(); sets/human/cat/glasses/color.ls (function(){ return [ { id: 'a', color: Color.red.A700 }, { id: 'b', color: Color.pink.A700 }, { id: 'c', color: Color.purple.A700 }, { id: 'd', color: Color.deepPurple.A700 }, { id: 'e', color: Color.indigo.A700 }, { id: 'f', color: Color.blue.A700 }, { id: 'g', color: Color.lightBlue.A700 }, { id: 'h', color: Color.cyan.A700 }, { id: 'i', color: Color.teal.A700 }, { id: 'j', color: Color.green.A700 }, { id: 'k', color: Color.lightGreen.A700 }, { id: 'l', color: Color.lime.A700 }, { id: 'm', color: Color.yellow.A700 }, { id: 'n', color: Color.amber.A700 }, { id: 'o', color: Color.orange.A700 }, { id: 'p', color: Color.deepOrange.A700 }, { id: 'q', color: Color.brown[900] }, { id: 'r', color: Color.grey[500] }, { id: 's', color: Color.brown[50] } ]; })(); sets/human/cat/glasses/color2.ls (function(){ return [ { id: 'none' }, { id: 'a', color: Color.red.A700 }, { id: 'b', color: Color.pink.A700 }, { id: 'c', color: Color.purple.A700 }, { id: 'd', color: Color.deepPurple.A700 }, { id: 'e', color: Color.indigo.A700 }, { id: 'f', color: Color.blue.A700 }, { id: 'g', color: Color.lightBlue.A700 }, { id: 'h', color: Color.cyan.A700 }, { id: 'i', color: Color.teal.A700 }, { id: 'j', color: Color.green.A700 }, { id: 'k', color: Color.lightGreen.A700 }, { id: 'l', color: Color.lime.A700 }, { id: 'm', color: Color.yellow.A700 }, { id: 'n', color: Color.amber.A700 }, { id: 'o', color: Color.orange.A700 }, { id: 'p', color: Color.deepOrange.A700 }, { id: 'q', color: Color.white }, { id: 'r', color: Color.brown[900] } ]; })(); sets/human/cat/glasses/style.ls (function(){ return [ { id: 'none' }, { id: 'a', svg: 'glasses-a', x: 77, y: 99 }, { id: 'b', svg: 'glasses-b', x: 76, y: 98 }, { id: 'c', svg: 'glasses-c', x: 79, y: 103 }, { id: 'd', svg: 'glasses-d', x: 73, y: 101 }, { id: 'e', svg: 'glasses-e', x: 80, y: 101 }, { id: 'f', svg: 'glasses-f', x: 84, y: 106 }, { id: 'g', svg: 'glasses-g', x: 83, y: 107 }, { id: 'h', svg: 'glasses-h', x: 85, y: 106 }, { id: 'i', svg: 'glasses-i', x: 79, y: 108 }, { id: 'j', svg: 'glasses-j', x: 85, y: 106 } ]; })(); sets/human/cat/hair/color.ls (function(){ return [ { id: 'a', color: '#FFE89E' }, { id: 'b', color: '#FFCC84' }, { id: 'c', color: '#C4722F' }, { id: 'd', color: '#B3825D' }, { id: 'e', color: '#9A6842' }, { id: 'f', color: '#744136' }, { id: 'g', color: '#5C2D24' }, { id: 'h', color: '#452314' }, { id: 'i', color: '#1D0C05' } ]; })(); sets/human/cat/hair/style.ls (function(){ return [ { id: 'none' }, { id: 'a', svg: 'hair-a', x: 68, y: 24 }, { id: 'b', svg: 'hair-b', x: 78, y: 31 }, { id: 'c', svg: 'hair-c', x: 72, y: 33 }, { id: 'd', svg: 'hair-d', x: 77, y: 33 }, { id: 'e', svg: 'hair-e', x: 76, y: 31 }, { id: 'f', svg: 'hair-f', x: 72, y: 32 }, { id: 'g', svg: 'hair-g', x: 71, y: 33 }, { id: 'h', svg: 'hair-h', x: 56, y: 33 }, { id: 'i', svg: 'hair-i', x: 74, y: 27 }, { id: 'j', svg: 'hair-j', x: 76, y: 24 }, { id: 'k', svg: 'hair-k', x: 70, y: 24 }, { id: 'l', svg: 'hair-l', x: 75, y: 24 }, { id: 'm', svg: 'hair-m', x: 52, y: 5 }, { id: 'n', svg: 'hair-n', x: 76, y: 34 }, { id: 'o', svg: 'hair-o', x: 78, y: 20 }, { id: 'p', svg: 'hair-p', x: 61, y: 35 } ]; })(); sets/human/cat/hair/style2.ls (function(){ return [ { id: 'none' }, { id: 'b', svg: 'hair-b-back', x: 48, y: 29 }, { id: 'c', svg: 'hair-c-back', x: 100, y: 170 }, { id: 'd', svg: 'hair-d-back', x: 60, y: 32 }, { id: 'e', svg: 'hair-e-back', x: 32, y: 11 }, { id: 'f', svg: 'hair-f-back', x: 70, y: 32 }, { id: 'g', svg: 'hair-g-back', x: 61, y: 33 }, { id: 'k', svg: 'hair-k-back', x: 65, y: 30 }, { id: 'n', svg: 'hair-n-back', x: 45, y: 30 } ]; })(); sets/human/cat/mouth/color.ls (function(){ return [ { id: 'none' }, { id: 'a', color: Color.deepOrange.A200 }, { id: 'b', color: Color.deepOrange.A400 }, { id: 'c', color: Color.deepOrange.A700 }, { id: 'd', color: Color.deepOrange[900] }, { id: 'e', color: Color.orange.A200 }, { id: 'f', color: Color.orange.A400 }, { id: 'g', color: Color.orange.A700 }, { id: 'h', color: Color.orange[900] }, { id: 'i', color: Color.red.A200 }, { id: 'j', color: Color.red.A400 }, { id: 'k', color: Color.red.A700 }, { id: 'l', color: Color.red[900] }, { id: 'm', color: Color.pink.A200 }, { id: 'n', color: Color.pink.A400 }, { id: 'o', color: Color.pink.A700 } ]; })(); sets/human/cat/mouth/style.ls (function(){ return [ { id: 'b', svg: 'mouth-b', x: 118, y: 160 }, { id: 'c', svg: 'mouth-c', x: 116, y: 155 }, { id: 'a', svg: 'mouth-a', x: 117, y: 159 } ]; })(); sets/human/cat/shirt/color.ls (function(){ return [ { id: 'a', color: Color.red.A700 }, { id: 'b', color: Color.pink.A700 }, { id: 'c', color: Color.purple.A700 }, { id: 'd', color: Color.deepPurple.A700 }, { id: 'e', color: Color.indigo.A700 }, { id: 'f', color: Color.blue.A700 }, { id: 'g', color: Color.lightBlue.A700 }, { id: 'h', color: Color.cyan.A700 }, { id: 'i', color: Color.teal.A700 }, { id: 'j', color: Color.green.A700 }, { id: 'k', color: Color.lightGreen.A700 }, { id: 'l', color: Color.lime.A700 }, { id: 'm', color: Color.yellow.A700 }, { id: 'n', color: Color.amber.A700 }, { id: 'o', color: Color.orange.A700 }, { id: 'p', color: Color.deepOrange.A700 }, { id: 'q', color: Color.brown[900] }, { id: 'r', color: Color.grey[700] }, { id: 's', color: Color.grey[500] }, { id: 't', color: Color.grey[300] }, { id: 'u', color: Color.brown[50] } ]; })(); sets/human/cat/shirt/style.ls (function(){ return [ { id: 'a', svg: 'shirt-a', x: 71, y: 216 }, { id: 'b', svg: 'shirt-b', x: 71, y: 219 }, { id: 'c', svg: 'shirt-c', x: 71, y: 218 }, { id: 'd', svg: 'shirt-d', x: 71, y: 220 }, { id: 'e', svg: 'shirt-e', x: 85, y: 224 }, { id: 'f', svg: 'shirt-f', x: 92, y: 203 }, { id: 'g', svg: 'shirt-g', x: 72, y: 212 }, { id: 'h', svg: 'shirt-h', x: 72, y: 199 }, { id: 'i', svg: 'shirt-i', x: 71, y: 212 }, { id: 'j', svg: 'shirt-j', x: 71, y: 218 } ]; })(); sets/human/cat/skin/color.ls (function(){ return [ { id: 'a', color: '#FDD7B6' }, { id: 'b', color: '#FFD18F' }, { id: 'c', color: '#FBB980' }, { id: 'd', color: '#E9A36D' }, { id: 'e', color: '#C97E58' }, { id: 'f', color: '#9A6D4B' }, { id: 'g', color: '#5A3D28' } ]; })(); sets/human/cat/skin/style.ls (function(){ return [{ id: 'a', svg: 'skin', x: 70, y: 38 }]; })(); sets/human/cat/sunglass/style.ls (function(){ return [ { id: 'none' }, { id: 'a', svg: 'glasses-a', x: 77, y: 99 }, { id: 'b', svg: 'glasses-b', x: 76, y: 98 }, { id: 'c', svg: 'glasses-c', x: 79, y: 103 }, { id: 'd', svg: 'glasses-d', x: 73, y: 101 }, { id: 'e', svg: 'glasses-e', x: 80, y: 101 }, { id: 'f', svg: 'glasses-f', x: 84, y: 106 }, { id: 'g', svg: 'glasses-g', x: 83, y: 107 }, { id: 'h', svg: 'glasses-h', x: 85, y: 106 }, { id: 'i', svg: 'glasses-i', x: 79, y: 108 }, { id: 'j', svg: 'glasses-j', x: 85, y: 106 } ]; })(); sets/human/default.ls (function(){ return { set: 'human', skin: { style: 'a', color: 'a' }, hair: { style: 'a', style2: 'none', color: 'a' }, beard: { style: 'none', color: 'a' }, shirt: { style: 'a', color: 'a' }, eye: { style: 'a', color: 'a' }, eyebrow: { style: 'a', color: 'a' }, mouth: { style: 'a', color: 'a' }, glasses: { style: 'none', color: 'a', color2: 'b' }, earring: { style: 'none', color: 'a', color2: 'b' } }; })(); sets/human/definition.ls (function(){ return { human: { label: 'Mensch', width: 275, height: 275, categories: { skin: { label: 'Haut', options: { style: { label: 'Form', ids: include('cat/skin/style') }, color: { label: 'Farbe', ids: include('cat/skin/color') } } }, hair: { label: 'Haare', options: { style: { label: 'vorne', ids: include('cat/hair/style') }, style2: { label: 'hinten', ids: include('cat/hair/style2') }, color: { label: 'Farbe', ids: include('cat/hair/color') } } }, eyebrow: { label: 'Augenbrauen', options: { style: { label: 'Form', ids: include('cat/eyebrow/style') }, color: { label: 'Farbe', ids: include('cat/eyebrow/color') } } }, beard: { label: 'Bart', options: { style: { label: 'Form', ids: include('cat/beard/style') }, color: { label: 'Farbe', ids: include('cat/beard/color') } } }, eye: { label: 'Augen', options: { style: { label: 'Form', ids: include('cat/eye/style') }, color: { label: 'Farbe', ids: include('cat/eye/color') } } }, mouth: { label: 'Mund', options: { style: { label: 'Form', ids: include('cat/mouth/style') }, color: { label: 'Farbe', ids: include('cat/mouth/color') } } }, shirt: { label: 'Shirt', options: { style: { label: 'Form', ids: include('cat/shirt/style') }, color: { label: 'Farbe', ids: include('cat/shirt/color') } } }, glasses: { label: 'Brille', options: { style: { label: 'Form', ids: include('cat/glasses/style') }, color: { label: 'Gestell', ids: include('cat/glasses/color') }, color2: { label: 'Gläser', ids: include('cat/glasses/color2') } } }, earring: { label: 'Ohrringe', options: { style: { label: 'Form', ids: include('cat/earring/style') }, color: { label: 'Farbe 1', ids: include('cat/earring/color') }, color2: { label: 'Farbe 2', ids: include('cat/earring/color2') } } } } } }; })(); sets/human/parser.ls (function(){ var definition, d; definition = include('definition').human; d = definition.categories; return function(o){ var lsg, hairColor, ref$, hairBackStyle, skinColor, ref1$, skinStyle, eyeColor, ref2$, eyeStyle, beardColor, beardStyle, mouthColor, ref3$, mouthStyle, shirtColor, ref4$, shirtStyle, hairFrontStyle, eyebrowColor, ref5$, eyebrowStyle, earringColor, ref6$, earringColor2, ref7$, earringStyle, glassesColor, ref8$, glassesColor2, ref9$, glassesStyle; lsg = { id: 'human', width: definition.width, height: definition.height, objects: [] }; hairColor = (ref$ = _.find(d.hair.options.color.ids, { id: o.hair.color })) != null ? ref$.color : void 8; hairBackStyle = _.find(d.hair.options.style2.ids, { id: o.hair.style2 }); if (o.hair.style2 !== 'none') { lsg.objects.push({ type: 'svg', 'class': 'hair-back', svg: path("svg/" + hairBackStyle.svg + ".svg"), includeSvg: true, color: hairColor + "", x: hairBackStyle.x, y: hairBackStyle.y }); } skinColor = (ref1$ = _.find(d.skin.options.color.ids, { id: o.skin.color })) != null ? ref1$.color : void 8; skinStyle = _.find(d.skin.options.style.ids, { id: o.skin.style }); lsg.objects.push({ type: 'svg', 'class': 'skin', includeSvg: true, svg: path("svg/" + skinStyle.svg + ".svg"), color: skinColor + "", x: skinStyle.x, y: skinStyle.y }); eyeColor = (ref2$ = _.find(d.eye.options.color.ids, { id: o.eye.color })) != null ? ref2$.color : void 8; eyeStyle = _.find(d.eye.options.style.ids, { id: o.eye.style }); lsg.objects.push({ type: 'svg', 'class': 'eye-left', svg: path("svg/" + eyeStyle.svg + ".svg"), includeSvg: true, color: { color1: eyeColor + "", color2: skinColor + "" }, x: eyeStyle.left.x, y: eyeStyle.left.y }, { type: 'svg', 'class': 'eye-right', svg: path("svg/" + eyeStyle.svg + ".svg"), includeSvg: true, color: { color1: eyeColor + "", color2: skinColor + "" }, x: eyeStyle.right.x, y: eyeStyle.right.y, flipX: true }); if (o.beard.style !== 'none') { beardColor = _.find(d.beard.options.color.ids, { id: o.beard.color }).color; beardStyle = _.find(d.beard.options.style.ids, { id: o.beard.style }); lsg.objects.push({ type: 'svg', 'class': 'beard', svg: path("svg/" + beardStyle.svg + ".svg"), includeSvg: true, color: beardColor + "", x: beardStyle.x, y: beardStyle.y }); } mouthColor = (ref3$ = _.find(d.mouth.options.color.ids, { id: o.mouth.color })) != null ? ref3$.color : void 8; mouthStyle = _.find(d.mouth.options.style.ids, { id: o.mouth.style }); lsg.objects.push({ type: 'svg', 'class': 'mouth', svg: path("svg/" + mouthStyle.svg + ".svg"), includeSvg: true, color: (mouthColor || skinColor) + "", x: mouthStyle.x, y: mouthStyle.y }); shirtColor = (ref4$ = _.find(d.shirt.options.color.ids, { id: o.shirt.color })) != null ? ref4$.color : void 8; shirtStyle = _.find(d.shirt.options.style.ids, { id: o.shirt.style }); lsg.objects.push({ type: 'svg', 'class': 'shirt', svg: path("svg/" + shirtStyle.svg + ".svg"), includeSvg: true, color: shirtColor + "", x: shirtStyle.x, y: shirtStyle.y }); hairFrontStyle = _.find(d.hair.options.style.ids, { id: o.hair.style }); if (o.hair.style !== 'none') { lsg.objects.push({ type: 'svg', 'class': 'hair-front', svg: path("svg/" + hairFrontStyle.svg + ".svg"), includeSvg: true, color: hairColor + "", x: hairFrontStyle.x, y: hairFrontStyle.y }); } eyebrowColor = (ref5$ = _.find(d.eyebrow.options.color.ids, { id: o.eyebrow.color })) != null ? ref5$.color : void 8; eyebrowStyle = _.find(d.eyebrow.options.style.ids, { id: o.eyebrow.style }); lsg.objects.push({ type: 'svg', 'class': 'eyebrow-left', svg: path("svg/" + eyebrowStyle.svg + ".svg"), color: eyebrowColor + "", includeSvg: true, x: eyebrowStyle.left.x, y: eyebrowStyle.left.y }, { type: 'svg', 'class': 'eyebrow-right', svg: path("svg/" + eyebrowStyle.svg + ".svg"), includeSvg: true, color: eyebrowColor + "", x: eyebrowStyle.right.x, y: eyebrowStyle.right.y, flipX: true }); if (o.earring.style !== 'none') { earringColor = (ref6$ = _.find(d.earring.options.color.ids, { id: o.earring.color })) != null ? ref6$.color : void 8; earringColor2 = (ref7$ = _.find(d.earring.options.color2.ids, { id: o.earring.color2 })) != null ? ref7$.color : void 8; earringStyle = _.find(d.earring.options.style.ids, { id: o.earring.style }); lsg.objects.push({ type: 'svg', 'class': 'earring-left', svg: path("svg/" + earringStyle.svg + ".svg"), includeSvg: true, color: { color1: earringColor + "", color2: earringColor2 + "" }, x: earringStyle.left.x, y: earringStyle.left.y, rotate: earringStyle.left.rotate || '' }, { type: 'svg', 'class': 'earring-right', svg: path("svg/" + earringStyle.svg + ".svg"), includeSvg: true, color: { color1: earringColor + "", color2: earringColor2 + "" }, x: earringStyle.right.x, y: earringStyle.right.y, rotate: earringStyle.right.rotate || '', flipX: true }); } if (o.glasses.style !== 'none') { glassesColor = (ref8$ = _.find(d.glasses.options.color.ids, { id: o.glasses.color })) != null ? ref8$.color : void 8; glassesColor2 = (ref9$ = _.find(d.glasses.options.color2.ids, { id: o.glasses.color2 })) != null ? ref9$.color : void 8; glassesStyle = _.find(d.glasses.options.style.ids, { id: o.glasses.style }); lsg.objects.push({ type: 'svg', 'class': 'glasses', svg: path("svg/" + glassesStyle.svg + ".svg"), includeSvg: true, color: { color1: glassesColor + "", color2: glassesColor2 + "" }, x: glassesStyle.x, y: glassesStyle.y }); } return lsg; }; })(); sets/human/random.ls (function(){ return function(){ var def, s; def = include('definition').human.categories; s = function(cat, opt){ var ids; ids = def[cat].options[opt].ids; return _.shuffle(_.clone(ids))[0].id; }; return { set: 'human', skin: { style: s('skin', 'style'), color: s('skin', 'color') }, hair: { style: _.sample("abcdefgijklmno"), style2: s('hair', 'style2'), color: s('hair', 'color') }, beard: { style: "none", color: s('beard', 'color') }, shirt: { style: s('shirt', 'style'), color: s('shirt', 'color') }, eye: { style: s('eye', 'style'), color: s('eye', 'color') }, eyebrow: { style: s('eyebrow', 'style'), color: s('eyebrow', 'color') }, mouth: { style: "b", color: s('mouth', 'color') }, glasses: { style: "none", color: s('glasses', 'color'), color2: s('glasses', 'color2') }, earring: { style: "none", color: s('earring', 'color'), color2: s('earring', 'color2') } }; }; })(); sets/human/svg/beard-a.svg sets/human/svg/beard-b.svg sets/human/svg/beard-c.svg sets/human/svg/beard-d.svg sets/human/svg/beard-e.svg sets/human/svg/beard-f.svg sets/human/svg/ear-a.svg sets/human/svg/ear-b.svg sets/human/svg/earring-a.svg sets/human/svg/earring-b.svg sets/human/svg/earring-c.svg sets/human/svg/earring-d.svg sets/human/svg/eye-a.svg sets/human/svg/eye-b.svg sets/human/svg/eye-c.svg sets/human/svg/eye-d.svg sets/human/svg/eye-e.svg sets/human/svg/eye-f.svg sets/human/svg/eyebrow-a.svg sets/human/svg/eyebrow-b.svg sets/human/svg/eyebrow-c.svg sets/human/svg/eyebrow.svg sets/human/svg/glasses-a.svg sets/human/svg/glasses-b.svg sets/human/svg/glasses-c.svg sets/human/svg/glasses-d.svg sets/human/svg/glasses-e.svg sets/human/svg/glasses-f.svg sets/human/svg/glasses-g.svg sets/human/svg/glasses-h.svg sets/human/svg/glasses-i.svg sets/human/svg/glasses-j.svg sets/human/svg/hair-a.svg sets/human/svg/hair-b-back.svg sets/human/svg/hair-b.svg sets/human/svg/hair-c-back.svg sets/human/svg/hair-c.svg sets/human/svg/hair-d-back.svg sets/human/svg/hair-d.svg sets/human/svg/hair-e-back.svg sets/human/svg/hair-e.svg sets/human/svg/hair-f-back.svg sets/human/svg/hair-f.svg sets/human/svg/hair-g-back.svg sets/human/svg/hair-g.svg sets/human/svg/hair-h.svg sets/human/svg/hair-i.svg sets/human/svg/hair-j.svg sets/human/svg/hair-k-back.svg sets/human/svg/hair-k.svg sets/human/svg/hair-l.svg sets/human/svg/hair-m.svg sets/human/svg/hair-n-back.svg sets/human/svg/hair-n.svg sets/human/svg/hair-o.svg sets/human/svg/hair-p.svg sets/human/svg/mouth-a.svg sets/human/svg/mouth-b.svg sets/human/svg/mouth-c.svg sets/human/svg/shirt-a.svg sets/human/svg/shirt-b.svg sets/human/svg/shirt-c.svg sets/human/svg/shirt-d.svg sets/human/svg/shirt-e.svg sets/human/svg/shirt-f.svg sets/human/svg/shirt-g.svg sets/human/svg/shirt-h.svg sets/human/svg/shirt-i.svg sets/human/svg/shirt-j.svg sets/human/svg/skin.svg sets/monster/cat/arm/arm.ls (function(){ return { label: 'Arme', options: { style: { label: 'Stil', ids: [ { id: 'a', svg: 'arm-a', left: { x: 18, y: 78 }, right: { x: 123, y: 78 } }, { id: 'c', svg: 'arm-c', left: { x: 9, y: 76 }, right: { x: 129, y: 76 } }, { id: 'd', svg: 'arm-d', left: { x: 19, y: 112 }, right: { x: 161, y: 112 } }, { id: 'e', svg: 'arm-e', left: { x: 54, y: 112 }, right: { x: 158, y: 112 } }, { id: 'f', svg: 'arm-f', left: { x: 25, y: 85 }, right: { x: 142, y: 85 } }, { id: 'g', svg: 'arm-g', left: { x: 39, y: 102 }, right: { x: 163, y: 102 } }, { id: 'h', svg: 'arm-h', left: { x: 15, y: 100 }, right: { x: 164, y: 104 } }, { id: 'i', svg: 'arm-i', left: { x: 19, y: 92 }, right: { x: 144, y: 92 } }, { id: 'j', svg: 'arm-j', left: { x: 16, y: 92 }, right: { x: 140, y: 92 } }, { id: 'k', svg: 'arm-k', left: { x: 24, y: 93 }, right: { x: 138, y: 93 } }, { id: 'l', svg: 'arm-l', left: { x: 32, y: 97 }, right: { x: 152, y: 97 } }, { id: 'm', svg: 'arm-m', left: { x: 51, y: 103 }, right: { x: 156, y: 102 } }, { id: 'n', svg: 'arm-n', left: { x: 19, y: 92 }, right: { x: 146, y: 92 } }, { id: 'o', svg: 'arm-o', left: { x: 31, y: 102 }, right: { x: 160, y: 102 } }, { id: 'p', svg: 'arm-p', left: { x: 35, y: 102 }, right: { x: 152, y: 102 } } ] }, color: { label: 'Farbe', ids: include('color') } } }; })(); sets/monster/cat/arm/color.ls (function(){ return [ { id: 'a', color: Color.red.A400 }, { id: 'b', color: Color.pink.A400 }, { id: 'c', color: Color.purple.A400 }, { id: 'd', color: Color.deepPurple.A400 }, { id: 'e', color: Color.indigo.A400 }, { id: 'f', color: Color.blue.A400 }, { id: 'g', color: Color.lightBlue.A400 }, { id: 'h', color: Color.cyan.A400 }, { id: 'i', color: Color.teal.A400 }, { id: 'j', color: Color.green.A400 }, { id: 'k', color: Color.lightGreen.A400 }, { id: 'l', color: Color.lime.A400 }, { id: 'm', color: Color.yellow.A400 }, { id: 'n', color: Color.amber.A400 }, { id: 'o', color: Color.orange.A400 }, { id: 'p', color: Color.deepOrange.A400 } ]; })(); sets/monster/cat/body/body.ls (function(){ return { label: 'Körper', options: { style: { label: 'Stil', ids: [ { id: 'a', svg: 'body-a', x: 61, y: 21, yOffsetFace: -12 }, { id: 'b', svg: 'body-b', x: 41, y: 17, yOffsetFace: -14 }, { id: 'c', svg: 'body-c', x: 56, y: 28, yOffsetFace: -11 }, { id: 'd', svg: 'body-d', x: 63, y: 22, yOffsetFace: -10 }, { id: 'e', svg: 'body-e', x: 50, y: 18, yOffsetFace: -22 }, { id: 'f', svg: 'body-f', x: 46, y: 25, yOffsetFace: -23 }, { id: 'g', svg: 'body-g', x: 48, y: 32, yOffsetFace: -21 }, { id: 'h', svg: 'body-h', x: 49, y: 26, yOffsetFace: -19 }, { id: 'i', svg: 'body-i', x: 32, y: 18, yOffsetFace: -24 }, { id: 'j', svg: 'body-j', x: 54, y: 34, yOffsetFace: -23 }, { id: 'k', svg: 'body-k', x: 31, y: 23, yOffsetFace: -25 }, { id: 'l', svg: 'body-l', x: 45, y: 37, yOffsetFace: -23 }, { id: 'm', svg: 'body-m', x: 44, y: 24, yOffsetFace: -22 }, { id: 'n', svg: 'body-n', x: 39, y: 23, yOffsetFace: -13 }, { id: 'o', svg: 'body-o', x: 48, y: 15, yOffsetFace: -4 }, { id: 'p', svg: 'body-p', x: 72, y: 20, yOffsetFace: -2 }, { id: 'q', svg: 'body-q', x: 34, y: 14, yOffsetFace: -16 }, { id: 'r', svg: 'body-r', x: 47, y: 24, yOffsetFace: -7 }, { id: 's', svg: 'body-s', x: 58, y: 12, yOffsetFace: -9 }, { id: 't', svg: 'body-t', x: 53, y: 15, yOffsetFace: -3 }, { id: 'u', svg: 'body-u', x: 55, y: 23, yOffsetFace: 4 }, { id: 'v', svg: 'body-v', x: 55, y: 23, yOffsetFace: 1 }, { id: 'w', svg: 'body-w', x: 55, y: 23, yOffsetFace: -10 } ] }, color: { label: 'Farbe', ids: include('color') } } }; })(); sets/monster/cat/body/color.ls (function(){ return [ { id: 'a', color: Color.red.A700 }, { id: 'b', color: Color.pink.A700 }, { id: 'c', color: Color.purple.A700 }, { id: 'd', color: Color.deepPurple.A700 }, { id: 'e', color: Color.indigo.A700 }, { id: 'f', color: Color.blue.A700 }, { id: 'g', color: Color.lightBlue.A700 }, { id: 'h', color: Color.cyan.A700 }, { id: 'i', color: Color.teal.A700 }, { id: 'j', color: Color.green.A700 }, { id: 'k', color: Color.lightGreen.A700 }, { id: 'l', color: Color.lime.A700 }, { id: 'm', color: Color.yellow.A700 }, { id: 'n', color: Color.amber.A700 }, { id: 'o', color: Color.orange.A700 }, { id: 'p', color: Color.deepOrange.A700 }, { id: 'q', color: Color.brown[600] } ]; })(); sets/monster/cat/eye/color.ls (function(){ return [ { id: 'a', color: Color.red.A200 }, { id: 'b', color: Color.pink.A200 }, { id: 'c', color: Color.purple.A200 }, { id: 'd', color: Color.deepPurple.A200 }, { id: 'e', color: Color.indigo.A200 }, { id: 'f', color: Color.blue.A200 }, { id: 'g', color: Color.lightBlue.A200 }, { id: 'h', color: Color.cyan.A200 }, { id: 'i', color: Color.teal.A200 }, { id: 'j', color: Color.green.A200 }, { id: 'k', color: Color.lightGreen.A200 }, { id: 'l', color: Color.lime.A200 }, { id: 'm', color: Color.yellow.A200 }, { id: 'n', color: Color.amber.A200 }, { id: 'o', color: Color.orange.A200 }, { id: 'p', color: Color.deepOrange.A200 } ]; })(); sets/monster/cat/eye/eye.ls (function(){ return { label: 'Augen', options: { style: { label: 'Stil', ids: [ { id: 'b', svg: 'eye-b' }, { id: 'c', svg: 'eye-c' }, { id: 'a', svg: 'eye-a' }, { id: 'd', svg: 'eye-d', wFactor: 1.5 } ] }, amount: { label: 'Anzahl', ids: [ { id: 'a', label: '1', symbols: [{ x: 95, y: 70, w: 60 }] }, { id: 'b', label: '2', symbols: [ { x: 84, y: 85, w: 40 }, { x: 126, y: 81, w: 40 } ] }, { id: 'c', label: '3', symbols: [ { x: 80, y: 95, w: 32 }, { x: 135, y: 85, w: 32 }, { x: 106, y: 74, w: 32 } ] } ] }, color: { label: 'Farbe', ids: include('color') } } }; })(); sets/monster/cat/headExt/color.ls (function(){ return [ { id: 'a', color: Color.red.A400 }, { id: 'b', color: Color.pink.A400 }, { id: 'c', color: Color.purple.A400 }, { id: 'd', color: Color.deepPurple.A400 }, { id: 'e', color: Color.indigo.A400 }, { id: 'f', color: Color.blue.A400 }, { id: 'g', color: Color.lightBlue.A400 }, { id: 'h', color: Color.cyan.A400 }, { id: 'i', color: Color.teal.A400 }, { id: 'j', color: Color.green.A400 }, { id: 'k', color: Color.lightGreen.A400 }, { id: 'l', color: Color.lime.A400 }, { id: 'm', color: Color.yellow.A400 }, { id: 'n', color: Color.amber.A400 }, { id: 'o', color: Color.orange.A400 }, { id: 'p', color: Color.deepOrange.A400 } ]; })(); sets/monster/cat/headExt/headExt.ls (function(){ return { label: 'Kopfschmuck', options: { style: { label: 'Stil', ids: [ { id: 'none' }, { id: 'a', svg: 'head-ext-a', left: { x: 56, y: 29 }, right: { x: 145, y: 22 } }, { id: 'b', svg: 'head-ext-b', left: { x: 30, y: 24 }, right: { x: 140, y: 20 } }, { id: 'c', svg: 'head-ext-c', left: { x: 20, y: 23 }, right: { x: 134, y: 26 } }, { id: 'd', svg: 'head-ext-d', left: { x: 50, y: 23 }, right: { x: 158, y: 23 } } ] }, color: { label: 'Farbe', ids: include('color') } } }; })(); sets/monster/cat/leg/color.ls (function(){ return [ { id: 'a', color: Color.red.A400 }, { id: 'b', color: Color.pink.A400 }, { id: 'c', color: Color.purple.A400 }, { id: 'd', color: Color.deepPurple.A400 }, { id: 'e', color: Color.indigo.A400 }, { id: 'f', color: Color.blue.A400 }, { id: 'g', color: Color.lightBlue.A400 }, { id: 'h', color: Color.cyan.A400 }, { id: 'i', color: Color.teal.A400 }, { id: 'j', color: Color.green.A400 }, { id: 'k', color: Color.lightGreen.A400 }, { id: 'l', color: Color.lime.A400 }, { id: 'm', color: Color.yellow.A400 }, { id: 'n', color: Color.amber.A400 }, { id: 'o', color: Color.orange.A400 }, { id: 'p', color: Color.deepOrange.A400 } ]; })(); sets/monster/cat/leg/leg.ls (function(){ return { label: 'Beine', options: { style: { label: 'Stil', ids: [ { id: 'a', svg: 'leg-a', left: { x: 73, y: 133 }, right: { x: 141, y: 133 } }, { id: 'b', svg: 'leg-b', left: { x: 65, y: 112 }, right: { x: 132, y: 112 } }, { id: 'c', svg: 'leg-c', left: { x: 81, y: 130 }, right: { x: 141, y: 130 } }, { id: 'd', svg: 'leg-d', left: { x: 70, y: 125 }, right: { x: 120, y: 125 } }, { id: 'e', svg: 'leg-e', left: { x: 58, y: 90 }, right: { x: 138, y: 90 } }, { id: 'f', svg: 'leg-f', left: { x: 65, y: 97 }, right: { x: 110, y: 97 } }, { id: 'g', svg: 'leg-g', left: { x: 56, y: 82 }, right: { x: 106, y: 82 } }, { id: 'h', svg: 'leg-h', left: { x: 61, y: 107 }, right: { x: 124, y: 107 } }, { id: 'i', svg: 'leg-i', left: { x: 66, y: 114 }, right: { x: 84, y: 114 } }, { id: 'j', svg: 'leg-j', left: { x: 73, y: 101 }, right: { x: 112, y: 101 } }, { id: 'k', svg: 'leg-k', left: { x: 62, y: 127 }, right: { x: 112, y: 127 } }, { id: 'l', svg: 'leg-l', left: { x: 86, y: 101 }, right: { x: 124, y: 101 } }, { id: 'm', svg: 'leg-m', left: { x: 85, y: 124 }, right: { x: 135, y: 124 } } ] }, color: { label: 'Farbe', ids: include('color') } } }; })(); sets/monster/cat/mouth/mouth.ls (function(){ return { label: 'Maul', options: { style: { label: 'Stil', ids: [ { id: 'a', svg: 'mouth-a', x: 69, y: 123 }, { id: 'b', svg: 'mouth-b', x: 88, y: 127 }, { id: 'c', svg: 'mouth-c', x: 71, y: 120 }, { id: 'v', svg: 'mouth-v', x: 75, y: 130 }, { id: 'd', svg: 'mouth-d', x: 71, y: 125 }, { id: 'e', svg: 'mouth-e', x: 81, y: 125 }, { id: 'f', svg: 'mouth-f', x: 82, y: 125 }, { id: 'g', svg: 'mouth-g', x: 94, y: 130 }, { id: 'h', svg: 'mouth-h', x: 65, y: 125 }, { id: 'i', svg: 'mouth-i', x: 63, y: 120 }, { id: 'j', svg: 'mouth-j', x: 82, y: 130 }, { id: 'k', svg: 'mouth-k', x: 100, y: 130 }, { id: 'l', svg: 'mouth-l', x: 75, y: 122 }, { id: 'm', svg: 'mouth-m', x: 85, y: 130 }, { id: 'n', svg: 'mouth-n', x: 97, y: 130 }, { id: 'o', svg: 'mouth-o', x: 96, y: 130 }, { id: 'p', svg: 'mouth-p', x: 90, y: 127 }, { id: 'q', svg: 'mouth-q', x: 97, y: 126 }, { id: 'r', svg: 'mouth-r', x: 104, y: 124 }, { id: 's', svg: 'mouth-s', x: 84, y: 127 }, { id: 't', svg: 'mouth-t', x: 104, y: 133 }, { id: 'u', svg: 'mouth-u', x: 106, y: 130 }, { id: 'w', svg: 'mouth-w', x: 92, y: 130 } ] } } }; })(); sets/monster/default.ls (function(){ return { set: 'monster', body: { style: 'a', color: 'a' }, eye: { style: 'a', amount: 'a', color: 'b' }, mouth: { style: 'a' }, headExt: { style: 'a', color: 'c' }, arm: { style: 'a', color: 'c' }, leg: { style: 'a', color: 'd' } }; })(); sets/monster/definition.ls (function(){ return { monster: { label: 'männnlich', width: 250, height: 250, categories: { body: include('cat/body/body'), eye: include('cat/eye/eye'), mouth: include('cat/mouth/mouth'), headExt: include('cat/headExt/headExt'), leg: include('cat/leg/leg'), arm: include('cat/arm/arm') } } }; })(); sets/monster/parser.ls (function(){ var definition, d; definition = include('definition').monster; d = definition.categories; return function(o){ var lsg, headExtStyle, headExtColor, legStyle, legColor, armStyle, armColor, bodyColor, bodyStyle, eyeColor, eyeStyle, eyeAmount, i$, ref$, len$, i, symbol, w, xOffset, x, y, mouthStyle; lsg = { id: 'monster', width: definition.width, height: definition.height, objects: [] }; if (o.headExt.style !== 'none') { headExtStyle = _.find(d.headExt.options.style.ids, { id: o.headExt.style }); headExtColor = _.find(d.headExt.options.color.ids, { id: o.headExt.color }).color; lsg.objects.push({ type: 'svg', 'class': 'head-ext-left', svg: path("svg/" + headExtStyle.svg + ".svg"), includeSvg: true, color: headExtColor + "", x: headExtStyle.left.x, y: headExtStyle.left.y }, { type: 'svg', 'class': 'head-ext-right', svg: path("svg/" + headExtStyle.svg + ".svg"), includeSvg: true, color: headExtColor + "", x: headExtStyle.right.x, y: headExtStyle.right.y, flipX: true }); } legStyle = _.find(d.leg.options.style.ids, { id: o.leg.style }); legColor = _.find(d.leg.options.color.ids, { id: o.leg.color }).color; lsg.objects.push({ type: 'svg', 'class': 'leg-left', svg: path("svg/" + legStyle.svg + ".svg"), includeSvg: true, color: legColor + "", x: legStyle.left.x, y: legStyle.left.y }, { type: 'svg', 'class': 'leg-right', includeSvg: true, svg: path("svg/" + legStyle.svg + ".svg"), color: legColor + "", x: legStyle.right.x, y: legStyle.right.y, flipX: true }); armStyle = _.find(d.arm.options.style.ids, { id: o.arm.style }); armColor = _.find(d.arm.options.color.ids, { id: o.arm.color }).color; lsg.objects.push({ type: 'svg', 'class': 'arm-left', svg: path("svg/" + armStyle.svg + ".svg"), includeSvg: true, color: armColor + "", x: armStyle.left.x, y: armStyle.left.y }, { type: 'svg', 'class': 'arm-right', svg: path("svg/" + armStyle.svg + ".svg"), includeSvg: true, color: armColor + "", x: armStyle.right.x, y: armStyle.right.y, flipX: true }); bodyColor = _.find(d.body.options.color.ids, { id: o.body.color }).color; bodyStyle = _.find(d.body.options.style.ids, { id: o.body.style }); lsg.objects.push({ type: 'svg', 'class': 'body', svg: path("svg/" + bodyStyle.svg + ".svg"), includeSvg: true, color: bodyColor + "", x: bodyStyle.x, y: bodyStyle.y }); eyeColor = _.find(d.eye.options.color.ids, { id: o.eye.color }).color; eyeStyle = _.find(d.eye.options.style.ids, { id: o.eye.style }); eyeAmount = _.find(d.eye.options.amount.ids, { id: o.eye.amount }); for (i$ = 0, len$ = (ref$ = eyeAmount.symbols).length; i$ < len$; ++i$) { i = i$; symbol = ref$[i$]; w = symbol.w * (eyeStyle.wFactor || 1); xOffset = (w - symbol.w) / 2; x = symbol.x - xOffset; y = symbol.y + (bodyStyle.yOffsetFace || 0); lsg.objects.push({ type: 'svg', 'class': "eye-" + (i + 1), svg: path("svg/" + eyeStyle.svg + ".svg"), includeSvg: true, color: { color1: eyeColor + "", color2: bodyColor + "" }, x: x, y: y, w: w }); } mouthStyle = _.find(d.mouth.options.style.ids, { id: o.mouth.style }); y = mouthStyle.y + (bodyStyle.yOffsetFace || 0); lsg.objects.push({ type: 'svg', 'class': 'mouth', includeSvg: true, svg: path("svg/" + mouthStyle.svg + ".svg"), color: bodyColor + "", x: mouthStyle.x, y: y }); return lsg; }; })(); sets/monster/random.ls (function(){ return function(){ var def, s; def = include('definition').monster.categories; s = function(cat, opt){ var ids; ids = def[cat].options[opt].ids; return _.shuffle(_.clone(ids))[0].id; }; return { set: 'monster', body: { style: s('body', 'style'), color: s('body', 'color') }, eye: { style: s('eye', 'style'), amount: s('eye', 'amount'), color: s('eye', 'color') }, mouth: { style: s('mouth', 'style') }, headExt: { style: s('headExt', 'style'), color: s('headExt', 'color') }, leg: { style: s('leg', 'style'), color: s('leg', 'color') }, arm: { style: s('arm', 'style'), color: s('arm', 'color') } }; }; })(); sets/monster/svg/arm-a.svg sets/monster/svg/arm-c.svg sets/monster/svg/arm-d.svg sets/monster/svg/arm-e.svg sets/monster/svg/arm-f.svg sets/monster/svg/arm-g.svg sets/monster/svg/arm-h.svg sets/monster/svg/arm-i.svg sets/monster/svg/arm-j.svg sets/monster/svg/arm-k.svg sets/monster/svg/arm-l.svg sets/monster/svg/arm-m.svg sets/monster/svg/arm-n.svg sets/monster/svg/arm-o.svg sets/monster/svg/arm-p.svg sets/monster/svg/arm-q.svg sets/monster/svg/body-a.svg sets/monster/svg/body-b.svg sets/monster/svg/body-c.svg sets/monster/svg/body-d.svg sets/monster/svg/body-e.svg sets/monster/svg/body-f.svg sets/monster/svg/body-g.svg sets/monster/svg/body-h.svg sets/monster/svg/body-i.svg sets/monster/svg/body-j.svg sets/monster/svg/body-k.svg sets/monster/svg/body-l.svg sets/monster/svg/body-m.svg sets/monster/svg/body-n.svg sets/monster/svg/body-o.svg sets/monster/svg/body-p.svg sets/monster/svg/body-q.svg sets/monster/svg/body-r.svg sets/monster/svg/body-s.svg sets/monster/svg/body-t.svg sets/monster/svg/body-u.svg sets/monster/svg/body-v.svg sets/monster/svg/body-w.svg sets/monster/svg/eye-a.svg sets/monster/svg/eye-b.svg sets/monster/svg/eye-c.svg sets/monster/svg/eye-d.svg sets/monster/svg/head-ext-a.svg sets/monster/svg/head-ext-b.svg sets/monster/svg/head-ext-c.svg sets/monster/svg/head-ext-d.svg sets/monster/svg/head-ext-e.svg sets/monster/svg/leg-a.svg sets/monster/svg/leg-b.svg sets/monster/svg/leg-c.svg sets/monster/svg/leg-d.svg sets/monster/svg/leg-e.svg sets/monster/svg/leg-f.svg sets/monster/svg/leg-g.svg sets/monster/svg/leg-h.svg sets/monster/svg/leg-i.svg sets/monster/svg/leg-j.svg sets/monster/svg/leg-k.svg sets/monster/svg/leg-l.svg sets/monster/svg/leg-m.svg sets/monster/svg/mouth-a.svg sets/monster/svg/mouth-b.svg sets/monster/svg/mouth-c.svg sets/monster/svg/mouth-d.svg sets/monster/svg/mouth-e.svg sets/monster/svg/mouth-f.svg sets/monster/svg/mouth-g.svg sets/monster/svg/mouth-h.svg sets/monster/svg/mouth-i.svg sets/monster/svg/mouth-j.svg sets/monster/svg/mouth-k.svg sets/monster/svg/mouth-l.svg sets/monster/svg/mouth-m.svg sets/monster/svg/mouth-n.svg sets/monster/svg/mouth-o.svg sets/monster/svg/mouth-p.svg sets/monster/svg/mouth-q.svg sets/monster/svg/mouth-r.svg sets/monster/svg/mouth-s.svg sets/monster/svg/mouth-t.svg sets/monster/svg/mouth-u.svg sets/monster/svg/mouth-v.svg sets/monster/svg/mouth-w.svg sets/monster/svg/mouth.svg