@dicebear/bottts
Version:
Avatar style for DiceBear
43 lines (42 loc) • 2.3 kB
JavaScript
/**
* Do not change this file manually! This file was generated with the "Dicebear Exporter"-Plugin for Figma.
*
* Plugin: https://www.figma.com/community/plugin/1005765655729342787
* File: https://www.figma.com/file/4nf3pyoOuM1U9Pa8M0cL6u
*/
import { getComponents } from './utils/getComponents.js';
import { getColors } from './utils/getColors.js';
export const meta = {
title: 'Bottts',
creator: 'Pablo Stanley',
source: 'https://bottts.com/',
homepage: 'https://twitter.com/pablostanley',
license: {
name: 'Free for personal and commercial use',
url: 'https://bottts.com/',
},
};
export const create = ({ prng, options }) => {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
const components = getComponents({ prng, options });
const colors = getColors({ prng, options });
return {
attributes: {
viewBox: '0 0 180 180',
fill: 'none',
'shape-rendering': 'auto',
},
body: `<g transform="translate(0 66)">${(_b = (_a = components.sides) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : ''}</g><g transform="translate(41)">${(_d = (_c = components.top) === null || _c === void 0 ? void 0 : _c.value(components, colors)) !== null && _d !== void 0 ? _d : ''}</g><g transform="translate(25 44)">${(_f = (_e = components.face) === null || _e === void 0 ? void 0 : _e.value(components, colors)) !== null && _f !== void 0 ? _f : ''}</g><g transform="translate(52 124)">${(_h = (_g = components.mouth) === null || _g === void 0 ? void 0 : _g.value(components, colors)) !== null && _h !== void 0 ? _h : ''}</g><g transform="translate(38 76)">${(_k = (_j = components.eyes) === null || _j === void 0 ? void 0 : _j.value(components, colors)) !== null && _k !== void 0 ? _k : ''}</g>`,
extra: () => ({
...Object.entries(components).reduce((acc, [key, value]) => {
acc[key] = value === null || value === void 0 ? void 0 : value.name;
return acc;
}, {}),
...Object.entries(colors).reduce((acc, [key, value]) => {
acc[`${key}Color`] = value;
return acc;
}, {}),
}),
};
};
export { schema } from './schema.js';