@dicebear/bottts
Advanced tools
Comparing version 5.0.0-alpha.16 to 5.0.0-alpha.20
@@ -5,4 +5,4 @@ export const top = { | ||
bulb01: (components, colors) => `<mask id="topBulb01-a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="22" y="0" width="56" height="52"><path d="M48 0a16 16 0 0 0-16 16v16a8 8 0 0 0 8 8H23a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h54a1 1 0 0 0 1-1V41a1 1 0 0 0-1-1H60a8 8 0 0 0 8-8V16A16 16 0 0 0 52 0h-4Z" fill="#59C4FF"/></mask><g mask="url(#topBulb01-a)"><path d="M0 0h100v52H0V0Z" fill="${colors.base.value}"/><path d="M0 0h100v52H0V0Z" fill="#fff" fill-opacity=".3"/><path fill="#fff" fill-opacity=".4" d="M20-3h60v43H20z"/><path d="M49 3.5c4.93 0 9.37 2.13 12.44 5.52" stroke="#fff" stroke-width="2" stroke-linecap="round"/><path d="m49.83 26-9-9L38 19.83l10 10V40h4V29.97l10.14-10.14L59.31 17l-9 9h-.48Z" fill="#fff" fill-opacity=".8"/></g>`, | ||
glowingBulb01: (components, colors) => `<g filter="url(#topGlowingBulb01-a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 24A16 16 0 0 1 48 8h4a16 16 0 0 1 16 16v8a8 8 0 0 1-8 8H40a8 8 0 0 1-8-8v-8Z" fill="#fff" fill-opacity=".3"/></g><path d="M49 11.5c4.93 0 9.37 2.13 12.44 5.52" stroke="#fff" stroke-width="2" stroke-linecap="round"/><path d="m49.83 29-9-9L38 22.83l10 10V40h4v-7.03l10.14-10.14L59.31 20l-9 9h-.48Z" fill="#fff" fill-opacity=".8"/><rect x="22" y="40" width="56" height="12" rx="1" fill="#48494B"/><mask id="topGlowingBulb01-b" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="22" y="40" width="56" height="12"><rect x="22" y="40" width="56" height="12" rx="1" fill="#fff"/></mask><defs><filter id="topGlowingBulb01-a" x="24" y="0" width="52" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset/><feGaussianBlur stdDeviation="4"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_202_827"/><feBlend in="SourceGraphic" in2="effect1_dropShadow_202_827" result="shape"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset/><feGaussianBlur stdDeviation="2"/><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/><feBlend in2="shape" result="effect2_innerShadow_202_827"/></filter></defs>`, | ||
glowingBulb02: (components, colors) => `<g filter="url(#topGlowingBulb02-a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M30 33a20 20 0 1 1 40 0v11H30V33Z" fill="#fff" fill-opacity=".3"/></g><ellipse cx="50" cy="30" rx="4" ry="6" fill="#fff" fill-opacity=".6"/><path d="M50 15.5c4.93 0 9.37 2.13 12.44 5.52m2.43 3.5c.7 1.3 1.21 2.73 1.53 4.23" stroke="#fff" stroke-width="2" stroke-linecap="round"/><rect x="20" y="36" width="60" height="16" rx="1" fill="#48494B"/><mask id="topGlowingBulb02-b" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="20" y="36" width="60" height="16"><rect x="20" y="36" width="60" height="16" rx="1" fill="#fff"/></mask><defs><filter id="topGlowingBulb02-a" x="22" y="5" width="56" height="47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset/><feGaussianBlur stdDeviation="4"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_202_840"/><feBlend in="SourceGraphic" in2="effect1_dropShadow_202_840" result="shape"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset/><feGaussianBlur stdDeviation="2"/><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/><feBlend in2="shape" result="effect2_innerShadow_202_840"/></filter></defs>`, | ||
glowingBulb01: (components, colors) => `<g filter="url(#topGlowingBulb01-a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M32 24A16 16 0 0 1 48 8h4a16 16 0 0 1 16 16v8a8 8 0 0 1-8 8H40a8 8 0 0 1-8-8v-8Z" fill="#fff" fill-opacity=".3"/></g><path d="M49 11.5c4.93 0 9.37 2.13 12.44 5.52" stroke="#fff" stroke-width="2" stroke-linecap="round"/><path d="m49.83 29-9-9L38 22.83l10 10V40h4v-7.03l10.14-10.14L59.31 20l-9 9h-.48Z" fill="#fff" fill-opacity=".8"/><rect x="22" y="40" width="56" height="12" rx="1" fill="#48494B"/><mask id="topGlowingBulb01-b" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="22" y="40" width="56" height="12"><rect x="22" y="40" width="56" height="12" rx="1" fill="#fff"/></mask><defs><filter id="topGlowingBulb01-a" x="24" y="0" width="52" height="48" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset/><feGaussianBlur stdDeviation="4"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_301_827"/><feBlend in="SourceGraphic" in2="effect1_dropShadow_301_827" result="shape"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset/><feGaussianBlur stdDeviation="2"/><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/><feBlend in2="shape" result="effect2_innerShadow_301_827"/></filter></defs>`, | ||
glowingBulb02: (components, colors) => `<g filter="url(#topGlowingBulb02-a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M30 33a20 20 0 1 1 40 0v11H30V33Z" fill="#fff" fill-opacity=".3"/></g><ellipse cx="50" cy="30" rx="4" ry="6" fill="#fff" fill-opacity=".6"/><path d="M50 15.5c4.93 0 9.37 2.13 12.44 5.52m2.43 3.5c.7 1.3 1.21 2.73 1.53 4.23" stroke="#fff" stroke-width="2" stroke-linecap="round"/><rect x="20" y="36" width="60" height="16" rx="1" fill="#48494B"/><mask id="topGlowingBulb02-b" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="20" y="36" width="60" height="16"><rect x="20" y="36" width="60" height="16" rx="1" fill="#fff"/></mask><defs><filter id="topGlowingBulb02-a" x="22" y="5" width="56" height="47" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset/><feGaussianBlur stdDeviation="4"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_301_840"/><feBlend in="SourceGraphic" in2="effect1_dropShadow_301_840" result="shape"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/><feOffset/><feGaussianBlur stdDeviation="2"/><feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/><feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0"/><feBlend in2="shape" result="effect2_innerShadow_301_840"/></filter></defs>`, | ||
horns: (components, colors) => `<mask id="topHorns-a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="12" width="84" height="40"><path d="M71.21 40c7.64-6.7 13.42-19.31 12.8-26-.14-1.45 2-1.7 3 0 4.42 7.51 2.72 22.07 2.15 26H92v12H66V40h5.21ZM16.52 13.74c0 7.53 4.97 19.7 12.74 26.26H34v12H8V40h3.23c-.6-3.56-2.7-18.4 2.2-25.9.9-1.38 3.1-1.42 3.1-.36Z" fill="#E1E6E8"/></mask><g mask="url(#topHorns-a)"><path d="M0 0h100v52H0V0Z" fill="${colors.base.value}"/><path d="M0 0h100v52H0V0Z" fill="#fff" fill-opacity=".3"/><path fill="#000" fill-opacity=".4" d="M0 40h100v12H0z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M15.46 13h16.1v27H20.83c-7.45-7.85-5.36-27-5.36-27ZM84.82 13h7.75v27H81.82c5.75-7.8 3-27 3-27Z" fill="#fff" fill-opacity=".4"/></g>`, | ||
@@ -9,0 +9,0 @@ lights: (components, colors) => `<mask id="topLights-a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="10" y="22" width="80" height="30"><path d="M23 22a5 5 0 0 0-5 5v13h-6a2 2 0 0 0-2 2v10h80V42a2 2 0 0 0-2-2h-6V27a5 5 0 0 0-5-5h-6a5 5 0 0 0-5 5v13h-8V27a5 5 0 0 0-5-5h-6a5 5 0 0 0-5 5v13h-8V27a5 5 0 0 0-5-5h-6Z" fill="#E1E6E8"/></mask><g mask="url(#topLights-a)"><path d="M0 0h100v52H0V0Z" fill="${colors.base.value}"/><path d="M0 0h100v52H0V0Z" fill="#fff" fill-opacity=".3"/><path fill="#fff" fill-opacity=".6" d="M0 0h100v40H0z"/><rect x="24" y="28" width="4" height="8" rx="2" fill="#fff" fill-opacity=".6"/><rect x="48" y="28" width="4" height="8" rx="2" fill="#fff" fill-opacity=".6"/><rect x="72" y="28" width="4" height="8" rx="2" fill="#fff" fill-opacity=".6"/></g>`, |
@@ -6,3 +6,2 @@ import { schema } from './schema.js'; | ||
import { onPostCreate } from './hooks/onPostCreate.js'; | ||
import { dimensions } from './meta/components.js'; | ||
export const style = { | ||
@@ -21,6 +20,6 @@ meta: { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
onPreCreate({ prng, options, preview: false }); | ||
onPreCreate({ prng, options }); | ||
const components = getComponents({ prng, options }); | ||
const colors = getColors({ prng, options }); | ||
onPostCreate({ prng, options, components, colors, preview: false }); | ||
onPostCreate({ prng, options, components, colors }); | ||
return { | ||
@@ -35,33 +34,2 @@ attributes: { | ||
}, | ||
preview: ({ prng, options, property }) => { | ||
var _a, _b; | ||
const componentGroup = property.toString(); | ||
const colorGroup = property.toString().replace(/Color$/, ''); | ||
onPreCreate({ prng, options, preview: true }); | ||
const components = getComponents({ prng, options }); | ||
const colors = getColors({ prng, options }); | ||
onPostCreate({ prng, options, components, colors, preview: true }); | ||
if (componentGroup in components) { | ||
const { width, height } = dimensions[componentGroup]; | ||
return { | ||
attributes: { | ||
viewBox: `0 0 ${width} ${height}`, | ||
fill: 'none', | ||
'shape-rendering': 'auto', | ||
}, | ||
body: (_b = (_a = components[componentGroup]) === null || _a === void 0 ? void 0 : _a.value(components, colors)) !== null && _b !== void 0 ? _b : '', | ||
}; | ||
} | ||
if (colorGroup in colors) { | ||
return { | ||
attributes: { | ||
viewBox: `0 0 1 1`, | ||
fill: 'none', | ||
'shape-rendering': 'auto', | ||
}, | ||
body: `<rect width="1" height="1" fill="${colors[colorGroup].value}" />`, | ||
}; | ||
} | ||
return undefined; | ||
}, | ||
}; |
@@ -8,5 +8,4 @@ import { Prng, StyleOptions } from '@dicebear/core'; | ||
colors: ColorPickCollection; | ||
preview: boolean; | ||
}; | ||
export declare function onPostCreate({ prng, options, components, colors, preview, }: Props): void; | ||
export declare function onPostCreate({ prng, options, components, colors }: Props): void; | ||
export {}; |
@@ -1,3 +0,3 @@ | ||
export function onPostCreate({ prng, options, components, colors, preview, }) { | ||
export function onPostCreate({ prng, options, components, colors }) { | ||
// Write your modifications here | ||
} |
@@ -6,5 +6,4 @@ import { Prng, StyleOptions } from '@dicebear/core'; | ||
options: StyleOptions<Options>; | ||
preview: boolean; | ||
}; | ||
export declare function onPreCreate({ prng, options, preview }: Props): void; | ||
export declare function onPreCreate({ prng, options }: Props): void; | ||
export {}; |
@@ -1,3 +0,3 @@ | ||
export function onPreCreate({ prng, options, preview }) { | ||
export function onPreCreate({ prng, options }) { | ||
// Write your modifications here | ||
} |
@@ -5,3 +5,3 @@ /*! | ||
* Code licensed under MIT License. | ||
* Copyright (c) 2021 Florian Körner | ||
* Copyright (c) 2022 Florian Körner | ||
* | ||
@@ -12,4 +12,4 @@ * Design "Bottts" by Pablo Stanley licensed under Free for personal and commercial use. | ||
*/ | ||
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, preview: import("@dicebear/core").StylePreview<import("./types.js").Options> | undefined, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7; | ||
export { create, preview, meta, schema }; | ||
declare const create: import("@dicebear/core").StyleCreate<import("./types.js").Options>, meta: import("@dicebear/core").StyleMeta, schema: import("json-schema").JSONSchema7; | ||
export { create, meta, schema }; | ||
export type { Options } from './types.js'; |
@@ -5,3 +5,3 @@ /*! | ||
* Code licensed under MIT License. | ||
* Copyright (c) 2021 Florian Körner | ||
* Copyright (c) 2022 Florian Körner | ||
* | ||
@@ -13,3 +13,3 @@ * Design "Bottts" by Pablo Stanley licensed under Free for personal and commercial use. | ||
import { style } from './core.js'; | ||
const { create, preview, meta, schema } = style; | ||
export { create, preview, meta, schema }; | ||
const { create, meta, schema } = style; | ||
export { create, meta, schema }; |
{ | ||
"name": "@dicebear/bottts", | ||
"version": "5.0.0-alpha.16", | ||
"version": "5.0.0-alpha.20", | ||
"description": "Avatar style for DiceBear", | ||
@@ -31,14 +31,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"@dicebear/core": "^5.0.0-alpha.16", | ||
"@tsconfig/recommended": "^1.0.0", | ||
"@types/jest": "^26.0.22", | ||
"@dicebear/core": "^5.0.0-alpha.20", | ||
"@tsconfig/recommended": "^1.0.1", | ||
"del-cli": "^4.0.1", | ||
"typescript": "^4.5.2", | ||
"uvu": "^0.5.2" | ||
"typescript": "^4.6.3", | ||
"uvu": "^0.5.3" | ||
}, | ||
"peerDependencies": { | ||
"@dicebear/core": "^5.0.0-alpha.10" | ||
"@dicebear/core": "^5.0.0-alpha.16" | ||
}, | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
"node": "^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -48,3 +47,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "149a4a22c3a4d48dd5552bd22a49db0f853e0b5e" | ||
"gitHead": "6b1c2bd64294365be21d0a133a362ede5ed62b5a" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
96141
41
905